id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
47973088_1208 | {
"fields": [],
"file": "core/operation/src/test/java/uk/gov/gchq/gaffer/operation/impl/output/ToSingletonListTest.java",
"identifier": "ToSingletonListTest",
"interfaces": "",
"superclass": "extends OperationTest<ToSingletonList>"
} | {
"body": "@Test\n @Override\n public void builderShouldCreatePopulatedOperation() {\n // Given\n final ToSingletonList<Integer> operation = new ToSingletonList.Builder<Integer>()\n .input(1)\n .build();\n\n // Then\n assertTrue(operation.getInput().equa... | {
"fields": [
{
"declarator": "input",
"modifier": "private",
"original_string": "private T input;",
"type": "T",
"var_name": "input"
},
{
"declarator": "options",
"modifier": "private",
"original_string": "private Map<String, String> options;",
"type"... | {
"body": "@Override\n public T getInput() {\n return input;\n }",
"class_method_signature": "ToSingletonList.getInput()",
"constructor": false,
"full_signature": "@Override public T getInput()",
"identifier": "getInput",
"invocations": [],
"modifiers": "@Override public",
"parameters": "()... | {
"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_670 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/resolver/named/NamedOperationScoreResolverTest.java",
"identifier": "NamedOperationScoreResolverTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldDefaultScoreFromOpChainIfNamedOpScoreEmpty() throws CacheOperationFailedException {\n // Given\n final String namedOpName = \"namedOp\";\n final Map parametersMap = new HashMap<>();\n final Integer expectedScore = 7;\n final NamedOperation<Ele... | {
"fields": [
{
"declarator": "cache",
"modifier": "private final",
"original_string": "private final NamedOperationCache cache;",
"type": "NamedOperationCache",
"var_name": "cache"
},
{
"declarator": "LOGGER = LoggerFactory.getLogger(NamedOperationScoreResolver.class)"... | {
"body": "@Override\n public Integer getScore(final NamedOperation operation) {\n return getScore(operation, null);\n }",
"class_method_signature": "NamedOperationScoreResolver.getScore(final NamedOperation operation)",
"constructor": false,
"full_signature": "@Override public Integer getScore(fin... | {
"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_220 | {
"fields": [],
"file": "store-implementation/map-store/src/test/java/uk/gov/gchq/gaffer/mapstore/factory/SimpleMapFactoryTest.java",
"identifier": "SimpleMapFactoryTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldThrowExceptionIfMapClassIsInvalid() throws StoreException {\n // Given\n final Class mapClass = String.class;\n final Schema schema = mock(Schema.class);\n final MapStoreProperties properties = mock(MapStoreProperties.class);\n final SimpleMap... | {
"fields": [
{
"declarator": "MAP_CLASS = \"gaffer.store.mapstore.map.class\"",
"modifier": "public static final",
"original_string": "public static final String MAP_CLASS = \"gaffer.store.mapstore.map.class\";",
"type": "String",
"var_name": "MAP_CLASS"
},
{
"declarat... | {
"body": "@Override\n public void initialise(final Schema schema, final MapStoreProperties properties) {\n final String mapClassName = properties.get(MAP_CLASS, MAP_CLASS_DEFAULT);\n try {\n mapClass = Class.forName(SimpleClassNameIdResolver.getClassName(mapClassName)).asSubclass(Map.clas... | {
"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_1121 | {
"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 shouldReturnResultWithoutModification() {\n // Given\n final OperationAuthoriser hook = fromJson(OP_AUTHS_PATH);\n final Object result = mock(Object.class);\n final OperationChain opChain = new OperationChain.Builder()\n .first(new GenerateO... | {
"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 <T> T postExecute(final T result, final OperationChain<?> opChain, final Context context) {\n // This method can be overridden to add additional authorisation checks on the results.\n return result;\n }",
"class_method_signature": "OperationAuthoriser.postExecute(fi... | {
"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_109 | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(AddUpdateTableIteratorTest.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(AddUpdateTableIteratorTest.class);",
"type": "Logger",
"var_name": ... | {
"body": "@Test\n public void shouldOverrideExistingGraphInGraphLibrary() throws Exception {\n // Given\n shouldRunMainWithFileGraphLibrary(); // load version graph version 1 into the library.\n final String[] args = {GRAPH_ID, SCHEMA_2_DIR, STORE_PROPS_2_PATH_UPDATED, \"update\", FILE_GRAPH_... | {
"fields": [
{
"declarator": "UPDATE_KEY = \"update\"",
"modifier": "public static final",
"original_string": "public static final String UPDATE_KEY = \"update\";",
"type": "String",
"var_name": "UPDATE_KEY"
},
{
"declarator": "REMOVE_KEY = \"remove\"",
"modifier... | {
"body": "public static void main(final String[] args) throws Exception {\n if (args.length < NUM_REQUIRED_ARGS) {\n System.err.println(\"Wrong number of arguments. \\nUsage: \"\n + \"<graphId> \"\n + \"<comma separated schema paths> <store properties path> \"\... | {
"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_559 | {
"fields": [],
"file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/CloseableUtilTest.java",
"identifier": "CloseableUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldCloseACloseable() throws IOException {\n final Closeable closeable = mock(Closeable.class);\n\n CloseableUtil.close(closeable);\n\n verify(closeable).close();\n }",
"class_method_signature": "CloseableUtilTest.shouldCloseACloseable()",
"constructor":... | {
"fields": [],
"file": "core/common-util/src/main/java/uk/gov/gchq/gaffer/commonutil/CloseableUtil.java",
"identifier": "CloseableUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "CloseableUtil.CloseableUtil()",
"constructor": true,
"full_signature": "private Closeable... | {
"body": "public static void close(final Object... objs) {\n for (final Object obj : objs) {\n close(obj);\n }\n }",
"class_method_signature": "CloseableUtil.close(final Object... objs)",
"constructor": false,
"full_signature": "public static void close(final Object... objs)",
"id... | {
"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_1064 | {
"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": "SCHEMA_ID_1 = \"schemaId1\"",
"modifi... | {
"body": "@Test\n public void shouldConstructGraphFromSchemaFolderPath() throws IOException {\n // Given\n final Schema expectedSchema = new Schema.Builder()\n .json(StreamUtil.elementsSchema(getClass()), StreamUtil.typesSchema(getClass()))\n .build();\n\n Graph ... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(Graph.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(Graph.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": ... | {
"body": "public Schema getSchema() {\n return store.getOriginalSchema();\n }",
"class_method_signature": "Graph.getSchema()",
"constructor": false,
"full_signature": "public Schema getSchema()",
"identifier": "getSchema",
"invocations": [
"getOriginalSchema"
],
"modifiers": "public",
"... | {
"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_332 | {
"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 shouldContainDestination() {\n // Given\n final AdjacencyMap adjacencyMap = getAdjacencyMap();\n\n // When\n final boolean result = adjacencyMap.containsDestination(2);\n\n // Then\n assertThat(result, is(true));\n }",
"class_method_sign... | {
"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 containsDestination(final Object destination) {\n return edgeGraph.columnKeySet().contains(destination);\n }",
"class_method_signature": "AdjacencyMap.containsDestination(final Object destination)",
"constructor": false,
"full_signature": "public boolean containsDestination(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_762 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/handler/join/match/ElementMatchTest.java",
"identifier": "ElementMatchTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldThrowExceptionIfNotInitialised() {\n // Given\n\n ElementMatch elementMatch = new ElementMatch();\n\n // When / Then\n\n try {\n elementMatch.matching(new Entity(\"testGroup\", \"test\"));\n fail(\"Exception expected\");\n ... | {
"fields": [
{
"declarator": "elementJoinComparator",
"modifier": "private",
"original_string": "private ElementJoinComparator elementJoinComparator;",
"type": "ElementJoinComparator",
"var_name": "elementJoinComparator"
},
{
"declarator": "matchCandidates",
"mod... | {
"body": "@Override\n public List matching(final Object testObject) {\n if (matchCandidates == null) {\n throw new IllegalArgumentException(NULL_MATCH_CANDIDATES_ERROR_MESSAGE);\n }\n\n List matches = new ArrayList<>();\n\n\n for (final Object entry : matchCandidates) {\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_298 | {
"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 shouldOverrideGlobalElementPropertiesWhenSpecificEntityGroupPropertiesSet() {\n // Given\n final View view = new View.Builder()\n .globalElements(new GlobalViewElementDefinition.Builder()\n .groups(TestGroups.ENTITY)\n ... | {
"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_277 | {
"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 shouldReturnFalseWhenViewHasNullPostTransformEdgeFilters() {\n // Given\n final View view = new View.Builder()\n .edge(TestGroups.EDGE, new ViewElementDefinition.Builder()\n .postTransformFilter(null)\n .build... | {
"fields": [
{
"declarator": "globalElements",
"modifier": "private",
"original_string": "private List<GlobalViewElementDefinition> globalElements;",
"type": "List<GlobalViewElementDefinition>",
"var_name": "globalElements"
},
{
"declarator": "globalEntities",
"m... | {
"body": "public boolean hasPostTransformFilters() {\n return hasFilters(ViewElementDefinition::hasPostTransformFilters);\n }",
"class_method_signature": "View.hasPostTransformFilters()",
"constructor": false,
"full_signature": "public boolean hasPostTransformFilters()",
"identifier": "hasPostTrans... | {
"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_627 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/util/AggregatorUtilTest.java",
"identifier": "AggregatorUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldIngestAggregateElementsWithGroupBy() {\n // given\n final Schema schema = Schema.fromJson(StreamUtil.openStreams(getClass(), \"schema-groupby\"));\n final List<Element> elements = Arrays.asList(\n new Entity.Builder()\n ... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/util/AggregatorUtil.java",
"identifier": "AggregatorUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "AggregatorUtil.AggregatorUtil()",
"constructor": true,
"full_signature": "private AggregatorU... | {
"body": "public static CloseableIterable<Element> ingestAggregate(final Iterable<? extends Element> elements, final Schema schema) {\n if (null == schema) {\n throw new IllegalArgumentException(\"Schema is required\");\n }\n final Collection<String> aggregatedGroups = schema.getAggre... | {
"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_1176 | {
"fields": [],
"file": "core/operation/src/test/java/uk/gov/gchq/gaffer/operation/function/ToEntityIdTest.java",
"identifier": "ToEntityIdTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnEntitySeedIfInputIsAnObject() {\n // Given\n final Object input = \"item\";\n final ToEntityId function = new ToEntityId();\n\n // When\n final EntityId output = function.apply(input);\n\n // Then\n assertEquals(new EntityS... | {
"fields": [],
"file": "core/operation/src/main/java/uk/gov/gchq/gaffer/operation/function/ToEntityId.java",
"identifier": "ToEntityId",
"interfaces": "",
"methods": [
{
"class_method_signature": "ToEntityId.apply(final Object obj)",
"constructor": false,
"full_signature": "@Override pu... | {
"body": "@Override\n public EntityId apply(final Object obj) {\n if (null == obj) {\n return null;\n }\n return obj instanceof EntityId ? (EntityId) obj : new EntitySeed(obj);\n }",
"class_method_signature": "ToEntityId.apply(final Object obj)",
"constructor": false,
"ful... | {
"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_1199 | {
"fields": [],
"file": "core/operation/src/test/java/uk/gov/gchq/gaffer/operation/impl/CountTest.java",
"identifier": "CountTest",
"interfaces": "",
"superclass": "extends OperationTest<Count>"
} | {
"body": "@Test\n @Override\n public void builderShouldCreatePopulatedOperation() {\n // Given\n final Count count = new Count.Builder<String>()\n .input(\"1\", \"2\")\n .build();\n\n // Then\n assertThat(count.getInput(), is(notNullValue()));\n }",
... | {
"fields": [
{
"declarator": "input",
"modifier": "private",
"original_string": "private Iterable<? extends T> input;",
"type": "Iterable<? extends T>",
"var_name": "input"
},
{
"declarator": "options",
"modifier": "private",
"original_string": "private Map... | {
"body": "@Override\n public Iterable<? extends T> getInput() {\n return input;\n }",
"class_method_signature": "Count.getInput()",
"constructor": false,
"full_signature": "@Override public Iterable<? extends T> getInput()",
"identifier": "getInput",
"invocations": [],
"modifiers": "@Overrid... | {
"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_918 | {
"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 shouldValidateAndReturnTrueWhenEntityTransformerProjectsToUnknownProperty() {\n // Given\n final ViewValidator validator = new ViewValidator();\n final View view = new View.Builder()\n .entity(TestGroups.ENTITY, new ViewElementDefinition.Builder()\... | {
"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_1033 | {
"fields": [],
"file": "core/serialisation/src/test/java/uk/gov/gchq/gaffer/serialisation/implementation/JavaSerialiserTest.java",
"identifier": "JavaSerialiserTest",
"interfaces": "",
"superclass": "extends ToBytesSerialisationTest<Object>"
} | {
"body": "@Test\n public void canHandleParameterisedDAO() {\n assertTrue(serialiser.canHandle(ParameterisedTestObject.class));\n }",
"class_method_signature": "JavaSerialiserTest.canHandleParameterisedDAO()",
"constructor": false,
"full_signature": "@Test public void canHandleParameterisedDAO()",
... | {
"fields": [
{
"declarator": "serialVersionUID = 2073581763875104361L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 2073581763875104361L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "SERIA... | {
"body": "@Override\n public boolean canHandle(final Class clazz) {\n return SERIALISABLE.isAssignableFrom(clazz);\n }",
"class_method_signature": "JavaSerialiser.canHandle(final Class clazz)",
"constructor": false,
"full_signature": "@Override public boolean canHandle(final Class clazz)",
"iden... | {
"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_774 | {
"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 shouldPassValidationOfOperationScores() throws ClassNotFoundException {\n // Given\n final ScoreOperationChainHandler handler = new ScoreOperationChainHandler();\n final LinkedHashMap<String, Integer> opScores = new LinkedHashMap<>();\n opScores.put(Operat... | {
"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": "@JsonSetter(\"opScores\")\n public void setOpScoresFromStrings(final Map<String, Integer> opScores) throws ClassNotFoundException {\n this.opScores.clear();\n CollectionUtil.toMapWithClassKeys(opScores, this.opScores);\n validateOpScores();\n }",
"class_method_signature": "Scor... | {
"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_324 | {
"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 shouldNotContainVertex() {\n final EntityMap entityMap = getEntityMap();\n\n final boolean results = entityMap.containsVertex(7);\n\n assertThat(results, is(false));\n }",
"class_method_signature": "EntityMapTest.shouldNotContainVertex()",
"constructor": f... | {
"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_16 | {
"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 shouldGetCleanStringsWithNoEmptiesAndWhitespace() {\n // Given\n final String csv = \", 1 ,2 ,, 3, \";\n\n // When\n final List<String> values = FederatedStoreUtil.getCleanStrings(csv);\n\n // Then\n assertEquals(Arrays.asList(\"1\", \"2\", \... | {
"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> getCleanStrings(final String value) {\n final List<String> values;\n if (value != null) {\n values = Lists.newArrayList(StringUtils.stripAll(value.split(SCHEMA_DEL_REGEX)));\n values.removeAll(STRINGS_TO_REMOVE);\n } else {\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_1249 | {
"fields": [],
"file": "core/operation/src/test/java/uk/gov/gchq/gaffer/operation/OperationChainTest.java",
"identifier": "OperationChainTest",
"interfaces": "",
"superclass": "extends OperationsTest<OperationChain>"
} | {
"body": "@Test\n public void shouldConvertToOverviewStringWithNoOperations() {\n // Given\n final OperationChain opChain = new OperationChain();\n\n // When\n final String overview = opChain.toOverviewString();\n\n // Then\n assertEquals(\"OperationChain[]\", overview);\... | {
"fields": [
{
"declarator": "operations",
"modifier": "private",
"original_string": "private List<Operation> operations;",
"type": "List<Operation>",
"var_name": "operations"
},
{
"declarator": "options",
"modifier": "private",
"original_string": "private ... | {
"body": "public String toOverviewString() {\n final String opStrings = operations.stream()\n .filter(o -> null != o)\n .map(o -> o.getClass().getSimpleName())\n .collect(Collectors.joining(\"->\"));\n\n return getClass().getSimpleName() + \"[\" + opStrings ... | {
"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_631 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/util/AggregatorUtilTest.java",
"identifier": "AggregatorUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldQueryAggregateElementsWithGroupByAndViewAggregator() {\n // given\n final Schema schema = Schema.fromJson(StreamUtil.openStreams(getClass(), \"schema-groupby\"));\n final View view = new View.Builder()\n .entity(TestGroups.ENTITY, new ViewEle... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/util/AggregatorUtil.java",
"identifier": "AggregatorUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "AggregatorUtil.AggregatorUtil()",
"constructor": true,
"full_signature": "private AggregatorU... | {
"body": "public static CloseableIterable<Element> queryAggregate(final Iterable<? extends Element> elements, final Schema schema, final View view) {\n if (null == schema) {\n throw new IllegalArgumentException(\"Schema is required\");\n }\n if (null == view) {\n throw new ... | {
"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_261 | {
"fields": [],
"file": "core/access/src/test/java/uk/gov/gchq/gaffer/user/UserTest.java",
"identifier": "UserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldNotAllowChangingDataAuths() {\n // Given\n final String userId = \"user 01\";\n final String dataAuth1 = \"dataAuth 1\";\n final String dataAuth2 = \"dataAuth 2\";\n final String newDataAuth = \"new dataAuth\";\n final User user = new U... | {
"fields": [
{
"declarator": "serialVersionUID = -2446354817298439281L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -2446354817298439281L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "UNK... | {
"body": "public Set<String> getDataAuths() {\n return Collections.unmodifiableSet(dataAuths);\n }",
"class_method_signature": "User.getDataAuths()",
"constructor": false,
"full_signature": "public Set<String> getDataAuths()",
"identifier": "getDataAuths",
"invocations": [
"unmodifiableSet"
... | {
"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_1160 | {
"fields": [],
"file": "core/operation/src/test/java/uk/gov/gchq/gaffer/operation/util/OperationUtilTest.java",
"identifier": "OperationUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldConvertIterableToElementIds() {\n // Given\n final Iterable<Object> input = Arrays.asList(\n 1,\n \"2\",\n new EntitySeed(\"3\"),\n new Entity(\"group\", \"4\"),\n new EdgeSeed(\"5\", 6),\n... | {
"fields": [],
"file": "core/operation/src/main/java/uk/gov/gchq/gaffer/operation/util/OperationUtil.java",
"identifier": "OperationUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "OperationUtil.OperationUtil()",
"constructor": true,
"full_signature": "private Operati... | {
"body": "public static Iterable<? extends ElementId> toElementIds(final Object... input) {\n if (null == input) {\n return null;\n }\n return Arrays.stream(input).map(new ToElementId()).collect(Collectors.toList());\n }",
"class_method_signature": "OperationUtil.toElementIds(fin... | {
"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_148 | {
"fields": [],
"file": "store-implementation/accumulo-store/src/test/java/uk/gov/gchq/gaffer/accumulostore/operation/impl/GetElementsWithinSetTest.java",
"identifier": "GetElementsWithinSetTest",
"interfaces": "",
"superclass": "extends OperationTest<GetElementsWithinSet>"
} | {
"body": "@Test\n public void shouldCreateInputFromVertices() {\n // When\n final GetElementsWithinSet op = new GetElementsWithinSet.Builder()\n .input(AccumuloTestData.SEED_B, AccumuloTestData.SEED_B1.getVertex())\n .build();\n\n // Then\n assertEquals(\n... | {
"fields": [
{
"declarator": "view",
"modifier": "private",
"original_string": "private View view;",
"type": "View",
"var_name": "view"
},
{
"declarator": "directedType",
"modifier": "private",
"original_string": "private DirectedType directedType;",
... | {
"body": "@Override\n public Iterable<? extends EntityId> getInput() {\n return input;\n }",
"class_method_signature": "GetElementsWithinSet.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_518 | {
"fields": [],
"file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/CollectionUtilTest.java",
"identifier": "CollectionUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnTrueWhenAnyMissingCalledWithNullCollectionAndSomeValues() {\n // Given\n final Object[] values = new Object[] {1, 2, 3};\n\n // When\n final boolean result = CollectionUtil.anyMissing(null, values);\n\n // Then\n assertTrue(result... | {
"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 boolean anyMissing(final Collection collection, final Object[] objects) {\n boolean result = false;\n if (null == collection || collection.isEmpty()) {\n if (null != objects && 0 < objects.length) {\n result = true;\n }\n } else if (nu... | {
"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_1025 | {
"fields": [],
"file": "core/serialisation/src/test/java/uk/gov/gchq/gaffer/serialisation/implementation/StringSerialiserTest.java",
"identifier": "StringSerialiserTest",
"interfaces": "",
"superclass": "extends ToBytesSerialisationTest<String>"
} | {
"body": "@Test\n public void canSerialiseStringClass() {\n assertTrue(serialiser.canHandle(String.class));\n }",
"class_method_signature": "StringSerialiserTest.canSerialiseStringClass()",
"constructor": false,
"full_signature": "@Test public void canSerialiseStringClass()",
"identifier": "canS... | {
"fields": [
{
"declarator": "serialVersionUID = 5647756843689779437L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 5647756843689779437L;",
"type": "long",
"var_name": "serialVersionUID"
}
],
"file": "core/serialisatio... | {
"body": "@Override\n public boolean canHandle(final Class clazz) {\n return String.class.equals(clazz);\n }",
"class_method_signature": "StringSerialiser.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_373 | {
"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 shouldCompareCustomObjUsingToStringReversed() {\n final ComparableOrToStringComparator comparator = new ComparableOrToStringComparator();\n\n final int result = comparator.compare(new IntegerWrapper(2), new IntegerWrapper(1));\n\n assertTrue(result > 0, \"Should ... | {
"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_689 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/handler/compare/SortHandlerTest.java",
"identifier": "SortHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldSortBasedOnElement() throws OperationException {\n // Given\n final Entity entity1 = new Entity.Builder().group(TestGroups.ENTITY).property(\"property1\", 1)\n .property(\"property2\", 1).build();\n ... | {
"fields": [
{
"declarator": "MAX_HANDLER = new MaxHandler()",
"modifier": "private static final",
"original_string": "private static final MaxHandler MAX_HANDLER = new MaxHandler();",
"type": "MaxHandler",
"var_name": "MAX_HANDLER"
}
],
"file": "core/store/src/main/java/uk/... | {
"body": "@Override\n public Iterable<? extends Element> doOperation(final Sort 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 == 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_723 | {
"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 shouldHandleNullInput() {\n // Given\n final MapHandler<Integer, Integer> handler = new MapHandler<>();\n\n final Map<Integer, Integer> operation = new Map.Builder<Integer>()\n .input(null)\n .first(function)\n .build(... | {
"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_236 | {
"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 shouldGetObjectGenerators() {\n // When\n final Set<Class> classes = (Set<Class>) service.getObjectGenerators().getEntity();\n\n // Then\n assertFalse(classes.isEmpty());\n }",
"class_method_signature": "GraphConfigurationServiceV2Test.shouldGetObject... | {
"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 getObjectGenerators() {\n return Response.ok(ReflectionUtil.getSubTypes(ObjectGenerator.class))\n .header(GAFFER_MEDIA_TYPE_HEADER, GAFFER_MEDIA_TYPE)\n .build();\n }",
"class_method_signature": "GraphConfigurationServiceV2.getObjectG... | {
"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_666 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/resolver/IfScoreResolverTest.java",
"identifier": "IfScoreResolverTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldGetScoreForNestedOperations() {\n // Given\n final Map map = mock(Map.class);\n final Conditional conditional = mock(Conditional.class);\n given(conditional.getTransform()).willReturn(map);\n\n final GetWalks getWalks = mock(GetWalks.class);\n... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(IfScoreResolver.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(IfScoreResolver.class);",
"type": "Logger",
"var_name": "LOGGER"
}
],
... | {
"body": "@Override\n public Integer getScore(final If operation) {\n throw new UnsupportedOperationException(\"Default Score Resolver has not been provided.\");\n }",
"class_method_signature": "IfScoreResolver.getScore(final If operation)",
"constructor": false,
"full_signature": "@Override publi... | {
"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_41 | {
"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 shouldInitialiseWithCache() throws StoreException {\n assertNull(CacheServiceLoader.getService());\n federatedProperties.setCacheProperties(CACHE_SERVICE_CLASS_STRING);\n assertNull(CacheServiceLoader.getService());\n store.initialise(FEDERATED_STORE_ID, 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": "@Override\n public void initialise(final String graphId, final Schema unused, final StoreProperties properties) throws StoreException {\n super.initialise(graphId, new Schema(), properties);\n customPropertiesAuths = getCustomPropertiesAuths();\n isPublicAccessAllowed = Boolean.valu... | {
"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_1137 | {
"fields": [],
"file": "core/graph/src/test/java/uk/gov/gchq/gaffer/graph/GraphConfigTest.java",
"identifier": "GraphConfigTest",
"interfaces": "",
"superclass": "extends JSONSerialisationTest<GraphConfig>"
} | {
"body": "@Test\n public void shouldJsonDeserialiseFromHookPaths(@TempDir Path tmpDir) throws IOException {\n // Given\n final File hook1Path = tmpDir.resolve(\"hook1Path\").toFile();\n final File hook2Path = tmpDir.resolve(\"hook2Path\").toFile();\n FileUtils.write(hook1Path, \"{\\\"c... | {
"fields": [
{
"declarator": "graphId",
"modifier": "private",
"original_string": "private String graphId;",
"type": "String",
"var_name": "graphId"
},
{
"declarator": "view",
"modifier": "private",
"original_string": "private byte[] view;",
"type": "... | {
"body": "public List<GraphHook> getHooks() {\n return hooks;\n }",
"class_method_signature": "GraphConfig.getHooks()",
"constructor": false,
"full_signature": "public List<GraphHook> getHooks()",
"identifier": "getHooks",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"retur... | {
"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_959 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/schema/SchemaElementDefinitionValidatorTest.java",
"identifier": "SchemaElementDefinitionValidatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldValidateComponentTypesAndErrorWhenPropertyNameIsAReservedWord() {\n for (final IdentifierType identifierType : IdentifierType.values()) {\n // Given\n final SchemaElementDefinition elementDef = mock(SchemaElementDefinition.class);\n final... | {
"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 validateComponentTypes(final SchemaElementDefinition elementDef) {\n final ValidationResult result = new ValidationResult();\n for (final IdentifierType idType : elementDef.getIdentifiers()) {\n try {\n if (null == elementDef.getIdentifierC... | {
"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_1072 | {
"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": "SCHEMA_ID_1 = \"schemaId1\"",
"modifi... | {
"body": "@Test\n public void shouldThrowExceptionOnExecuteJobWithANullContext() throws OperationException {\n // Given\n final Context context = null;\n final OperationChain opChain = mock(OperationChain.class);\n\n final Graph graph = new Graph.Builder()\n .config(new ... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(Graph.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(Graph.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": ... | {
"body": "public JobDetail executeJob(final Operation operation, final User user) throws OperationException {\n return executeJob(new GraphRequest<>(operation, user)).getResult();\n }",
"class_method_signature": "Graph.executeJob(final Operation operation, final User user)",
"constructor": false,
"fu... | {
"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_1136 | {
"fields": [],
"file": "core/graph/src/test/java/uk/gov/gchq/gaffer/graph/hook/NamedOperationResolverTest.java",
"identifier": "NamedOperationResolverTest",
"interfaces": "",
"superclass": "extends GraphHookTest<NamedOperationResolver>"
} | {
"body": "@Test\n public void shouldNotExecuteNamedOperationWithMissingRequiredArg() throws OperationException, CacheOperationFailedException {\n // Given\n final String opName = \"opName\";\n final NamedOperationCache cache = mock(NamedOperationCache.class);\n final NamedOperationReso... | {
"fields": [
{
"declarator": "cache",
"modifier": "private final",
"original_string": "private final NamedOperationCache cache;",
"type": "NamedOperationCache",
"var_name": "cache"
}
],
"file": "core/graph/src/main/java/uk/gov/gchq/gaffer/graph/hook/NamedOperationResolver.ja... | {
"body": "@Override\n public void preExecute(final OperationChain<?> opChain, final Context context) {\n resolveNamedOperations(opChain, context.getUser());\n }",
"class_method_signature": "NamedOperationResolver.preExecute(final OperationChain<?> opChain, final Context context)",
"constructor": fal... | {
"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_958 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/schema/SchemaElementDefinitionValidatorTest.java",
"identifier": "SchemaElementDefinitionValidatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldValidateComponentTypesAndReturnTrueWhenNoIdentifiersOrProperties() {\n // Given\n final SchemaElementDefinition elementDef = mock(SchemaElementDefinition.class);\n final SchemaElementDefinitionValidator validator = new SchemaElementDefinitionValidator();\n\... | {
"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 validateComponentTypes(final SchemaElementDefinition elementDef) {\n final ValidationResult result = new ValidationResult();\n for (final IdentifierType idType : elementDef.getIdentifiers()) {\n try {\n if (null == elementDef.getIdentifierC... | {
"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_1073 | {
"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": "SCHEMA_ID_1 = \"schemaId1\"",
"modifi... | {
"body": "@Test\n public void shouldThrowExceptionOnExecuteWithANullUser() throws OperationException {\n // Given\n final User user = null;\n final OperationChain opChain = mock(OperationChain.class);\n\n final Graph graph = new Graph.Builder()\n .config(new GraphConfig.... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(Graph.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(Graph.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": ... | {
"body": "public void execute(final Operation operation, final User user) throws OperationException {\n execute(new GraphRequest<>(operation, user));\n }",
"class_method_signature": "Graph.execute(final Operation operation, final User user)",
"constructor": false,
"full_signature": "public void execu... | {
"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_372 | {
"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 shouldCompareCustomObjUsingToString() {\n final ComparableOrToStringComparator comparator = new ComparableOrToStringComparator();\n\n final int result = comparator.compare(new IntegerWrapper(1), new IntegerWrapper(2));\n\n assertTrue(result < 0, \"Should be less ... | {
"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_688 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/handler/compare/SortHandlerTest.java",
"identifier": "SortHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnNullsLast() throws OperationException, JsonProcessingException {\n // Given\n final Entity entity1 = new Entity.Builder().group(TestGroups.ENTITY).property(\"property\", 1).build();\n final Entity entity2 = new Entity.Build... | {
"fields": [
{
"declarator": "MAX_HANDLER = new MaxHandler()",
"modifier": "private static final",
"original_string": "private static final MaxHandler MAX_HANDLER = new MaxHandler();",
"type": "MaxHandler",
"var_name": "MAX_HANDLER"
}
],
"file": "core/store/src/main/java/uk/... | {
"body": "@Override\n public Iterable<? extends Element> doOperation(final Sort 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 == 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_722 | {
"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 shouldHandleNullOperation() {\n // Given\n final MapHandler<Integer, Integer> handler = new MapHandler<>();\n\n final Map<Integer, Integer> operation = null;\n\n // When / Then\n\n try {\n handler.doOperation(operation, context, store);\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_237 | {
"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 shouldSerialiseAndDeserialiseGetStoreTraits() throws SerialisationException {\n // When\n byte[] bytes = JSONSerialiser.serialise(service.getStoreTraits().getEntity());\n final Set<String> traits = JSONSerialiser.deserialise(bytes, Set.class);\n\n // Then\... | {
"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 getStoreTraits() {\n return Response.ok(graphFactory.getGraph().getStoreTraits())\n .header(GAFFER_MEDIA_TYPE_HEADER, GAFFER_MEDIA_TYPE)\n .build();\n }",
"class_method_signature": "GraphConfigurationServiceV2.getStoreTraits()",
"co... | {
"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_667 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/resolver/IfScoreResolverTest.java",
"identifier": "IfScoreResolverTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldThrowErrorWhenNoDefaultResolverConfigured() {\n // Given\n final IfScoreResolver resolver = new IfScoreResolver();\n\n final If operation = new If.Builder<>()\n .conditional(new Conditional())\n .then(new GetAllElements())\n ... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(IfScoreResolver.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(IfScoreResolver.class);",
"type": "Logger",
"var_name": "LOGGER"
}
],
... | {
"body": "@Override\n public Integer getScore(final If operation) {\n throw new UnsupportedOperationException(\"Default Score Resolver has not been provided.\");\n }",
"class_method_signature": "IfScoreResolver.getScore(final If operation)",
"constructor": false,
"full_signature": "@Override publi... | {
"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_40 | {
"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 shouldThrowExceptionWithInvalidCacheClass() throws StoreException {\n federatedProperties.setCacheProperties(INVALID_CACHE_SERVICE_CLASS_STRING);\n try {\n clearCache();\n store.initialise(FEDERATED_STORE_ID, null, federatedProperties);\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": "@Override\n public void initialise(final String graphId, final Schema unused, final StoreProperties properties) throws StoreException {\n super.initialise(graphId, new Schema(), properties);\n customPropertiesAuths = getCustomPropertiesAuths();\n isPublicAccessAllowed = Boolean.valu... | {
"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_1161 | {
"fields": [],
"file": "core/operation/src/test/java/uk/gov/gchq/gaffer/operation/util/OperationUtilTest.java",
"identifier": "OperationUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnNullIfConvertFromElementIdsWithNullInput() {\n assertNull(OperationUtil.fromElementIds(null));\n }",
"class_method_signature": "OperationUtilTest.shouldReturnNullIfConvertFromElementIdsWithNullInput()",
"constructor": false,
"full_signature": "@Test public... | {
"fields": [],
"file": "core/operation/src/main/java/uk/gov/gchq/gaffer/operation/util/OperationUtil.java",
"identifier": "OperationUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "OperationUtil.OperationUtil()",
"constructor": true,
"full_signature": "private Operati... | {
"body": "public static Iterable<?> fromElementIds(final Iterable<? extends ElementId> input) {\n if (null == input) {\n return null;\n }\n return IterableUtil.map(input, new FromElementId());\n }",
"class_method_signature": "OperationUtil.fromElementIds(final Iterable<? extends ... | {
"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_149 | {
"fields": [],
"file": "store-implementation/accumulo-store/src/test/java/uk/gov/gchq/gaffer/accumulostore/operation/impl/GetElementsInRangesTest.java",
"identifier": "GetElementsInRangesTest",
"interfaces": "",
"superclass": "extends OperationTest<GetElementsInRanges>"
} | {
"body": "@Test\n public void shouldJSONSerialiseAndDeserialise() throws SerialisationException {\n // Given\n final List<Pair<ElementId, ElementId>> pairList = new ArrayList<>();\n final Pair<ElementId, ElementId> pair1 = new Pair<>(AccumuloTestData.SEED_SOURCE_1, AccumuloTestData.SEED_DESTI... | {
"fields": [
{
"declarator": "input",
"modifier": "private",
"original_string": "private Iterable<? extends Pair<? extends ElementId, ? extends ElementId>> input;",
"type": "Iterable<? extends Pair<? extends ElementId, ? extends ElementId>>",
"var_name": "input"
},
{
"... | {
"body": "@Override\n public Iterable<? extends Pair<? extends ElementId, ? extends ElementId>> getInput() {\n return input;\n }",
"class_method_signature": "GetElementsInRanges.getInput()",
"constructor": false,
"full_signature": "@Override public Iterable<? extends Pair<? extends ElementId, ? ex... | {
"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_519 | {
"fields": [],
"file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/CollectionUtilTest.java",
"identifier": "CollectionUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnFalseWhenAnyMissingCalledWithNullCollectionAndValues() {\n // When\n final boolean result = CollectionUtil.anyMissing(null, null);\n\n // Then\n assertFalse(result);\n }",
"class_method_signature": "CollectionUtilTest.shouldReturnFalseWhen... | {
"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 boolean anyMissing(final Collection collection, final Object[] objects) {\n boolean result = false;\n if (null == collection || collection.isEmpty()) {\n if (null != objects && 0 < objects.length) {\n result = true;\n }\n } else if (nu... | {
"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_1024 | {
"fields": [],
"file": "core/serialisation/src/test/java/uk/gov/gchq/gaffer/serialisation/implementation/StringSerialiserTest.java",
"identifier": "StringSerialiserTest",
"interfaces": "",
"superclass": "extends ToBytesSerialisationTest<String>"
} | {
"body": "@Test\n public void cantSerialiseLongClass() {\n assertFalse(serialiser.canHandle(Long.class));\n }",
"class_method_signature": "StringSerialiserTest.cantSerialiseLongClass()",
"constructor": false,
"full_signature": "@Test public void cantSerialiseLongClass()",
"identifier": "cantSeri... | {
"fields": [
{
"declarator": "serialVersionUID = 5647756843689779437L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 5647756843689779437L;",
"type": "long",
"var_name": "serialVersionUID"
}
],
"file": "core/serialisatio... | {
"body": "@Override\n public boolean canHandle(final Class clazz) {\n return String.class.equals(clazz);\n }",
"class_method_signature": "StringSerialiser.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_775 | {
"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 shouldFailValidationOfOperationScores() throws ClassNotFoundException {\n // Given\n final ScoreOperationChainHandler handler = new ScoreOperationChainHandler();\n final LinkedHashMap<String, Integer> opScores = new LinkedHashMap<>();\n opScores.put(GetEle... | {
"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": "@JsonSetter(\"opScores\")\n public void setOpScoresFromStrings(final Map<String, Integer> opScores) throws ClassNotFoundException {\n this.opScores.clear();\n CollectionUtil.toMapWithClassKeys(opScores, this.opScores);\n validateOpScores();\n }",
"class_method_signature": "Scor... | {
"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_325 | {
"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 shouldGetEdges() {\n final AdjacencyMap adjacencyMap = getAdjacencyMap();\n\n final Set<Edge> results = adjacencyMap.getEdges(1, 2);\n\n assertThat(results, hasItems(makeEdge(1, 2)));\n }",
"class_method_signature": "AdjacencyMapTest.shouldGetEdges()",
"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 Set<Edge> getEdges(final Object source, final Object destination) {\n final Set<Edge> results = edgeGraph.get(source, destination);\n return null != results ? results : Collections.emptySet();\n }",
"class_method_signature": "AdjacencyMap.getEdges(final Object source, final 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_17 | {
"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 shouldNotUpdateOperationViewIfNotRequired() {\n // Given\n final Graph graph = createGraph();\n final GetElements operation = new GetElements.Builder()\n .view(new View.Builder()\n .edge(TestGroups.EDGE)\n ... | {
"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 <OP extends Operation> OP updateOperationForGraph(final OP operation, final Graph graph) {\n OP resultOp = operation;\n if (operation instanceof Operations) {\n resultOp = (OP) operation.shallowClone();\n final Operations<Operation> operations = (Operations... | {
"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_1248 | {
"fields": [],
"file": "core/operation/src/test/java/uk/gov/gchq/gaffer/operation/OperationChainTest.java",
"identifier": "OperationChainTest",
"interfaces": "",
"superclass": "extends OperationsTest<OperationChain>"
} | {
"body": "@Test\n public void shouldConvertToOverviewString() {\n // Given\n final OperationChain opChain = new OperationChain.Builder()\n .first(new GetAdjacentIds.Builder()\n .input(new EntitySeed(\"vertex1\"))\n .build())\n ... | {
"fields": [
{
"declarator": "operations",
"modifier": "private",
"original_string": "private List<Operation> operations;",
"type": "List<Operation>",
"var_name": "operations"
},
{
"declarator": "options",
"modifier": "private",
"original_string": "private ... | {
"body": "public String toOverviewString() {\n final String opStrings = operations.stream()\n .filter(o -> null != o)\n .map(o -> o.getClass().getSimpleName())\n .collect(Collectors.joining(\"->\"));\n\n return getClass().getSimpleName() + \"[\" + opStrings ... | {
"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_630 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/util/AggregatorUtilTest.java",
"identifier": "AggregatorUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldQueryAggregateElementsWithGroupBy() {\n // given\n final Schema schema = Schema.fromJson(StreamUtil.openStreams(getClass(), \"schema-groupby\"));\n final View view = new View.Builder()\n .entity(TestGroups.ENTITY, new ViewElementDefinition.Bu... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/util/AggregatorUtil.java",
"identifier": "AggregatorUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "AggregatorUtil.AggregatorUtil()",
"constructor": true,
"full_signature": "private AggregatorU... | {
"body": "public static CloseableIterable<Element> queryAggregate(final Iterable<? extends Element> elements, final Schema schema, final View view) {\n if (null == schema) {\n throw new IllegalArgumentException(\"Schema is required\");\n }\n if (null == view) {\n throw new ... | {
"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_260 | {
"fields": [],
"file": "core/access/src/test/java/uk/gov/gchq/gaffer/user/UserTest.java",
"identifier": "UserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldSetUnknownIdWhenBuildingUser() {\n // Given\n // When\n final User user = new User.Builder()\n .build();\n\n // Then\n assertEquals(User.UNKNOWN_USER_ID, user.getUserId());\n }",
"class_method_signature": "UserTest.shouldSe... | {
"fields": [
{
"declarator": "serialVersionUID = -2446354817298439281L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -2446354817298439281L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "UNK... | {
"body": "public String getUserId() {\n return userId;\n }",
"class_method_signature": "User.getUserId()",
"constructor": false,
"full_signature": "public String getUserId()",
"identifier": "getUserId",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "String",
"sig... | {
"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_1177 | {
"fields": [],
"file": "core/operation/src/test/java/uk/gov/gchq/gaffer/operation/function/ToEntityIdTest.java",
"identifier": "ToEntityIdTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnOriginalValueIfInputIsAnEntitySeed() {\n // Given\n final EntitySeed input = new EntitySeed(\"item\");\n final ToEntityId function = new ToEntityId();\n\n // When\n final EntityId output = function.apply(input);\n\n // Then\n ... | {
"fields": [],
"file": "core/operation/src/main/java/uk/gov/gchq/gaffer/operation/function/ToEntityId.java",
"identifier": "ToEntityId",
"interfaces": "",
"methods": [
{
"class_method_signature": "ToEntityId.apply(final Object obj)",
"constructor": false,
"full_signature": "@Override pu... | {
"body": "@Override\n public EntityId apply(final Object obj) {\n if (null == obj) {\n return null;\n }\n return obj instanceof EntityId ? (EntityId) obj : new EntitySeed(obj);\n }",
"class_method_signature": "ToEntityId.apply(final Object obj)",
"constructor": false,
"ful... | {
"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_1198 | {
"fields": [
{
"declarator": "INPUT_DIRECTORY = \"/input\"",
"modifier": "private static final",
"original_string": "private static final String INPUT_DIRECTORY = \"/input\";",
"type": "String",
"var_name": "INPUT_DIRECTORY"
},
{
"declarator": "TEST_OPTION_KEY = \"test... | {
"body": "@Test\n @Override\n public void builderShouldCreatePopulatedOperation() {\n final SplitStore splitTable = new SplitStore.Builder().inputPath(INPUT_DIRECTORY).option(TEST_OPTION_KEY, \"true\").build();\n assertEquals(INPUT_DIRECTORY, splitTable.getInputPath());\n assertEquals(\"tr... | {
"fields": [
{
"declarator": "inputPath",
"modifier": "@Required\n private",
"original_string": "@Required\n private String inputPath;",
"type": "String",
"var_name": "inputPath"
},
{
"declarator": "options",
"modifier": "private",
"original_string": ... | {
"body": "public String getInputPath() {\n return inputPath;\n }",
"class_method_signature": "SplitStore.getInputPath()",
"constructor": false,
"full_signature": "public String getInputPath()",
"identifier": "getInputPath",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"retu... | {
"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_919 | {
"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 shouldValidateAndReturnTrueWhenEntityTransformerResult() {\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_1032 | {
"fields": [],
"file": "core/serialisation/src/test/java/uk/gov/gchq/gaffer/serialisation/implementation/JavaSerialiserTest.java",
"identifier": "JavaSerialiserTest",
"interfaces": "",
"superclass": "extends ToBytesSerialisationTest<Object>"
} | {
"body": "@Test\n public void canHandleUnParameterisedDAO() {\n assertTrue(serialiser.canHandle(SimpleTestObject.class));\n }",
"class_method_signature": "JavaSerialiserTest.canHandleUnParameterisedDAO()",
"constructor": false,
"full_signature": "@Test public void canHandleUnParameterisedDAO()",
... | {
"fields": [
{
"declarator": "serialVersionUID = 2073581763875104361L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 2073581763875104361L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "SERIA... | {
"body": "@Override\n public boolean canHandle(final Class clazz) {\n return SERIALISABLE.isAssignableFrom(clazz);\n }",
"class_method_signature": "JavaSerialiser.canHandle(final Class clazz)",
"constructor": false,
"full_signature": "@Override public boolean canHandle(final Class clazz)",
"iden... | {
"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_333 | {
"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 shouldNotContainDestination() {\n // Given\n final AdjacencyMap adjacencyMap = getAdjacencyMap();\n\n // When\n final boolean result = adjacencyMap.containsDestination(7);\n\n // Then\n assertThat(result, is(false));\n }",
"class_method_... | {
"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 containsDestination(final Object destination) {\n return edgeGraph.columnKeySet().contains(destination);\n }",
"class_method_signature": "AdjacencyMap.containsDestination(final Object destination)",
"constructor": false,
"full_signature": "public boolean containsDestination(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_763 | {
"fields": [
{
"declarator": "TEST_ENTITY_GROUP = \"testEntity1\"",
"modifier": "private static final",
"original_string": "private static final String TEST_ENTITY_GROUP = \"testEntity1\";",
"type": "String",
"var_name": "TEST_ENTITY_GROUP"
},
{
"declarator": "TEST_ENT... | {
"body": "@Test\n public void shouldThrowExceptionFromFunctionIfInputIsInvalid() {\n // given\n // Performing a FirstItem on null should throw IllegalArgumentException\n List<Long> testList = Lists.newArrayList(100L, 200L, 300L, null);\n\n // when\n KeyFunctionMatch match = new ... | {
"fields": [
{
"declarator": "NULL_FUNCTION_ERROR_MESSAGE = \"Key functions for left and right input cannot be null\"",
"modifier": "private static final",
"original_string": "private static final String NULL_FUNCTION_ERROR_MESSAGE = \"Key functions for left and right input cannot be null\";",
... | {
"body": "@Override\n public void init(final Iterable matchCandidates) {\n\n if (matchCandidates == null) {\n throw new IllegalArgumentException(NULL_MATCH_CANDIDATES_ERROR_MESSAGE);\n }\n // Iterates over match candidates, creates an index using second key function.\n for (... | {
"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_299 | {
"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 shouldAddGlobalExcludeElementPropertiesToEntityGroup() {\n // Given\n final View view = new View.Builder()\n .globalElements(new GlobalViewElementDefinition.Builder()\n .groups(TestGroups.ENTITY)\n .excludePro... | {
"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_276 | {
"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 shouldReturnTrueWhenViewHasPostTransformEdgeFilters() {\n // Given\n final View view = new View.Builder()\n .entity(TestGroups.ENTITY)\n .edge(TestGroups.EDGE, new ViewElementDefinition.Builder()\n .postTransformFilte... | {
"fields": [
{
"declarator": "globalElements",
"modifier": "private",
"original_string": "private List<GlobalViewElementDefinition> globalElements;",
"type": "List<GlobalViewElementDefinition>",
"var_name": "globalElements"
},
{
"declarator": "globalEntities",
"m... | {
"body": "public boolean hasPostTransformFilters() {\n return hasFilters(ViewElementDefinition::hasPostTransformFilters);\n }",
"class_method_signature": "View.hasPostTransformFilters()",
"constructor": false,
"full_signature": "public boolean hasPostTransformFilters()",
"identifier": "hasPostTrans... | {
"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_626 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/util/AggregatorUtilTest.java",
"identifier": "AggregatorUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldIngestAggregateElementsWithNoGroupBy() {\n // given\n final Schema schema = Schema.fromJson(StreamUtil.openStreams(getClass(), \"schema-groupby\"));\n\n final List<Element> elements = Arrays.asList(\n new Entity.Builder()\n ... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/util/AggregatorUtil.java",
"identifier": "AggregatorUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "AggregatorUtil.AggregatorUtil()",
"constructor": true,
"full_signature": "private AggregatorU... | {
"body": "public static CloseableIterable<Element> ingestAggregate(final Iterable<? extends Element> elements, final Schema schema) {\n if (null == schema) {\n throw new IllegalArgumentException(\"Schema is required\");\n }\n final Collection<String> aggregatedGroups = schema.getAggre... | {
"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_1120 | {
"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 shouldReturnAllOpAuths() {\n // Given\n final OperationAuthoriser hook = fromJson(OP_AUTHS_PATH);\n\n // When\n final Set<String> allOpAuths = hook.getAllAuths();\n\n // Then\n assertThat(allOpAuths,\n IsCollectionContaining.ha... | {
"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": "@JsonIgnore\n public Set<String> getAllAuths() {\n return Collections.unmodifiableSet(allAuths);\n }",
"class_method_signature": "OperationAuthoriser.getAllAuths()",
"constructor": false,
"full_signature": "@JsonIgnore public Set<String> getAllAuths()",
"identifier": "getAllAuths",
"... | {
"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_108 | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(AddUpdateTableIteratorTest.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(AddUpdateTableIteratorTest.class);",
"type": "Logger",
"var_name": ... | {
"body": "@Test\n public void shouldRunMainWithFileGraphLibrary() throws Exception {\n // Given\n final String[] args = {GRAPH_ID, SCHEMA_DIR, STORE_PROPS_PATH_UPDATED, \"update\", FILE_GRAPH_LIBRARY_TEST_PATH};\n\n // When\n AddUpdateTableIterator.main(args);\n\n // Then\n ... | {
"fields": [
{
"declarator": "UPDATE_KEY = \"update\"",
"modifier": "public static final",
"original_string": "public static final String UPDATE_KEY = \"update\";",
"type": "String",
"var_name": "UPDATE_KEY"
},
{
"declarator": "REMOVE_KEY = \"remove\"",
"modifier... | {
"body": "public static void main(final String[] args) throws Exception {\n if (args.length < NUM_REQUIRED_ARGS) {\n System.err.println(\"Wrong number of arguments. \\nUsage: \"\n + \"<graphId> \"\n + \"<comma separated schema paths> <store properties path> \"\... | {
"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_558 | {
"fields": [],
"file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/iterable/StreamIteratorTest.java",
"identifier": "StreamIteratorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldDelegateCloseToWrappedIterator() {\n final Stream<Object> stream = mock(Stream.class);\n final StreamIterator<Object> streamIterator = new StreamIterator<>(stream);\n\n streamIterator.close();\n\n verify(stream).close();\n }",
"class_method_sign... | {
"fields": [
{
"declarator": "stream",
"modifier": "private final",
"original_string": "private final Stream<T> stream;",
"type": "Stream<T>",
"var_name": "stream"
},
{
"declarator": "iterator",
"modifier": "private final",
"original_string": "private final... | {
"body": "@Override\n public void close() {\n CloseableUtil.close(iterator);\n CloseableUtil.close(stream);\n }",
"class_method_signature": "StreamIterator.close()",
"constructor": false,
"full_signature": "@Override public void close()",
"identifier": "close",
"invocations": [
"clo... | {
"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_1065 | {
"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": "SCHEMA_ID_1 = \"schemaId1\"",
"modifi... | {
"body": "@Test\n public void shouldConstructGraphFromSchemaURI() throws IOException, URISyntaxException {\n // Given\n final URI typeInputUri = getResourceUri(StreamUtil.TYPES_SCHEMA);\n final URI schemaInputUri = getResourceUri(StreamUtil.ELEMENTS_SCHEMA);\n final URI storeInputUri =... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(Graph.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(Graph.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": ... | {
"body": "public Schema getSchema() {\n return store.getOriginalSchema();\n }",
"class_method_signature": "Graph.getSchema()",
"constructor": false,
"full_signature": "public Schema getSchema()",
"identifier": "getSchema",
"invocations": [
"getOriginalSchema"
],
"modifiers": "public",
"... | {
"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_734 | {
"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 shouldProcessWalksWithEdgeExtraction() throws OperationException {\n // Given\n final Iterable<Walk> walks = Arrays.asList(walk, walk1);\n\n final Map<Iterable<Walk>, Iterable<Edge>> map = new Map.Builder<Iterable<Walk>>()\n .input(walks)\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_364 | {
"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 shouldCompareValueWithNull() {\n final ComparableOrToStringComparator comparator = new ComparableOrToStringComparator();\n\n final int result = comparator.compare(1, null);\n\n assertTrue(result < 0, \"Should be less than 0\");\n }",
"class_method_signature"... | {
"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_56 | {
"fields": [
{
"declarator": "FEDERATEDSTORE_GRAPH_ID = \"federatedStore\"",
"modifier": "private static final",
"original_string": "private static final String FEDERATEDSTORE_GRAPH_ID = \"federatedStore\";",
"type": "String",
"var_name": "FEDERATEDSTORE_GRAPH_ID"
},
{
... | {
"body": "@Test\n public void shouldRemoveGraphForAddingUser() throws Exception {\n FederatedStore store = new FederatedStore();\n final FederatedStoreProperties federatedStoreProperties = new FederatedStoreProperties();\n federatedStoreProperties.setCacheProperties(CACHE_SERVICE_CLASS_STRING... | {
"fields": [],
"file": "store-implementation/federated-store/src/main/java/uk/gov/gchq/gaffer/federatedstore/operation/handler/impl/FederatedRemoveGraphHandler.java",
"identifier": "FederatedRemoveGraphHandler",
"interfaces": "implements OutputOperationHandler<RemoveGraph, Boolean>",
"methods": [
{
... | {
"body": "@Override\n public Boolean doOperation(final RemoveGraph operation, final Context context, final Store store) throws OperationException {\n try {\n final boolean userRequestingAdminUsage = isUserRequestingAdminUsage(operation);\n return ((FederatedStore) store).remove(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_1209 | {
"fields": [],
"file": "core/operation/src/test/java/uk/gov/gchq/gaffer/operation/impl/output/ToStreamTest.java",
"identifier": "ToStreamTest",
"interfaces": "",
"superclass": "extends OperationTest<ToStream>"
} | {
"body": "@Test\n @Override\n public void builderShouldCreatePopulatedOperation() {\n // Given\n final ToStream<String> toStream = new ToStream.Builder<String>().input(\"1\", \"2\").build();\n\n // Then\n assertThat(toStream.getInput(), is(notNullValue()));\n assertThat(toStr... | {
"fields": [
{
"declarator": "input",
"modifier": "private",
"original_string": "private Iterable<? extends T> input;",
"type": "Iterable<? extends T>",
"var_name": "input"
},
{
"declarator": "options",
"modifier": "private",
"original_string": "private Map... | {
"body": "@Override\n public Iterable<? extends T> getInput() {\n return input;\n }",
"class_method_signature": "ToStream.getInput()",
"constructor": false,
"full_signature": "@Override public Iterable<? extends T> getInput()",
"identifier": "getInput",
"invocations": [],
"modifiers": "@Over... | {
"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_671 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/resolver/named/NamedOperationScoreResolverTest.java",
"identifier": "NamedOperationScoreResolverTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldCatchExceptionForCacheFailures() {\n // Given\n final NamedOperation<Element, Iterable<? extends Element>> namedOp = mock(NamedOperation.class);\n final NamedOperationScoreResolver resolver = new NamedOperationScoreResolver();\n\n // When\n fi... | {
"fields": [
{
"declarator": "cache",
"modifier": "private final",
"original_string": "private final NamedOperationCache cache;",
"type": "NamedOperationCache",
"var_name": "cache"
},
{
"declarator": "LOGGER = LoggerFactory.getLogger(NamedOperationScoreResolver.class)"... | {
"body": "@Override\n public Integer getScore(final NamedOperation operation) {\n return getScore(operation, null);\n }",
"class_method_signature": "NamedOperationScoreResolver.getScore(final NamedOperation operation)",
"constructor": false,
"full_signature": "@Override public Integer getScore(fin... | {
"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_221 | {
"fields": [],
"file": "store-implementation/map-store/src/test/java/uk/gov/gchq/gaffer/mapstore/factory/SimpleMapFactoryTest.java",
"identifier": "SimpleMapFactoryTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldCloneElementUsingCloner() throws StoreException {\n // Given\n final ElementCloner elementCloner = mock(ElementCloner.class);\n final Element element = mock(Element.class);\n final Element expectedClonedElement = mock(Element.class);\n final S... | {
"fields": [
{
"declarator": "MAP_CLASS = \"gaffer.store.mapstore.map.class\"",
"modifier": "public static final",
"original_string": "public static final String MAP_CLASS = \"gaffer.store.mapstore.map.class\";",
"type": "String",
"var_name": "MAP_CLASS"
},
{
"declarat... | {
"body": "@Override\n public Element cloneElement(final Element element, final Schema schema) {\n return cloner.cloneElement(element, schema);\n }",
"class_method_signature": "SimpleMapFactory.cloneElement(final Element element, final Schema schema)",
"constructor": false,
"full_signature": "@Over... | {
"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_466 | {
"fields": [
{
"declarator": "ve = new VisibilityEvaluator(new Authorisations(\"one\", \"two\", \"three\", \"four\"))",
"modifier": "final",
"original_string": "final VisibilityEvaluator ve = new VisibilityEvaluator(new Authorisations(\"one\", \"two\", \"three\", \"four\"));",
"type": "Vi... | {
"body": "@Test\n public void testNonAscii() throws VisibilityParseException {\n final VisibilityEvaluator ve = new VisibilityEvaluator(new Authorisations(\"五\", \"六\", \"八\", \"九\", \"五十\"));\n\n assertTrue(ve.evaluate(new ElementVisibility(quote(\"五\") + \"|\" + quote(\"四\"))));\n assertFal... | {
"fields": [
{
"declarator": "auths",
"modifier": "private",
"original_string": "private Authorisations auths;",
"type": "Authorisations",
"var_name": "auths"
}
],
"file": "core/common-util/src/main/java/uk/gov/gchq/gaffer/commonutil/elementvisibilityutil/VisibilityEvaluator... | {
"body": "public boolean evaluate(final ElementVisibility visibility) throws VisibilityParseException {\n return this.evaluate(visibility.getExpression(), visibility.getParseTree());\n }",
"class_method_signature": "VisibilityEvaluator.evaluate(final ElementVisibility visibility)",
"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_935 | {
"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 shouldValidateAndReturnFalseForOrFilterWithIncompatibleProperties() {\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_870 | {
"fields": [
{
"declarator": "cache",
"modifier": "private static",
"original_string": "private static NamedOperationCache cache;",
"type": "NamedOperationCache",
"var_name": "cache"
},
{
"declarator": "GAFFER_USER = \"gaffer user\"",
"modifier": "private static ... | {
"body": "@Test\n public void shouldReturnEmptySetIfThereAreNoOperationsInTheCache() {\n CloseableIterable<NamedOperationDetail> ops = cache.getAllNamedOperations(standardUser);\n assert Iterables.size(ops) == 0;\n }",
"class_method_signature": "NamedOperationCacheTest.shouldReturnEmptySetIfThe... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(NamedOperationCache.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(NamedOperationCache.class);",
"type": "Logger",
"var_name": "LOGGER"
}... | {
"body": "public CloseableIterable<NamedOperationDetail> getAllNamedOperations(final User user) {\n return getAll(user, null);\n }",
"class_method_signature": "NamedOperationCache.getAllNamedOperations(final User user)",
"constructor": false,
"full_signature": "public CloseableIterable<NamedOperation... | {
"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_173 | {
"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 shouldReturnHBaseRetrieverWithIncludeMatchedVertex() 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_7 | {
"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 shouldReturnFalseForUserWithoutPermission() {\n assertFalse(createAccessPredicate(TEST_USER.getUserId(), asList(\"auth1\"), NON_PUBLIC).test(new User.Builder().userId(\"AnotherUser\").opAuths(\"auth3\").build(), null));\n }",
"class_method_signature": "FederatedGraphReadA... | {
"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_489 | {
"fields": [],
"file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/StringUtilTest.java",
"identifier": "StringUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void unescapeCommaShouldNotRemoveSemicolon() {\n assertEquals(\"don'tRemove;SemiColon\", StringUtil.unescapeComma(\"don'tRemove;SemiColon\"));\n }",
"class_method_signature": "StringUtilTest.unescapeCommaShouldNotRemoveSemicolon()",
"constructor": false,
"full_signature": ... | {
"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 unescapeComma(final String escapedStr) {\n final StringBuilder str = new StringBuilder(escapedStr.length());\n boolean isEscaped = false;\n for (int i = 0; i < escapedStr.length(); i++) {\n char c = escapedStr.charAt(i);\n if (isEscaped) {\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_523 | {
"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 shouldCloseIterableWhenStreamIsClosed() throws Throwable {\n // Given\n final CloseableIterable<String> iterable = mock(CloseableIterable.class);\n final CloseableIterator<String> iterator = mock(CloseableIterator.class);\n given(iterable.spliterator()).wi... | {
"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> toStream(final Iterable<T> iterable) {\n if (iterable instanceof StreamIterable) {\n return ((StreamIterable<T>) iterable).getStream();\n }\n\n return StreamSupport.stream(iterable.spliterator(), false)\n .onClose(() -> CloseableUti... | {
"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_1272 | {
"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 shouldBeAbleToDeleteCacheEntries() throws CacheOperationException {\n service.initialise(serviceProps);\n service.putInCache(TEST_REGION, \"test\", 1);\n\n service.removeFromCache(TEST_REGION, \"test\");\n assertEquals(0, service.sizeOfCache(TEST_REGION));... | {
"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_1337 | {
"fields": [],
"file": "library/spark/spark-library/src/test/java/uk/gov/gchq/gaffer/spark/function/DataFrameToIterableRowTest.java",
"identifier": "DataFrameToIterableRowTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldConvertDataFrameToIterableOfRows() {\n // Given\n final SparkSession sparkSession = SparkSessionProvider.getSparkSession();\n\n final Function<Dataset<Row>, Iterable<? extends Row>> function = new DataFrameToIterableRow();\n\n final Dataset<Row> data... | {
"fields": [],
"file": "library/spark/spark-library/src/main/java/uk/gov/gchq/gaffer/spark/function/DataFrameToIterableRow.java",
"identifier": "DataFrameToIterableRow",
"interfaces": "implements Function<Dataset<Row>, Iterable<? extends Row>>",
"methods": [
{
"class_method_signature": "DataFrameTo... | {
"body": "@Override\n public Iterable<? extends Row> apply(final Dataset<Row> dataset) {\n return dataset::toLocalIterator;\n }",
"class_method_signature": "DataFrameToIterableRow.apply(final Dataset<Row> dataset)",
"constructor": false,
"full_signature": "@Override public Iterable<? extends Row> ... | {
"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_962 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/schema/SchemaElementDefinitionValidatorTest.java",
"identifier": "SchemaElementDefinitionValidatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldValidateFunctionSelectionsAndReturnFalseWhenAFunctionIsNull() {\n // Given\n final SchemaElementDefinition elementDef = mock(SchemaElementDefinition.class);\n final ElementFilter elementFilter = new ElementFilter.Builder()\n .select(\"selecti... | {
"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_1049 | {
"fields": [],
"file": "core/serialisation/src/test/java/uk/gov/gchq/gaffer/serialisation/implementation/raw/RawLongSerialiserTest.java",
"identifier": "RawLongSerialiserTest",
"interfaces": "",
"superclass": "extends ToBytesSerialisationTest<Long>"
} | {
"body": "@Test\n public void cantSerialiseStringClass() {\n assertFalse(serialiser.canHandle(String.class));\n }",
"class_method_signature": "RawLongSerialiserTest.cantSerialiseStringClass()",
"constructor": false,
"full_signature": "@Test public void cantSerialiseStringClass()",
"identifier": ... | {
"fields": [
{
"declarator": "serialVersionUID = 369129707952407270L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 369129707952407270L;",
"type": "long",
"var_name": "serialVersionUID"
}
],
"file": "core/serialisation/... | {
"body": "@Override\n public boolean canHandle(final Class clazz) {\n return Long.class.equals(clazz);\n }",
"class_method_signature": "RawLongSerialiser.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_431 | {
"fields": [],
"file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/element/function/ElementTransformerTest.java",
"identifier": "ElementTransformerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldTransformElementUsingMockFunction() {\n // Given\n final String selection = \"reference1\";\n final String projection = \"reference1\";\n final Integer valueResult = 3;\n\n final Function<String, Integer> function = mock(Function.class);\n ... | {
"fields": [
{
"declarator": "elementTuple = new ElementTuple()",
"modifier": "private final",
"original_string": "private final ElementTuple elementTuple = new ElementTuple();",
"type": "ElementTuple",
"var_name": "elementTuple"
}
],
"file": "core/data/src/main/java/uk/gov/... | {
"body": "public Element apply(final Element element) {\n elementTuple.setElement(element);\n apply(elementTuple);\n return element;\n }",
"class_method_signature": "ElementTransformer.apply(final Element element)",
"constructor": false,
"full_signature": "public Element apply(final 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_574 | {
"fields": [],
"file": "core/type/src/test/java/uk/gov/gchq/gaffer/types/TypeSubTypeValueTest.java",
"identifier": "TypeSubTypeValueTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testComparisonsAreAsExpected() {\n TypeSubTypeValue typeSubTypeValue = new TypeSubTypeValue(\"a\", \"b\", \"c\");\n\n assertEquals(0, typeSubTypeValue.compareTo(new TypeSubTypeValue(\"a\", \"b\", \"c\")));\n\n assertTrue(typeSubTypeValue.compareTo(null) > 0);\n\n... | {
"fields": [
{
"declarator": "stringComparator = Comparator\n .nullsFirst(String::compareTo)",
"modifier": "private static",
"original_string": "private static Comparator<String> stringComparator = Comparator\n .nullsFirst(String::compareTo);",
"type": "Comparator<St... | {
"body": "@Override\n public int compareTo(final TypeSubTypeValue typeSubTypeValue) {\n if (null == typeSubTypeValue) {\n return 1;\n }\n int i = stringComparator.compare(type, typeSubTypeValue.getType());\n if (i != 0) {\n return i;\n }\n i = string... | {
"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_124 | {
"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 shouldFailWithSameBackingArrayMatchingSelectionWithDifferentOffsetsDifferentLengthsButLargerLengthIsLimitedByEndOfArray() throws Exception {\n br1 = new BytesAndRange(e, 0, 5);\n br2 = new BytesAndRange(e, 5, 9999);\n assertFalse(ByteUtils.areKeyBytesEqual(br1, b... | {
"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_827 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/handler/output/ToArrayHandlerTest.java",
"identifier": "ToArrayHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldConvertIterableOfObjectsToArray() throws OperationException {\n // Given\n final Object[] originalArray = new Object[]{\n new Entity(\"entity\"),\n new Edge.Builder().group(\"edge\"),\n new EntitySeed(\"vertex\"),\n ... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/output/ToArrayHandler.java",
"identifier": "ToArrayHandler",
"interfaces": "implements OutputOperationHandler<ToArray<T>, T[]>",
"methods": [
{
"class_method_signature": "ToArrayHandler.doOperation(final ToA... | {
"body": "@SuppressFBWarnings(value = \"PZLA_PREFER_ZERO_LENGTH_ARRAYS\")\n @Override\n public T[] doOperation(final ToArray<T> operation, final Context context, final Store store) throws OperationException {\n if (null == operation.getInput() || Iterables.isEmpty(operation.getInput())) {\n r... | {
"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_1225 | {
"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 shouldSerialiseAndDeserialiseOperationWithEntityIds() throws SerialisationException {\n // Given\n final EntityId entitySeed = new EntitySeed(\"identifier\");\n final GetAdjacentIds op = new GetAdjacentIds.Builder()\n .input(entitySeed)\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_1360 | {
"fields": [
{
"declarator": "DELTA = 0.00001D",
"modifier": "private static final",
"original_string": "private static final double DELTA = 0.00001D;",
"type": "double",
"var_name": "DELTA"
},
{
"declarator": "hllSketchWithCardinality5",
"modifier": "private sta... | {
"body": "@Test\n public void shouldRejectWhenEqualToAndEqualToIsFalse() {\n // Given\n final HllSketchIsLessThan filter = new HllSketchIsLessThan(18);\n // When\n boolean accepted = filter.test(hllSketchWithCardinality18);\n // Then\n assertFalse(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 HllSketch input) {\n if (null == input) {\n return false;\n }\n final long cardinality = Math.round(input.getEstimate());\n if (orEqualTo) {\n return cardinality <= controlValue;\n } else {\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_95 | {
"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 testReturnsUsefulExceptionIfAskForPartitionerForNonExistentGroupForReversedEdges() {\n // Given\n final GraphPartitioner graphPartitioner = new GraphPartitioner();\n\n // When / Then\n try {\n final GroupPartitioner partitioner = graphPartitione... | {
"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 GroupPartitioner getGroupPartitionerForReversedEdges(final String group) {\n if (!reversedEdgesGroupToPartitioner.containsKey(group)) {\n throw new IllegalArgumentException(\"No GroupPartitioner for key \" + group + \" exists for reversedEdgesGroupToPartitioner\");\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_348 | {
"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 shouldGetSourceVertexFromWalkWithNoEntities() {\n // Given\n // [A] -> [B] -> [C]\n\n final Walk walk = new Walk.Builder()\n .edges(EDGE_AB, EDGE_BC)\n .build();\n\n // When\n final Object result = walk.getSourceVertex(... | {
"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 Object getSourceVertex() {\n return entities.get(0).getKey();\n }",
"class_method_signature": "Walk.getSourceVertex()",
"constructor": false,
"full_signature": "@JsonIgnore public Object getSourceVertex()",
"identifier": "getSourceVertex",
"invocations": [
"g... | {
"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_718 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/handler/SetVariableHandlerTest.java",
"identifier": "SetVariableHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldSetVariableInContext() throws OperationException {\n // Given\n final Context context = new Context(new User());\n final Store store = mock(Store.class);\n final String testVarName = \"testVarName\";\n final int testVarValue = 4;\n\n Se... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/SetVariableHandler.java",
"identifier": "SetVariableHandler",
"interfaces": "implements OperationHandler<SetVariable>",
"methods": [
{
"class_method_signature": "SetVariableHandler.doOperation(final SetVaria... | {
"body": "@Override\n public Void doOperation(final SetVariable operation, final Context context, final Store store) throws OperationException {\n if (null == operation.getVariableName()) {\n throw new IllegalArgumentException(\"Variable name cannot be null\");\n }\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_427 | {
"fields": [],
"file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/element/function/ToElementTupleTest.java",
"identifier": "ToElementTupleTest",
"interfaces": "",
"superclass": "extends FunctionTest"
} | {
"body": "@Test\n public void shouldConvertAnElementIntoAnElementTuple() {\n final Element element = new Entity.Builder()\n .group(TestGroups.ENTITY)\n .vertex(\"vertex1\")\n .property(TestPropertyNames.COUNT, 1)\n .build();\n final ToEleme... | {
"fields": [],
"file": "core/data/src/main/java/uk/gov/gchq/gaffer/data/element/function/ToElementTuple.java",
"identifier": "ToElementTuple",
"interfaces": "",
"methods": [
{
"class_method_signature": "ToElementTuple.apply(final Element element)",
"constructor": false,
"full_signature"... | {
"body": "@Override\n public ElementTuple apply(final Element element) {\n if (isNull(element)) {\n return null;\n }\n\n return new ElementTuple(element);\n }",
"class_method_signature": "ToElementTuple.apply(final Element element)",
"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_974 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/schema/SchemaElementDefinitionValidatorTest.java",
"identifier": "SchemaElementDefinitionValidatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldValidateAndReturnFalseWhenVisibilityIsAggregatedWithOtherProperty() {\n // Given\n final SchemaElementDefinitionValidator validator = new SchemaElementDefinitionValidator();\n final BinaryOperator<Integer> function1 = mock(BinaryOperator.class);\n fi... | {
"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_831 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/handler/output/ToSetHandlerTest.java",
"identifier": "ToSetHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldConvertIterableToSet() throws OperationException {\n // Given\n final Iterable originalResults = new WrappedCloseableIterable<>(Arrays.asList(1, 2, 2, 2, 3, 4, 1, 5, 6, 7, 8, 5, 9, 1, 6, 8, 2, 10));\n final ToSetHandler<Integer> handler = new ToSetHandler<>... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/output/ToSetHandler.java",
"identifier": "ToSetHandler",
"interfaces": "implements OutputOperationHandler<ToSet<T>, Set<? extends T>>",
"methods": [
{
"class_method_signature": "ToSetHandler.doOperation(fina... | {
"body": "@Override\n public Set<T> doOperation(final ToSet<T> operation, final Context context, final Store store) throws OperationException {\n if (null == operation.getInput()) {\n return null;\n }\n\n return Streams.toStream(operation.getInput())\n .collect... | {
"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_132 | {
"fields": [],
"file": "store-implementation/accumulo-store/src/test/java/uk/gov/gchq/gaffer/accumulostore/utils/IteratorSettingBuilderTest.java",
"identifier": "IteratorSettingBuilderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldAddCompactSchemaToIteratorSetting() throws Exception {\n // Given\n final IteratorSetting setting = mock(IteratorSetting.class);\n final Schema schema = mock(Schema.class);\n final String compactSchemaJson = \"CompactSchema\";\n\n given(schema... | {
"fields": [
{
"declarator": "setting",
"modifier": "private final",
"original_string": "private final IteratorSetting setting;",
"type": "IteratorSetting",
"var_name": "setting"
}
],
"file": "store-implementation/accumulo-store/src/main/java/uk/gov/gchq/gaffer/accumulostore... | {
"body": "public IteratorSettingBuilder schema(final Schema schema) {\n try {\n setting.addOption(AccumuloStoreConstants.SCHEMA, new String(schema.toCompactJson(), CommonConstants.UTF_8));\n } catch (final UnsupportedEncodingException e) {\n throw new SchemaException(\"Unable to 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_562 | {
"fields": [],
"file": "core/type/src/test/java/uk/gov/gchq/gaffer/serialisation/FreqMapSerialiserTest.java",
"identifier": "FreqMapSerialiserTest",
"interfaces": "",
"superclass": "extends ToBytesSerialisationTest<FreqMap>"
} | {
"body": "@Test\n public void cantSerialiseStringClass() {\n assertFalse(serialiser.canHandle(String.class));\n }",
"class_method_signature": "FreqMapSerialiserTest.cantSerialiseStringClass()",
"constructor": false,
"full_signature": "@Test public void cantSerialiseStringClass()",
"identifier": ... | {
"fields": [
{
"declarator": "serialVersionUID = 6530929395214726384L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 6530929395214726384L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "longS... | {
"body": "@Override\n public boolean canHandle(final Class clazz) {\n return FreqMap.class.equals(clazz);\n }",
"class_method_signature": "FreqMapSerialiser.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_1233 | {
"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 shouldGetOperations() {\n // Given\n final GetElements getElements = new GetElements.Builder()\n .input(new EntitySeed(\"A\"))\n .build();\n\n final OperationChain opChain = new OperationChain.Builder()\n .first(new Ge... | {
"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 @JsonIgnore\n public Collection<Operation> getOperations() {\n final List<Operation> ops = new LinkedList<>();\n\n if (null == conditional) {\n ops.add(new OperationChain());\n } else {\n ops.add(OperationChain.wrap(conditional.getTransform()));\... | {
"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_83 | {
"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 testTraits() throws StoreException {\n final ParquetStore store = new ParquetStore();\n final Set<StoreTrait> expectedTraits = new HashSet<>();\n expectedTraits.add(StoreTrait.INGEST_AGGREGATION);\n expectedTraits.add(StoreTrait.PRE_AGGREGATION_FILTERING);... | {
"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": "@Override\n public Set<StoreTrait> getTraits() {\n return TRAITS;\n }",
"class_method_signature": "ParquetStore.getTraits()",
"constructor": false,
"full_signature": "@Override public Set<StoreTrait> getTraits()",
"identifier": "getTraits",
"invocations": [],
"modifiers": "@Overrid... | {
"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.