id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
47973088_1188 | {
"fields": [],
"file": "core/operation/src/test/java/uk/gov/gchq/gaffer/operation/impl/DiscardOutputTest.java",
"identifier": "DiscardOutputTest",
"interfaces": "",
"superclass": "extends OperationTest<DiscardOutput>"
} | {
"body": "@Test\n @Override\n public void builderShouldCreatePopulatedOperation() {\n // Given\n final DiscardOutput discardOutput = new DiscardOutput.Builder().input(\"1\").build();\n\n // When / Then\n assertThat(discardOutput.getInput(), is(nullValue()));\n }",
"class_method... | {
"fields": [
{
"declarator": "options",
"modifier": "private",
"original_string": "private Map<String, String> options;",
"type": "Map<String, String>",
"var_name": "options"
}
],
"file": "core/operation/src/main/java/uk/gov/gchq/gaffer/operation/impl/DiscardOutput.java",
... | {
"body": "@Override\n public Object getInput() {\n return null;\n }",
"class_method_signature": "DiscardOutput.getInput()",
"constructor": false,
"full_signature": "@Override public Object getInput()",
"identifier": "getInput",
"invocations": [],
"modifiers": "@Override public",
"parameter... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_773 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/handler/ScoreOperationChainHandlerTest.java",
"identifier": "ScoreOperationChainHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnZeroForANullOperationChain() throws OperationException {\n // Given\n final ScoreOperationChainHandler handler = new ScoreOperationChainHandler();\n\n final Context context = mock(Context.class);\n final Store store = mock(Store.class);\n ... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(ScoreOperationChainHandler.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(ScoreOperationChainHandler.class);",
"type": "Logger",
"var_name": ... | {
"body": "@Override\n public Integer doOperation(final ScoreOperationChain operation, final Context context, final Store store) throws OperationException {\n return getChainScore(operation.getOperationChain(), context.getUser());\n\n }",
"class_method_signature": "ScoreOperationChainHandler.doOperatio... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_289 | {
"fields": [],
"file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/elementdefinition/view/ViewTest.java",
"identifier": "ViewTest",
"interfaces": "",
"superclass": "extends JSONSerialisationTest<View>"
} | {
"body": "@Test\n public void shouldOverrideEmptyGlobalPropertiesAndIncludeEdgeGroupProperties() {\n // Given\n final View view = new View.Builder()\n .globalEdges(new GlobalViewElementDefinition.Builder()\n .groups(TestGroups.EDGE)\n .pro... | {
"fields": [
{
"declarator": "globalElements",
"modifier": "private",
"original_string": "private List<GlobalViewElementDefinition> globalElements;",
"type": "List<GlobalViewElementDefinition>",
"var_name": "globalElements"
},
{
"declarator": "globalEntities",
"m... | {
"body": "public void expandGlobalDefinitions() {\n if (null != globalEntities && !globalEntities.isEmpty()) {\n setEntities(expandGlobalDefinitions(getEntities(), getEntityGroups(), globalEntities, false));\n globalEntities = null;\n }\n\n if (null != globalEdges && !globa... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_323 | {
"fields": [],
"file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/graph/entity/EntityMapTest.java",
"identifier": "EntityMapTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldContainVertex() {\n final EntityMap entityMap = getEntityMap();\n\n final boolean results = entityMap.containsVertex(6);\n\n assertThat(results, is(true));\n }",
"class_method_signature": "EntityMapTest.shouldContainVertex()",
"constructor": false,
... | {
"fields": [
{
"declarator": "backingMap = HashMultimap.create()",
"modifier": "private final",
"original_string": "private final SetMultimap<Object, Entity> backingMap = HashMultimap.create();",
"type": "SetMultimap<Object, Entity>",
"var_name": "backingMap"
}
],
"file": "c... | {
"body": "public boolean containsVertex(final Object vertex) {\n return backingMap.containsKey(vertex);\n }",
"class_method_signature": "EntityMap.containsVertex(final Object vertex)",
"constructor": false,
"full_signature": "public boolean containsVertex(final Object vertex)",
"identifier": "conta... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_636 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/SerialisationFactoryTest.java",
"identifier": "SerialisationFactoryTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnOrderedSerialiserForAnInteger() throws SerialisationException {\n // Given\n final SerialisationFactory factory = new SerialisationFactory();\n final Class<?> clazz = Integer.class;\n final boolean ordered = true;\n\n // When\n fi... | {
"fields": [
{
"declarator": "serialisers",
"modifier": "private final",
"original_string": "private final List<Serialiser> serialisers;",
"type": "List<Serialiser>",
"var_name": "serialisers"
},
{
"declarator": "LAST_RESORT_FINALISER = new JavaSerialiser()",
"mo... | {
"body": "public Serialiser getSerialiser(final Class<?> objClass) {\n return getSerialiser(objClass, false, false);\n }",
"class_method_signature": "SerialisationFactory.getSerialiser(final Class<?> objClass)",
"constructor": false,
"full_signature": "public Serialiser getSerialiser(final Class<?> o... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_266 | {
"fields": [],
"file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/elementdefinition/view/ViewTest.java",
"identifier": "ViewTest",
"interfaces": "",
"superclass": "extends JSONSerialisationTest<View>"
} | {
"body": "@Test\n public void shouldSerialiseToCompactJson() {\n final View view = new View();\n\n final String compactJson = new String(view.toCompactJson());\n\n assertFalse(compactJson.contains(String.format(\"%n\")));\n }",
"class_method_signature": "ViewTest.shouldSerialiseToCompact... | {
"fields": [
{
"declarator": "globalElements",
"modifier": "private",
"original_string": "private List<GlobalViewElementDefinition> globalElements;",
"type": "List<GlobalViewElementDefinition>",
"var_name": "globalElements"
},
{
"declarator": "globalEntities",
"m... | {
"body": "public byte[] toCompactJson() throws SchemaException {\n return toJson(false);\n }",
"class_method_signature": "View.toCompactJson()",
"constructor": false,
"full_signature": "public byte[] toCompactJson()",
"identifier": "toCompactJson",
"invocations": [
"toJson"
],
"modifiers"... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_11 | {
"fields": [],
"file": "store-implementation/federated-store/src/test/java/uk/gov/gchq/gaffer/federatedstore/util/FederatedStoreUtilTest.java",
"identifier": "FederatedStoreUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldGetNullGraphIdsWhenNullCsvValue() {\n // Given\n final Map<String, String> config = new HashMap<>();\n config.put(FederatedStoreConstants.KEY_OPERATION_OPTIONS_GRAPH_IDS, null);\n\n // When\n final List<String> graphIds = FederatedStoreUtil.ge... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(FederatedStoreUtil.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(FederatedStoreUtil.class);",
"type": "Logger",
"var_name": "LOGGER"
},
... | {
"body": "public static List<String> getGraphIds(final Map<String, String> config) {\n if (null == config) {\n return null;\n }\n\n return getCleanStrings(config.get(KEY_OPERATION_OPTIONS_GRAPH_IDS));\n }",
"class_method_signature": "FederatedStoreUtil.getGraphIds(final Map<Strin... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1171 | {
"fields": [],
"file": "core/operation/src/test/java/uk/gov/gchq/gaffer/operation/function/FromElementIdTest.java",
"identifier": "FromElementIdTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnOriginalValueIfInputIsAnEdge() {\n // Given\n final Edge input = new Edge(\"group\");\n final FromElementId function = new FromElementId();\n\n // When\n final Object output = function.apply(input);\n\n // Then\n assertSame... | {
"fields": [],
"file": "core/operation/src/main/java/uk/gov/gchq/gaffer/operation/function/FromElementId.java",
"identifier": "FromElementId",
"interfaces": "",
"methods": [
{
"class_method_signature": "FromElementId.apply(final ElementId e)",
"constructor": false,
"full_signature": "@O... | {
"body": "@Override\n public Object apply(final ElementId e) {\n if (null == e) {\n return null;\n }\n return e instanceof EntityId ? ((EntityId) e).getVertex() : e;\n }",
"class_method_signature": "FromElementId.apply(final ElementId e)",
"constructor": false,
"full_signa... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_509 | {
"fields": [],
"file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/CollectionUtilTest.java",
"identifier": "CollectionUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldConvertMapToClassKeysWithProvidedMap() throws ClassNotFoundException {\n // Given\n final Map<String, String> map = new HashMap<>();\n populateStringKeyMap(map);\n\n final Map<Class<? extends Number>, String> result = new LinkedHashMap<>();\n\n ... | {
"fields": [],
"file": "core/common-util/src/main/java/uk/gov/gchq/gaffer/commonutil/CollectionUtil.java",
"identifier": "CollectionUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "CollectionUtil.CollectionUtil()",
"constructor": true,
"full_signature": "private Colle... | {
"body": "public static <K, V> void toMapWithClassKeys(final Map<String, V> mapAsStrings, final Map<Class<? extends K>, V> map) throws ClassNotFoundException {\n for (final Map.Entry<String, V> entry : mapAsStrings.entrySet()) {\n map.put(\n (Class) Class.forName(SimpleClassNameI... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_159 | {
"fields": [
{
"declarator": "serialisation",
"modifier": "private",
"original_string": "private ElementSerialisation serialisation;",
"type": "ElementSerialisation",
"var_name": "serialisation"
}
],
"file": "store-implementation/hbase-store/src/test/java/uk/gov/gchq/gaffer/... | {
"body": "@Test\n public void shouldTruncatePropertyBytesWithEmptyBytes() throws Exception {\n // Given\n final byte[] bytes = HBaseStoreConstants.EMPTY_BYTES;\n\n // When\n final byte[] truncatedBytes = serialisation.getPropertiesAsBytesFromColumnQualifier(TestGroups.EDGE, bytes, 2);\... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(ElementSerialisation.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(ElementSerialisation.class);",
"type": "Logger",
"var_name": "LOGGER"
... | {
"body": "public byte[] getPropertiesAsBytesFromColumnQualifier(final String group, final byte[] bytes, final int numProps)\n throws SerialisationException {\n if (numProps == 0 || null == bytes || bytes.length == 0) {\n return HBaseStoreConstants.EMPTY_BYTES;\n }\n final S... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1034 | {
"fields": [],
"file": "core/serialisation/src/test/java/uk/gov/gchq/gaffer/serialisation/implementation/SetSerialiserTest.java",
"identifier": "SetSerialiserTest",
"interfaces": "",
"superclass": "extends ToBytesSerialisationTest<Set<? extends Object>>"
} | {
"body": "@Test\n @Override\n public void shouldDeserialiseEmpty() throws SerialisationException {\n assertEquals(new HashSet(), serialiser.deserialiseEmpty());\n }",
"class_method_signature": "SetSerialiserTest.shouldDeserialiseEmpty()",
"constructor": false,
"full_signature": "@Test @Override... | {
"fields": [
{
"declarator": "serialVersionUID = -8681798703430202402L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -8681798703430202402L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "obj... | {
"body": "@Override\n public Set<? extends Object> deserialiseEmpty() throws SerialisationException {\n Set set;\n if (null == getSetClass()) {\n set = new HashSet<>();\n } else {\n try {\n set = getSetClass().newInstance();\n } catch (final Ill... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_335 | {
"fields": [],
"file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/graph/adjacency/AdjacencyMapTest.java",
"identifier": "AdjacencyMapTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldNotContainSource() {\n final AdjacencyMap adjacencyMap = getAdjacencyMap();\n\n final boolean result = adjacencyMap.containsSource(7);\n\n assertThat(result, is(false));\n }",
"class_method_signature": "AdjacencyMapTest.shouldNotContainSource()",
"co... | {
"fields": [
{
"declarator": "edgeGraph = HashBasedTable.create()",
"modifier": "private final",
"original_string": "private final HashBasedTable<Object, Object, Set<Edge>> edgeGraph = HashBasedTable.create();",
"type": "HashBasedTable<Object, Object, Set<Edge>>",
"var_name": "edgeG... | {
"body": "public boolean containsSource(final Object source) {\n return edgeGraph.rowKeySet().contains(source);\n }",
"class_method_signature": "AdjacencyMap.containsSource(final Object source)",
"constructor": false,
"full_signature": "public boolean containsSource(final Object source)",
"identifi... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_765 | {
"fields": [
{
"declarator": "store = mock(Store.class)",
"modifier": "private final",
"original_string": "private final Store store = mock(Store.class);",
"type": "Store",
"var_name": "store"
},
{
"declarator": "context = new Context(new User())",
"modifier": "p... | {
"body": "@Test\n public void shouldExecuteThenOperationWhenConditionMet() throws OperationException {\n // Given\n final Object input = Arrays.asList(new EntitySeed(\"1\"), new EntitySeed(\"2\"));\n final Conditional conditional = mock(Conditional.class);\n final Predicate<Object> pre... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/IfHandler.java",
"identifier": "IfHandler",
"interfaces": "implements OutputOperationHandler<If<Object, Object>, Object>",
"methods": [
{
"class_method_signature": "IfHandler.doOperation(final If operation, ... | {
"body": "@Override\n public Object doOperation(final If operation, final Context context, final Store store) throws OperationException {\n final Object input = operation.getInput();\n\n boolean computedCondition;\n\n if (null == operation.getCondition()) {\n if (null == operation.... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1258 | {
"fields": [],
"file": "core/operation/src/test/java/uk/gov/gchq/gaffer/named/operation/NamedOperationDetailTest.java",
"identifier": "NamedOperationDetailTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldDeserialiseCustomAccessPredicate() throws SerialisationException {\n // Given\n String json = \"{\" +\n \" \\\"operationName\\\": \\\"operationName\\\",\" +\n \" \\\"creatorId\\\": \\\"creatorUserId\\\",\" +\n \" ... | {
"fields": [
{
"declarator": "serialVersionUID = -8831783492657131469L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -8831783492657131469L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "CHA... | {
"body": "public AccessPredicate getReadAccessPredicate() {\n try {\n return readAccessPredicateJson != null ? JSONSerialiser.deserialise(readAccessPredicateJson, AccessPredicate.class) : null;\n } catch (final SerialisationException e) {\n throw new IllegalArgumentException(\"rea... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_270 | {
"fields": [],
"file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/elementdefinition/view/ViewTest.java",
"identifier": "ViewTest",
"interfaces": "",
"superclass": "extends JSONSerialisationTest<View>"
} | {
"body": "@Test\n public void shouldReturnFalseWhenViewHasEmptyPreAggEdgeFilters() {\n // Given\n final View view = new View.Builder()\n .edge(TestGroups.EDGE, new ViewElementDefinition.Builder()\n .preAggregationFilter(new ElementFilter.Builder()\n ... | {
"fields": [
{
"declarator": "globalElements",
"modifier": "private",
"original_string": "private List<GlobalViewElementDefinition> globalElements;",
"type": "List<GlobalViewElementDefinition>",
"var_name": "globalElements"
},
{
"declarator": "globalEntities",
"m... | {
"body": "public boolean hasPreAggregationFilters() {\n return hasFilters(ViewElementDefinition::hasPreAggregationFilters);\n }",
"class_method_signature": "View.hasPreAggregationFilters()",
"constructor": false,
"full_signature": "public boolean hasPreAggregationFilters()",
"identifier": "hasPreAg... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_620 | {
"fields": [
{
"declarator": "user = new User(\"user01\")",
"modifier": "private final",
"original_string": "private final User user = new User(\"user01\");",
"type": "User",
"var_name": "user"
},
{
"declarator": "context = new Context(user)",
"modifier": "privat... | {
"body": "@Test\n public void shouldThrowExceptionIfGraphIdIsNull() throws Exception {\n final StoreProperties properties = mock(StoreProperties.class);\n given(properties.getJobExecutorThreadCount()).willReturn(1);\n try {\n store.initialise(null, schema, properties);\n ... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(Store.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(Store.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": ... | {
"body": "public void initialise(final String graphId, final Schema schema, final StoreProperties properties) throws StoreException {\n LOGGER.debug(\"Initialising {}\", getClass().getSimpleName());\n if (null == graphId) {\n throw new IllegalArgumentException(\"graphId is required\");\n ... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1126 | {
"fields": [
{
"declarator": "ADD_OPERATIONS_TO_CHAIN_RESOURCE_PATH = \"addOperationsToChain.json\"",
"modifier": "private static final",
"original_string": "private static final String ADD_OPERATIONS_TO_CHAIN_RESOURCE_PATH = \"addOperationsToChain.json\";",
"type": "String",
"var_n... | {
"body": "@Test\n public void shouldAddAllOperationsGivenJson() throws IOException {\n // Given\n final byte[] bytes;\n try (final InputStream inputStream = StreamUtil.openStream(getClass(), ADD_OPERATIONS_TO_CHAIN_RESOURCE_PATH)) {\n bytes = IOUtils.toByteArray(inputStream);\n ... | {
"fields": [
{
"declarator": "defaultOperations = new AdditionalOperations()",
"modifier": "private final",
"original_string": "private final AdditionalOperations defaultOperations = new AdditionalOperations();",
"type": "AdditionalOperations",
"var_name": "defaultOperations"
},... | {
"body": "@Override\n public void preExecute(final OperationChain<?> opChain, final Context context) {\n final List<Operation> newOpList = new ArrayList<>();\n\n boolean hasAuth = false;\n if (!authorisedOps.isEmpty() && !context.getUser().getOpAuths().isEmpty()) {\n for (final Str... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_948 | {
"fields": [
{
"declarator": "EDGE_DESCRIPTION = \"Edge description\"",
"modifier": "public static final",
"original_string": "public static final String EDGE_DESCRIPTION = \"Edge description\";",
"type": "String",
"var_name": "EDGE_DESCRIPTION"
},
{
"declarator": "ENT... | {
"body": "@Test\n public void testSchemaConstructedFromPath() throws Exception {\n\n final Schema schema = Schema.fromJson(Paths.get(SchemaTest.class.getResource(\"/schema\").toURI()));\n\n assertExpectedSchemaElementsContent(schema);\n assertExpectedSchemaSerialis... | {
"fields": [
{
"declarator": "unknownType = new TypeDefinition()",
"modifier": "private final",
"original_string": "private final TypeDefinition unknownType = new TypeDefinition();",
"type": "TypeDefinition",
"var_name": "unknownType"
},
{
"declarator": "id",
"mo... | {
"body": "public static Schema fromJson(final InputStream... inputStreams) throws SchemaException {\n return new Schema.Builder().json(inputStreams).build();\n }",
"class_method_signature": "Schema.fromJson(final InputStream... inputStreams)",
"constructor": false,
"full_signature": "public static Sc... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1063 | {
"fields": [
{
"declarator": "historicSerialisationPairs",
"modifier": "private final",
"original_string": "private final Pair<Object, byte[]>[] historicSerialisationPairs;",
"type": "Pair<Object, byte[]>[]",
"var_name": "historicSerialisationPairs"
}
],
"file": "core/serial... | {
"body": "@Test\n public void shouldThrowExceptionWhenUpdateInstanceWithInvalidModulesValue() throws Exception {\n // Given\n final String invalidValue = TestCustomJsonModules1.class.getName() + \"-\" + TestCustomJsonModules2.class.getName();\n System.setProperty(JSONSerialiser.JSON_SERIALISE... | {
"fields": [
{
"declarator": "JSON_SERIALISER_CLASS_KEY = \"gaffer.serialiser.json.class\"",
"modifier": "public static final",
"original_string": "public static final String JSON_SERIALISER_CLASS_KEY = \"gaffer.serialiser.json.class\";",
"type": "String",
"var_name": "JSON_SERIALIS... | {
"body": "@Deprecated\n public static void update(final String jsonSerialiserClass, final String jsonSerialiserModules) {\n update(jsonSerialiserClass, jsonSerialiserModules, null);\n }",
"class_method_signature": "JSONSerialiser.update(final String jsonSerialiserClass, final String jsonSerialiserModu... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_732 | {
"fields": [
{
"declarator": "context",
"modifier": "private",
"original_string": "private Context context;",
"type": "Context",
"var_name": "context"
},
{
"declarator": "store",
"modifier": "private",
"original_string": "private Store store;",
"type"... | {
"body": "@Test\n public void shouldProcessWalkObjects() throws OperationException {\n // Given\n final Iterable<Iterable<Set<Edge>>> walks = Arrays.asList(walk, walk1);\n\n final Map<Iterable<Iterable<Set<Edge>>>, Iterable<Set<Edge>>> map = new Map.Builder<Iterable<Iterable<Set<Edge>>>>()\n ... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/MapHandler.java",
"identifier": "MapHandler",
"interfaces": "implements OutputOperationHandler<Map<I, O>, O>",
"methods": [
{
"class_method_signature": "MapHandler.doOperation(final Map<I, O> operation, fina... | {
"body": "@Override\n public O doOperation(final Map<I, O> operation, final Context context, final Store store) throws OperationException {\n if (null == operation) {\n throw new OperationException(\"Operation cannot be null\");\n }\n\n Object input = operation.getInput();\n\n ... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_362 | {
"fields": [],
"file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/element/comparison/ComparableOrToStringComparatorTest.java",
"identifier": "ComparableOrToStringComparatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldCompareNulls() {\n final ComparableOrToStringComparator comparator = new ComparableOrToStringComparator();\n\n final int result = comparator.compare(null, null);\n\n assertEquals(0, result);\n }",
"class_method_signature": "ComparableOrToStringComparat... | {
"fields": [],
"file": "core/data/src/main/java/uk/gov/gchq/gaffer/data/element/comparison/ComparableOrToStringComparator.java",
"identifier": "ComparableOrToStringComparator",
"interfaces": "implements Comparator<Object>, Serializable",
"methods": [
{
"class_method_signature": "ComparableOrToStrin... | {
"body": "@Override\n public int compare(final Object vertex1, final Object vertex2) {\n if (null == vertex1) {\n if (null == vertex2) {\n return 0;\n }\n return 1;\n }\n\n if (null == vertex2) {\n return -1;\n }\n\n if ... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_698 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/handler/compare/MaxHandlerTest.java",
"identifier": "MaxHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnNullIfOperationInputIsNull() throws OperationException {\n // Given\n final Max max = new Max.Builder().build();\n final MaxHandler handler = new MaxHandler();\n\n // When\n final Element result = handler.doOperation(max, null, null);\n\... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/compare/MaxHandler.java",
"identifier": "MaxHandler",
"interfaces": "implements OutputOperationHandler<Max, Element>",
"methods": [
{
"class_method_signature": "MaxHandler.doOperation(final Max operation, fi... | {
"body": "@Override\n public Element doOperation(final Max operation, final Context context, final Store store) throws OperationException {\n // If there is no input or there are no comparators, we return null\n if (null == operation.getInput()\n || null == operation.getComparators()\... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_677 | {
"fields": [
{
"declarator": "schema = new Schema.Builder()\n .entity(TestGroups.ENTITY, new SchemaEntityDefinition.Builder()\n .vertex(TestTypes.ID_STRING)\n .build())\n .edge(TestGroups.EDGE, new SchemaEdgeDefinition.Builder()\n ... | {
"body": "@Test\n public void shouldSampleApproximatelyHalfOfElements() throws OperationException {\n // Given\n final int numSplits = 3;\n final List<Element> elements =\n IntStream.range(0, 1000 * numSplits)\n .mapToObj(i -> new Entity(TestGroups.ENTITY... | {
"fields": [
{
"declarator": "MAX_SAMPLED_ELEMENTS_DEFAULT = 10000000",
"modifier": "public static final",
"original_string": "public static final int MAX_SAMPLED_ELEMENTS_DEFAULT = 10000000;",
"type": "int",
"var_name": "MAX_SAMPLED_ELEMENTS_DEFAULT"
},
{
"declarator"... | {
"body": "@Override\n public List<T> doOperation(final SampleElementsForSplitPoints<T> operation, final Context context, final Store store) throws OperationException {\n final S typedStore = (S) store;\n\n validate(operation, typedStore);\n\n final Integer numSplits = getNumSplits(operation, ... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_227 | {
"fields": [
{
"declarator": "GRAPH_ID = \"graphId\"",
"modifier": "private static final",
"original_string": "private static final String GRAPH_ID = \"graphId\";",
"type": "String",
"var_name": "GRAPH_ID"
},
{
"declarator": "service",
"modifier": "@InjectMocks\n... | {
"body": "@Test\n public void shouldThrowExceptionWhenGetFilterFunctionsWithUnknownClassName() {\n // When / Then\n try {\n service.getFilterFunction(\"unknown className\");\n fail(\"Exception expected\");\n } catch (final IllegalArgumentException e) {\n asser... | {
"fields": [
{
"declarator": "graphFactory",
"modifier": "@Inject\n private",
"original_string": "@Inject\n private GraphFactory graphFactory;",
"type": "GraphFactory",
"var_name": "graphFactory"
},
{
"declarator": "userFactory",
"modifier": "@Inject\n p... | {
"body": "@Override\n public Response getFilterFunction() {\n return Response.ok(ReflectionUtil.getSubTypes(Predicate.class))\n .header(GAFFER_MEDIA_TYPE_HEADER, GAFFER_MEDIA_TYPE)\n .build();\n }",
"class_method_signature": "GraphConfigurationServiceV2.getFilterFunction(... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_50 | {
"fields": [
{
"declarator": "TEST_ENTITY = \"TestEntity\"",
"modifier": "public static final",
"original_string": "public static final String TEST_ENTITY = \"TestEntity\";",
"type": "String",
"var_name": "TEST_ENTITY"
},
{
"declarator": "TEST_GRAPH_ID = \"testGraphId\... | {
"body": "@Test\n public void shouldReturnEmptyIterableWhenNoResults() throws Exception {\n // Given\n final OP op = getExampleOperation();\n op.addOption(KEY_OPERATION_OPTIONS_GRAPH_IDS, TEST_GRAPH_ID);\n\n Schema unusedSchema = new Schema.Builder().build();\n StoreProperties s... | {
"fields": [],
"file": "store-implementation/federated-store/src/main/java/uk/gov/gchq/gaffer/federatedstore/operation/handler/FederatedOperationOutputHandler.java",
"identifier": "FederatedOperationOutputHandler",
"interfaces": "implements OutputOperationHandler<OP, O>",
"methods": [
{
"class_meth... | {
"body": "@Override\n public O doOperation(final OP operation, final Context context, final Store store) throws OperationException {\n final Collection<Graph> graphs = ((FederatedStore) store).getGraphs(context.getUser(), operation.getOption(KEY_OPERATION_OPTIONS_GRAPH_IDS), operation);\n final List... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_933 | {
"fields": [
{
"declarator": "ALL_STORE_TRAITS = Sets.newHashSet(StoreTrait.values())",
"modifier": "public static final",
"original_string": "public static final Set<StoreTrait> ALL_STORE_TRAITS = Sets.newHashSet(StoreTrait.values());",
"type": "Set<StoreTrait>",
"var_name": "ALL_S... | {
"body": "@Test\n public void shouldValidateAndReturnTrueWhenPostTransformerSelectionIsUnknown() {\n // Given\n final ViewValidator validator = new ViewValidator();\n final View view = new View.Builder()\n .entity(TestGroups.ENTITY, new ViewElementDefinition.Builder()\n ... | {
"fields": [
{
"declarator": "SKIP_VIEW_VALIDATION = \"skipViewValidation\"",
"modifier": "public static final",
"original_string": "public static final String SKIP_VIEW_VALIDATION = \"skipViewValidation\";",
"type": "String",
"var_name": "SKIP_VIEW_VALIDATION"
},
{
"d... | {
"body": "public ValidationResult validate(final View view, final Schema schema, final Set<StoreTrait> storeTraits) {\n final boolean isStoreOrdered = storeTraits.contains(StoreTrait.ORDERED);\n\n final ValidationResult result = new ValidationResult();\n\n if (null != view) {\n valida... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1018 | {
"fields": [],
"file": "core/serialisation/src/test/java/uk/gov/gchq/gaffer/serialisation/implementation/ordered/OrderedDateSerialiserTest.java",
"identifier": "OrderedDateSerialiserTest",
"interfaces": "",
"superclass": "extends ToBytesSerialisationTest<Date>"
} | {
"body": "@Test\n public void checkMultipleDatesOrderPreserved() throws SerialisationException {\n // Given\n Date startTestDate = new Date(1L);\n Date newTestDate;\n for (Long time = 2L; time > 10L; time++) {\n newTestDate = new Date(time);\n\n // When / Then\n ... | {
"fields": [
{
"declarator": "serialVersionUID = 6636121009320739764L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 6636121009320739764L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "LONG_... | {
"body": "@Override\n public byte[] serialise(final Date object) {\n return LONG_SERIALISER.serialise(object.getTime());\n }",
"class_method_signature": "OrderedDateSerialiser.serialise(final Date object)",
"constructor": false,
"full_signature": "@Override public byte[] serialise(final Date objec... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_899 | {
"fields": [
{
"declarator": "PROPERTY_STRING_TYPE = \"property.string\"",
"modifier": "public static final",
"original_string": "public static final String PROPERTY_STRING_TYPE = \"property.string\";",
"type": "String",
"var_name": "PROPERTY_STRING_TYPE"
}
],
"file": "core/... | {
"body": "@Test\n public void shouldReturnValidatorWithNoFunctionsWhenNoVerticesOrProperties() {\n // Given\n final T elementDef = createEmptyBuilder().build();\n\n // When\n final ElementFilter validator = elementDef.getValidator();\n\n // Then\n assertEquals(0, validato... | {
"fields": [
{
"declarator": "elementDefValidator",
"modifier": "private final",
"original_string": "private final SchemaElementDefinitionValidator elementDefValidator;",
"type": "SchemaElementDefinitionValidator",
"var_name": "elementDefValidator"
},
{
"declarator": "... | {
"body": "@JsonIgnore\n public ElementFilter getValidator() {\n return getValidator(true);\n }",
"class_method_signature": "SchemaElementDefinition.getValidator()",
"constructor": false,
"full_signature": "@JsonIgnore public ElementFilter getValidator()",
"identifier": "getValidator",
"invocat... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_460 | {
"fields": [],
"file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/JsonUtilTest.java",
"identifier": "JsonUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnTrueWhenJsonArraysAreEqual() {\n final String json1 = \"[1,2,3]\";\n final String json2 = \"[1,2,3]\";\n\n assertTrue(JsonUtil.equals(json1, json2));\n assertTrue(JsonUtil.equals(json1.getBytes(), json2.getBytes()));\n\n JsonAssert.asser... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(JsonUtil.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(JsonUtil.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declara... | {
"body": "public static boolean equals(final String expectedJson, final String actualJson) {\n try {\n final Map expectedSchemaMap = null != expectedJson ? OBJECT_MAPPER.readValue(expectedJson, Map.class) : Collections.emptyMap();\n final Map actualSchemaMap = null != actualJson ? OBJECT... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_175 | {
"fields": [],
"file": "store-implementation/hbase-store/src/test/java/uk/gov/gchq/gaffer/hbasestore/operation/handler/GetElementsHandlerTest.java",
"identifier": "GetElementsHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnHBaseRetrieverWithoutIncludeMatchdxVertex() throws OperationException, StoreException {\n // Given\n final Iterable<EntityId> ids = mock(Iterable.class);\n final Context context = mock(Context.class);\n final User user = mock(User.class);\n ... | {
"fields": [],
"file": "store-implementation/hbase-store/src/main/java/uk/gov/gchq/gaffer/hbasestore/operation/handler/GetElementsHandler.java",
"identifier": "GetElementsHandler",
"interfaces": "implements OutputOperationHandler<GetElements, CloseableIterable<? extends Element>>",
"methods": [
{
"... | {
"body": "@Override\n public CloseableIterable<? extends Element> doOperation(final GetElements operation, final Context context, final Store store) throws OperationException {\n return doOperation(operation, context.getUser(), (HBaseStore) store);\n }",
"class_method_signature": "GetElementsHandler.d... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1 | {
"fields": [
{
"declarator": "TEST_USER = new User.Builder().userId(\"TestUser\").opAuths(\"auth1\", \"auth2\").build()",
"modifier": "private static final",
"original_string": "private static final User TEST_USER = new User.Builder().userId(\"TestUser\").opAuths(\"auth1\", \"auth2\").build();"... | {
"body": "@Test\n public void shouldReturnTrueForPublicResource() {\n assertTrue(createAccessPredicate(TEST_USER.getUserId(), asList(\"auth1\"), PUBLIC).test(new User.Builder().userId(\"AnotherUser\").build(), null));\n }",
"class_method_signature": "FederatedGraphReadAccessPredicateTest.shouldReturnT... | {
"fields": [],
"file": "store-implementation/federated-store/src/main/java/uk/gov/gchq/gaffer/federatedstore/access/predicate/FederatedGraphReadAccessPredicate.java",
"identifier": "FederatedGraphReadAccessPredicate",
"interfaces": "",
"methods": [
{
"class_method_signature": "FederatedGraphReadAcc... | {
"body": "@Override\n public boolean test(final User user, final String adminAuth) {\n return super.test(user, adminAuth);\n }",
"class_method_signature": "FederatedGraphReadAccessPredicate.test(final User user, final String adminAuth)",
"constructor": false,
"full_signature": "@Override public bo... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_525 | {
"fields": [],
"file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/stream/StreamsTest.java",
"identifier": "StreamsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldCloseIterableWhenParallelStreamIsClosed() throws Throwable {\n // Given\n final CloseableIterable<String> iterable = mock(CloseableIterable.class);\n final CloseableIterator<String> iterator = mock(CloseableIterator.class);\n given(iterable.spliterat... | {
"fields": [],
"file": "core/common-util/src/main/java/uk/gov/gchq/gaffer/commonutil/stream/Streams.java",
"identifier": "Streams",
"interfaces": "",
"methods": [
{
"class_method_signature": "Streams.toStream(final Iterable<T> iterable)",
"constructor": false,
"full_signature": "public ... | {
"body": "public static <T> Stream<T> toParallelStream(final Iterable<T> iterable) {\n if (iterable instanceof StreamIterable) {\n return ((StreamIterable<T>) iterable).getStream().parallel();\n }\n\n return StreamSupport.stream(iterable.spliterator(), true)\n .onClose(... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_876 | {
"fields": [
{
"declarator": "cache = new NamedOperationCache()",
"modifier": "private final",
"original_string": "private final NamedOperationCache cache = new NamedOperationCache();",
"type": "NamedOperationCache",
"var_name": "cache"
},
{
"declarator": "addNamedOper... | {
"body": "@Test\n public void shouldReturnLabelWhenNamedOperationHasLabel() throws Exception {\n final AddNamedOperation addNamedOperationWithLabel = new AddNamedOperation.Builder()\n .name(\"My Operation With Label\")\n .labels(Arrays.asList(\"test label\"))\n ... | {
"fields": [
{
"declarator": "cache",
"modifier": "private final",
"original_string": "private final NamedOperationCache cache;",
"type": "NamedOperationCache",
"var_name": "cache"
}
],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/named/GetAll... | {
"body": "@Override\n public CloseableIterable<NamedOperationDetail> doOperation(final GetAllNamedOperations operation, final Context context, final Store store) throws OperationException {\n final CloseableIterable<NamedOperationDetail> ops = cache.getAllNamedOperations(context.getUser(), store.getPropert... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1274 | {
"fields": [
{
"declarator": "service = new JcsCacheService()",
"modifier": "private",
"original_string": "private JcsCacheService service = new JcsCacheService();",
"type": "JcsCacheService",
"var_name": "service"
},
{
"declarator": "TEST_REGION = \"test\"",
"mo... | {
"body": "@Test\n public void shouldGetAllKeysFromCache() throws CacheOperationException {\n service.initialise(serviceProps);\n service.putInCache(TEST_REGION, \"test1\", 1);\n service.putInCache(TEST_REGION, \"test2\", 2);\n service.putInCache(TEST_REGION, \"test3\", 3);\n\n a... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(JcsCacheService.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(JcsCacheService.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
... | {
"body": "@Override\n public void initialise(final Properties properties) {\n String configFile = properties.getProperty(CacheProperties.CACHE_CONFIG_FILE);\n manager = CompositeCacheManager.getUnconfiguredInstance();\n\n if (null != configFile) {\n try {\n Propertie... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1331 | {
"fields": [
{
"declarator": "FREQ_MAP_CONVERTER = new FreqMapConverter()",
"modifier": "private static final",
"original_string": "private static final FreqMapConverter FREQ_MAP_CONVERTER = new FreqMapConverter();",
"type": "FreqMapConverter",
"var_name": "FREQ_MAP_CONVERTER"
}... | {
"body": "@Test\n public void testCanHandleFreqMap() {\n assertTrue(FREQ_MAP_CONVERTER.canHandle(FreqMap.class));\n assertFalse(FREQ_MAP_CONVERTER.canHandle(String.class));\n }",
"class_method_signature": "FreqMapConverterTest.testCanHandleFreqMap()",
"constructor": false,
"full_signature":... | {
"fields": [
{
"declarator": "serialVersionUID = -1247681579101863145L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -1247681579101863145L;",
"type": "long",
"var_name": "serialVersionUID"
}
],
"file": "library/spark/s... | {
"body": "@Override\n public boolean canHandle(final Class clazz) {\n return FreqMap.class.equals(clazz);\n }",
"class_method_signature": "FreqMapConverter.canHandle(final Class clazz)",
"constructor": false,
"full_signature": "@Override public boolean canHandle(final Class clazz)",
"identifier"... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_749 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/handler/WhileHandlerTest.java",
"identifier": "WhileHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldFailPredicateTestAndNotExecuteDelegateOperation() throws OperationException {\n // Given\n final Edge input = new Edge.Builder()\n .group(\"testEdge\")\n .source(\"src\")\n .dest(\"dest\")\n .directed(tru... | {
"fields": [
{
"declarator": "maxRepeats = While.MAX_REPEATS",
"modifier": "private",
"original_string": "private int maxRepeats = While.MAX_REPEATS;",
"type": "int",
"var_name": "maxRepeats"
}
],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/W... | {
"body": "@Override\n public Object doOperation(final While operation,\n final Context context,\n final Store store) throws OperationException {\n validateMaxRepeats(operation);\n\n Object input = operation.getInput();\n for (int repea... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_319 | {
"fields": [
{
"declarator": "TEST_VIEW_NAME = \"testViewName\"",
"modifier": "private static final",
"original_string": "private static final String TEST_VIEW_NAME = \"testViewName\";",
"type": "String",
"var_name": "TEST_VIEW_NAME"
},
{
"declarator": "TEST_PARAM_KEY ... | {
"body": "@Test\n public void shouldAddAllMergedNamedViewNamesToTopLevelNamedView() {\n final String namedViewName = \"namedViewName\";\n\n final NamedView namedViewToMerge3 = new NamedView.Builder()\n .name(namedViewName + 3)\n .edge(TestGroups.EDGE_2)\n ... | {
"fields": [
{
"declarator": "name",
"modifier": "@Required\n private",
"original_string": "@Required\n private String name;",
"type": "String",
"var_name": "name"
},
{
"declarator": "parameters",
"modifier": "private",
"original_string": "private Map... | {
"body": "public List<String> getMergedNamedViewNames() {\n return mergedNamedViewNames;\n }",
"class_method_signature": "NamedView.getMergedNamedViewNames()",
"constructor": false,
"full_signature": "public List<String> getMergedNamedViewNames()",
"identifier": "getMergedNamedViewNames",
"invoca... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_437 | {
"fields": [],
"file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/element/ElementTest.java",
"identifier": "ElementTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldCreateElementWithUnknownGroup() {\n // Given\n // When\n final Element element = newElement();\n\n // Then\n assertEquals(Element.DEFAULT_GROUP, element.getGroup());\n }",
"class_method_signature": "ElementTest.shouldCreateElementWithUnkn... | {
"fields": [
{
"declarator": "DEFAULT_GROUP = \"UNKNOWN\"",
"modifier": "public static final",
"original_string": "public static final String DEFAULT_GROUP = \"UNKNOWN\";",
"type": "String",
"var_name": "DEFAULT_GROUP"
},
{
"declarator": "properties",
"modifier":... | {
"body": "public String getGroup() {\n return group;\n }",
"class_method_signature": "Element.getGroup()",
"constructor": false,
"full_signature": "public String getGroup()",
"identifier": "getGroup",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "String",
"signa... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_964 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/schema/SchemaElementDefinitionValidatorTest.java",
"identifier": "SchemaElementDefinitionValidatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldValidateFunctionSelectionsAndReturnTrueWhenElementFilterIsNull() {\n // Given\n final SchemaElementDefinition elementDef = mock(SchemaElementDefinition.class);\n final ElementFilter elementFilter = null;\n final SchemaElementDefinitionValidator valid... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(SchemaElementDefinitionValidator.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(SchemaElementDefinitionValidator.class);",
"type": "Logger",
... | {
"body": "protected ValidationResult validateFunctionArgumentTypes(\n final ElementFilter filter, final SchemaElementDefinition schemaElDef) {\n final ValidationResult result = new ValidationResult();\n if (null != filter && null != filter.getComponents()) {\n for (final TupleAdap... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_821 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/handler/output/ToCsvHandlerTest.java",
"identifier": "ToCsvHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldConvertToCsvWithCommaReplacement() throws OperationException {\n // Given\n final List<Element> elements = Lists.newArrayList(\n makeEntity(\"vertex1,with comma\", \"count\", 1),\n makeEntity(\"vertex2\"),\n makeEdge(\"... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/output/ToCsvHandler.java",
"identifier": "ToCsvHandler",
"interfaces": "implements OutputOperationHandler<ToCsv, Iterable<? extends String>>",
"methods": [
{
"class_method_signature": "ToCsvHandler.doOperati... | {
"body": "@Override\n public Iterable<? extends String> doOperation(final ToCsv operation, final Context context, final Store store) throws OperationException {\n if (null == operation.getInput()) {\n return null;\n }\n\n if (null == operation.getElementGenerator()) {\n ... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_572 | {
"fields": [],
"file": "core/type/src/test/java/uk/gov/gchq/gaffer/types/CustomMapTest.java",
"identifier": "CustomMapTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldJSONSerialiseStringMap() throws IOException {\n //given\n final MapSerialiser mapSerialiser = new MapSerialiser();\n mapSerialiser.setValueSerialiser(new StringSerialiser());\n mapSerialiser.setKeySerialiser(new StringSerialiser());\n final Cu... | {
"fields": [
{
"declarator": "keySerialiser",
"modifier": "private final",
"original_string": "private final ToBytesSerialiser<? super K> keySerialiser;",
"type": "ToBytesSerialiser<? super K>",
"var_name": "keySerialiser"
},
{
"declarator": "valueSerialiser",
"m... | {
"body": "public V put(final K key, final V value) {\n return delegateMap.put(key, value);\n }",
"class_method_signature": "CustomMap.put(final K key, final V value)",
"constructor": false,
"full_signature": "public V put(final K key, final V value)",
"identifier": "put",
"invocations": [
"pu... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_122 | {
"fields": [
{
"declarator": "a",
"modifier": "private",
"original_string": "private byte[] a;",
"type": "byte[]",
"var_name": "a"
},
{
"declarator": "b",
"modifier": "private",
"original_string": "private byte[] b;",
"type": "byte[]",
"var_name... | {
"body": "@Test\n public void shouldFailWithSameLengthAndDifferentArrayContent() throws Exception {\n br1 = new BytesAndRange(a, 0, a.length);\n br2 = new BytesAndRange(d, 0, d.length);\n assertFalse(ByteUtils.areKeyBytesEqual(br1, br2));\n }",
"class_method_signature": "ByteUtilsTest.sh... | {
"fields": [],
"file": "store-implementation/accumulo-store/src/main/java/uk/gov/gchq/gaffer/accumulostore/utils/ByteUtils.java",
"identifier": "ByteUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "ByteUtils.ByteUtils()",
"constructor": true,
"full_signature": "privat... | {
"body": "public static boolean areKeyBytesEqual(final byte[] bytes1, final byte[] bytes2) {\n if (Arrays.equals(bytes1, bytes2)) {\n return true;\n }\n\n int last = bytes1.length;\n\n if (last != bytes2.length) {\n return false;\n }\n\n if (last == 0) ... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1223 | {
"fields": [],
"file": "core/operation/src/test/java/uk/gov/gchq/gaffer/operation/impl/get/GetElementsTest.java",
"identifier": "GetElementsTest",
"interfaces": "",
"superclass": "extends OperationTest<GetElements>"
} | {
"body": "@Test\n public void shouldCreateInputFromVertices() {\n // When\n final GetElements op = new GetElements.Builder()\n .input(\"1\", new EntitySeed(\"2\"), new Entity(\"group1\", \"3\"), new EdgeSeed(\"4\", \"5\"), new Edge(\"group\", \"6\", \"7\", true))\n .bui... | {
"fields": [
{
"declarator": "seedMatching",
"modifier": "private",
"original_string": "private SeedMatchingType seedMatching;",
"type": "SeedMatchingType",
"var_name": "seedMatching"
},
{
"declarator": "view",
"modifier": "private",
"original_string": "pri... | {
"body": "@Override\n public Iterable<? extends ElementId> getInput() {\n return input;\n }",
"class_method_signature": "GetElements.getInput()",
"constructor": false,
"full_signature": "@Override public Iterable<? extends ElementId> getInput()",
"identifier": "getInput",
"invocations": [],
... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1366 | {
"fields": [
{
"declarator": "hyperLogLogPlusWithCardinality5",
"modifier": "private static",
"original_string": "private static HyperLogLogPlus hyperLogLogPlusWithCardinality5;",
"type": "HyperLogLogPlus",
"var_name": "hyperLogLogPlusWithCardinality5"
},
{
"declarator... | {
"body": "@Test\n public void shouldAcceptWhenLessThan() {\n // Given\n final HyperLogLogPlusIsLessThan filter = new HyperLogLogPlusIsLessThan(15);\n // When\n boolean accepted = filter.test(hyperLogLogPlusWithCardinality5);\n // Then\n assertTrue(accepted);\n }",
"c... | {
"fields": [
{
"declarator": "controlValue",
"modifier": "private",
"original_string": "private long controlValue;",
"type": "long",
"var_name": "controlValue"
},
{
"declarator": "orEqualTo",
"modifier": "private",
"original_string": "private boolean orEqua... | {
"body": "@Override\n public boolean test(final HyperLogLogPlus input) {\n if (null == input) {\n return false;\n }\n final long cardinality = input.cardinality();\n if (orEqualTo) {\n if (cardinality <= controlValue) {\n return true;\n }... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_93 | {
"fields": [],
"file": "store-implementation/parquet-store/src/test/java/uk/gov/gchq/gaffer/parquetstore/partitioner/GraphPartitionerTest.java",
"identifier": "GraphPartitionerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCannotOverwriteExistingGroupPartitioner() {\n // Given\n final String group = \"GROUP1\";\n final PartitionKey key1 = new PartitionKey(new Object[]{1L, \"B\"});\n final PartitionKey key2 = new PartitionKey(new Object[]{5L, \"A\"});\n final Parti... | {
"fields": [
{
"declarator": "groupToPartitioner",
"modifier": "private final",
"original_string": "private final Map<String, GroupPartitioner> groupToPartitioner;",
"type": "Map<String, GroupPartitioner>",
"var_name": "groupToPartitioner"
},
{
"declarator": "reversedE... | {
"body": "public void addGroupPartitioner(final String group, final GroupPartitioner groupPartitioner) {\n if (groupToPartitioner.containsKey(group)) {\n throw new IllegalArgumentException(\"Cannot overwrite the groupPartitioner of a group that already exists in groupToPartitioner (group was \"\n ... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_972 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/schema/SchemaElementDefinitionValidatorTest.java",
"identifier": "SchemaElementDefinitionValidatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldValidateAndReturnFalseWhenAggregatorProvidedWithNoProperties() {\n // Given\n final SchemaElementDefinitionValidator validator = new SchemaElementDefinitionValidator();\n final BinaryOperator<Integer> function1 = mock(BinaryOperator.class);\n final S... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(SchemaElementDefinitionValidator.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(SchemaElementDefinitionValidator.class);",
"type": "Logger",
... | {
"body": "public ValidationResult validate(final SchemaElementDefinition elementDef) {\n final ValidationResult result = new ValidationResult();\n\n final ElementFilter validator = elementDef.getValidator();\n final ElementAggregator aggregator = elementDef.getFullAggregator();\n result.a... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1059 | {
"fields": [
{
"declarator": "historicSerialisationPairs",
"modifier": "private final",
"original_string": "private final Pair<Object, byte[]>[] historicSerialisationPairs;",
"type": "Pair<Object, byte[]>[]",
"var_name": "historicSerialisationPairs"
}
],
"file": "core/serial... | {
"body": "@Test\n public void shouldSerialiseObjectWithoutFieldX() throws Exception {\n // Given\n final SimpleTestObject obj = new SimpleTestObject();\n\n // When\n final String json = new String(JSONSerialiser.serialise(obj, \"x\"), CommonConstants.UTF_8);\n\n // Then\n ... | {
"fields": [
{
"declarator": "JSON_SERIALISER_CLASS_KEY = \"gaffer.serialiser.json.class\"",
"modifier": "public static final",
"original_string": "public static final String JSON_SERIALISER_CLASS_KEY = \"gaffer.serialiser.json.class\";",
"type": "String",
"var_name": "JSON_SERIALIS... | {
"body": "public static byte[] serialise(final Object object, final String... fieldsToExclude) throws SerialisationException {\n return serialise(object, false, fieldsToExclude);\n }",
"class_method_signature": "JSONSerialiser.serialise(final Object object, final String... fieldsToExclude)",
"construct... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_421 | {
"fields": [],
"file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/element/function/ExtractGroupTest.java",
"identifier": "ExtractGroupTest",
"interfaces": "",
"superclass": "extends FunctionTest"
} | {
"body": "@Test\n public void shouldReturnGroupFromEdge() {\n // Given\n final ExtractGroup function = new ExtractGroup();\n final String group = \"testGroup\";\n final Edge edge = new Edge.Builder()\n .source(\"src\")\n .dest(\"dest\")\n .d... | {
"fields": [],
"file": "core/data/src/main/java/uk/gov/gchq/gaffer/data/element/function/ExtractGroup.java",
"identifier": "ExtractGroup",
"interfaces": "",
"methods": [
{
"class_method_signature": "ExtractGroup.apply(final Element element)",
"constructor": false,
"full_signature": "@Ov... | {
"body": "@Override\n public String apply(final Element element) {\n return null != element ? element.getGroup() : null;\n }",
"class_method_signature": "ExtractGroup.apply(final Element element)",
"constructor": false,
"full_signature": "@Override public String apply(final Element element)",
"i... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_134 | {
"fields": [
{
"declarator": "GRAPH_ID = \"graph1\"",
"modifier": "private static final",
"original_string": "private static final String GRAPH_ID = \"graph1\";",
"type": "String",
"var_name": "GRAPH_ID"
},
{
"declarator": "LOCALITY_GRAPH_ID = \"localityTest\"",
... | {
"body": "@Test\n public void shouldCreateTableWithCorrectLocalityGroups() throws Exception {\n final AccumuloStore store = new SingleUseAccumuloStore();\n final Schema schema = new Schema.Builder()\n .type(TestTypes.ID_STRING, String.class)\n .type(TestTypes.DIRECTED_T... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(TableUtils.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(TableUtils.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"dec... | {
"body": "public static synchronized void createTable(final AccumuloStore store)\n throws StoreException, TableExistsException {\n // Create table and namespace (if provided)\n final String tableName = store.getTableName();\n if (null == tableName) {\n throw new AccumuloRun... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_564 | {
"fields": [],
"file": "core/type/src/test/java/uk/gov/gchq/gaffer/serialisation/IntegerFreqMapSerialiserTest.java",
"identifier": "IntegerFreqMapSerialiserTest",
"interfaces": "",
"superclass": "extends ToBytesSerialisationTest<IntegerFreqMap>"
} | {
"body": "@Test\n public void cantSerialiseStringClass() {\n assertFalse(serialiser.canHandle(String.class));\n }",
"class_method_signature": "IntegerFreqMapSerialiserTest.cantSerialiseStringClass()",
"constructor": false,
"full_signature": "@Test public void cantSerialiseStringClass()",
"identi... | {
"fields": [
{
"declarator": "serialVersionUID = 3772387954385745791L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 3772387954385745791L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "SEPER... | {
"body": "@Override\n public boolean canHandle(final Class clazz) {\n return IntegerFreqMap.class.equals(clazz);\n }",
"class_method_signature": "IntegerFreqMapSerialiser.canHandle(final Class clazz)",
"constructor": false,
"full_signature": "@Override public boolean canHandle(final Class clazz)",... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_837 | {
"fields": [
{
"declarator": "vertex1",
"modifier": "private",
"original_string": "private Object vertex1, vertex2, vertex3,\n vertex4, vertex5, vertex6,\n vertex7, vertex8;",
"type": "Object",
"var_name": "vertex1"
}
],
"file": "core/store/src/test/jav... | {
"body": "@Test\n public void shouldCorrectlyConvertEdgeSeedsWithOppositeUseMatchedVertex() throws OperationException {\n // Given\n final List elementIds = Arrays.asList(\n new EdgeSeed(vertex1, vertex2, false, null),\n new EdgeSeed(vertex3, vertex4, false, null),\n ... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/output/ToVerticesHandler.java",
"identifier": "ToVerticesHandler",
"interfaces": "implements OutputOperationHandler<ToVertices, Iterable<? extends Object>>",
"methods": [
{
"class_method_signature": "ToVerti... | {
"body": "@Override\n public Iterable<Object> doOperation(final ToVertices operation, final Context context, final Store store) throws OperationException {\n if (null == operation.getInput()) {\n return null;\n }\n\n return new StreamFlatMapIterable<>(operation.getInput(), elementI... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1235 | {
"fields": [],
"file": "core/operation/src/test/java/uk/gov/gchq/gaffer/operation/impl/IfTest.java",
"identifier": "IfTest",
"interfaces": "",
"superclass": "extends OperationTest<If>"
} | {
"body": "@Test\n public void shouldThrowErrorForTryingToUpdateOperationsWithTooFewOps() {\n // Given\n final GetElements getElements = new GetElements.Builder()\n .input(new EntitySeed(\"1\"))\n .build();\n\n final If<Object, Object> ifOp = new If.Builder<>()\n ... | {
"fields": [
{
"declarator": "condition",
"modifier": "private",
"original_string": "private Boolean condition;",
"type": "Boolean",
"var_name": "condition"
},
{
"declarator": "conditional",
"modifier": "private",
"original_string": "private Conditional con... | {
"body": "@Override\n public void updateOperations(final Collection<Operation> operations) {\n if (null == operations || 3 != operations.size()) {\n throw new IllegalArgumentException(\"Unable to update operations - exactly 3 operations are required. Received \" + (null != operations ? operation... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_85 | {
"fields": [
{
"declarator": "VERTEX = \"vertex\"",
"modifier": "private static final",
"original_string": "private static final String VERTEX = \"vertex\";",
"type": "String",
"var_name": "VERTEX"
},
{
"declarator": "schema = new Schema.Builder()\n .type(Te... | {
"body": "@Test\n public void shouldCorrectlyUseCompressionOption(@TempDir java.nio.file.Path tempDir)\n throws Exception {\n for (final String compressionType : Sets.newHashSet(\"GZIP\", \"SNAPPY\", \"UNCOMPRESSED\")) {\n // Given\n final Schema schema = new Schema.Builder... | {
"fields": [
{
"declarator": "GROUP = \"group\"",
"modifier": "public static final",
"original_string": "public static final String GROUP = \"group\";",
"type": "String",
"var_name": "GROUP"
},
{
"declarator": "GRAPH = \"graph\"",
"modifier": "public static final... | {
"body": "public List<Path> getFilesForGroup(final String group) throws IOException {\n final Path dir = new Path(getDataDir()\n + \"/\" + getSnapshotPath(currentSnapshot)\n + \"/\" + GRAPH\n + \"/\" + GROUP + \"=\" + group);\n final FileStatus[] files = fs.... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1370 | {
"fields": [
{
"declarator": "hyperLogLogPlusWithCardinality5",
"modifier": "private static",
"original_string": "private static HyperLogLogPlus hyperLogLogPlusWithCardinality5;",
"type": "HyperLogLogPlus",
"var_name": "hyperLogLogPlusWithCardinality5"
},
{
"declarator... | {
"body": "@Test\n public void shouldRejectWhenInputIsNull() {\n // Given\n final HyperLogLogPlusIsLessThan filter = new HyperLogLogPlusIsLessThan(15);\n // When\n boolean accepted = filter.test(null);\n // Then\n assertFalse(accepted);\n }",
"class_method_signature":... | {
"fields": [
{
"declarator": "controlValue",
"modifier": "private",
"original_string": "private long controlValue;",
"type": "long",
"var_name": "controlValue"
},
{
"declarator": "orEqualTo",
"modifier": "private",
"original_string": "private boolean orEqua... | {
"body": "@Override\n public boolean test(final HyperLogLogPlus input) {\n if (null == input) {\n return false;\n }\n final long cardinality = input.cardinality();\n if (orEqualTo) {\n if (cardinality <= controlValue) {\n return true;\n }... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_708 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/handler/ForEachHandlerTest.java",
"identifier": "ForEachHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldExecuteAndReturnExpected() throws OperationException {\n // Given\n final Store store = mock(Store.class);\n final Context context = new Context(new User());\n\n final InputOutput op = mock(InputOutput.class);\n final InputOutput opClone = moc... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/ForEachHandler.java",
"identifier": "ForEachHandler",
"interfaces": "implements OutputOperationHandler<ForEach<I, O>, Iterable<? extends O>>",
"methods": [
{
"class_method_signature": "ForEachHandler.doOpera... | {
"body": "@Override\n public Iterable<? extends O> doOperation(final ForEach<I, O> forEach, final Context context, final Store store) throws OperationException {\n if (null == forEach.getOperation()) {\n throw new OperationException(\"Operation cannot be null\");\n }\n if (null == ... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_358 | {
"fields": [],
"file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/element/LazyPropertiesTest.java",
"identifier": "LazyPropertiesTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldDelegateEntrySetMethodToPropertiesInstance() {\n // Given\n final Properties properties = mock(Properties.class);\n final LazyProperties lazyProperties =\n new LazyProperties(properties, null);\n final Set<Map.Entry<String, Object>> ex... | {
"fields": [
{
"declarator": "serialVersionUID = 9009552236887934877L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 9009552236887934877L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "value... | {
"body": "@Override\n public Set<Map.Entry<String, Object>> entrySet() {\n return properties.entrySet();\n }",
"class_method_signature": "LazyProperties.entrySet()",
"constructor": false,
"full_signature": "@Override public Set<Map.Entry<String, Object>> entrySet()",
"identifier": "entrySet",
... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_476 | {
"fields": [],
"file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/elementvisibilityutil/ElementVisibilityTest.java",
"identifier": "ElementVisibilityTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testToStringMultiByte() {\n final ElementVisibility cv = new ElementVisibility(quote(\"五\"));\n\n assertEquals(\"[\\\"五\\\"]\", cv.toString());\n }",
"class_method_signature": "ElementVisibilityTest.testToStringMultiByte()",
"constructor": false,
"full_signatur... | {
"fields": [
{
"declarator": "node",
"modifier": "",
"original_string": "ElementVisibility.Node node;",
"type": "ElementVisibility.Node",
"var_name": "node"
},
{
"declarator": "expression",
"modifier": "private",
"original_string": "private byte[] expressio... | {
"body": "public static String quote(final String term) {\n return new String(quote(term.getBytes(UTF_8)), UTF_8);\n }",
"class_method_signature": "ElementVisibility.quote(final String term)",
"constructor": false,
"full_signature": "public static String quote(final String term)",
"identifier": "qu... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_925 | {
"fields": [
{
"declarator": "ALL_STORE_TRAITS = Sets.newHashSet(StoreTrait.values())",
"modifier": "public static final",
"original_string": "public static final Set<StoreTrait> ALL_STORE_TRAITS = Sets.newHashSet(StoreTrait.values());",
"type": "Set<StoreTrait>",
"var_name": "ALL_S... | {
"body": "@Test\n public void shouldValidateAndReturnTrueWhenEdgeTransformerProjectsToUnknownProperty() {\n // Given\n final ViewValidator validator = new ViewValidator();\n final View view = new View.Builder()\n .edge(TestGroups.EDGE, new ViewElementDefinition.Builder()\n ... | {
"fields": [
{
"declarator": "SKIP_VIEW_VALIDATION = \"skipViewValidation\"",
"modifier": "public static final",
"original_string": "public static final String SKIP_VIEW_VALIDATION = \"skipViewValidation\";",
"type": "String",
"var_name": "SKIP_VIEW_VALIDATION"
},
{
"d... | {
"body": "public ValidationResult validate(final View view, final Schema schema, final Set<StoreTrait> storeTraits) {\n final boolean isStoreOrdered = storeTraits.contains(StoreTrait.ORDERED);\n\n final ValidationResult result = new ValidationResult();\n\n if (null != view) {\n valida... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_860 | {
"fields": [
{
"declarator": "cache",
"modifier": "private static",
"original_string": "private static NamedViewCache cache;",
"type": "NamedViewCache",
"var_name": "cache"
},
{
"declarator": "GAFFER_USER = \"gaffer user\"",
"modifier": "private static final",
... | {
"body": "@Test\n public void shouldThrowExceptionIfNamedViewAlreadyExists() throws CacheOperationFailedException {\n cache.addNamedView(standard, false);\n try {\n cache.addNamedView(standard, false);\n fail(EXCEPTION_EXPECTED);\n } catch (OverwritingException e) {\n ... | {
"fields": [
{
"declarator": "CACHE_NAME = \"NamedView\"",
"modifier": "private static final",
"original_string": "private static final String CACHE_NAME = \"NamedView\";",
"type": "String",
"var_name": "CACHE_NAME"
}
],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/s... | {
"body": "public void addNamedView(final NamedViewDetail namedViewDetail, final boolean overwrite) throws CacheOperationFailedException {\n add(namedViewDetail, overwrite, null, null);\n }",
"class_method_signature": "NamedViewCache.addNamedView(final NamedViewDetail namedViewDetail, final boolean overwr... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_533 | {
"fields": [],
"file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/iterable/ChainedIterableTest.java",
"identifier": "ChainedIterableTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldRemoveElementFromThirdIterable() {\n // Given\n final List<String> itr1 = Lists.newArrayList(\"a\");\n final List<String> emptyItr2 = new ArrayList<>(0);\n final List<String> itr3 = Lists.newArrayList(\"b\", \"c\", \"d\", \"e\");\n final List<... | {
"fields": [
{
"declarator": "itrs",
"modifier": "private final",
"original_string": "private final Iterable<T>[] itrs;",
"type": "Iterable<T>[]",
"var_name": "itrs"
},
{
"declarator": "n",
"modifier": "private final",
"original_string": "private final int ... | {
"body": "@Override\n public CloseableIterator<T> iterator() {\n return new IteratorWrapper();\n }",
"class_method_signature": "ChainedIterable.iterator()",
"constructor": false,
"full_signature": "@Override public CloseableIterator<T> iterator()",
"identifier": "iterator",
"invocations": [],
... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_163 | {
"fields": [
{
"declarator": "serialisation",
"modifier": "private",
"original_string": "private ElementSerialisation serialisation;",
"type": "ElementSerialisation",
"var_name": "serialisation"
}
],
"file": "store-implementation/hbase-store/src/test/java/uk/gov/gchq/gaffer/... | {
"body": "@Test\n public void shouldGetPropertiesFromTimestamp() throws Exception {\n // Given\n // add extra timestamp property to schema\n final Schema schema = new Schema.Builder().json(StreamUtil.schemas(getClass())).build();\n serialisation = new ElementSerialisation(new Schema.Bu... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(ElementSerialisation.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(ElementSerialisation.class);",
"type": "Logger",
"var_name": "LOGGER"
... | {
"body": "public Properties getPropertiesFromTimestamp(final String group, final long timestamp)\n throws SerialisationException {\n final SchemaElementDefinition elementDefinition = schema.getElement(group);\n if (null == elementDefinition) {\n throw new SerialisationException(\"... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_499 | {
"fields": [],
"file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/TextUtilTest.java",
"identifier": "TextUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetByteBufferReturnsNullWhenTextIsNull() {\n assertEquals(null, TextUtil.getByteBuffer(null));\n }",
"class_method_signature": "TextUtilTest.testGetByteBufferReturnsNullWhenTextIsNull()",
"constructor": false,
"full_signature": "@Test public void testGetByteBuffer... | {
"fields": [],
"file": "core/common-util/src/main/java/uk/gov/gchq/gaffer/commonutil/TextUtil.java",
"identifier": "TextUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "TextUtil.TextUtil()",
"constructor": true,
"full_signature": "private TextUtil()",
"identifie... | {
"body": "public static ByteBuffer getByteBuffer(final Text text) {\n if (text == null) {\n return null;\n }\n byte[] bytes = text.getBytes();\n return ByteBuffer.wrap(bytes, 0, text.getLength());\n }",
"class_method_signature": "TextUtil.getByteBuffer(final Text text)",
... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1262 | {
"fields": [
{
"declarator": "serviceLoaderProperties = new Properties()",
"modifier": "private",
"original_string": "private Properties serviceLoaderProperties = new Properties();",
"type": "Properties",
"var_name": "serviceLoaderProperties"
}
],
"file": "core/cache/src/tes... | {
"body": "@DisplayName(\"Should not throw NullPointer when Loader is initialised with null properties\")\n @Test\n public void shouldINotThrowNullPointerExceptionOnInitialiseLoader() {\n CacheServiceLoader.initialise(null);\n }",
"class_method_signature": "CacheServiceLoaderTest.shouldINotThrowNull... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(CacheServiceLoader.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(CacheServiceLoader.class);",
"type": "Logger",
"var_name": "LOGGER"
},
... | {
"body": "public static void initialise(final Properties properties) {\n if (null == properties) {\n LOGGER.warn(\"received null properties - exiting initialise method without creating service\");\n return;\n }\n final String cacheClass = properties.getProperty(CachePropert... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1327 | {
"fields": [
{
"declarator": "DELTA = 0.0000000001",
"modifier": "private static final",
"original_string": "private static final double DELTA = 0.0000000001;",
"type": "double",
"var_name": "DELTA"
},
{
"declarator": "UNION_CONVERTER = new UnionConverter()",
"mo... | {
"body": "@Test\n public void testCanHandleUnion() {\n assertTrue(UNION_CONVERTER.canHandle(Union.class));\n assertFalse(UNION_CONVERTER.canHandle(String.class));\n }",
"class_method_signature": "UnionConverterTest.testCanHandleUnion()",
"constructor": false,
"full_signature": "@Test public... | {
"fields": [
{
"declarator": "serialVersionUID = -7267397762494567236L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -7267397762494567236L;",
"type": "long",
"var_name": "serialVersionUID"
}
],
"file": "library/spark/s... | {
"body": "@Override\n public boolean canHandle(final Class clazz) {\n return Union.class.equals(clazz);\n }",
"class_method_signature": "UnionConverter.canHandle(final Class clazz)",
"constructor": false,
"full_signature": "@Override public boolean canHandle(final Class clazz)",
"identifier": "c... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_187 | {
"fields": [
{
"declarator": "SCHEMA = new Schema.Builder()\n .type(\"string\", new TypeDefinition.Builder()\n .clazz(String.class)\n .aggregateFunction(new StringConcat())\n .build())\n .type(\"type\", Boolean.class)\n ... | {
"body": "@Test\n public void shouldConstructProcessors() throws OperationException, IOException {\n // Given\n final Scan scan = mock(Scan.class);\n given(scan.getAttribute(HBaseStoreConstants.VIEW)).willReturn(VIEW.toCompactJson());\n given(scan.getAttribute(HBaseStoreConstants.EXTRA... | {
"fields": [],
"file": "store-implementation/hbase-store/src/main/java/uk/gov/gchq/gaffer/hbasestore/coprocessor/scanner/StoreScanner.java",
"identifier": "StoreScanner",
"interfaces": "",
"methods": [
{
"class_method_signature": "StoreScanner.StoreScanner(final InternalScanner scanner,\n ... | {
"body": "protected static List<GafferScannerProcessor> createProcessors(final Schema schema, final ElementSerialisation serialisation) {\n final List<GafferScannerProcessor> processors = new ArrayList<>();\n if (schema.isAggregationEnabled()) {\n processors.add(new StoreAggregationProcessor... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1005 | {
"fields": [],
"file": "core/serialisation/src/test/java/uk/gov/gchq/gaffer/serialisation/implementation/ordered/OrderedFloatSerialiserTest.java",
"identifier": "OrderedFloatSerialiserTest",
"interfaces": "",
"superclass": "extends ToBytesSerialisationTest<Float>"
} | {
"body": "@Test\n public void canSerialiseFloatClass() {\n assertTrue(serialiser.canHandle(Float.class));\n }",
"class_method_signature": "OrderedFloatSerialiserTest.canSerialiseFloatClass()",
"constructor": false,
"full_signature": "@Test public void canSerialiseFloatClass()",
"identifier": "ca... | {
"fields": [
{
"declarator": "serialVersionUID = 6829577492677279853L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 6829577492677279853L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "INTEG... | {
"body": "@Override\n public boolean canHandle(final Class clazz) {\n return Float.class.equals(clazz);\n }",
"class_method_signature": "OrderedFloatSerialiser.canHandle(final Class clazz)",
"constructor": false,
"full_signature": "@Override public boolean canHandle(final Class clazz)",
"identif... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_884 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/ElementValidatorTest.java",
"identifier": "ElementValidatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnTrueWhenSchemaValidateWithoutIsAWithValidElement() {\n // Given\n final Schema schema = mock(Schema.class);\n final String group = TestGroups.EDGE;\n final Element elm = mock(Element.class);\n final SchemaElementDefinition elementDef = m... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(ElementValidator.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(ElementValidator.class);",
"type": "Logger",
"var_name": "LOGGER"
},
... | {
"body": "@Override\n public boolean validate(final Element element) {\n if (null == element) {\n return false;\n }\n\n if (null != schema) {\n return validateWithSchema(element);\n }\n\n if (null != view) {\n return validateAgainstViewFilter(ele... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1140 | {
"fields": [
{
"declarator": "graph",
"modifier": "",
"original_string": "Graph graph;",
"type": "Graph",
"var_name": "graph"
},
{
"declarator": "storeProperties = new StoreProperties()",
"modifier": "final",
"original_string": "final StoreProperties storeP... | {
"body": "@Test\n public void shouldValidateValidOperationChainAgainstSchema() {\n // When\n final ValidationResult validationResult = SchemaOperationChainUtil.validate(schema, validOperationChain);\n\n // Then\n assertTrue(validationResult.isValid());\n }",
"class_method_signatur... | {
"fields": [],
"file": "core/graph/src/main/java/uk/gov/gchq/gaffer/graph/SchemaOperationChainUtil.java",
"identifier": "SchemaOperationChainUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "SchemaOperationChainUtil.SchemaOperationChainUtil()",
"constructor": true,
"ful... | {
"body": "public static ValidationResult validate(final Schema schema, final OperationChain operationChain) {\n updateOperationChainViews(operationChain, schema);\n SchemaOperationChainValidator validator = new SchemaOperationChainValidator(new ViewValidator(), schema);\n\n return validator.vali... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_168 | {
"fields": [
{
"declarator": "inputDir",
"modifier": "private",
"original_string": "private String inputDir;",
"type": "String",
"var_name": "inputDir"
},
{
"declarator": "outputDir",
"modifier": "private",
"original_string": "private String outputDir;",
... | {
"body": "@Test\n public void shouldSetupJob() throws IOException, StoreException {\n // Given\n final JobConf localConf = createLocalConf();\n final FileSystem fs = FileSystem.getLocal(localConf);\n fs.mkdirs(new Path(outputDir));\n\n final JobFactory factory = getJobFactory();... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(HBaseAddElementsFromHdfsJobFactory.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(HBaseAddElementsFromHdfsJobFactory.class);",
"type": "Logger",
... | {
"body": "@Override\n public void setupJob(final Job job, final AddElementsFromHdfs operation, final String mapperGeneratorClassName, final Store store) throws IOException {\n job.setJarByClass(getClass());\n job.setJobName(getJobName(mapperGeneratorClassName, operation.getOutputPath()));\n\n ... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_492 | {
"fields": [],
"file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/StringUtilTest.java",
"identifier": "StringUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void escapeCommaShouldReplaceBackslashWithSemiColon() {\n assertEquals(\"replaceWith\\\\;semicolon\", StringUtil.escapeComma(\"replaceWith\\\\semicolon\"));\n }",
"class_method_signature": "StringUtilTest.escapeCommaShouldReplaceBackslashWithSemiColon()",
"constructor": fals... | {
"fields": [
{
"declarator": "COMMA = ','",
"modifier": "public static final",
"original_string": "public static final char COMMA = ',';",
"type": "char",
"var_name": "COMMA"
},
{
"declarator": "ESCAPE_CHAR = '\\\\'",
"modifier": "private static final",
"or... | {
"body": "public static String escapeComma(final String str) {\n final StringBuilder escapedStr = new StringBuilder(str.length());\n for (int i = 0; i < str.length(); i++) {\n char c = str.charAt(i);\n if (ESCAPE_CHAR == c) {\n escapedStr.append(ESCAPE_CHAR);\n ... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_538 | {
"fields": [],
"file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/iterable/WrappedCloseableIterableTest.java",
"identifier": "WrappedCloseableIterableTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldDelegateCloseToWrappedIterables() {\n final CloseableIterable<? extends Object> iterable1 = mock(CloseableIterable.class);\n final CloseableIterable<Integer> iterable2 = mock(CloseableIterable.class);\n final Iterable<Object> chainedIterable = getChainedIte... | {
"fields": [
{
"declarator": "iterable",
"modifier": "private final",
"original_string": "private final Iterable<T> iterable;",
"type": "Iterable<T>",
"var_name": "iterable"
}
],
"file": "core/common-util/src/main/java/uk/gov/gchq/gaffer/commonutil/iterable/WrappedCloseableI... | {
"body": "@Override\n public void close() {\n CloseableUtil.close(iterable);\n }",
"class_method_signature": "WrappedCloseableIterable.close()",
"constructor": false,
"full_signature": "@Override public void close()",
"identifier": "close",
"invocations": [
"close"
],
"modifiers": "@Ov... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_36 | {
"fields": [
{
"declarator": "ID_SCHEMA_ENTITY = \"basicEntitySchema\"",
"modifier": "public static final",
"original_string": "public static final String ID_SCHEMA_ENTITY = \"basicEntitySchema\";",
"type": "String",
"var_name": "ID_SCHEMA_ENTITY"
},
{
"declarator": "I... | {
"body": "@Test\n public void shouldReturnNotReturnEnabledOrDisabledGraphsWhenNotInCsv() throws Exception {\n // Given\n populateGraphs();\n\n // When\n final Collection<Graph> returnedGraphs = store.getGraphs(blankUser, \"mockGraphId0,mockGraphId1\", ignore);\n\n // Then\n ... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(Store.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(Store.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": ... | {
"body": "public Collection<Graph> getGraphs(final User user, final String graphIdsCsv, final Operation operation) {\n Collection<Graph> rtn = new ArrayList<>();\n if (nonNull(operation)) {\n String optionKey = FEDERATED_STORE_PROCESSED + id;\n boolean isIdFound = !operation.getOp... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1269 | {
"fields": [
{
"declarator": "service = new JcsCacheService()",
"modifier": "private",
"original_string": "private JcsCacheService service = new JcsCacheService();",
"type": "JcsCacheService",
"var_name": "service"
},
{
"declarator": "TEST_REGION = \"test\"",
"mo... | {
"body": "@Test\n public void shouldThrowAnExceptionIfPathIsMisconfigured() {\n String badFileName = \"/made/up/file/name\";\n String expected = String.format(\"Cannot create cache using config file %s\", badFileName);\n\n serviceProps.setProperty(CacheProperties.CACHE_CONFIG_FILE, badFileNam... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(JcsCacheService.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(JcsCacheService.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
... | {
"body": "@Override\n public void initialise(final Properties properties) {\n String configFile = properties.getProperty(CacheProperties.CACHE_CONFIG_FILE);\n manager = CompositeCacheManager.getUnconfiguredInstance();\n\n if (null != configFile) {\n try {\n Propertie... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_611 | {
"fields": [
{
"declarator": "schema",
"modifier": "private static",
"original_string": "private static Schema schema;",
"type": "Schema",
"var_name": "schema"
},
{
"declarator": "serialiser",
"modifier": "private static",
"original_string": "private static... | {
"body": "@Test\n public void testIsConsistent() {\n assertEquals(true, serialiser.isConsistent());\n }",
"class_method_signature": "ElementIdSerialiserTest.testIsConsistent()",
"constructor": false,
"full_signature": "@Test public void testIsConsistent()",
"identifier": "testIsConsistent",
"i... | {
"fields": [
{
"declarator": "serialVersionUID = 2116809339334801784L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 2116809339334801784L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "entit... | {
"body": "@Override\n public boolean isConsistent() {\n return null != edgeIdSerialiser && null != entityIdSerialiser\n && edgeIdSerialiser.isConsistent() && entityIdSerialiser.isConsistent();\n }",
"class_method_signature": "ElementIdSerialiser.isConsistent()",
"constructor": false,
... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_241 | {
"fields": [
{
"declarator": "GRAPH_ID = \"graphId\"",
"modifier": "private static final",
"original_string": "private static final String GRAPH_ID = \"graphId\";",
"type": "String",
"var_name": "GRAPH_ID"
},
{
"declarator": "service",
"modifier": "@InjectMocks\n... | {
"body": "@Test\n public void shouldGetSerialisedFields() throws IOException {\n // When\n final Set<String> fields = service.getSerialisedFields(IsA.class.getName());\n\n // Then\n assertEquals(1, fields.size());\n assertTrue(fields.contains(\"type\"));\n }",
"class_method... | {
"fields": [
{
"declarator": "graphFactory",
"modifier": "@Inject\n private",
"original_string": "@Inject\n private GraphFactory graphFactory;",
"type": "GraphFactory",
"var_name": "graphFactory"
},
{
"declarator": "userFactory",
"modifier": "@Inject\n p... | {
"body": "@SuppressFBWarnings(value = \"REC_CATCH_EXCEPTION\", justification = \"Need to wrap all runtime exceptions before they are given to the user\")\n @Override\n public Set<String> getSerialisedFields(final String className) {\n final Class<?> clazz;\n try {\n clazz = Class.forNa... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_754 | {
"fields": [
{
"declarator": "handler",
"modifier": "private",
"original_string": "private GetSchemaHandler handler;",
"type": "GetSchemaHandler",
"var_name": "handler"
},
{
"declarator": "schema",
"modifier": "private",
"original_string": "private Schema s... | {
"body": "@Test\n public void shouldReturnFullSchema() throws OperationException {\n given(store.getProperties()).willReturn(properties);\n given(store.getOriginalSchema()).willReturn(schema);\n given(context.getUser()).willReturn(user);\n\n final GetSchema operation = new GetSchema();... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/GetSchemaHandler.java",
"identifier": "GetSchemaHandler",
"interfaces": "implements OutputOperationHandler<GetSchema, Schema>",
"methods": [
{
"class_method_signature": "GetSchemaHandler.doOperation(final Ge... | {
"body": "@Override\n public Schema doOperation(final GetSchema operation, final Context context, final Store store) throws OperationException {\n final Schema schema;\n if (null == operation) {\n throw new OperationException(\"Operation cannot be null\");\n }\n\n if (operat... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_304 | {
"fields": [],
"file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/elementdefinition/view/ViewTest.java",
"identifier": "ViewTest",
"interfaces": "",
"superclass": "extends JSONSerialisationTest<View>"
} | {
"body": "@Test\n public void shouldFilterEntitiesInBuilder() {\n // When\n final View view = new View.Builder()\n .entity(TestGroups.ENTITY)\n .entity(TestGroups.ENTITY_2)\n .removeEntities(e -> e.getKey().equals(TestGroups.ENTITY))\n .bui... | {
"fields": [
{
"declarator": "globalElements",
"modifier": "private",
"original_string": "private List<GlobalViewElementDefinition> globalElements;",
"type": "List<GlobalViewElementDefinition>",
"var_name": "globalElements"
},
{
"declarator": "globalEntities",
"m... | {
"body": "@Override\n public boolean equals(final Object obj) {\n if (this == obj) {\n return true;\n }\n\n if (null == obj || getClass() != obj.getClass()) {\n return false;\n }\n\n final View view = (View) obj;\n\n return new EqualsBuilder()\n ... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1286 | {
"fields": [
{
"declarator": "SERIALISER = new RoaringBitmapSerialiser()",
"modifier": "private static final",
"original_string": "private static final RoaringBitmapSerialiser SERIALISER = new RoaringBitmapSerialiser();",
"type": "RoaringBitmapSerialiser",
"var_name": "SERIALISER"
... | {
"body": "@Test\n @Override\n public void shouldDeserialiseEmpty() throws SerialisationException {\n // When\n final RoaringBitmap value = serialiser.deserialiseEmpty();\n\n // Then\n assertEquals(new RoaringBitmap(), value);\n }",
"class_method_signature": "RoaringBitmapSerial... | {
"fields": [
{
"declarator": "serialVersionUID = 3772387954385745791L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 3772387954385745791L;",
"type": "long",
"var_name": "serialVersionUID"
}
],
"file": "library/bitmap-li... | {
"body": "@Override\n public RoaringBitmap deserialiseEmpty() {\n return new RoaringBitmap();\n }",
"class_method_signature": "RoaringBitmapSerialiser.deserialiseEmpty()",
"constructor": false,
"full_signature": "@Override public RoaringBitmap deserialiseEmpty()",
"identifier": "deserialiseEmpty... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_979 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/schema/SchemaElementDefinitionValidatorTest.java",
"identifier": "SchemaElementDefinitionValidatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldValidateAndReturnFalseWhenAggregatorSelectionHasUnknownProperty() {\n // Given\n final SchemaElementDefinitionValidator validator = new SchemaElementDefinitionValidator();\n final BinaryOperator<Integer> function1 = mock(BinaryOperator.class);\n fina... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(SchemaElementDefinitionValidator.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(SchemaElementDefinitionValidator.class);",
"type": "Logger",
... | {
"body": "public ValidationResult validate(final SchemaElementDefinition elementDef) {\n final ValidationResult result = new ValidationResult();\n\n final ElementFilter validator = elementDef.getValidator();\n final ElementAggregator aggregator = elementDef.getFullAggregator();\n result.a... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1052 | {
"fields": [],
"file": "core/serialisation/src/test/java/uk/gov/gchq/gaffer/serialisation/implementation/raw/RawFloatSerialiserTest.java",
"identifier": "RawFloatSerialiserTest",
"interfaces": "",
"superclass": "extends ToBytesSerialisationTest<Float>"
} | {
"body": "@Test\n public void canSerialiseFloatClass() {\n assertTrue(serialiser.canHandle(Float.class));\n }",
"class_method_signature": "RawFloatSerialiserTest.canSerialiseFloatClass()",
"constructor": false,
"full_signature": "@Test public void canSerialiseFloatClass()",
"identifier": "canSer... | {
"fields": [
{
"declarator": "serialVersionUID = -8573401558869574875L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -8573401558869574875L;",
"type": "long",
"var_name": "serialVersionUID"
}
],
"file": "core/serialisat... | {
"body": "@Override\n public boolean canHandle(final Class clazz) {\n return Float.class.equals(clazz);\n }",
"class_method_signature": "RawFloatSerialiser.canHandle(final Class clazz)",
"constructor": false,
"full_signature": "@Override public boolean canHandle(final Class clazz)",
"identifier"... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_580 | {
"fields": [
{
"declarator": "freqMap",
"modifier": "private",
"original_string": "private FreqMap freqMap;",
"type": "FreqMap",
"var_name": "freqMap"
}
],
"file": "core/type/src/test/java/uk/gov/gchq/gaffer/types/function/FreqMapPredicatorTest.java",
"identifier": "FreqMa... | {
"body": "@Test\n public void shouldJsonSerialiseAndDeserialise() throws SerialisationException {\n //given\n final FreqMapPredicator nullPredicator = new FreqMapPredicator();\n final FreqMapPredicator regexPredicator = new FreqMapPredicator(new Regex(\"^\\\\wo\\\\w$\"));\n\n //when\n ... | {
"fields": [
{
"declarator": "predicate",
"modifier": "private",
"original_string": "private KoryphePredicate<String> predicate;",
"type": "KoryphePredicate<String>",
"var_name": "predicate"
}
],
"file": "core/type/src/main/java/uk/gov/gchq/gaffer/types/function/FreqMapPredi... | {
"body": "@Override\n public FreqMap apply(final FreqMap freqMap) {\n return filterPredicate(freqMap);\n }",
"class_method_signature": "FreqMapPredicator.apply(final FreqMap freqMap)",
"constructor": false,
"full_signature": "@Override public FreqMap apply(final FreqMap freqMap)",
"identifier": ... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_996 | {
"fields": [],
"file": "core/serialisation/src/test/java/uk/gov/gchq/gaffer/serialisation/util/JsonSerialisationUtilTest.java",
"identifier": "JsonSerialisationUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testClassWithTypeParamExtendingComparable() {\n // Given\n final String classWithTypeParamExtendingComparableName =\n ClassWithTypeParamExtendingComparable.class.getName();\n\n // When\n final Map<String, String> result =\n Js... | {
"fields": [
{
"declarator": "cache = Collections.emptyMap()",
"modifier": "private static",
"original_string": "private static Map<String, Map<String, String>> cache = Collections.emptyMap();",
"type": "Map<String, Map<String, String>>",
"var_name": "cache"
}
],
"file": "co... | {
"body": "public static Map<String, String> getSerialisedFieldClasses(final String className) {\n final Map<String, String> cachedResult = cache.get(className);\n if (null != cachedResult) {\n return cachedResult;\n }\n\n final Class<?> clazz;\n try {\n clazz ... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1117 | {
"fields": [
{
"declarator": "OP_AUTHS_PATH = \"/opAuthoriser.json\"",
"modifier": "private static final",
"original_string": "private static final String OP_AUTHS_PATH = \"/opAuthoriser.json\";",
"type": "String",
"var_name": "OP_AUTHS_PATH"
},
{
"declarator": "USER =... | {
"body": "@Test\n public void shouldRejectOperationChainWhenUserDoesntHaveAllOpAuthsForAllOperations() {\n // Given\n final OperationAuthoriser hook = fromJson(OP_AUTHS_PATH);\n final OperationChain opChain = new OperationChain.Builder()\n .first(new GetAdjacentIds()) // Requi... | {
"fields": [
{
"declarator": "allAuths = new HashSet<>()",
"modifier": "private final",
"original_string": "private final Set<String> allAuths = new HashSet<>();",
"type": "Set<String>",
"var_name": "allAuths"
},
{
"declarator": "auths = new HashMap<>()",
"modifi... | {
"body": "@Override\n public void preExecute(final OperationChain<?> opChain, final Context context) {\n if (null != opChain) {\n for (final Operation operation : opChain.getOperations()) {\n authorise(operation, context.getUser());\n }\n authorise(opChain, c... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_216 | {
"fields": [
{
"declarator": "SCHEMA = Schema.fromJson(StreamUtil.schemas(HBaseStoreTest.class))",
"modifier": "private static final",
"original_string": "private static final Schema SCHEMA = Schema.fromJson(StreamUtil.schemas(HBaseStoreTest.class));",
"type": "Schema",
"var_name": ... | {
"body": "@Test\n public void shouldCreateAStoreUsingGraphId() throws Exception {\n // Given\n final HBaseProperties properties = HBaseProperties.loadStoreProperties(StreamUtil.storeProps(HBaseStoreTest.class));\n final SingleUseMiniHBaseStore store = new SingleUseMiniHBaseStore();\n\n ... | {
"fields": [
{
"declarator": "TRAITS =\n Collections.unmodifiableSet(Sets.newHashSet(\n ORDERED,\n VISIBILITY,\n PRE_AGGREGATION_FILTERING,\n POST_AGGREGATION_FILTERING,\n POST_TRANSFORMATION_FILTERING... | {
"body": "@Override\n public void initialise(final String graphId, final Schema schema, final StoreProperties properties)\n throws StoreException {\n preInitialise(graphId, schema, properties);\n TableUtils.ensureTableExists(this);\n }",
"class_method_signature": "HBaseStore.initiali... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_646 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/ContextTest.java",
"identifier": "ContextTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldConstructContextWithUnknownUser() {\n // Given\n // When\n final Context context = new Context();\n\n // Then\n assertEquals(User.UNKNOWN_USER_ID, context.getUser().getUserId());\n }",
"class_method_signature": "ContextTest.shouldConstruc... | {
"fields": [
{
"declarator": "user",
"modifier": "private final",
"original_string": "private final User user;",
"type": "User",
"var_name": "user"
},
{
"declarator": "jobId",
"modifier": "private final",
"original_string": "private final String jobId;",
... | {
"body": "public User getUser() {\n return user;\n }",
"class_method_signature": "Context.getUser()",
"constructor": false,
"full_signature": "public User getUser()",
"identifier": "getUser",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "User",
"signature": "Use... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_61 | {
"fields": [
{
"declarator": "EXPECTED_GRAPH_ID = \"testGraphID\"",
"modifier": "private static final",
"original_string": "private static final String EXPECTED_GRAPH_ID = \"testGraphID\";",
"type": "String",
"var_name": "EXPECTED_GRAPH_ID"
},
{
"declarator": "READ_ACC... | {
"body": "@Test\n public void shouldShallowCloneOperationWithNulls() {\n final AddGraphWithHooks a = new Builder()\n .graphId(null)\n .parentPropertiesId(null)\n .parentSchemaIds(null)\n .schema(null)\n .graphAuths(null)\n ... | {
"fields": [
{
"declarator": "hooks",
"modifier": "private",
"original_string": "private GraphHook[] hooks;",
"type": "GraphHook[]",
"var_name": "hooks"
}
],
"file": "store-implementation/federated-store/src/main/java/uk/gov/gchq/gaffer/federatedstore/operation/AddGraphWithH... | {
"body": "@Override\n public AddGraphWithHooks shallowClone() throws CloneFailedException {\n Builder builder = new Builder()\n .graphId(getGraphId())\n .schema(getSchema())\n .storeProperties(getStoreProperties())\n .parentSchemaIds(getParentSche... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_353 | {
"fields": [
{
"declarator": "EDGE_AB = new Edge.Builder().group(TestGroups.EDGE).source(\"A\").dest(\"B\").directed(true).build()",
"modifier": "private static final",
"original_string": "private static final Edge EDGE_AB = new Edge.Builder().group(TestGroups.EDGE).source(\"A\").dest(\"B\").di... | {
"body": "@Test\n public void shouldThrowIAEForNullWalkInput() {\n final Function<Walk, Object> function = new ExtractWalkVertex();\n\n final Exception exception = assertThrows(IllegalArgumentException.class, () -> function.apply(null));\n assertEquals(\"Walk cannot be null\", exception.getMe... | {
"fields": [],
"file": "core/data/src/main/java/uk/gov/gchq/gaffer/data/graph/function/walk/ExtractWalkVertex.java",
"identifier": "ExtractWalkVertex",
"interfaces": "",
"methods": [
{
"class_method_signature": "ExtractWalkVertex.apply(final Walk walk)",
"constructor": false,
"full_sign... | {
"body": "@Override\n public Object apply(final Walk walk) {\n if (null == walk) {\n throw new IllegalArgumentException(\"Walk cannot be null\");\n }\n return walk.getSourceVertex();\n }",
"class_method_signature": "ExtractWalkVertex.apply(final Walk walk)",
"constructor": f... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_703 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/handler/compare/MinHandlerTest.java",
"identifier": "MinHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldFindMinBasedOnElement() throws OperationException {\n // Given\n final Entity entity1 = makeEntity(1, 1);\n final Entity entity2 = makeEntity(2, 2);\n final Entity entity3 = makeEntity(3, 3);\n final Entity entity4 = makeEntity(4, 4);\n\n ... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/compare/MinHandler.java",
"identifier": "MinHandler",
"interfaces": "implements OutputOperationHandler<Min, Element>",
"methods": [
{
"class_method_signature": "MinHandler.doOperation(final Min operation, fi... | {
"body": "@Override\n public Element doOperation(final Min operation, final Context context, final Store store) throws OperationException {\n // If there is no input or there are no comparators, we return null\n if (null == operation.getInput()\n || null == operation.getComparators()\... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_596 | {
"fields": [
{
"declarator": "schema",
"modifier": "private static",
"original_string": "private static Schema schema;",
"type": "Schema",
"var_name": "schema"
},
{
"declarator": "serialiser",
"modifier": "private static",
"original_string": "private static... | {
"body": "@Test\n public void testCantSerialiseIntegerClass() throws SerialisationException {\n assertFalse(serialiser.canHandle(Integer.class));\n }",
"class_method_signature": "ElementSerialiserTest.testCantSerialiseIntegerClass()",
"constructor": false,
"full_signature": "@Test public void test... | {
"fields": [
{
"declarator": "serialVersionUID = 4640352297806229672L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 4640352297806229672L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "entit... | {
"body": "@Override\n public boolean canHandle(final Class clazz) {\n return Element.class.isAssignableFrom(clazz);\n }",
"class_method_signature": "ElementSerialiser.canHandle(final Class clazz)",
"constructor": false,
"full_signature": "@Override public boolean canHandle(final Class clazz)",
"... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1044 | {
"fields": [],
"file": "core/serialisation/src/test/java/uk/gov/gchq/gaffer/serialisation/implementation/raw/CompactRawIntegerSerialiserTest.java",
"identifier": "CompactRawIntegerSerialiserTest",
"interfaces": "",
"superclass": "extends ToBytesSerialisationTest<Integer>"
} | {
"body": "@Test\n public void cantSerialiseStringClass() {\n assertFalse(serialiser.canHandle(String.class));\n }",
"class_method_signature": "CompactRawIntegerSerialiserTest.cantSerialiseStringClass()",
"constructor": false,
"full_signature": "@Test public void cantSerialiseStringClass()",
"ide... | {
"fields": [
{
"declarator": "serialVersionUID = -2874472098583724627L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -2874472098583724627L;",
"type": "long",
"var_name": "serialVersionUID"
}
],
"file": "core/serialisat... | {
"body": "@Override\n public boolean canHandle(final Class clazz) {\n return Integer.class.equals(clazz);\n }",
"class_method_signature": "CompactRawIntegerSerialiser.canHandle(final Class clazz)",
"constructor": false,
"full_signature": "@Override public boolean canHandle(final Class clazz)",
"... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1101 | {
"fields": [
{
"declarator": "NAMED_VIEW_NAME = \"namedViewName\"",
"modifier": "private static final",
"original_string": "private static final String NAMED_VIEW_NAME = \"namedViewName\";",
"type": "String",
"var_name": "NAMED_VIEW_NAME"
},
{
"declarator": "NESTED_NAM... | {
"body": "@Test\n public void shouldResolveNamedViewAndMergeAnotherView() throws CacheOperationFailedException {\n // Given\n given(CACHE.getNamedView(NAMED_VIEW_NAME, CONTEXT.getUser())).willReturn(FULL_NAMED_VIEW_DETAIL);\n final View viewToMerge = new View.Builder().edge(TestGroups.EDGE).b... | {
"fields": [
{
"declarator": "cache",
"modifier": "private final",
"original_string": "private final NamedViewCache cache;",
"type": "NamedViewCache",
"var_name": "cache"
}
],
"file": "core/graph/src/main/java/uk/gov/gchq/gaffer/graph/hook/NamedViewResolver.java",
"identif... | {
"body": "@Override\n public void preExecute(final OperationChain<?> opChain, final Context context) {\n resolveViews(opChain, context);\n }",
"class_method_signature": "NamedViewResolver.preExecute(final OperationChain<?> opChain, final Context context)",
"constructor": false,
"full_signature": "... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_980 | {
"fields": [
{
"declarator": "noGraphLibrary = new NoGraphLibrary()",
"modifier": "",
"original_string": "NoGraphLibrary noGraphLibrary = new NoGraphLibrary();",
"type": "NoGraphLibrary",
"var_name": "noGraphLibrary"
},
{
"declarator": "GRAPH_ID = \"noGraphLibraryTestI... | {
"body": "@Test\n public void shouldReturnNullWhenGettingIds() {\n // When / Then\n noGraphLibrary.add(GRAPH_ID, SCHEMA_ID, schema, PROPERTIES_ID, storeProperties);\n assertNull(noGraphLibrary.getIds(GRAPH_ID));\n }",
"class_method_signature": "NoGraphLibraryTest.shouldReturnNullWhenGett... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(NoGraphLibrary.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(NoGraphLibrary.class);",
"type": "Logger",
"var_name": "LOGGER"
}
],
"f... | {
"body": "@Override\n public Pair<String, String> getIds(final String graphId) {\n return null;\n }",
"class_method_signature": "NoGraphLibrary.getIds(final String graphId)",
"constructor": false,
"full_signature": "@Override public Pair<String, String> getIds(final String graphId)",
"identifier... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_129 | {
"fields": [
{
"declarator": "a",
"modifier": "private",
"original_string": "private byte[] a;",
"type": "byte[]",
"var_name": "a"
},
{
"declarator": "b",
"modifier": "private",
"original_string": "private byte[] b;",
"type": "byte[]",
"var_name... | {
"body": "@Test\n public void shouldFailWithNullAndEmptyArrays() throws Exception {\n br1 = new BytesAndRange(f, 0, 0);\n br2 = new BytesAndRange(null, 0, 0);\n assertFalse(ByteUtils.areKeyBytesEqual(br1, br2));\n }",
"class_method_signature": "ByteUtilsTest.shouldFailWithNullAndEmptyArr... | {
"fields": [],
"file": "store-implementation/accumulo-store/src/main/java/uk/gov/gchq/gaffer/accumulostore/utils/ByteUtils.java",
"identifier": "ByteUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "ByteUtils.ByteUtils()",
"constructor": true,
"full_signature": "privat... | {
"body": "public static boolean areKeyBytesEqual(final byte[] bytes1, final byte[] bytes2) {\n if (Arrays.equals(bytes1, bytes2)) {\n return true;\n }\n\n int last = bytes1.length;\n\n if (last != bytes2.length) {\n return false;\n }\n\n if (last == 0) ... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_579 | {
"fields": [
{
"declarator": "freqMap",
"modifier": "private",
"original_string": "private FreqMap freqMap;",
"type": "FreqMap",
"var_name": "freqMap"
}
],
"file": "core/type/src/test/java/uk/gov/gchq/gaffer/types/function/FreqMapPredicatorTest.java",
"identifier": "FreqMa... | {
"body": "@Test\n public void shouldNotMutateOriginalValue() {\n //given\n final Regex predicate = new Regex(\"^\\\\wo\\\\w$\");\n final FreqMapPredicator fRegexPredicator = new FreqMapPredicator(predicate);\n\n //when\n final FreqMap fRegex = fRegexPredicator.apply(freqMap);\n\... | {
"fields": [
{
"declarator": "predicate",
"modifier": "private",
"original_string": "private KoryphePredicate<String> predicate;",
"type": "KoryphePredicate<String>",
"var_name": "predicate"
}
],
"file": "core/type/src/main/java/uk/gov/gchq/gaffer/types/function/FreqMapPredi... | {
"body": "@Override\n public FreqMap apply(final FreqMap freqMap) {\n return filterPredicate(freqMap);\n }",
"class_method_signature": "FreqMapPredicator.apply(final FreqMap freqMap)",
"constructor": false,
"full_signature": "@Override public FreqMap apply(final FreqMap freqMap)",
"identifier": ... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_77 | {
"fields": [
{
"declarator": "utils",
"modifier": "private",
"original_string": "private SchemaUtils utils;",
"type": "SchemaUtils",
"var_name": "utils"
}
],
"file": "store-implementation/parquet-store/src/test/java/uk/gov/gchq/gaffer/parquetstore/utils/SchemaUtilsTest.java"... | {
"body": "@Test\n public void getEdgeGroupsTest() {\n final Set<String> edgeGroups = utils.getEdgeGroups();\n final LinkedHashSet<String> expected = new LinkedHashSet<>(2);\n expected.add(TestGroups.EDGE);\n expected.add(TestGroups.EDGE_2);\n assertEquals(expected, edgeGroups);\... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(SchemaUtils.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(SchemaUtils.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"d... | {
"body": "public Set<String> getEdgeGroups() {\n return gafferSchema.getEdgeGroups();\n }",
"class_method_signature": "SchemaUtils.getEdgeGroups()",
"constructor": false,
"full_signature": "public Set<String> getEdgeGroups()",
"identifier": "getEdgeGroups",
"invocations": [
"getEdgeGroups"
... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1228 | {
"fields": [],
"file": "core/operation/src/test/java/uk/gov/gchq/gaffer/operation/impl/get/GetAdjacentIdsTest.java",
"identifier": "GetAdjacentIdsTest",
"interfaces": "",
"superclass": "extends OperationTest<GetAdjacentIds>"
} | {
"body": "@Test\n public void shouldSetInputFromVerticesAndEntityIds() {\n // When\n final GetAdjacentIds op = new GetAdjacentIds.Builder()\n .input(\"1\", new EntitySeed(\"2\"), new Entity(\"group1\", \"3\"))\n .build();\n\n // Then\n assertEquals(\n ... | {
"fields": [
{
"declarator": "view",
"modifier": "private",
"original_string": "private View view;",
"type": "View",
"var_name": "view"
},
{
"declarator": "input",
"modifier": "private",
"original_string": "private Iterable<? extends EntityId> input;",
... | {
"body": "@Override\n public Iterable<? extends EntityId> getInput() {\n return input;\n }",
"class_method_signature": "GetAdjacentIds.getInput()",
"constructor": false,
"full_signature": "@Override public Iterable<? extends EntityId> getInput()",
"identifier": "getInput",
"invocations": [],
... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_650 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/resolver/DefaultScoreResolverTest.java",
"identifier": "DefaultScoreResolverTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldGetScoreForNestedOperations() {\n // Given\n final GetElements getElements = mock(GetElements.class);\n final GetWalks getWalks = mock(GetWalks.class);\n final GetAdjacentIds getAdjacentIds = mock(GetAdjacentIds.class);\n given(getWalks.getOpe... | {
"fields": [
{
"declarator": "DEFAULT_OPERATION_SCORE = 1",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_OPERATION_SCORE = 1;",
"type": "int",
"var_name": "DEFAULT_OPERATION_SCORE"
},
{
"declarator": "scoreResolvers",
"mo... | {
"body": "@Override\n public Integer getScore(final Operation operation) {\n if (null == operation) {\n return 0;\n }\n\n // Named operations should use their custom resolver despite implementing Operations\n if (operation instanceof Operations && !(operation instanceof Name... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_200 | {
"fields": [
{
"declarator": "SCHEMA = new Schema.Builder()\n .type(\"string\", String.class)\n .type(\"type\", Boolean.class)\n .edge(TestGroups.EDGE, new SchemaEdgeDefinition.Builder()\n .source(\"string\")\n .destination(\"string\")\... | {
"body": "@Test\n public void shouldFilterOutInvalidEntity() throws OperationException, SerialisationException {\n // Given\n final ValidationProcessor processor = new ValidationProcessor(SCHEMA);\n\n // When / Then\n assertFalse(processor.test(CellUtil.getLazyCell(new Entity(TestGroup... | {
"fields": [
{
"declarator": "validator",
"modifier": "private final",
"original_string": "private final ElementValidator validator;",
"type": "ElementValidator",
"var_name": "validator"
}
],
"file": "store-implementation/hbase-store/src/main/java/uk/gov/gchq/gaffer/hbasesto... | {
"body": "@Override\n public boolean test(final LazyElementCell elementCell) {\n return validator.validateWithSchema(elementCell.getElement());\n }",
"class_method_signature": "ValidationProcessor.test(final LazyElementCell elementCell)",
"constructor": false,
"full_signature": "@Override public b... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_715 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/handler/LimitHandlerTest.java",
"identifier": "LimitHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldLimitResults() throws Exception {\n // Given\n final List<Integer> input = Arrays.asList(1, 2, 3, 4, 5);\n final List<Integer> expectedResult = Arrays.asList(1, 2, 3);\n final Integer resultLimit = expectedResult.size();\n final Limit<Integer>... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/LimitHandler.java",
"identifier": "LimitHandler",
"interfaces": "implements OutputOperationHandler<Limit<T>, Iterable<? extends T>>",
"methods": [
{
"class_method_signature": "LimitHandler.doOperation(final ... | {
"body": "@Override\n public Iterable<? extends T> doOperation(final Limit<T> operation, final Context context, final Store store) throws OperationException {\n if (null == operation.getInput()) {\n return null;\n }\n\n if (null != operation.getResultLimit()) {\n return ... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_345 | {
"fields": [
{
"declarator": "EDGE_AB = new Edge.Builder().group(TestGroups.EDGE).source(\"A\").dest(\"B\").directed(true).build()",
"modifier": "private static final",
"original_string": "private static final Edge EDGE_AB = new Edge.Builder().group(TestGroups.EDGE).source(\"A\").dest(\"B\").di... | {
"body": "@Test\n public void shouldGetNotPath() {\n // Given\n // [A] -> [B] -> [C] -> [B]\n\n // When\n final Walk walk = new Walk.Builder()\n .edge(EDGE_AB)\n .edge(EDGE_BC)\n .edge(EDGE_CB)\n .build();\n\n // Then\n... | {
"fields": [
{
"declarator": "edges",
"modifier": "private final",
"original_string": "private final List<Set<Edge>> edges;",
"type": "List<Set<Edge>>",
"var_name": "edges"
},
{
"declarator": "entities",
"modifier": "private final",
"original_string": "priv... | {
"body": "@JsonIgnore\n public boolean isPath() {\n return distinct(getVerticesOrdered());\n }",
"class_method_signature": "Walk.isPath()",
"constructor": false,
"full_signature": "@JsonIgnore public boolean isPath()",
"identifier": "isPath",
"invocations": [
"distinct",
"getVerticesOr... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.