id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
47973088_623 | {
"fields": [
{
"declarator": "user = new User(\"user01\")",
"modifier": "private final",
"original_string": "private final User user = new User(\"user01\");",
"type": "User",
"var_name": "user"
},
{
"declarator": "context = new Context(user)",
"modifier": "privat... | {
"body": "@Test\n public void shouldFindInvalidSerialiser() throws Exception {\n final Class<StringToStringSerialiser> invalidSerialiserClass = StringToStringSerialiser.class;\n Schema invalidSchema = new Schema.Builder()\n .edge(TestGroups.EDGE, new SchemaEdgeDefinition.Builder()\n ... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(Store.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(Store.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": ... | {
"body": "public void initialise(final String graphId, final Schema schema, final StoreProperties properties) throws StoreException {\n LOGGER.debug(\"Initialising {}\", getClass().getSimpleName());\n if (null == graphId) {\n throw new IllegalArgumentException(\"graphId is required\");\n ... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_336 | {
"fields": [],
"file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/graph/adjacency/PrunedAdjacencyMapsTest.java",
"identifier": "PrunedAdjacencyMapsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldPrune() {\n // Given\n final AdjacencyMaps adjacencyMaps = new PrunedAdjacencyMaps();\n\n final AdjacencyMap first = new AdjacencyMap();\n first.putEdge(1, 2, makeEdge(1, 2));\n first.putEdge(1, 3, makeEdge(1, 3));\n\n final AdjacencyMa... | {
"fields": [
{
"declarator": "adjacencyMaps = new ArrayList<>()",
"modifier": "private final",
"original_string": "private final List<AdjacencyMap> adjacencyMaps = new ArrayList<>();",
"type": "List<AdjacencyMap>",
"var_name": "adjacencyMaps"
}
],
"file": "core/data/src/main... | {
"body": "@Override\n public void add(final AdjacencyMap adjacencyMap) {\n removeOrphans(adjacencyMaps, adjacencyMap);\n adjacencyMaps.add(adjacencyMap);\n }",
"class_method_signature": "PrunedAdjacencyMaps.add(final AdjacencyMap adjacencyMap)",
"constructor": false,
"full_signature": "@Ove... | {
"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_766 | {
"fields": [
{
"declarator": "store = mock(Store.class)",
"modifier": "private final",
"original_string": "private final Store store = mock(Store.class);",
"type": "Store",
"var_name": "store"
},
{
"declarator": "context = new Context(new User())",
"modifier": "p... | {
"body": "@Test\n public void shouldExecuteOtherwiseOperationWhenConditionNotMet() throws OperationException {\n // Given\n final Object input = Arrays.asList(new EntitySeed(\"1\"), new EntitySeed(\"2\"));\n final Conditional conditional = mock(Conditional.class);\n final Predicate<Obj... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/IfHandler.java",
"identifier": "IfHandler",
"interfaces": "implements OutputOperationHandler<If<Object, Object>, Object>",
"methods": [
{
"class_method_signature": "IfHandler.doOperation(final If operation, ... | {
"body": "@Override\n public Object doOperation(final If operation, final Context context, final Store store) throws OperationException {\n final Object input = operation.getInput();\n\n boolean computedCondition;\n\n if (null == operation.getCondition()) {\n if (null == operation.... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_418 | {
"fields": [],
"file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/element/function/ExtractIdTest.java",
"identifier": "ExtractIdTest",
"interfaces": "",
"superclass": "extends FunctionTest"
} | {
"body": "@Test\n public void shouldReturnNullWhenIdentifierTypeNotFoundInElement() {\n final Element element = mock(Element.class);\n final IdentifierType type = IdentifierType.VERTEX;\n final ExtractId extractor = new ExtractId(type);\n\n final Object result = extractor.apply(element... | {
"fields": [
{
"declarator": "id",
"modifier": "private",
"original_string": "private IdentifierType id;",
"type": "IdentifierType",
"var_name": "id"
}
],
"file": "core/data/src/main/java/uk/gov/gchq/gaffer/data/element/function/ExtractId.java",
"identifier": "ExtractId",
... | {
"body": "@Override\n public Object apply(final Element element) {\n return null != element ? element.getIdentifier(id) : null;\n }",
"class_method_signature": "ExtractId.apply(final Element element)",
"constructor": false,
"full_signature": "@Override public Object apply(final Element element)",
... | {
"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_1060 | {
"fields": [
{
"declarator": "historicSerialisationPairs",
"modifier": "private final",
"original_string": "private final Pair<Object, byte[]>[] historicSerialisationPairs;",
"type": "Pair<Object, byte[]>[]",
"var_name": "historicSerialisationPairs"
}
],
"file": "core/serial... | {
"body": "@Test\n public void shouldSerialiseObjectWithFieldX() throws Exception {\n // Given\n final SimpleTestObject obj = new SimpleTestObject();\n\n // When\n final String json = new String(JSONSerialiser.serialise(obj), CommonConstants.UTF_8);\n\n // Then\n assertTru... | {
"fields": [
{
"declarator": "JSON_SERIALISER_CLASS_KEY = \"gaffer.serialiser.json.class\"",
"modifier": "public static final",
"original_string": "public static final String JSON_SERIALISER_CLASS_KEY = \"gaffer.serialiser.json.class\";",
"type": "String",
"var_name": "JSON_SERIALIS... | {
"body": "public static byte[] serialise(final Object object, final String... fieldsToExclude) throws SerialisationException {\n return serialise(object, false, fieldsToExclude);\n }",
"class_method_signature": "JSONSerialiser.serialise(final Object object, final String... fieldsToExclude)",
"construct... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1125 | {
"fields": [
{
"declarator": "ADD_OPERATIONS_TO_CHAIN_RESOURCE_PATH = \"addOperationsToChain.json\"",
"modifier": "private static final",
"original_string": "private static final String ADD_OPERATIONS_TO_CHAIN_RESOURCE_PATH = \"addOperationsToChain.json\";",
"type": "String",
"var_n... | {
"body": "@Test\n public void shouldAddAllOperationsWithSecondAuthsGivenPath() throws IOException {\n // Given\n AddOperationsToChain hook = fromJson(ADD_OPERATIONS_TO_CHAIN_RESOURCE_PATH);\n\n User user = new User.Builder().opAuths(\"auth2\").build();\n\n Operation splitStore = new Sp... | {
"fields": [
{
"declarator": "defaultOperations = new AdditionalOperations()",
"modifier": "private final",
"original_string": "private final AdditionalOperations defaultOperations = new AdditionalOperations();",
"type": "AdditionalOperations",
"var_name": "defaultOperations"
},... | {
"body": "@Override\n public void preExecute(final OperationChain<?> opChain, final Context context) {\n final List<Operation> newOpList = new ArrayList<>();\n\n boolean hasAuth = false;\n if (!authorisedOps.isEmpty() && !context.getUser().getOpAuths().isEmpty()) {\n for (final Str... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_53 | {
"fields": [
{
"declarator": "TEST_GRAPH_ID = \"testGraphId\"",
"modifier": "private static final",
"original_string": "private static final String TEST_GRAPH_ID = \"testGraphId\";",
"type": "String",
"var_name": "TEST_GRAPH_ID"
},
{
"declarator": "user",
"modifi... | {
"body": "@Test\n public final void shouldMergeResultsFromFieldObjectsWithGivenGraphIds() throws Exception {\n // Given\n final Operation op = mock(Operation.class);\n final Operation opClone = mock(Operation.class);\n given(op.getOption(KEY_OPERATION_OPTIONS_GRAPH_IDS)).willReturn(\"1... | {
"fields": [],
"file": "store-implementation/federated-store/src/main/java/uk/gov/gchq/gaffer/federatedstore/operation/handler/FederatedOperationHandler.java",
"identifier": "FederatedOperationHandler",
"interfaces": "implements OperationHandler<Operation>",
"methods": [
{
"class_method_signature":... | {
"body": "public Object doOperation(final Operation operation, final Context context, final Store store) throws OperationException {\n final Collection<Graph> graphs = ((FederatedStore) store).getGraphs(context.getUser(), operation.getOption(KEY_OPERATION_OPTIONS_GRAPH_IDS), operation);\n for (final Gr... | {
"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_674 | {
"fields": [
{
"declarator": "schema = new Schema.Builder()\n .entity(TestGroups.ENTITY, new SchemaEntityDefinition.Builder()\n .vertex(TestTypes.ID_STRING)\n .build())\n .edge(TestGroups.EDGE, new SchemaEdgeDefinition.Builder()\n ... | {
"body": "@Test\n public void shouldThrowExceptionForNullInput() throws OperationException {\n // Given\n final AbstractSampleElementsForSplitPointsHandler<?, S> handler = createHandler();\n final SampleElementsForSplitPoints operation = new SampleElementsForSplitPoints.Builder<>()\n ... | {
"fields": [
{
"declarator": "MAX_SAMPLED_ELEMENTS_DEFAULT = 10000000",
"modifier": "public static final",
"original_string": "public static final int MAX_SAMPLED_ELEMENTS_DEFAULT = 10000000;",
"type": "int",
"var_name": "MAX_SAMPLED_ELEMENTS_DEFAULT"
},
{
"declarator"... | {
"body": "@Override\n public List<T> doOperation(final SampleElementsForSplitPoints<T> operation, final Context context, final Store store) throws OperationException {\n final S typedStore = (S) store;\n\n validate(operation, typedStore);\n\n final Integer numSplits = getNumSplits(operation, ... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_224 | {
"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 shouldReturnDescription() {\n // When\n final int status = service.getDescription().getStatus();\n final String description = service.getDescription().getEntity().toString();\n\n // Then\n assertEquals(200, status);\n assertEquals(\"test grap... | {
"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 getDescription() {\n return Response.ok(graphFactory.getGraph().getDescription())\n .header(GAFFER_MEDIA_TYPE_HEADER, GAFFER_MEDIA_TYPE)\n .build();\n }",
"class_method_signature": "GraphConfigurationServiceV2.getDescription()",
"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_731 | {
"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 shouldReturnIterableFromOperation() throws OperationException {\n // Given\n final Iterable<Iterable<Integer>> input = Arrays.asList(\n Arrays.asList(1, 2, 3),\n Arrays.asList(4, 5, 6),\n Arrays.asList(7, 8, 9));\n\n f... | {
"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_361 | {
"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 shouldCompareEqualStrings() {\n final ComparableOrToStringComparator comparator = new ComparableOrToStringComparator();\n\n final int result = comparator.compare(\"1\", \"1\");\n\n assertEquals(0, result);\n }",
"class_method_signature": "ComparableOrToStrin... | {
"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_1349 | {
"fields": [
{
"declarator": "SERIALISER = new ReservoirLongsSketchSerialiser()",
"modifier": "private static final",
"original_string": "private static final ReservoirLongsSketchSerialiser SERIALISER = new ReservoirLongsSketchSerialiser();",
"type": "ReservoirLongsSketchSerialiser",
... | {
"body": "@Test\n public void testCanHandleReservoirLongsUnion() {\n assertTrue(SERIALISER.canHandle(ReservoirLongsSketch.class));\n assertFalse(SERIALISER.canHandle(String.class));\n }",
"class_method_signature": "ReservoirLongsSketchSerialiserTest.testCanHandleReservoirLongsUnion()",
"const... | {
"fields": [
{
"declarator": "serialVersionUID = 2492278033004791488L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 2492278033004791488L;",
"type": "long",
"var_name": "serialVersionUID"
}
],
"file": "library/sketches-... | {
"body": "@Override\n public boolean canHandle(final Class clazz) {\n return ReservoirLongsSketch.class.equals(clazz);\n }",
"class_method_signature": "ReservoirLongsSketchSerialiser.canHandle(final Class clazz)",
"constructor": false,
"full_signature": "@Override public boolean canHandle(final Cl... | {
"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_875 | {
"fields": [
{
"declarator": "namedViewCache = new NamedViewCache()",
"modifier": "private final",
"original_string": "private final NamedViewCache namedViewCache = new NamedViewCache();",
"type": "NamedViewCache",
"var_name": "namedViewCache"
},
{
"declarator": "handl... | {
"body": "@Test\n public void shouldNotAddNestedNamedView() throws OperationException {\n final NamedView nestedNamedView = new NamedView.Builder()\n .name(testNamedViewName + 1)\n .edge(TestGroups.EDGE)\n .build();\n\n addNamedView = new AddNamedView.Bui... | {
"fields": [
{
"declarator": "cache",
"modifier": "private final",
"original_string": "private final NamedViewCache cache;",
"type": "NamedViewCache",
"var_name": "cache"
}
],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/named/AddNamedViewHand... | {
"body": "@Override\n public Object doOperation(final AddNamedView operation, final Context context, final Store store) throws OperationException {\n if (null == operation.getName() || operation.getName().isEmpty()) {\n throw new IllegalArgumentException(\"NamedView name must be set and not empt... | {
"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_176 | {
"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 shouldDoNothingIfNoSeedsProvided() throws OperationException {\n // Given\n final GetElementsHandler handler = new GetElementsHandler();\n final GetElements getElements = new GetElements();\n final Context context = mock(Context.class);\n final HBas... | {
"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_2 | {
"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 shouldReturnFalseForUserWhoIsNotResourceCreator() {\n assertFalse(createAccessPredicate(TEST_USER.getUserId(), NO_AUTHS, NON_PUBLIC).test(new User.Builder().userId(\"AnotherUser\").build(), null));\n }",
"class_method_signature": "FederatedGraphReadAccessPredicateTest.sho... | {
"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_526 | {
"fields": [
{
"declarator": "INVALID_STRING = \"inv@l1dStr|ng&^\"",
"modifier": "private static final",
"original_string": "private static final String INVALID_STRING = \"inv@l1dStr|ng&^\";",
"type": "String",
"var_name": "INVALID_STRING"
},
{
"declarator": "VALID_STR... | {
"body": "@Test\n public void shouldThrowExceptionWithInvalidStringName() {\n final Exception exception = assertThrows(IllegalArgumentException.class, () -> GroupUtil.validateName(INVALID_STRING));\n\n final String expected = \"Group is invalid: inv@l1dStr|ng&^, it must match regex: [a-zA-Z0-9|-]*\"... | {
"fields": [
{
"declarator": "PROPERTY_ALLOWED_CHARACTERS = Pattern.compile(\"[a-zA-Z0-9|-]*\")",
"modifier": "private static final",
"original_string": "private static final Pattern PROPERTY_ALLOWED_CHARACTERS = Pattern.compile(\"[a-zA-Z0-9|-]*\");",
"type": "Pattern",
"var_name": ... | {
"body": "public static void validateName(final String group) {\n if (!PROPERTY_ALLOWED_CHARACTERS.matcher(group).matches()) {\n throw new IllegalArgumentException(\"Group is invalid: \" + group + \", it must match regex: \" + PROPERTY_ALLOWED_CHARACTERS);\n }\n }",
"class_method_signat... | {
"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_463 | {
"fields": [],
"file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/JsonUtilTest.java",
"identifier": "JsonUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnFalseWhenActualObjectIsNull() {\n final String json1 = \"{\\\"a\\\": 1, \\\"b\\\": 2}\";\n\n assertFalse(JsonUtil.equals(json1, null));\n assertFalse(JsonUtil.equals(json1.getBytes(), null));\n\n JsonAssert.assertNotEqual(json1, null);\n ... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(JsonUtil.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(JsonUtil.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declara... | {
"body": "public static boolean equals(final String expectedJson, final String actualJson) {\n try {\n final Map expectedSchemaMap = null != expectedJson ? OBJECT_MAPPER.readValue(expectedJson, Map.class) : Collections.emptyMap();\n final Map actualSchemaMap = null != actualJson ? OBJECT... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_199 | {
"fields": [
{
"declarator": "SCHEMA = new Schema.Builder()\n .type(\"string\", String.class)\n .type(\"type\", Boolean.class)\n .edge(TestGroups.EDGE, new SchemaEdgeDefinition.Builder()\n .source(\"string\")\n .destination(\"string\")\... | {
"body": "@Test\n public void shouldConstructWithSchema() throws OperationException, SerialisationException {\n final ValidationProcessor processor = new ValidationProcessor(SCHEMA);\n assertEquals(SCHEMA, processor.getSchema());\n }",
"class_method_signature": "ValidationProcessorTest.shouldCo... | {
"fields": [
{
"declarator": "validator",
"modifier": "private final",
"original_string": "private final ElementValidator validator;",
"type": "ElementValidator",
"var_name": "validator"
}
],
"file": "store-implementation/hbase-store/src/main/java/uk/gov/gchq/gaffer/hbasesto... | {
"body": "public Schema getSchema() {\n return validator.getSchema();\n }",
"class_method_signature": "ValidationProcessor.getSchema()",
"constructor": false,
"full_signature": "public Schema getSchema()",
"identifier": "getSchema",
"invocations": [
"getSchema"
],
"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_930 | {
"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 shouldValidateAndReturnFalseWhenTimestampGroupByPropertyUsedInEntity() {\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_1298 | {
"fields": [
{
"declarator": "timestamps",
"modifier": "private",
"original_string": "private RBMBackedTimestampSet timestamps;",
"type": "RBMBackedTimestampSet",
"var_name": "timestamps"
},
{
"declarator": "predicate",
"modifier": "private",
"original_stri... | {
"body": "@Test\n public void shouldSetIncludeAllTimestampsToFalseByDefaultWhenDeserialising() throws IOException {\n // Given\n String serialised = \"{\" +\n \"\\\"class\\\":\\\"uk.gov.gchq.gaffer.time.predicate.RBMBackedTimestampSetInRange\\\",\" +\n \"\\\"startTime\\... | {
"fields": [
{
"declarator": "startTime",
"modifier": "private",
"original_string": "private Number startTime;",
"type": "Number",
"var_name": "startTime"
},
{
"declarator": "endTime",
"modifier": "private",
"original_string": "private Number endTime;",
... | {
"body": "public Boolean isIncludeAllTimestamps() {\n return includeAllTimestamps;\n }",
"class_method_signature": "RBMBackedTimestampSetInRange.isIncludeAllTimestamps()",
"constructor": false,
"full_signature": "public Boolean isIncludeAllTimestamps()",
"identifier": "isIncludeAllTimestamps",
"i... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1332 | {
"fields": [],
"file": "library/spark/spark-library/src/test/java/uk/gov/gchq/gaffer/spark/operation/graphframe/GetGraphFrameOfElementsTest.java",
"identifier": "GetGraphFrameOfElementsTest",
"interfaces": "",
"superclass": "extends OperationTest<GetGraphFrameOfElements>"
} | {
"body": "@Test\n public void shouldValidateOperationIfViewDoesNotContainEdgesOrEntities() {\n // Given\n final GetGraphFrameOfElements opWithEdgesOnly = new GetGraphFrameOfElements.Builder()\n .view(new View.Builder()\n .edge(TestGroups.EDGE)\n ... | {
"fields": [
{
"declarator": "converters",
"modifier": "private",
"original_string": "private List<Converter> converters;",
"type": "List<Converter>",
"var_name": "converters"
},
{
"declarator": "options",
"modifier": "private",
"original_string": "private ... | {
"body": "@Override\n public ValidationResult validate() {\n final ValidationResult result = Output.super.validate();\n\n if (result.isValid() && !view.hasEdges() && !view.hasEntities()) {\n result.addError(\"Cannot create a GraphFrame unless the View contains edges or entities.\");\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_1277 | {
"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 shouldAllowAgedOffValuesToBeReplaced() throws CacheOperationException {\n // given\n String filePath = new File(\"src/test/resources/cache.ccf\").getAbsolutePath();\n serviceProps.setProperty(CacheProperties.CACHE_CONFIG_FILE, filePath);\n service.initiali... | {
"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_28 | {
"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 shouldUpdateSchemaWhenNewGraphIsAdded() throws Exception {\n // Given\n addGraphWithPaths(ACC_ID_1, PROPERTIES_ALT, PATH_BASIC_ENTITY_SCHEMA_JSON);\n Schema before = store.getSchema((Operation) null, blankUser);\n addGraphWithPaths(ACC_ID_2, PROPERTIES_ALT... | {
"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 Schema getSchema() {\n return getSchema((Map<String, String>) null, (User) null);\n }",
"class_method_signature": "FederatedStore.getSchema()",
"constructor": false,
"full_signature": "@Override public Schema getSchema()",
"identifier": "getSchema",
"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_571 | {
"fields": [],
"file": "core/type/src/test/java/uk/gov/gchq/gaffer/types/CustomMapTest.java",
"identifier": "CustomMapTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldJSONSerialiseBigIntString() throws IOException {\n //given\n final CustomMap<TreeSet<String>, Double> expectedMap = new CustomMap<>(new TreeSetStringSerialiser(), new DoubleSerialiser());\n final TreeSet<String> key1 = new TreeSet<>();\n key1.add(\"k... | {
"fields": [
{
"declarator": "keySerialiser",
"modifier": "private final",
"original_string": "private final ToBytesSerialiser<? super K> keySerialiser;",
"type": "ToBytesSerialiser<? super K>",
"var_name": "keySerialiser"
},
{
"declarator": "valueSerialiser",
"m... | {
"body": "public V put(final K key, final V value) {\n return delegateMap.put(key, value);\n }",
"class_method_signature": "CustomMap.put(final K key, final V value)",
"constructor": false,
"full_signature": "public V put(final K key, final V value)",
"identifier": "put",
"invocations": [
"pu... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_121 | {
"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 shouldPassWithSameBackingArrayButDifferentOffsets() throws Exception {\n br1 = new BytesAndRange(e, 0, 5);\n br2 = new BytesAndRange(e, 5, 5);\n assertTrue(ByteUtils.areKeyBytesEqual(br1, br2));\n }",
"class_method_signature": "ByteUtilsTest.shouldPassWithSa... | {
"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_988 | {
"fields": [],
"file": "core/serialisation/src/test/java/uk/gov/gchq/gaffer/serialisation/util/JsonSerialisationUtilTest.java",
"identifier": "JsonSerialisationUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testClassWithJsonAnnotations() {\n // Given\n final String className = ClassWithAnnotations.class.getName();\n\n // When\n final Map<String, String> result = JsonSerialisationUtil.getSerialisedFieldClasses(className);\n\n // Then\n final Map<... | {
"fields": [
{
"declarator": "cache = Collections.emptyMap()",
"modifier": "private static",
"original_string": "private static Map<String, Map<String, String>> cache = Collections.emptyMap();",
"type": "Map<String, Map<String, String>>",
"var_name": "cache"
}
],
"file": "co... | {
"body": "public static Map<String, String> getSerialisedFieldClasses(final String className) {\n final Map<String, String> cachedResult = cache.get(className);\n if (null != cachedResult) {\n return cachedResult;\n }\n\n final Class<?> clazz;\n try {\n clazz ... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_822 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/handler/output/ToCsvHandlerTest.java",
"identifier": "ToCsvHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldConvertToCsvWithHeader() throws OperationException {\n // Given\n final List<Element> elements = Lists.newArrayList(\n makeEntity(\"vertex1\", \"count\", 1),\n makeEntity(\"vertex2\"),\n makeEdge(\"source1\", \"count\",... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/output/ToCsvHandler.java",
"identifier": "ToCsvHandler",
"interfaces": "implements OutputOperationHandler<ToCsv, Iterable<? extends String>>",
"methods": [
{
"class_method_signature": "ToCsvHandler.doOperati... | {
"body": "@Override\n public Iterable<? extends String> doOperation(final ToCsv operation, final Context context, final Store store) throws OperationException {\n if (null == operation.getInput()) {\n return null;\n }\n\n if (null == operation.getElementGenerator()) {\n ... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1109 | {
"fields": [
{
"declarator": "NAMED_VIEW_NAME = \"namedViewName\"",
"modifier": "private static final",
"original_string": "private static final String NAMED_VIEW_NAME = \"namedViewName\";",
"type": "String",
"var_name": "NAMED_VIEW_NAME"
},
{
"declarator": "NESTED_NAM... | {
"body": "@Test\n public void shouldBuildFullViewWhenANamedViewNeedingToBeResolvedAndMergedIsSupplied() throws CacheOperationFailedException, SerialisationException {\n // Given\n final View viewToMerge = new View.Builder().edge(TestGroups.EDGE).build();\n final NamedViewDetail namedViewDetai... | {
"fields": [
{
"declarator": "cache",
"modifier": "private final",
"original_string": "private final NamedViewCache cache;",
"type": "NamedViewCache",
"var_name": "cache"
}
],
"file": "core/graph/src/main/java/uk/gov/gchq/gaffer/graph/hook/NamedViewResolver.java",
"identif... | {
"body": "@Override\n public void preExecute(final OperationChain<?> opChain, final Context context) {\n resolveViews(opChain, context);\n }",
"class_method_signature": "NamedViewResolver.preExecute(final OperationChain<?> opChain, final Context context)",
"constructor": false,
"full_signature": "... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_967 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/schema/SchemaElementDefinitionValidatorTest.java",
"identifier": "SchemaElementDefinitionValidatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldValidateAndReturnTrueWhenAggregationIsDisabled() {\n // Given\n final SchemaElementDefinition elementDef = mock(SchemaElementDefinition.class);\n final SchemaElementDefinitionValidator validator = new SchemaElementDefinitionValidator();\n final Map<S... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(SchemaElementDefinitionValidator.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(SchemaElementDefinitionValidator.class);",
"type": "Logger",
... | {
"body": "public ValidationResult validate(final SchemaElementDefinition elementDef) {\n final ValidationResult result = new ValidationResult();\n\n final ElementFilter validator = elementDef.getValidator();\n final ElementAggregator aggregator = elementDef.getFullAggregator();\n result.a... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_434 | {
"fields": [],
"file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/element/LazyEdgeTest.java",
"identifier": "LazyEdgeTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldDelegateGetGroupToEdge() {\n // Given\n final ElementValueLoader edgeLoader = mock(ElementValueLoader.class);\n final String group = \"group\";\n final Edge edge = new Edge.Builder().group(group).build();\n final LazyEdge lazyEdge = new LazyEd... | {
"fields": [
{
"declarator": "serialVersionUID = 3950963135470686691L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 3950963135470686691L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "edge"... | {
"body": "@Override\n public String getGroup() {\n return edge.getGroup();\n }",
"class_method_signature": "LazyEdge.getGroup()",
"constructor": false,
"full_signature": "@Override public String getGroup()",
"identifier": "getGroup",
"invocations": [
"getGroup"
],
"modifiers": "@Overri... | {
"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_1365 | {
"fields": [
{
"declarator": "SERIALISER = new HllSketchSerialiser()",
"modifier": "private static final",
"original_string": "private static final HllSketchSerialiser SERIALISER = new HllSketchSerialiser();",
"type": "HllSketchSerialiser",
"var_name": "SERIALISER"
},
{
... | {
"body": "@Test\n public void testCanHandleHllSketch() {\n assertTrue(SERIALISER.canHandle(HllSketch.class));\n assertFalse(SERIALISER.canHandle(String.class));\n }",
"class_method_signature": "HllSketchSerialiserTest.testCanHandleHllSketch()",
"constructor": false,
"full_signature": "@Test... | {
"fields": [
{
"declarator": "serialVersionUID = 5903372368174309494L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 5903372368174309494L;",
"type": "long",
"var_name": "serialVersionUID"
}
],
"file": "library/sketches-... | {
"body": "@Override\n public boolean canHandle(final Class clazz) {\n return HllSketch.class.equals(clazz);\n }",
"class_method_signature": "HllSketchSerialiser.canHandle(final Class clazz)",
"constructor": false,
"full_signature": "@Override public boolean canHandle(final Class clazz)",
"identi... | {
"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_90 | {
"fields": [],
"file": "store-implementation/parquet-store/src/test/java/uk/gov/gchq/gaffer/parquetstore/partitioner/GroupPartitionerTest.java",
"identifier": "GroupPartitionerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testEmptyListIsValid() {\n // Given\n final GroupPartitioner partitioner = new GroupPartitioner(\"GROUP\", new ArrayList<>());\n\n // When\n final int size = partitioner.getSplitPoints().size();\n\n // Then\n assertEquals(0, size);\n }",
... | {
"fields": [
{
"declarator": "group",
"modifier": "private final",
"original_string": "private final String group;",
"type": "String",
"var_name": "group"
},
{
"declarator": "splitPoints",
"modifier": "private final",
"original_string": "private final List<... | {
"body": "public List<PartitionKey> getSplitPoints() {\n return splitPoints;\n }",
"class_method_signature": "GroupPartitioner.getSplitPoints()",
"constructor": false,
"full_signature": "public List<PartitionKey> getSplitPoints()",
"identifier": "getSplitPoints",
"invocations": [],
"modifiers":... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_208 | {
"fields": [
{
"declarator": "SCHEMA = new Schema.Builder()\n .type(\"string\", String.class)\n .type(\"type\", Boolean.class)\n .edge(TestGroups.EDGE, new SchemaEdgeDefinition.Builder()\n .source(\"string\")\n .destination(\"string\")\... | {
"body": "@Test\n public void shouldNotFilterOutValidEdge() throws OperationException, SerialisationException {\n // Given\n final PostAggregationFilterProcessor processor = new PostAggregationFilterProcessor(VIEW);\n\n // When / Then\n assertTrue(processor.test(CellUtil.getLazyCell(\n... | {
"fields": [
{
"declarator": "validator",
"modifier": "private final",
"original_string": "private final ElementValidator validator;",
"type": "ElementValidator",
"var_name": "validator"
}
],
"file": "store-implementation/hbase-store/src/main/java/uk/gov/gchq/gaffer/hbasesto... | {
"body": "@Override\n public boolean test(final LazyElementCell elementCell) {\n return validator.validateAggregation(elementCell.getElement());\n }",
"class_method_signature": "PostAggregationFilterProcessor.test(final LazyElementCell elementCell)",
"constructor": false,
"full_signature": "@Overr... | {
"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_658 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/resolver/DefaultScoreResolverTest.java",
"identifier": "DefaultScoreResolverTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnZeroForANullOperationChain() throws OperationException {\n // Given\n final DefaultScoreResolver scoreResolver = new DefaultScoreResolver();\n\n final OperationChain opChain = null;\n\n // When\n final Object result = scoreResolver.getSc... | {
"fields": [
{
"declarator": "DEFAULT_OPERATION_SCORE = 1",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_OPERATION_SCORE = 1;",
"type": "int",
"var_name": "DEFAULT_OPERATION_SCORE"
},
{
"declarator": "scoreResolvers",
"mo... | {
"body": "@Override\n public Integer getScore(final Operation operation) {\n if (null == operation) {\n return 0;\n }\n\n // Named operations should use their custom resolver despite implementing Operations\n if (operation instanceof Operations && !(operation instanceof Name... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1220 | {
"fields": [],
"file": "core/operation/src/test/java/uk/gov/gchq/gaffer/operation/impl/get/GetElementsTest.java",
"identifier": "GetElementsTest",
"interfaces": "",
"superclass": "extends OperationTest<GetElements>"
} | {
"body": "@Test\n public void shouldSetSeedMatchingTypeToRelated() {\n final ElementId elementId1 = new EntitySeed(\"identifier\");\n final ElementId elementId2 = new EdgeSeed(\"source2\", \"destination2\", true);\n\n // When\n final GetElements op = new GetElements.Builder()\n ... | {
"fields": [
{
"declarator": "seedMatching",
"modifier": "private",
"original_string": "private SeedMatchingType seedMatching;",
"type": "SeedMatchingType",
"var_name": "seedMatching"
},
{
"declarator": "view",
"modifier": "private",
"original_string": "pri... | {
"body": "@Deprecated\n @Override\n public SeedMatchingType getSeedMatching() {\n return seedMatching;\n }",
"class_method_signature": "GetElements.getSeedMatching()",
"constructor": false,
"full_signature": "@Deprecated @Override public SeedMatchingType getSeedMatching()",
"identifier": "get... | {
"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_834 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/handler/output/ToMapHandlerTest.java",
"identifier": "ToMapHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldConvertElementToMap() throws OperationException {\n // Given\n final Entity entity = new Entity.Builder().group(TestGroups.ENTITY)\n .vertex(1)\n .build();\n\n ... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/output/ToMapHandler.java",
"identifier": "ToMapHandler",
"interfaces": "implements OutputOperationHandler<ToMap, Iterable<? extends Map<String, Object>>>",
"methods": [
{
"class_method_signature": "ToMapHand... | {
"body": "@Override\n public Iterable<? extends Map<String, Object>> doOperation(final ToMap operation, final Context context, final Store store) throws OperationException {\n if (null == operation.getInput()) {\n return null;\n }\n\n return operation.getElementGenerator().apply(op... | {
"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_137 | {
"fields": [
{
"declarator": "GRAPH_ID = \"graph1\"",
"modifier": "private static final",
"original_string": "private static final String GRAPH_ID = \"graph1\";",
"type": "String",
"var_name": "GRAPH_ID"
},
{
"declarator": "LOCALITY_GRAPH_ID = \"localityTest\"",
... | {
"body": "@Test\n public void shouldThrowExceptionIfTableNameIsNotSpecifiedWhenCreatingTable() throws StoreException, TableExistsException {\n // Given\n final Schema schema = new Schema.Builder()\n .type(\"int\", Integer.class)\n .type(\"string\", String.class)\n ... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(TableUtils.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(TableUtils.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"dec... | {
"body": "public static synchronized void createTable(final AccumuloStore store)\n throws StoreException, TableExistsException {\n // Create table and namespace (if provided)\n final String tableName = store.getTableName();\n if (null == tableName) {\n throw new AccumuloRun... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_567 | {
"fields": [
{
"declarator": "SERIALISER = new TypeSubTypeValueSerialiser()",
"modifier": "private static final",
"original_string": "private static final TypeSubTypeValueSerialiser SERIALISER = new TypeSubTypeValueSerialiser();",
"type": "TypeSubTypeValueSerialiser",
"var_name": "S... | {
"body": "@Test\n @Override\n public void shouldDeserialiseEmpty() {\n final TypeSubTypeValue value = SERIALISER.deserialiseEmpty();\n\n assertEquals(new TypeSubTypeValue(), value);\n }",
"class_method_signature": "TypeSubTypeValueSerialiserTest.shouldDeserialiseEmpty()",
"constructor": fa... | {
"fields": [
{
"declarator": "serialVersionUID = 4687862916179832187L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 4687862916179832187L;",
"type": "long",
"var_name": "serialVersionUID"
}
],
"file": "core/type/src/mai... | {
"body": "@Override\n public TypeSubTypeValue deserialiseEmpty() {\n return new TypeSubTypeValue();\n }",
"class_method_signature": "TypeSubTypeValueSerialiser.deserialiseEmpty()",
"constructor": false,
"full_signature": "@Override public TypeSubTypeValue deserialiseEmpty()",
"identifier": "dese... | {
"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_588 | {
"fields": [],
"file": "core/type/src/test/java/uk/gov/gchq/gaffer/types/function/ToTypeValueTest.java",
"identifier": "ToTypeValueTest",
"interfaces": "",
"superclass": "extends FunctionTest"
} | {
"body": "@Test\n public void shouldConvertObjectToTypeValue() {\n // Given\n final ToTypeValue function = new ToTypeValue();\n final Object value = 1L;\n\n // When\n final TypeValue result = function.apply(value);\n\n // Then\n assertEquals(new TypeValue(null, val... | {
"fields": [],
"file": "core/type/src/main/java/uk/gov/gchq/gaffer/types/function/ToTypeValue.java",
"identifier": "ToTypeValue",
"interfaces": "",
"methods": [
{
"class_method_signature": "ToTypeValue.apply(final Object value)",
"constructor": false,
"full_signature": "@Override public... | {
"body": "@Override\n public TypeValue apply(final Object value) {\n return new TypeValue(null, null != value ? value.toString() : null);\n }",
"class_method_signature": "ToTypeValue.apply(final Object value)",
"constructor": false,
"full_signature": "@Override public TypeValue apply(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_422 | {
"fields": [],
"file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/element/function/ExtractGroupTest.java",
"identifier": "ExtractGroupTest",
"interfaces": "",
"superclass": "extends FunctionTest"
} | {
"body": "@Test\n public void shouldReturnGroupFromEntity() {\n // Given\n final ExtractGroup function = new ExtractGroup();\n final String group = \"testGroup_2\";\n final Entity entity = new Entity.Builder()\n .vertex(\"1\")\n .group(group)\n ... | {
"fields": [],
"file": "core/data/src/main/java/uk/gov/gchq/gaffer/data/element/function/ExtractGroup.java",
"identifier": "ExtractGroup",
"interfaces": "",
"methods": [
{
"class_method_signature": "ExtractGroup.apply(final Element element)",
"constructor": false,
"full_signature": "@Ov... | {
"body": "@Override\n public String apply(final Element element) {\n return null != element ? element.getGroup() : null;\n }",
"class_method_signature": "ExtractGroup.apply(final Element element)",
"constructor": false,
"full_signature": "@Override public String apply(final Element element)",
"i... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_971 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/schema/SchemaElementDefinitionValidatorTest.java",
"identifier": "SchemaElementDefinitionValidatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldValidateAndReturnTrueWhenNoPropertiesSoAggregatorIsValid() {\n // Given\n final SchemaElementDefinition elementDef = mock(SchemaElementDefinition.class);\n final SchemaElementDefinitionValidator validator = new SchemaElementDefinitionValidator();\n\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": "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_86 | {
"fields": [],
"file": "store-implementation/parquet-store/src/test/java/uk/gov/gchq/gaffer/parquetstore/partitioner/GroupPartitionerTest.java",
"identifier": "GroupPartitionerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldCorrectlyAssignPartitionIDs() {\n // Given\n final PartitionKey key1 = new PartitionKey(new Object[]{1L, \"B\"});\n final PartitionKey key2 = new PartitionKey(new Object[]{5L, \"A\"});\n final PartitionKey key3 = new PartitionKey(new Object[]{100L, \... | {
"fields": [
{
"declarator": "group",
"modifier": "private final",
"original_string": "private final String group;",
"type": "String",
"var_name": "group"
},
{
"declarator": "splitPoints",
"modifier": "private final",
"original_string": "private final List<... | {
"body": "public int getPartitionId(final PartitionKey partitionKey) {\n int result = 0;\n for (final PartitionKey key : splitPoints) {\n if (partitionKey.compareTo(key) < 0) {\n return result;\n }\n result++;\n }\n return result;\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_1373 | {
"fields": [],
"file": "library/sketches-library/src/test/java/uk/gov/gchq/gaffer/sketches/clearspring/cardinality/serialisation/HyperLogLogPlusSerialiserTest.java",
"identifier": "HyperLogLogPlusSerialiserTest",
"interfaces": "",
"superclass": "extends ViaCalculatedValueSerialiserTest<HyperLogLogPlus, Long>... | {
"body": "@Test\n public void testCanHandleHyperLogLogPlus() {\n assertTrue(serialiser.canHandle(HyperLogLogPlus.class));\n }",
"class_method_signature": "HyperLogLogPlusSerialiserTest.testCanHandleHyperLogLogPlus()",
"constructor": false,
"full_signature": "@Test public void testCanHandleHyperLog... | {
"fields": [
{
"declarator": "serialVersionUID = 2782098698280905174L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 2782098698280905174L;",
"type": "long",
"var_name": "serialVersionUID"
}
],
"file": "library/sketches-... | {
"body": "@Override\n public boolean canHandle(final Class clazz) {\n return HyperLogLogPlus.class.equals(clazz);\n }",
"class_method_signature": "HyperLogLogPlusSerialiser.canHandle(final Class clazz)",
"constructor": false,
"full_signature": "@Override public boolean canHandle(final Class clazz)... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1236 | {
"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 shouldThrowErrorForTryingToUpdateOperationsWithTooManyOps() {\n // Given\n final GetElements getElements = new GetElements.Builder()\n .input(new EntitySeed(\"2\"))\n .build();\n\n final GetAllElements getAllElements = new GetAllElem... | {
"fields": [
{
"declarator": "condition",
"modifier": "private",
"original_string": "private Boolean condition;",
"type": "Boolean",
"var_name": "condition"
},
{
"declarator": "conditional",
"modifier": "private",
"original_string": "private Conditional con... | {
"body": "@Override\n public void updateOperations(final Collection<Operation> operations) {\n if (null == operations || 3 != operations.size()) {\n throw new IllegalArgumentException(\"Unable to update operations - exactly 3 operations are required. Received \" + (null != operations ? operation... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_69 | {
"fields": [
{
"declarator": "props",
"modifier": "private",
"original_string": "private ParquetStoreProperties props;",
"type": "ParquetStoreProperties",
"var_name": "props"
}
],
"file": "store-implementation/parquet-store/src/test/java/uk/gov/gchq/gaffer/parquetstore/Parqu... | {
"body": "@Test\n public void shouldMergeParquetJsonModules() {\n // Given\n props.setJsonSerialiserModules(TestCustomJsonModules1.class.getName() + \",\" + TestCustomJsonModules2.class.getName());\n\n // When\n final String modules = props.getJsonSerialiserModules();\n\n // The... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(ParquetStoreProperties.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(ParquetStoreProperties.class);",
"type": "Logger",
"var_name": "LOGGER"... | {
"body": "@Override\n public String getJsonSerialiserModules() {\n return new StringDeduplicateConcat().apply(\n SketchesJsonModules.class.getName(),\n super.getJsonSerialiserModules()\n );\n }",
"class_method_signature": "ParquetStoreProperties.getJsonSerialiserMo... | {
"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_530 | {
"fields": [],
"file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/iterable/WrappedCloseableIteratorTest.java",
"identifier": "WrappedCloseableIteratorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldDoNothingWhenCloseCalledOnNoncloseableIterator() {\n final Iterator<Object> iterator = mock(Iterator.class);\n final WrappedCloseableIterator<Object> wrappedIterator = new WrappedCloseableIterator<>(iterator);\n\n assertDoesNotThrow(() -> wrappedIterator.cl... | {
"fields": [
{
"declarator": "iterator",
"modifier": "private final",
"original_string": "private final Iterator<T> iterator;",
"type": "Iterator<T>",
"var_name": "iterator"
}
],
"file": "core/common-util/src/main/java/uk/gov/gchq/gaffer/commonutil/iterable/WrappedCloseableI... | {
"body": "@Override\n public void close() {\n CloseableUtil.close(iterator);\n }",
"class_method_signature": "WrappedCloseableIterator.close()",
"constructor": false,
"full_signature": "@Override public void close()",
"identifier": "close",
"invocations": [
"close"
],
"modifiers": "@Ov... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_160 | {
"fields": [
{
"declarator": "serialisation",
"modifier": "private",
"original_string": "private ElementSerialisation serialisation;",
"type": "ElementSerialisation",
"var_name": "serialisation"
}
],
"file": "store-implementation/hbase-store/src/test/java/uk/gov/gchq/gaffer/... | {
"body": "@Test\n public void shouldBuildTimestampFromProperty() throws Exception {\n // Given\n // add extra timestamp property to schema\n final Schema schema = new Schema.Builder()\n .json(StreamUtil.schemas(getClass()))\n .build();\n serialisation = ne... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(ElementSerialisation.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(ElementSerialisation.class);",
"type": "Logger",
"var_name": "LOGGER"
... | {
"body": "public long getTimestamp(final Element element) throws SerialisationException {\n return getTimestamp(element.getProperties());\n }",
"class_method_signature": "ElementSerialisation.getTimestamp(final Element element)",
"constructor": false,
"full_signature": "public long getTimestamp(final... | {
"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_863 | {
"fields": [
{
"declarator": "cache",
"modifier": "private static",
"original_string": "private static NamedViewCache cache;",
"type": "NamedViewCache",
"var_name": "cache"
},
{
"declarator": "GAFFER_USER = \"gaffer user\"",
"modifier": "private static final",
... | {
"body": "@Test\n public void shouldReturnEmptySetIfThereAreNoOperationsInTheCache() throws CacheOperationFailedException {\n CloseableIterable<NamedViewDetail> views = cache.getAllNamedViews(standardUser);\n assertEquals(0, Iterables.size(views));\n }",
"class_method_signature": "NamedViewCach... | {
"fields": [
{
"declarator": "CACHE_NAME = \"NamedView\"",
"modifier": "private static final",
"original_string": "private static final String CACHE_NAME = \"NamedView\";",
"type": "String",
"var_name": "CACHE_NAME"
}
],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/s... | {
"body": "@Deprecated\n public CloseableIterable<NamedViewDetail> getAllNamedViews() throws CacheOperationFailedException {\n final Set<String> keys = CacheServiceLoader.getService().getAllKeysFromCache(CACHE_NAME);\n final Set<NamedViewDetail> views = new HashSet<>();\n for (final String key... | {
"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_1148 | {
"fields": [],
"file": "core/operation/src/test/java/uk/gov/gchq/gaffer/operation/data/EntitySeedTest.java",
"identifier": "EntitySeedTest",
"interfaces": "",
"superclass": "extends JSONSerialisationTest<EntitySeed>"
} | {
"body": "@Test\n public void shouldNotBeEqualWhenVerticesEqual() {\n // Given\n final EntityId seed1 = new EntitySeed(\"vertex\");\n final EntityId seed2 = new EntitySeed(\"other vertex\");\n\n // Then\n assertNotEquals(seed1, seed2);\n assertNotEquals(seed1.hashCode(), ... | {
"fields": [
{
"declarator": "serialVersionUID = -1668220155074029644L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -1668220155074029644L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "ver... | {
"body": "@Override\n public int hashCode() {\n return Objects.hashCode(vertex);\n }",
"class_method_signature": "EntitySeed.hashCode()",
"constructor": false,
"full_signature": "@Override public int hashCode()",
"identifier": "hashCode",
"invocations": [
"hashCode"
],
"modifiers": "@O... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_926 | {
"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 shouldValidateAndReturnTrueWhenEdgeTransformerResult() {\n // Given\n final ViewValidator validator = new ViewValidator();\n final View view = new View.Builder()\n .edge(TestGroups.EDGE, new ViewElementDefinition.Builder()\n ... | {
"fields": [
{
"declarator": "SKIP_VIEW_VALIDATION = \"skipViewValidation\"",
"modifier": "public static final",
"original_string": "public static final String SKIP_VIEW_VALIDATION = \"skipViewValidation\";",
"type": "String",
"var_name": "SKIP_VIEW_VALIDATION"
},
{
"d... | {
"body": "public ValidationResult validate(final View view, final Schema schema, final Set<StoreTrait> storeTraits) {\n final boolean isStoreOrdered = storeTraits.contains(StoreTrait.ORDERED);\n\n final ValidationResult result = new ValidationResult();\n\n if (null != view) {\n valida... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_475 | {
"fields": [
{
"declarator": "abs",
"modifier": "",
"original_string": "ArrayByteSequence abs;",
"type": "ArrayByteSequence",
"var_name": "abs"
},
{
"declarator": "data",
"modifier": "",
"original_string": "byte[] data;",
"type": "byte[]",
"var_... | {
"body": "@Test\n public void testToString() {\n assertEquals(\"\", new ArrayByteSequence(\"\").toString(), \"String conversion should round trip correctly\");\n }",
"class_method_signature": "ArrayByteSequenceTest.testToString()",
"constructor": false,
"full_signature": "@Test public void testToS... | {
"fields": [
{
"declarator": "serialVersionUID = 4850846929226802566L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 4850846929226802566L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "data"... | {
"body": "public String toString() {\n return new String(this.data, this.offset, this.length, StandardCharsets.UTF_8);\n }",
"class_method_signature": "ArrayByteSequence.toString()",
"constructor": false,
"full_signature": "public String toString()",
"identifier": "toString",
"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_1324 | {
"fields": [
{
"declarator": "instants = new TreeSet<>()",
"modifier": "private",
"original_string": "private SortedSet<Instant> instants = new TreeSet<>();",
"type": "SortedSet<Instant>",
"var_name": "instants"
},
{
"declarator": "instant1",
"modifier": "private... | {
"body": "@Test\n public void testGetNumberOfTimestamps() {\n // Given\n final RBMBackedTimestampSet timestampSet = new RBMBackedTimestampSet(TimeBucket.SECOND);\n timestampSet.add(instant1);\n timestampSet.add(instant1.plus(Duration.ofDays(100L)));\n timestampSet.add(instant1.p... | {
"fields": [
{
"declarator": "MIN_TIME = Instant.ofEpochMilli(0L)",
"modifier": "private static final",
"original_string": "private static final Instant MIN_TIME = Instant.ofEpochMilli(0L);",
"type": "Instant",
"var_name": "MIN_TIME"
},
{
"declarator": "MAX_TIME = Inst... | {
"body": "@Override\n public long getNumberOfTimestamps() {\n return rbm.getCardinality();\n }",
"class_method_signature": "RBMBackedTimestampSet.getNumberOfTimestamps()",
"constructor": false,
"full_signature": "@Override public long getNumberOfTimestamps()",
"identifier": "getNumberOfTimestamp... | {
"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_249 | {
"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() throws IOException {\n // When\n final Set<Class> classes = service.getObjectGenerators();\n\n // Then\n assertTrue(!classes.isEmpty());\n }",
"class_method_signature": "GraphConfigurationServiceTest.shouldGetObjectGenerato... | {
"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 Set<Class> getObjectGenerators() {\n return ReflectionUtil.getSubTypes(ObjectGenerator.class);\n }",
"class_method_signature": "GraphConfigurationService.getObjectGenerators()",
"constructor": false,
"full_signature": "@Override public Set<Class> getObjectGenerators()"... | {
"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_619 | {
"fields": [
{
"declarator": "schema",
"modifier": "private static",
"original_string": "private static Schema schema;",
"type": "Schema",
"var_name": "schema"
},
{
"declarator": "serialiser",
"modifier": "private static",
"original_string": "private static... | {
"body": "@Test\n public void testIsConsistent() {\n assertEquals(true, serialiser.isConsistent());\n }",
"class_method_signature": "EntityIdSerialiserTest.testIsConsistent()",
"constructor": false,
"full_signature": "@Test public void testIsConsistent()",
"identifier": "testIsConsistent",
"in... | {
"fields": [
{
"declarator": "serialVersionUID = -8190219367679033911L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -8190219367679033911L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "ver... | {
"body": "@Override\n public boolean isConsistent() {\n return null != vertexSerialiser && vertexSerialiser.isConsistent();\n }",
"class_method_signature": "EntityIdSerialiser.isConsistent()",
"constructor": false,
"full_signature": "@Override public boolean isConsistent()",
"identifier": "isCon... | {
"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_1261 | {
"fields": [
{
"declarator": "CACHE_SERVICE_CLASS_STRING = \"uk.gov.gchq.gaffer.cache.impl.HashMapCacheService\"",
"modifier": "private static final",
"original_string": "private static final String CACHE_SERVICE_CLASS_STRING = \"uk.gov.gchq.gaffer.cache.impl.HashMapCacheService\";",
"typ... | {
"body": "@Test\n public void shouldGetCacheServiceName() {\n assertEquals(\"serviceName1\", cache.getCacheName());\n }",
"class_method_signature": "CacheTest.shouldGetCacheServiceName()",
"constructor": false,
"full_signature": "@Test public void shouldGetCacheServiceName()",
"identifier": "sho... | {
"fields": [
{
"declarator": "ERROR_ADDING_KEY_TO_CACHE_KEY_S = \"Error adding key to cache. key: %s\"",
"modifier": "public static final",
"original_string": "public static final String ERROR_ADDING_KEY_TO_CACHE_KEY_S = \"Error adding key to cache. key: %s\";",
"type": "String",
"v... | {
"body": "public String getCacheName() {\n return cacheName;\n }",
"class_method_signature": "Cache.getCacheName()",
"constructor": false,
"full_signature": "public String getCacheName()",
"identifier": "getCacheName",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"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_1216 | {
"fields": [],
"file": "core/operation/src/test/java/uk/gov/gchq/gaffer/operation/impl/get/GetElementsTest.java",
"identifier": "GetElementsTest",
"interfaces": "",
"superclass": "extends OperationTest<GetElements>"
} | {
"body": "@Test\n public void shouldSetSeedMatchingTypeToEquals() {\n // Given\n final ElementId elementId1 = new EntitySeed(\"identifier\");\n\n // When\n final GetElements op = new GetElements.Builder()\n .input(elementId1)\n .seedMatching(SeedMatchingTy... | {
"fields": [
{
"declarator": "seedMatching",
"modifier": "private",
"original_string": "private SeedMatchingType seedMatching;",
"type": "SeedMatchingType",
"var_name": "seedMatching"
},
{
"declarator": "view",
"modifier": "private",
"original_string": "pri... | {
"body": "@Deprecated\n @Override\n public SeedMatchingType getSeedMatching() {\n return seedMatching;\n }",
"class_method_signature": "GetElements.getSeedMatching()",
"constructor": false,
"full_signature": "@Deprecated @Override public SeedMatchingType getSeedMatching()",
"identifier": "get... | {
"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_49 | {
"fields": [
{
"declarator": "TEST_ENTITY = \"TestEntity\"",
"modifier": "public static final",
"original_string": "public static final String TEST_ENTITY = \"TestEntity\";",
"type": "String",
"var_name": "TEST_ENTITY"
},
{
"declarator": "TEST_GRAPH_ID = \"testGraphId\... | {
"body": "@Test\n public void shouldThrowException() throws Exception {\n // Given\n final String message = \"Test Exception\";\n final OP op = getExampleOperation();\n op.addOption(KEY_OPERATION_OPTIONS_GRAPH_IDS, TEST_GRAPH_ID);\n\n Schema unusedSchema = new Schema.Builder().b... | {
"fields": [],
"file": "store-implementation/federated-store/src/main/java/uk/gov/gchq/gaffer/federatedstore/operation/handler/FederatedOperationOutputHandler.java",
"identifier": "FederatedOperationOutputHandler",
"interfaces": "implements OutputOperationHandler<OP, O>",
"methods": [
{
"class_meth... | {
"body": "@Override\n public O doOperation(final OP operation, final Context context, final Store store) throws OperationException {\n final Collection<Graph> graphs = ((FederatedStore) store).getGraphs(context.getUser(), operation.getOption(KEY_OPERATION_OPTIONS_GRAPH_IDS), operation);\n final List... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_394 | {
"fields": [],
"file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/element/PropertiesTest.java",
"identifier": "PropertiesTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldNotAddPropertyIfPropertyNameIsNull() {\n final Properties properties = new Properties();\n properties.put(null, \"propertyValue1\");\n\n assertEquals(0, properties.size());\n }",
"class_method_signature": "PropertiesTest.shouldNotAddPropertyIfPropertyN... | {
"fields": [
{
"declarator": "serialVersionUID = -5412533432398907359L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -5412533432398907359L;",
"type": "long",
"var_name": "serialVersionUID"
}
],
"file": "core/data/src/m... | {
"body": "@Override\n public Object put(final String name, final Object value) {\n if (null != name) {\n if (null == value) {\n return super.remove(name);\n } else {\n return super.put(name, value);\n }\n }\n return null;\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_681 | {
"fields": [
{
"declarator": "GROUP1 = \"GROUP1\"",
"modifier": "private static final",
"original_string": "private static final String GROUP1 = \"GROUP1\";",
"type": "String",
"var_name": "GROUP1"
},
{
"declarator": "GROUP2 = \"GROUP2\"",
"modifier": "private st... | {
"body": "@Test\n public void shouldReturnGroupCountsWithoutLimit() throws OperationException, IOException {\n // Given\n final CountGroupsHandler handler = new CountGroupsHandler();\n final Store store = mock(Store.class);\n final CountGroups countGroups = mock(CountGroups.class);\n ... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/CountGroupsHandler.java",
"identifier": "CountGroupsHandler",
"interfaces": "implements OutputOperationHandler<CountGroups, GroupCounts>",
"methods": [
{
"class_method_signature": "CountGroupsHandler.doOpera... | {
"body": "@Override\n public GroupCounts doOperation(final CountGroups operation,\n final Context context, final Store store)\n throws OperationException {\n final GroupCounts groupCounts = new GroupCounts();\n try {\n int count = 0;\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_1353 | {
"fields": [],
"file": "library/sketches-library/src/test/java/uk/gov/gchq/gaffer/sketches/datasketches/frequencies/serialisation/LongsSketchSerialiserTest.java",
"identifier": "LongsSketchSerialiserTest",
"interfaces": "",
"superclass": "extends ViaCalculatedValueSerialiserTest<LongsSketch, Long>"
} | {
"body": "@Test\n public void testCanHandleLongsSketch() {\n assertTrue(serialiser.canHandle(LongsSketch.class));\n assertFalse(serialiser.canHandle(String.class));\n }",
"class_method_signature": "LongsSketchSerialiserTest.testCanHandleLongsSketch()",
"constructor": false,
"full_signature"... | {
"fields": [
{
"declarator": "serialVersionUID = 4854333990248992270L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 4854333990248992270L;",
"type": "long",
"var_name": "serialVersionUID"
}
],
"file": "library/sketches-... | {
"body": "@Override\n public boolean canHandle(final Class clazz) {\n return LongsSketch.class.equals(clazz);\n }",
"class_method_signature": "LongsSketchSerialiser.canHandle(final Class clazz)",
"constructor": false,
"full_signature": "@Override public boolean canHandle(final Class clazz)",
"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_402 | {
"fields": [],
"file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/element/function/ElementAggregatorTest.java",
"identifier": "ElementAggregatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldAggregateElementUsingMockBinaryOperator() {\n // Given\n final String reference = \"reference1\";\n final Integer valueResult = 3;\n\n final BinaryOperator<Integer> function = mock(BinaryOperator.class);\n given(function.apply(1, 2)).willRetur... | {
"fields": [
{
"declarator": "stateTuple = new PropertiesTuple()",
"modifier": "private final",
"original_string": "private final PropertiesTuple stateTuple = new PropertiesTuple();",
"type": "PropertiesTuple",
"var_name": "stateTuple"
},
{
"declarator": "propertiesTup... | {
"body": "public Element apply(final Element state, final Element element) {\n if (null == state) {\n return element;\n }\n\n apply(state.getProperties(), element.getProperties());\n return state;\n }",
"class_method_signature": "ElementAggregator.apply(final Element state... | {
"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_951 | {
"fields": [
{
"declarator": "EDGE_DESCRIPTION = \"Edge description\"",
"modifier": "public static final",
"original_string": "public static final String EDGE_DESCRIPTION = \"Edge description\";",
"type": "String",
"var_name": "EDGE_DESCRIPTION"
},
{
"declarator": "ENT... | {
"body": "@Test\n public void shouldReturnTrueWhenSchemaHasValidatorEntityPropertyFilters() {\n // Given\n final Schema schema = new Schema.Builder()\n .entity(TestGroups.ENTITY,\n new SchemaEntityDefin... | {
"fields": [
{
"declarator": "unknownType = new TypeDefinition()",
"modifier": "private final",
"original_string": "private final TypeDefinition unknownType = new TypeDefinition();",
"type": "TypeDefinition",
"var_name": "unknownType"
},
{
"declarator": "id",
"mo... | {
"body": "public boolean hasValidation() {\n for (final SchemaElementDefinition elementDef : new ChainedIterable<SchemaElementDefinition>(getEntities().values(), getEdges().values())) {\n if (null != elementDef) {\n if (elementDef.hasValidation()) {\n return true;\... | {
"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_814 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/handler/output/ToEntitySeedsHandlerTest.java",
"identifier": "ToEntitySeedsHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldConvertVerticesToEntitySeeds() throws OperationException {\n // Given\n final Object vertex1 = \"vertex1\";\n final Object vertex2 = \"vertex2\";\n\n final Iterable originalResults = new WrappedCloseableIterable<>(Arrays.asList(vertex1, vertex2));\n ... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/output/ToEntitySeedsHandler.java",
"identifier": "ToEntitySeedsHandler",
"interfaces": "implements OutputOperationHandler<ToEntitySeeds, Iterable<? extends EntitySeed>>",
"methods": [
{
"class_method_signatu... | {
"body": "@Override\n public Iterable<EntitySeed> doOperation(final ToEntitySeeds operation, final Context context, final Store store) throws OperationException {\n if (null == operation.getInput()) {\n return null;\n }\n\n return new StreamMapIterable<>(\n operation... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1095 | {
"fields": [
{
"declarator": "OP_CHAIN_LIMITER_PATH = \"opChainLimiter.json\"",
"modifier": "private static final",
"original_string": "private static final String OP_CHAIN_LIMITER_PATH = \"opChainLimiter.json\";",
"type": "String",
"var_name": "OP_CHAIN_LIMITER_PATH"
}
],
"... | {
"body": "@Test\n public void shouldRejectOperationChainWhenUserHasAuthScoreLessThanChainScore() {\n // Given\n final OperationChainLimiter hook = fromJson(OP_CHAIN_LIMITER_PATH);\n final OperationChain opChain = new OperationChain.Builder()\n .first(new GetAdjacentIds())\n ... | {
"fields": [
{
"declarator": "scorer = new ScoreOperationChainHandler()",
"modifier": "private",
"original_string": "private ScoreOperationChainHandler scorer = new ScoreOperationChainHandler();",
"type": "ScoreOperationChainHandler",
"var_name": "scorer"
}
],
"file": "core/... | {
"body": "@Override\n public void preExecute(final OperationChain<?> opChain, final Context context) {\n if (null != opChain) {\n Integer chainScore = scorer.getChainScore(opChain, context.getUser());\n Integer maxAuthScore = scorer.getMaxUserAuthScore(context.getUser().getOpAuths());... | {
"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_117 | {
"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 shouldFailWithSameArraysAndDifferentLengths() throws Exception {\n br1 = new BytesAndRange(a, 0, a.length - 1);\n br2 = new BytesAndRange(a, 0, a.length);\n assertFalse(ByteUtils.areKeyBytesEqual(br1, br2));\n }",
"class_method_signature": "ByteUtilsTest.sho... | {
"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_547 | {
"fields": [],
"file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/iterable/LimitedInMemorySortedIterableTest.java",
"identifier": "LimitedInMemorySortedIterableTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldLimitAndNotDeduplicateEntries() {\n final LimitedInMemorySortedIterable<Integer> list = new LimitedInMemorySortedIterable<Integer>(Comparator.naturalOrder(), 4, false);\n\n list.add(1);\n list.add(2);\n list.add(1);\n list.add(2);\n lis... | {
"fields": [
{
"declarator": "comparator",
"modifier": "private final",
"original_string": "private final Comparator<E> comparator;",
"type": "Comparator<E>",
"var_name": "comparator"
},
{
"declarator": "deduplicate",
"modifier": "private final",
"original_... | {
"body": "public boolean add(final E e) {\n boolean result = false;\n\n final OneOrMore<E> values = backingMap.get(e);\n // Skip the item if we are deduplicating and the item already exists\n boolean skipItem = (deduplicate && null != values && values.contains(e));\n if (!skipItem)... | {
"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_269 | {
"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 shouldReturnFalseWhenViewHasNullPreAggEdgeFilters() {\n // Given\n final View view = new View.Builder()\n .edge(TestGroups.EDGE, new ViewElementDefinition.Builder()\n .preAggregationFilter(null)\n .build())\n ... | {
"fields": [
{
"declarator": "globalElements",
"modifier": "private",
"original_string": "private List<GlobalViewElementDefinition> globalElements;",
"type": "List<GlobalViewElementDefinition>",
"var_name": "globalElements"
},
{
"declarator": "globalEntities",
"m... | {
"body": "public boolean hasPreAggregationFilters() {\n return hasFilters(ViewElementDefinition::hasPreAggregationFilters);\n }",
"class_method_signature": "View.hasPreAggregationFilters()",
"constructor": false,
"full_signature": "public boolean hasPreAggregationFilters()",
"identifier": "hasPreAg... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_793 | {
"fields": [
{
"declarator": "SCHEMA = new Schema.Builder()\n .edge(TestGroups.EDGE, new SchemaEdgeDefinition())\n .edge(TestGroups.EDGE_2, new SchemaEdgeDefinition())\n .entity(TestGroups.ENTITY, new SchemaEntityDefinition())\n .entity(TestGroups.ENTITY_2, new S... | {
"body": "@Test\n public void shouldReturnAllValuesWithNullElementFilters() throws OperationException {\n // Given\n given(store.getSchema()).willReturn(SCHEMA);\n\n final Edge edge = new Edge.Builder()\n .group(TestGroups.EDGE)\n .source(\"junctionA\")\n ... | {
"fields": [
{
"declarator": "validator = new FilterValidator()",
"modifier": "private final",
"original_string": "private final FunctionValidator<Filter> validator = new FilterValidator();",
"type": "FunctionValidator<Filter>",
"var_name": "validator"
}
],
"file": "core/sto... | {
"body": "@Override\n public Iterable<? extends Element> doOperation(final Filter operation, final Context context, final Store store) throws OperationException {\n return doOperation(operation, store.getSchema());\n }",
"class_method_signature": "FilterHandler.doOperation(final Filter operation, fina... | {
"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_639 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/SerialisationFactoryTest.java",
"identifier": "SerialisationFactoryTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnCustomSerialiserIfCustomSerialiserFound() throws SerialisationException {\n // Given\n final Serialiser[] serialisers = new Serialiser[]{\n new RawDateSerialiser(),\n new RawDoubleSerialiser(),\n new RawFloatSeria... | {
"fields": [
{
"declarator": "serialisers",
"modifier": "private final",
"original_string": "private final List<Serialiser> serialisers;",
"type": "List<Serialiser>",
"var_name": "serialisers"
},
{
"declarator": "LAST_RESORT_FINALISER = new JavaSerialiser()",
"mo... | {
"body": "public Serialiser getSerialiser(final Class<?> objClass) {\n return getSerialiser(objClass, false, false);\n }",
"class_method_signature": "SerialisationFactory.getSerialiser(final Class<?> objClass)",
"constructor": false,
"full_signature": "public Serialiser getSerialiser(final Class<?> o... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1241 | {
"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 shouldBuildOperationChain() {\n // Given\n final AddElements addElements1 = mock(AddElements.class);\n final AddElements addElements2 = mock(AddElements.class);\n final GetAdjacentIds getAdj1 = mock(GetAdjacentIds.class);\n final GetAdjacentIds getA... | {
"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": "@JsonGetter(\"operations\")\n Operation[] getOperationArray() {\n return operations.toArray(new Operation[operations.size()]);\n }",
"class_method_signature": "OperationChain.getOperationArray()",
"constructor": false,
"full_signature": "@JsonGetter(\"operations\") Operation[] getOperati... | {
"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_1304 | {
"fields": [],
"file": "library/time-library/src/test/java/uk/gov/gchq/gaffer/time/LongTimeSeriesTest.java",
"identifier": "LongTimeSeriesTest",
"interfaces": "",
"superclass": "extends JSONSerialisationTest<LongTimeSeries>"
} | {
"body": "@Test\n public void testEquals() {\n // Given\n final LongTimeSeries timeSeries1 = new LongTimeSeries(TimeBucket.MINUTE);\n timeSeries1.upsert(Instant.ofEpochMilli(1000L), 1000L);\n timeSeries1.upsert(Instant.ofEpochMilli(10000L), 10000L);\n final LongTimeSeries timeSe... | {
"fields": [
{
"declarator": "VALID_TIME_BUCKETS = Sets.newHashSet(\n MILLISECOND,\n SECOND,\n MINUTE,\n HOUR,\n DAY,\n WEEK,\n MONTH,\n YEAR\n )",
"modifier": "private static final",
"original_string": "... | {
"body": "@Override\n public boolean equals(final Object obj) {\n if (this == obj) {\n return true;\n }\n if (null == obj || getClass() != obj.getClass()) {\n return false;\n }\n\n final LongTimeSeries that = (LongTimeSeries) obj;\n\n return new Equa... | {
"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_286 | {
"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 shouldThrowExceptionWhenGlobalExcludePropertiesAndEntityPropertiesSet() {\n // Given\n final View view = new View.Builder()\n .globalEntities(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_1187 | {
"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 SplitStoreFromFile splitTable = new SplitStoreFromFile.Builder().inputPath(INPUT_DIRECTORY).option(TEST_OPTION_KEY, \"true\").build();\n assertEquals(INPUT_DIRECTORY, splitTable.getInputPath());\n a... | {
"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": "SplitStoreFromFile.getInputPath()",
"constructor": false,
"full_signature": "public String getInputPath()",
"identifier": "getInputPath",
"invocations": [],
"modifiers": "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_906 | {
"fields": [
{
"declarator": "PROPERTY_STRING_TYPE = \"property.string\"",
"modifier": "public static final",
"original_string": "public static final String PROPERTY_STRING_TYPE = \"property.string\";",
"type": "String",
"var_name": "PROPERTY_STRING_TYPE"
}
],
"file": "core/... | {
"body": "@Test\n public void shouldReturnQueryAggregatorWithViewAggregator() {\n // Given\n final T elementDef = createBuilder()\n .property(\"property1\", PROPERTY_STRING_TYPE)\n .property(\"property2\", PROPERTY_STRING_TYPE)\n .property(\"property3\", ... | {
"fields": [
{
"declarator": "elementDefValidator",
"modifier": "private final",
"original_string": "private final SchemaElementDefinitionValidator elementDefValidator;",
"type": "SchemaElementDefinitionValidator",
"var_name": "elementDefValidator"
},
{
"declarator": "... | {
"body": "@JsonIgnore\n public ElementAggregator getQueryAggregator(final Set<String> viewGroupBy, final ElementAggregator viewAggregator) {\n if (null == viewAggregator) {\n return getQueryAggregatorForNullViewAggregator(viewGroupBy);\n }\n return getQueryAggregatorForNonNullViewA... | {
"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_455 | {
"fields": [
{
"declarator": "INVALID_STRING = \"inv@l1dStr|ng&^\"",
"modifier": "private static final",
"original_string": "private static final String INVALID_STRING = \"inv@l1dStr|ng&^\";",
"type": "String",
"var_name": "INVALID_STRING"
},
{
"declarator": "VALID_STR... | {
"body": "@Test\n public void shouldThrowExceptionWithInvalidStringName() {\n final Exception exception = assertThrows(IllegalArgumentException.class, () -> PropertiesUtil.validateName(INVALID_STRING));\n\n final String expected = \"Property is invalid: inv@l1dStr|ng&^, it must match regex: [a-zA-Z0... | {
"fields": [
{
"declarator": "PROPERTY_ALLOWED_CHARACTERS = Pattern.compile(\"[a-zA-Z0-9|-]*\")",
"modifier": "private static final",
"original_string": "private static final Pattern PROPERTY_ALLOWED_CHARACTERS = Pattern.compile(\"[a-zA-Z0-9|-]*\");",
"type": "Pattern",
"var_name": ... | {
"body": "public static void validateName(final String property) {\n if (!PROPERTY_ALLOWED_CHARACTERS.matcher(property).matches()) {\n throw new IllegalArgumentException(\"Property is invalid: \" + property + \", it must match regex: \" + PROPERTY_ALLOWED_CHARACTERS);\n }\n }",
"class_m... | {
"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_510 | {
"fields": [],
"file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/CollectionUtilTest.java",
"identifier": "CollectionUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnTrueWhenCollectionContainsAProvidedValue() {\n // Given\n final Collection<Integer> collection = Sets.newHashSet(10, 20, 2, 30);\n final Object[] values = new Object[] {1, 2, 3};\n\n // When\n final boolean result = CollectionUtil.contai... | {
"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 containsAny(final Collection collection, final Object[] objects) {\n boolean result = false;\n if (null != collection && null != objects) {\n for (final Object object : objects) {\n if (collection.contains(object)) {\n result ... | {
"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_140 | {
"fields": [
{
"declarator": "SCHEMA = Schema.fromJson(StreamUtil.schemas(AccumuloAddElementsFromHdfsJobFactoryTest.class))",
"modifier": "private static final",
"original_string": "private static final Schema SCHEMA = Schema.fromJson(StreamUtil.schemas(AccumuloAddElementsFromHdfsJobFactoryTest... | {
"body": "@Test\n public void shouldSetNoLessThanMinNumberOfReducersSpecified() throws IOException, StoreException, OperationException {\n // Given\n store.initialise(\"graphId\", SCHEMA, PROPERTIES);\n final JobConf localConf = createLocalConf();\n final FileSystem fs = FileSystem.get... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(AccumuloAddElementsFromHdfsJobFactory.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(AccumuloAddElementsFromHdfsJobFactory.class);",
"type": "Logge... | {
"body": "@Override\n public void setupJob(final Job job, final AddElementsFromHdfs operation, final String mapperGenerator, final Store store) throws IOException {\n job.setJarByClass(getClass());\n job.setJobName(getJobName(mapperGenerator, operation.getOutputPath()));\n\n setupMapper(job);... | {
"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_843 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/handler/job/GetJobDetailsHandlerTest.java",
"identifier": "GetJobDetailsHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldThrowExceptionIfJobTrackerIsNotConfigured() {\n // Given\n final GetJobDetailsHandler handler = new GetJobDetailsHandler();\n final GetJobDetails operation = mock(GetJobDetails.class);\n final Store store = mock(Store.class);\n final User user... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/job/GetJobDetailsHandler.java",
"identifier": "GetJobDetailsHandler",
"interfaces": "implements OutputOperationHandler<GetJobDetails, JobDetail>",
"methods": [
{
"class_method_signature": "GetJobDetailsHandl... | {
"body": "@Override\n public JobDetail doOperation(final GetJobDetails operation, final Context context, final Store store) throws OperationException {\n if (null == store.getJobTracker()) {\n throw new OperationException(\"The Job Tracker has not been configured\", SERVICE_UNAVAILABLE);\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_1168 | {
"fields": [],
"file": "core/operation/src/test/java/uk/gov/gchq/gaffer/operation/function/FromElementIdTest.java",
"identifier": "FromElementIdTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnNullIfTheInputIsNull() {\n // Given\n final FromElementId function = new FromElementId();\n\n // When\n final Object output = function.apply(null);\n\n // Then\n assertNull(output);\n }",
"class_method_signature": "FromElemen... | {
"fields": [],
"file": "core/operation/src/main/java/uk/gov/gchq/gaffer/operation/function/FromElementId.java",
"identifier": "FromElementId",
"interfaces": "",
"methods": [
{
"class_method_signature": "FromElementId.apply(final ElementId e)",
"constructor": false,
"full_signature": "@O... | {
"body": "@Override\n public Object apply(final ElementId e) {\n if (null == e) {\n return null;\n }\n return e instanceof EntityId ? ((EntityId) e).getVertex() : e;\n }",
"class_method_signature": "FromElementId.apply(final ElementId e)",
"constructor": false,
"full_signa... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1257 | {
"fields": [],
"file": "core/operation/src/test/java/uk/gov/gchq/gaffer/named/operation/NamedOperationDetailTest.java",
"identifier": "NamedOperationDetailTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldDeserialiseNormalOpChain() throws SerialisationException {\n // Given\n String json = \"{\" +\n \" \\\"operationName\\\": \\\"operationName\\\",\" +\n \" \\\"creatorId\\\": \\\"creatorUserId\\\",\" +\n \" \\\"oper... | {
"fields": [
{
"declarator": "serialVersionUID = -8831783492657131469L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -8831783492657131469L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "CHA... | {
"body": "public String getOperations() {\n return operations;\n }",
"class_method_signature": "NamedOperationDetail.getOperations()",
"constructor": false,
"full_signature": "public String getOperations()",
"identifier": "getOperations",
"invocations": [],
"modifiers": "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_785 | {
"fields": [
{
"declarator": "store = mock(Store.class)",
"modifier": "private final",
"original_string": "private final Store store = mock(Store.class);",
"type": "Store",
"var_name": "store"
},
{
"declarator": "context = new Context()",
"modifier": "private fin... | {
"body": "@Test\n public void shouldAggregateTheSameFromSchemaOrOperation() throws OperationException {\n // Given\n final Schema schema = new Schema.Builder()\n .edge(TestGroups.EDGE, new SchemaEdgeDefinition.Builder()\n .build())\n .build();\n\n... | {
"fields": [
{
"declarator": "validator = new AggregateValidator()",
"modifier": "private final",
"original_string": "private final FunctionValidator<Aggregate> validator = new AggregateValidator();",
"type": "FunctionValidator<Aggregate>",
"var_name": "validator"
}
],
"file... | {
"body": "@Override\n public Iterable<? extends Element> doOperation(final Aggregate operation, final Context context, final Store store) throws OperationException {\n return doOperation(operation, store.getSchema());\n }",
"class_method_signature": "AggregateHandler.doOperation(final Aggregate 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_290 | {
"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 shouldOverrideGlobalPropertiesWhenSpecificEdgeGroupPropertiesSet() {\n // Given\n final View view = new View.Builder()\n .globalEdges(new GlobalViewElementDefinition.Builder()\n .groups(TestGroups.EDGE)\n .pro... | {
"fields": [
{
"declarator": "globalElements",
"modifier": "private",
"original_string": "private List<GlobalViewElementDefinition> globalElements;",
"type": "List<GlobalViewElementDefinition>",
"var_name": "globalElements"
},
{
"declarator": "globalEntities",
"m... | {
"body": "public void expandGlobalDefinitions() {\n if (null != globalEntities && !globalEntities.isEmpty()) {\n setEntities(expandGlobalDefinitions(getEntities(), getEntityGroups(), globalEntities, false));\n globalEntities = null;\n }\n\n if (null != globalEdges && !globa... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1312 | {
"fields": [
{
"declarator": "BOUNDED_TIMESTAMP_SET_AGGREGATOR\n = new BoundedTimestampSetAggregator()",
"modifier": "private static final",
"original_string": "private static final BoundedTimestampSetAggregator BOUNDED_TIMESTAMP_SET_AGGREGATOR\n = new BoundedTimestampSetA... | {
"body": "@Test\n public void testCantMergeIfDifferentMaxSize() {\n try {\n final BoundedTimestampSet boundedTimestampSet1 = new BoundedTimestampSet(CommonTimeUtil.TimeBucket.SECOND, 10);\n final BoundedTimestampSet boundedTimestampSet2 = new BoundedTimestampSet(CommonTimeUtil.TimeBuc... | {
"fields": [],
"file": "library/time-library/src/main/java/uk/gov/gchq/gaffer/time/binaryoperator/BoundedTimestampSetAggregator.java",
"identifier": "BoundedTimestampSetAggregator",
"interfaces": "",
"methods": [
{
"class_method_signature": "BoundedTimestampSetAggregator._apply(final BoundedTimesta... | {
"body": "@Override\n protected BoundedTimestampSet _apply(final BoundedTimestampSet a, final BoundedTimestampSet b) {\n // Can only be merged if they have the same time bucket and maximum size.\n if (!a.getTimeBucket().equals(b.getTimeBucket())) {\n throw new IllegalArgumentException(\"C... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_443 | {
"fields": [],
"file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/element/EdgeTest.java",
"identifier": "EdgeTest",
"interfaces": "",
"superclass": "extends ElementTest"
} | {
"body": "@Test\n public void shouldDeserialiseFromJsonUsingDirectedTrueField() throws SerialisationException {\n final String json = \"{\\\"class\\\": \\\"uk.gov.gchq.gaffer.data.element.Edge\\\", \\\"directed\\\": true}\";\n\n final Edge deserialisedEdge = JSONSerialiser.deserialise(json.getBytes(... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(Edge.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(Edge.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "s... | {
"body": "@JsonIgnore(false)\n @JsonGetter(\"directed\")\n @Override\n public boolean isDirected() {\n return directed;\n }",
"class_method_signature": "Edge.isDirected()",
"constructor": false,
"full_signature": "@JsonIgnore(false) @JsonGetter(\"directed\") @Override public boolean isDirect... | {
"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_910 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/schema/SchemaEdgeDefinitionTest.java",
"identifier": "SchemaEdgeDefinitionTest",
"interfaces": "",
"superclass": "extends SchemaElementDefinitionTest<SchemaEdgeDefinition>"
} | {
"body": "@Test\n public void shouldOverrideDestinationWhenMerging() {\n // Given\n final SchemaEdgeDefinition elementDef1 = new SchemaEdgeDefinition.Builder()\n .destination(\"destination.integer\")\n .build();\n\n final SchemaEdgeDefinition elementDef2 = new Sc... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/schema/SchemaEdgeDefinition.java",
"identifier": "SchemaEdgeDefinition",
"interfaces": "",
"methods": [
{
"class_method_signature": "SchemaEdgeDefinition.getSource()",
"constructor": false,
"full_signature": "publ... | {
"body": "public String getDestination() {\n return getIdentifierTypeName(IdentifierType.DESTINATION);\n }",
"class_method_signature": "SchemaEdgeDefinition.getDestination()",
"constructor": false,
"full_signature": "public String getDestination()",
"identifier": "getDestination",
"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_1191 | {
"fields": [],
"file": "core/operation/src/test/java/uk/gov/gchq/gaffer/operation/impl/GetWalksTest.java",
"identifier": "GetWalksTest",
"interfaces": "",
"superclass": "extends OperationTest<GetWalks>"
} | {
"body": "@Test\n public void shouldValidateOperationWhenNoOperationsProvided() {\n // Given\n final GetWalks getWalks = new GetWalks.Builder().input(new EntitySeed(\"1\"), new EntitySeed(\"2\"))\n .build();\n\n // Then\n ... | {
"fields": [
{
"declarator": "HOP_DEFINITION = \"A hop is a GetElements operation that selects at least 1 edge group.\"",
"modifier": "public static final",
"original_string": "public static final String HOP_DEFINITION = \"A hop is a GetElements operation that selects at least 1 edge group.\";"... | {
"body": "@Override\n public ValidationResult validate() {\n final ValidationResult result = InputOutput.super.validate();\n\n final int getEdgeOperations = getNumberOfGetEdgeOperations();\n\n if (getEdgeOperations < 1) {\n result.addError(\"No hops were provided. \" + HOP_DEFINITI... | {
"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_855 | {
"fields": [
{
"declarator": "EMPTY_ADMIN_AUTH = \"\"",
"modifier": "private static final",
"original_string": "private static final String EMPTY_ADMIN_AUTH = \"\";",
"type": "String",
"var_name": "EMPTY_ADMIN_AUTH"
},
{
"declarator": "mockCache = mock(NamedOperationCa... | {
"body": "@Test\n public void shouldNotAllowForNonRecursiveNamedOperationsToBeNested() throws OperationException {\n OperationChain child = new OperationChain.Builder().first(new AddElements()).build();\n addNamedOperation.setOperationChain(child);\n addNamedOperation.setOperationName(\"child... | {
"fields": [
{
"declarator": "cache",
"modifier": "private final",
"original_string": "private final NamedOperationCache cache;",
"type": "NamedOperationCache",
"var_name": "cache"
}
],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/named/AddNam... | {
"body": "@Override\n public Void doOperation(final AddNamedOperation operation, final Context context, final Store store) throws OperationException {\n try {\n final NamedOperationDetail namedOperationDetail = new NamedOperationDetail.Builder()\n .operationChain(operation.get... | {
"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_156 | {
"fields": [],
"file": "store-implementation/accumulo-store/src/test/java/uk/gov/gchq/gaffer/accumulostore/key/core/AbstractCoreKeyAccumuloElementConverterTest.java",
"identifier": "AbstractCoreKeyAccumuloElementConverterTest",
"interfaces": "",
"superclass": "extends AbstractAccumuloElementConverterTest<Abs... | {
"body": "@Test\n public void shouldReturnOverriddenSerialiseNull() throws Exception {\n //given\n ByteArrayOutputStream stream = new ByteArrayOutputStream();\n //expected = Size in bytes + bytes of \"Empty\"\n byte[] expected = Bytes.concat(new byte[]{5}, \"Empty\".getBytes());\n ... | {
"fields": [
{
"declarator": "schema",
"modifier": "protected final",
"original_string": "protected final Schema schema;",
"type": "Schema",
"var_name": "schema"
},
{
"declarator": "timestampProperty",
"modifier": "private final",
"original_string": "privat... | {
"body": "protected void serialiseSizeAndPropertyValue(final String propertyName, final SchemaElementDefinition elementDefinition, final Properties properties, final ByteArrayOutputStream stream) {\n try {\n final TypeDefinition typeDefinition = elementDefinition.getPropertyTypeDef(propertyName);\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_506 | {
"fields": [],
"file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/CollectionUtilTest.java",
"identifier": "CollectionUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldConvertMapToStringKeys() {\n // Given\n final Map<Class<? extends Number>, String> map = new HashMap<>();\n populateClassKeyMap(map);\n\n // When\n final Map<String, String> result = CollectionUtil.toMapWithStringKeys(map);\n\n // Then\... | {
"fields": [],
"file": "core/common-util/src/main/java/uk/gov/gchq/gaffer/commonutil/CollectionUtil.java",
"identifier": "CollectionUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "CollectionUtil.CollectionUtil()",
"constructor": true,
"full_signature": "private Colle... | {
"body": "public static <K, V> void toMapWithStringKeys(final Map<Class<? extends K>, V> map, final Map<String, V> mapAsStrings) {\n for (final Map.Entry<Class<? extends K>, V> entry : map.entrySet()) {\n mapAsStrings.put(\n entry.getKey().getName(),\n entry.ge... | {
"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_228 | {
"fields": [
{
"declarator": "GRAPH_ID = \"graphId\"",
"modifier": "private static final",
"original_string": "private static final String GRAPH_ID = \"graphId\";",
"type": "String",
"var_name": "GRAPH_ID"
},
{
"declarator": "service",
"modifier": "@InjectMocks\n... | {
"body": "@Test\n public void shouldGetSerialisedFields() {\n // When\n final Set<String> fields = (Set<String>) service.getSerialisedFields(IsA.class.getName()).getEntity();\n\n // Then\n assertEquals(1, fields.size());\n assertTrue(fields.contains(\"type\"));\n }",
"class... | {
"fields": [
{
"declarator": "graphFactory",
"modifier": "@Inject\n private",
"original_string": "@Inject\n private GraphFactory graphFactory;",
"type": "GraphFactory",
"var_name": "graphFactory"
},
{
"declarator": "userFactory",
"modifier": "@Inject\n p... | {
"body": "@SuppressFBWarnings(value = \"REC_CATCH_EXCEPTION\", justification = \"Need to wrap all runtime exceptions before they are given to the user\")\n @Override\n public Response getSerialisedFields(final String className) {\n final Class<?> clazz;\n try {\n clazz = Class.forName(... | {
"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_678 | {
"fields": [
{
"declarator": "store = mock(Store.class)",
"modifier": "private final",
"original_string": "private final Store store = mock(Store.class);",
"type": "Store",
"var_name": "store"
},
{
"declarator": "context = new Context(new User())",
"modifier": "p... | {
"body": "@Test\n public void shouldValidateOperationChain() throws OperationException {\n // Given\n final AddElements addElements = new AddElements();\n final GetAdjacentIds getAdj = new GetAdjacentIds();\n final GetElements getElements = new GetElements();\n final DiscardOutp... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/ValidateOperationChainHandler.java",
"identifier": "ValidateOperationChainHandler",
"interfaces": "implements OutputOperationHandler<ValidateOperationChain, ValidationResult>",
"methods": [
{
"class_method_s... | {
"body": "@Override\n public ValidationResult doOperation(final ValidateOperationChain operation, final Context context, final Store store) throws OperationException {\n return validateOperationChain(operation.getOperationChain(), context.getUser(), store);\n }",
"class_method_signature": "ValidateOpe... | {
"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_382 | {
"fields": [],
"file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/element/comparison/ElementPropertyComparatorTest.java",
"identifier": "ElementPropertyComparatorTest",
"interfaces": "",
"superclass": "extends JSONSerialisationTest<ElementPropertyComparator>"
} | {
"body": "@Test\n public void shouldCompareReversed() {\n // Given\n final Entity smallEntity = makeEntity(TestGroups.ENTITY, TestPropertyNames.PROP_1, 1);\n final Entity largeEntity = makeEntity(TestGroups.ENTITY, TestPropertyNames.PROP_1, 2);\n\n final ElementComparator comparator = ... | {
"fields": [
{
"declarator": "comparator",
"modifier": "private",
"original_string": "private Comparator comparator;",
"type": "Comparator",
"var_name": "comparator"
},
{
"declarator": "count = 0",
"modifier": "public static",
"original_string": "public sta... | {
"body": "@Override\n public int compare(final Element e1, final Element e2) {\n count++;\n\n if (null == e1) {\n if (null == e2) {\n return 0;\n }\n return 1;\n }\n if (null == e2) {\n return -1;\n }\n\n if (!gro... | {
"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_1200 | {
"fields": [
{
"declarator": "operationChain = new OperationChain.Builder()\n .first(new AddElements())\n .then(new GetElements())\n .build()",
"modifier": "final",
"original_string": "final OperationChain operationChain = new OperationChain.Builder()\n ... | {
"body": "@Test\n public void shouldJSONSerialiseAndDeserialise() throws SerialisationException {\n // Given\n final ValidateOperationChain validateOperationChain = new ValidateOperationChain.Builder()\n .operationChain(operationChain)\n .build();\n\n // When\n ... | {
"fields": [
{
"declarator": "operationChain",
"modifier": "@Required\n private",
"original_string": "@Required\n private OperationChain operationChain;",
"type": "OperationChain",
"var_name": "operationChain"
},
{
"declarator": "options",
"modifier": "priv... | {
"body": "public OperationChain getOperationChain() {\n return operationChain;\n }",
"class_method_signature": "ValidateOperationChain.getOperationChain()",
"constructor": false,
"full_signature": "public OperationChain getOperationChain()",
"identifier": "getOperationChain",
"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_1345 | {
"fields": [],
"file": "library/spark/spark-accumulo-library/src/test/java/uk/gov/gchq/gaffer/sparkaccumulo/operation/javardd/GetJavaRDDOfElementsInRangesTest.java",
"identifier": "GetJavaRDDOfElementsInRangesTest",
"interfaces": "",
"superclass": "extends OperationTest<GetJavaRDDOfElementsInRanges>"
} | {
"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": "GetJavaRDDOfElementsInRanges.getInput()",
"constructor": false,
"full_signature": "@Override public Iterable<? extends Pair<? extends Elemen... | {
"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_697 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/handler/compare/MaxHandlerTest.java",
"identifier": "MaxHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldFindMaxBasedOnElement() throws OperationException {\n // Given\n final Entity entity1 = makeEntity(1, 1);\n final Entity entity2 = makeEntity(2, 2);\n final Entity entity3 = makeEntity(3, 3);\n final Entity entity4 = makeEntity(4, 4);\n\n ... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/compare/MaxHandler.java",
"identifier": "MaxHandler",
"interfaces": "implements OutputOperationHandler<Max, Element>",
"methods": [
{
"class_method_signature": "MaxHandler.doOperation(final Max operation, fi... | {
"body": "@Override\n public Element doOperation(final Max operation, final Context context, final Store store) throws OperationException {\n // If there is no input or there are no comparators, we return null\n if (null == operation.getInput()\n || null == operation.getComparators()\... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_947 | {
"fields": [
{
"declarator": "EDGE_DESCRIPTION = \"Edge description\"",
"modifier": "public static final",
"original_string": "public static final String EDGE_DESCRIPTION = \"Edge description\";",
"type": "String",
"var_name": "EDGE_DESCRIPTION"
},
{
"declarator": "ENT... | {
"body": "@Test\n public void testCorrectSerialiserRetrievableFromConfig() throws NotSerializableException {\n Schema store = new Schema.Builder()\n .type(TestTypes.PROP_STRING,\n new TypeDefinition.Builder().clazz(St... | {
"fields": [
{
"declarator": "unknownType = new TypeDefinition()",
"modifier": "private final",
"original_string": "private final TypeDefinition unknownType = new TypeDefinition();",
"type": "TypeDefinition",
"var_name": "unknownType"
},
{
"declarator": "id",
"mo... | {
"body": "@Override\n public SchemaElementDefinition getElement(final String group) {\n return (SchemaElementDefinition) super.getElement(group);\n }",
"class_method_signature": "Schema.getElement(final String group)",
"constructor": false,
"full_signature": "@Override public SchemaElementDefiniti... | {
"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_414 | {
"fields": [],
"file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/element/function/ExtractPropertyTest.java",
"identifier": "ExtractPropertyTest",
"interfaces": "",
"superclass": "extends FunctionTest"
} | {
"body": "@Test\n public void shouldReturnNullWhenNameNotFoundInElementProperties() {\n final Element element = mock(Element.class);\n final String propName = \"absentProperty\";\n\n final ExtractProperty extractor = new ExtractProperty(propName);\n\n final Object result = extractor.ap... | {
"fields": [
{
"declarator": "name",
"modifier": "private",
"original_string": "private String name;",
"type": "String",
"var_name": "name"
}
],
"file": "core/data/src/main/java/uk/gov/gchq/gaffer/data/element/function/ExtractProperty.java",
"identifier": "ExtractProperty"... | {
"body": "@Override\n public Object apply(final Element element) {\n return null != element ? element.getProperty(name) : null;\n }",
"class_method_signature": "ExtractProperty.apply(final Element element)",
"constructor": false,
"full_signature": "@Override public Object apply(final Element eleme... | {
"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_551 | {
"fields": [],
"file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/iterable/ConsumableBlockingQueueTest.java",
"identifier": "ConsumableBlockingQueueTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldNotBlockWhenConsumingWhenQueueIsEmpty() {\n final ConsumableBlockingQueue<Integer> queue = new ConsumableBlockingQueue<>(5);\n\n final Iterator<Integer> iterator = queue.iterator();\n\n assertFalse(iterator.hasNext());\n }",
"class_method_signature": "... | {
"fields": [
{
"declarator": "serialVersionUID = 4048319404021495269L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 4048319404021495269L;",
"type": "long",
"var_name": "serialVersionUID"
}
],
"file": "core/common-util/... | {
"body": "@Override\n @Nonnull\n public Iterator<T> iterator() {\n return new Iterator<T>() {\n @Override\n public boolean hasNext() {\n return !isEmpty();\n }\n\n @Override\n public T next() {\n if (!hasNext()) {\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_101 | {
"fields": [
{
"declarator": "BYTE_ENTITY_GRAPH = \"byteEntityGraph\"",
"modifier": "private static final",
"original_string": "private static final String BYTE_ENTITY_GRAPH = \"byteEntityGraph\";",
"type": "String",
"var_name": "BYTE_ENTITY_GRAPH"
},
{
"declarator": "... | {
"body": "@Test\n public void shouldAllowRangeScanOperationsWhenVertexSerialiserDoesPreserveObjectOrdering() throws StoreException {\n // Given\n final AccumuloStore store = new AccumuloStore();\n final Serialiser serialiser = new StringSerialiser();\n store.preInitialise(BYTE_ENTITY_G... | {
"fields": [
{
"declarator": "TRAITS =\n Collections.unmodifiableSet(Sets.newHashSet(\n ORDERED,\n VISIBILITY,\n INGEST_AGGREGATION,\n QUERY_AGGREGATION,\n PRE_AGGREGATION_FILTERING,\n ... | {
"body": "public void preInitialise(final String graphId, final Schema schema, final StoreProperties properties) throws StoreException {\n setProperties(properties);\n\n final String deprecatedTableName = getProperties().getTable();\n if (null == graphId && null != deprecatedTableName) {\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_1083 | {
"fields": [
{
"declarator": "JSON_PATH = \"/functionAuthoriser.json\"",
"modifier": "private static final",
"original_string": "private static final String JSON_PATH = \"/functionAuthoriser.json\";",
"type": "String",
"var_name": "JSON_PATH"
}
],
"file": "core/graph/src/tes... | {
"body": "@Test\n public void shouldMaintainOperationChainIfItFailsToSerialise() {\n // Given\n FunctionAuthoriser authoriser = new FunctionAuthoriser(Lists.newArrayList(Identity.class));\n\n List fakeInput = Lists.newArrayList(new EntitySeed(1), new EntitySeed(2), new EntitySeed(3));\n ... | {
"fields": [
{
"declarator": "ERROR_MESSAGE_PREFIX = \"Operation chain contained an unauthorised function: \"",
"modifier": "private static final",
"original_string": "private static final String ERROR_MESSAGE_PREFIX = \"Operation chain contained an unauthorised function: \";",
"type": "S... | {
"body": "@Override\n public void preExecute(final OperationChain<?> opChain, final Context context) {\n if (unauthorisedFunctions == null || unauthorisedFunctions.isEmpty()) {\n return;\n }\n\n Object input = null;\n // Null the input to avoid serialising potentially large ... | {
"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.