id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
47973088_817 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/handler/output/ToSingletonListHandlerTest.java",
"identifier": "ToSingletonListHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldConvertIntToSingletonList() throws OperationException {\n // Given\n final int singleInt = 4;\n final List<Integer> expectedResult = Arrays.asList(4);\n\n final ToSingletonListHandler handler = new ToSingletonListHandler();\n final ToSingleton... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/output/ToSingletonListHandler.java",
"identifier": "ToSingletonListHandler",
"interfaces": "implements OutputOperationHandler<ToSingletonList<T>, List<? extends T>>",
"methods": [
{
"class_method_signature":... | {
"body": "@Override\n public List<? extends T> doOperation(final ToSingletonList<T> operation, final Context context, final Store store) throws OperationException {\n if (null != operation.getInput()) {\n return Collections.singletonList(operation.getInput());\n } else {\n thro... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1096 | {
"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 shouldAcceptOperationChainWhenUserHasMaxAuthScoreGreaterThanChainScore() {\n // Given\n final OperationChainLimiter hook = fromJson(OP_CHAIN_LIMITER_PATH);\n final OperationChain opChain = new OperationChain.Builder()\n .first(new GetAdjacentIds())... | {
"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_952 | {
"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 shouldReturnTrueWhenSchemaHasValidatorEntityIdentifierFilters() {\n // Given\n final Schema schema = new Schema.Builder()\n .entity(TestGroups.ENTITY, new SchemaEntityDefinition.Builder().vertex(\"str\").build())\n ... | {
"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_1079 | {
"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 shouldAllowEmptyOperationChain() {\n // Given\n OperationChain chain = new OperationChain();\n\n // When\n FunctionAuthoriser authoriser = new FunctionAuthoriser(Lists.newArrayList(Identity.class));\n\n // Then no exceptions\n authoriser.preE... | {
"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"
... |
47973088_401 | {
"fields": [],
"file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/element/function/ElementFilterTest.java",
"identifier": "ElementFilterTest",
"interfaces": "",
"superclass": "extends JSONSerialisationTest<ElementFilter>"
} | {
"body": "@Test\n public void shouldReturnModifiableComponentsWhenNotLocked() {\n final ElementFilter filter = getTestObject();\n\n final List<TupleAdaptedPredicate<String, ?>> components = filter.getComponents();\n\n assertDoesNotThrow(() -> components.add(null));\n }",
"class_method_si... | {
"fields": [
{
"declarator": "elementTuple = new ElementTuple()",
"modifier": "private final",
"original_string": "private final ElementTuple elementTuple = new ElementTuple();",
"type": "ElementTuple",
"var_name": "elementTuple"
},
{
"declarator": "readOnly",
"m... | {
"body": "@Override\n public List<TupleAdaptedPredicate<String, ?>> getComponents() {\n if (readOnly) {\n return Collections.unmodifiableList(super.getComponents());\n }\n\n return super.getComponents();\n }",
"class_method_signature": "ElementFilter.getComponents()",
"const... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_285 | {
"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 shouldAddGlobalTransformToEntityGroup() {\n // Given\n final ElementTransformer elementTransformer = new ElementTransformer.Builder()\n .select(TestPropertyNames.PROP_3)\n .execute(new Identity())\n .project(TestPropertyNames... | {
"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_1307 | {
"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 testAggregateWhenBothInNotFullState() {\n // Given\n final BoundedTimestampSet boundedTimestampSet1 = new BoundedTimestampSet(CommonTimeUtil.TimeBucket.SECOND, 10);\n boundedTimestampSet1.add(Instant.ofEpochMilli(1000L));\n boundedTimestampSet1.add(Instant... | {
"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_1242 | {
"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 shouldBuildOperationChainWithTypeUnsafe() {\n // When\n final GetAdjacentIds getAdjIds1 = new GetAdjacentIds();\n final ExportToSet<CloseableIterable<? extends EntityId>> exportToSet1 = new ExportToSet<>();\n final DiscardOutput discardOutput1 = new Discar... | {
"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_790 | {
"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 shouldFailValidationWhenTypeArgumentOfBinaryOperatorInFunctionIsIncorrect() {\n // Given\n final Schema schema = new Schema.Builder()\n .entity(TestGroups.ENTITY, new SchemaEntityDefinition.Builder()\n .property(TestPropertyNames.TI... | {
"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_840 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/handler/output/ToStreamHandlerTest.java",
"identifier": "ToStreamHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldHandleNullInput() throws OperationException {\n // Given\n final ToStreamHandler<Integer> handler = new ToStreamHandler();\n final ToStream operation = mock(ToStream.class);\n\n given(operation.getInput()).willReturn(null);\n\n //When\n ... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/output/ToStreamHandler.java",
"identifier": "ToStreamHandler",
"interfaces": "implements OutputOperationHandler<ToStream<T>, Stream<? extends T>>",
"methods": [
{
"class_method_signature": "ToStreamHandler.d... | {
"body": "@Override\n public Stream<? extends T> doOperation(final ToStream<T> operation, final Context context, final Store store) throws OperationException {\n if (null == operation.getInput()) {\n return null;\n }\n\n return Streams.toStream(operation.getInput());\n }",
"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_513 | {
"fields": [],
"file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/CollectionUtilTest.java",
"identifier": "CollectionUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnFalseWhenContainsAnyCalledWithNullCollection() {\n final Object[] values = new Object[] {1, 2, 3};\n\n final boolean result = CollectionUtil.containsAny(null, values);\n\n assertFalse(result);\n }",
"class_method_signature": "CollectionUtilTest.s... | {
"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_143 | {
"fields": [],
"file": "store-implementation/accumulo-store/src/test/java/uk/gov/gchq/gaffer/accumulostore/operation/handler/GetElementsHandlerTest.java",
"identifier": "GetElementsHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldThrowExceptionIfAnOldOperationOptionIsUsed() throws OperationException, StoreException {\n // Given\n final Iterable<EntityId> ids = mock(Iterable.class);\n final GetElementsHandler handler = new GetElementsHandler();\n final GetElements getElements ... | {
"fields": [],
"file": "store-implementation/accumulo-store/src/main/java/uk/gov/gchq/gaffer/accumulostore/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,\n final Context context, final Store store)\n throws OperationException {\n return doOperation(operation, context.getUser(), (Accu... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_456 | {
"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 shouldPassValidationWithValidStringName() {\n assertDoesNotThrow(() -> PropertiesUtil.validateName(VALID_STRING));\n }",
"class_method_signature": "PropertiesUtilTest.shouldPassValidationWithValidStringName()",
"constructor": false,
"full_signature": "@Test public voi... | {
"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_1184 | {
"fields": [],
"file": "core/operation/src/test/java/uk/gov/gchq/gaffer/operation/impl/compare/MaxTest.java",
"identifier": "MaxTest",
"interfaces": "",
"superclass": "extends OperationTest<Max>"
} | {
"body": "@Test\n @Override\n public void builderShouldCreatePopulatedOperation() {\n // Given\n final Max max = new Max.Builder().input(new Entity.Builder()\n .group(TestGroups.ENTITY)\n .property(\"property\", 1)\n .build(), new Entity.Builder()\n ... | {
"fields": [
{
"declarator": "input",
"modifier": "private",
"original_string": "private Iterable<? extends Element> input;",
"type": "Iterable<? extends Element>",
"var_name": "input"
},
{
"declarator": "comparators",
"modifier": "@Required\n private",
... | {
"body": "@Override\n public Iterable<? extends Element> getInput() {\n return input;\n }",
"class_method_signature": "Max.getInput()",
"constructor": false,
"full_signature": "@Override public Iterable<? extends Element> getInput()",
"identifier": "getInput",
"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_905 | {
"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 shouldReturnQueryAggregatorWithMultiPropertyAggregator() {\n // Given\n final T elementDef = createBuilder()\n .property(\"property1\", PROPERTY_STRING_TYPE)\n .property(\"property2\", PROPERTY_STRING_TYPE)\n .property(\"prop... | {
"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_1311 | {
"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 testCantMergeIfDifferentTimeBucket() {\n try {\n final BoundedTimestampSet boundedTimestampSet1 = new BoundedTimestampSet(CommonTimeUtil.TimeBucket.SECOND, 10);\n final BoundedTimestampSet boundedTimestampSet2 = new BoundedTimestampSet(CommonTimeUtil.Time... | {
"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_769 | {
"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 shouldExecuteCorrectlyWithOperationChainAsThen() throws OperationException {\n // Given\n final Object input = Arrays.asList(new EntitySeed(\"1\"), new EntitySeed(\"2\"));\n final Conditional conditional = mock(Conditional.class);\n final Predicate<Object>... | {
"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_293 | {
"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 shouldAddGlobalTransformToEdgeGroup() {\n // Given\n final ElementTransformer elementTransformer = new ElementTransformer.Builder()\n .select(TestPropertyNames.PROP_3)\n .execute(new Identity())\n .project(TestPropertyNames.P... | {
"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_339 | {
"fields": [
{
"declarator": "EDGE_AB = new Edge.Builder().group(TestGroups.EDGE).source(\"A\").dest(\"B\").directed(true).build()",
"modifier": "private static final",
"original_string": "private static final Edge EDGE_AB = new Edge.Builder().group(TestGroups.EDGE).source(\"A\").dest(\"B\").di... | {
"body": "@Test\n public void shouldGetEntitiesAtDistance() {\n // Given\n // [A] -> [E] -> [D]\n // \\ \\ \\\n // (BasicEntity) (BasicEntity) (BasicEntity)\n\n // When\n final Walk walk = new Walk.Builder()\n .entit... | {
"fields": [
{
"declarator": "edges",
"modifier": "private final",
"original_string": "private final List<Set<Edge>> edges;",
"type": "List<Set<Edge>>",
"var_name": "edges"
},
{
"declarator": "entities",
"modifier": "private final",
"original_string": "priv... | {
"body": "@JsonIgnore\n public Set<Entity> getEntitiesAtDistance(final int n) {\n return entities.get(n).getValue();\n }",
"class_method_signature": "Walk.getEntitiesAtDistance(final int n)",
"constructor": false,
"full_signature": "@JsonIgnore public Set<Entity> getEntitiesAtDistance(final int 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_786 | {
"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 shouldAggregateAMixOfEdgesAndEntities() throws OperationException {\n // Given\n final Schema schema = new Schema.Builder()\n .edge(TestGroups.EDGE, new SchemaEdgeDefinition.Builder()\n .aggregator(new ElementAggregator.Builder()\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_1254 | {
"fields": [],
"file": "core/operation/src/test/java/uk/gov/gchq/gaffer/named/operation/NamedOperationDetailTest.java",
"identifier": "NamedOperationDetailTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldConfigureCustomReadAccessPredicateWhenSpecified() {\n final AccessPredicate customAccessPredicate = new AccessPredicate(new CustomUserPredicate());\n final NamedOperationDetail namedOperationDetail = getBaseNamedOperationDetailBuilder()\n .readAcces... | {
"fields": [
{
"declarator": "serialVersionUID = -8831783492657131469L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -8831783492657131469L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "CHA... | {
"body": "public AccessPredicate getReadAccessPredicate() {\n try {\n return readAccessPredicateJson != null ? JSONSerialiser.deserialise(readAccessPredicateJson, AccessPredicate.class) : null;\n } catch (final SerialisationException e) {\n throw new IllegalArgumentException(\"rea... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_155 | {
"fields": [
{
"declarator": "factory",
"modifier": "private final",
"original_string": "private final AbstractCoreKeyIteratorSettingsFactory factory;",
"type": "AbstractCoreKeyIteratorSettingsFactory",
"var_name": "factory"
}
],
"file": "store-implementation/accumulo-store/... | {
"body": "@Test\n public void shouldReturnPostAggFilterIterator() throws Exception {\n // Given\n final AccumuloStore store = mock(AccumuloStore.class);\n final Schema schema = createSchema();\n final View view = new View.Builder()\n .edge(TestGroups.EDGE, new ViewElemen... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(AbstractCoreKeyIteratorSettingsFactory.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(AbstractCoreKeyIteratorSettingsFactory.class);",
"type": "Log... | {
"body": "@Override\n public IteratorSetting getElementPostAggregationFilterIteratorSetting(final View view, final AccumuloStore store)\n throws IteratorSettingException {\n if (!view.hasPostAggregationFilters()) {\n LOGGER.debug(\"Returning null from getElementPostAggregationFilterIt... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_505 | {
"fields": [],
"file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/CollectionUtilTest.java",
"identifier": "CollectionUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnTreeSetWithNoItemsForNullArray() {\n final TreeSet<String> treeSet = CollectionUtil.treeSet(null);\n\n assertEquals(0, treeSet.size());\n }",
"class_method_signature": "CollectionUtilTest.shouldReturnTreeSetWithNoItemsForNullArray()",
"constructor": f... | {
"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 <T> TreeSet<T> treeSet(final T item) {\n final TreeSet<T> treeSet = new TreeSet<>();\n if (null != item) {\n treeSet.add(item);\n }\n\n return treeSet;\n }",
"class_method_signature": "CollectionUtil.treeSet(final T item)",
"constructor": false,
... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_856 | {
"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 shouldAllowForOperationChainJSONWithParameter() {\n try {\n final String opChainJSON = \"{ \\\"operations\\\": [ { \\\"class\\\":\\\"uk.gov.gchq.gaffer.operation.impl.get.GetAllElements\\\" }, { \\\"class\\\":\\\"uk.gov.gchq.gaffer.operation.impl.Limit\\\", \\\"resu... | {
"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_913 | {
"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 shouldValidateAndReturnTrueWhenEmptyFunctions() {\n // Given\n final ViewValidator validator = new ViewValidator();\n final View view = new View.Builder().build();\n final Schema schema = new Schema();\n\n // When\n final ValidationResult res... | {
"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_1038 | {
"fields": [],
"file": "core/serialisation/src/test/java/uk/gov/gchq/gaffer/serialisation/implementation/raw/CompactRawLongSerialiserTest.java",
"identifier": "CompactRawLongSerialiserTest",
"interfaces": "",
"superclass": "extends ToBytesSerialisationTest<Long>"
} | {
"body": "@Test\n public void cantSerialiseStringClass() {\n assertFalse(serialiser.canHandle(String.class));\n }",
"class_method_signature": "CompactRawLongSerialiserTest.cantSerialiseStringClass()",
"constructor": false,
"full_signature": "@Test public void cantSerialiseStringClass()",
"identi... | {
"fields": [
{
"declarator": "serialVersionUID = 6104372357426908732L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 6104372357426908732L;",
"type": "long",
"var_name": "serialVersionUID"
}
],
"file": "core/serialisatio... | {
"body": "@Override\n public boolean canHandle(final Class clazz) {\n return Long.class.equals(clazz);\n }",
"class_method_signature": "CompactRawLongSerialiser.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_1192 | {
"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 shouldValidateOperationWhenFirstOperationContainsNonNullInput() {\n // Given\n final GetWalks getWalks = new GetWalks.Builder().input(new EntitySeed(\"1\"), new EntitySeed(\"2\"))\n .operations(new GetElements.Builder()... | {
"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_440 | {
"fields": [],
"file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/element/ElementTest.java",
"identifier": "ElementTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnFalseForEqualsWithNullElement() {\n final Element element1 = newElement(\"group\");\n\n boolean isEqual = element1.equals(null);\n\n assertFalse(isEqual);\n }",
"class_method_signature": "ElementTest.shouldReturnFalseForEqualsWithNullElement()",
... | {
"fields": [
{
"declarator": "DEFAULT_GROUP = \"UNKNOWN\"",
"modifier": "public static final",
"original_string": "public static final String DEFAULT_GROUP = \"UNKNOWN\";",
"type": "String",
"var_name": "DEFAULT_GROUP"
},
{
"declarator": "properties",
"modifier":... | {
"body": "@Override\n public boolean equals(final Object obj) {\n if (this == obj) {\n return true;\n }\n\n if (null == obj || getClass() != obj.getClass()) {\n return false;\n }\n\n final Element element = (Element) obj;\n\n return new EqualsBuilder... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_694 | {
"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 shouldFindMaxBasedOnProperty() throws OperationException {\n // Given\n final Entity entity1 = makeEntity(\"property\", 1);\n final Entity entity2 = makeEntity(\"property\", 2);\n final Entity entity3 = makeEntity(\"property\", 3);\n final Entity en... | {
"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_1346 | {
"fields": [],
"file": "library/sketches-library/src/test/java/uk/gov/gchq/gaffer/sketches/datasketches/sampling/serialisation/ReservoirLongsUnionSerialiserTest.java",
"identifier": "ReservoirLongsUnionSerialiserTest",
"interfaces": "",
"superclass": "extends ViaCalculatedArrayValueSerialiserTest<ReservoirLo... | {
"body": "@Test\n public void testCanHandleReservoirLongsUnion() {\n assertTrue(serialiser.canHandle(ReservoirLongsUnion.class));\n assertFalse(serialiser.canHandle(String.class));\n }",
"class_method_signature": "ReservoirLongsUnionSerialiserTest.testCanHandleReservoirLongsUnion()",
"constru... | {
"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 ReservoirLongsUnion.class.equals(clazz);\n }",
"class_method_signature": "ReservoirLongsUnionSerialiser.canHandle(final Class clazz)",
"constructor": false,
"full_signature": "@Override public boolean canHandle(final Clas... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1203 | {
"fields": [
{
"declarator": "ADD_ELEMENTS_JSON = String.format(\"{%n\" +\n \" \\\"class\\\" : \\\"uk.gov.gchq.gaffer.operation.impl.add.AddElements\\\",%n\" +\n \" \\\"validate\\\" : true,%n\" +\n \" \\\"skipInvalidElements\\\" : false,%n\" +\n \" \\\"input\... | {
"body": "@Test\n public void shouldJSONSerialiseAndDeserialise() throws SerialisationException {\n // Given\n final AddElements addElements = getTestObject();\n\n final Map<String, String> options = new HashMap<>();\n options.put(\"option\", \"value\");\n\n addElements.setOptio... | {
"fields": [
{
"declarator": "validate = true",
"modifier": "private",
"original_string": "private boolean validate = true;",
"type": "boolean",
"var_name": "validate"
},
{
"declarator": "skipInvalidElements",
"modifier": "private",
"original_string": "priv... | {
"body": "@Override\n public void setOptions(final Map<String, String> options) {\n this.options = options;\n }",
"class_method_signature": "AddElements.setOptions(final Map<String, String> options)",
"constructor": false,
"full_signature": "@Override public void setOptions(final Map<String, Strin... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_381 | {
"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 shouldCompareWhenSecondElementsHasWrongGroup() {\n // Given\n final Entity smallEntity = makeEntity(TestGroups.ENTITY_2, TestPropertyNames.PROP_1, 1);\n final Entity largeEntity = makeEntity(TestGroups.ENTITY, TestPropertyNames.PROP_1, 2);\n\n final Elemen... | {
"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_1080 | {
"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 shouldAllowAllFunctionsWhenUnauthorisedFunctionsAreNull() {\n // Given\n OperationChain chain = generateOperation(Identity.class, ToString.class);\n\n // When\n FunctionAuthoriser authoriser = new FunctionAuthoriser(null);\n\n // Then no exceptions\... | {
"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"
... |
47973088_801 | {
"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 shouldFailValidationWhenTypeArgumentOfPredicateIsIncorrect() {\n // Given\n final Schema schema = new Schema.Builder()\n .edge(TestGroups.EDGE, new SchemaEdgeDefinition.Builder()\n .source(\"junctionA\")\n .de... | {
"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_552 | {
"fields": [],
"file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/iterable/StreamIterableTest.java",
"identifier": "StreamIterableTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldDelegateIteratorToIterable() {\n // Given\n final StreamSupplier<Object> streamSupplier = mock(StreamSupplier.class);\n final Stream<Object> stream = mock(Stream.class);\n given(streamSupplier.get()).willReturn(stream);\n final StreamIterable<... | {
"fields": [
{
"declarator": "streamSupplier",
"modifier": "private final",
"original_string": "private final StreamSupplier<T> streamSupplier;",
"type": "StreamSupplier<T>",
"var_name": "streamSupplier"
}
],
"file": "core/common-util/src/main/java/uk/gov/gchq/gaffer/commonu... | {
"body": "@Override\n public CloseableIterator<T> iterator() {\n return new StreamIterator<>(streamSupplier.get());\n }",
"class_method_signature": "StreamIterable.iterator()",
"constructor": false,
"full_signature": "@Override public CloseableIterator<T> iterator()",
"identifier": "iterator",
... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_102 | {
"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 shouldNotAllowRangeScanOperationsWhenVertexSerialiserDoesNotPreserveObjectOrdering() throws StoreException {\n // Given\n final AccumuloStore store = new AccumuloStore();\n final Serialiser serialiser = new CompactRawLongSerialiser();\n store.preInitialise... | {
"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_417 | {
"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 shouldReturnNullWithNoIdentifierTypeProvided() {\n final Element element = mock(Element.class);\n final ExtractId extractor = new ExtractId();\n\n final Object result = extractor.apply(element);\n\n assertNull(result);\n }",
"class_method_signature": ... | {
"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_944 | {
"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 testLoadingSchemaFromJson() {\n // Edge definitions\n SchemaElementDefinition edgeDefinition = schema.getEdge(TestGroups.EDGE);\n assertNotNull(edgeDefinition);\n assertEquals(EDGE_DESCRIPTION, edgeDefinition.getDescript... | {
"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 TypeDefinition getType(final String typeName) {\n TypeDefinition typeDef = types.get(typeName);\n if (null == typeDef) {\n typeDef = unknownType;\n }\n\n return typeDef;\n }",
"class_method_signature": "Schema.getType(final String typeName)",
"constructo... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_27 | {
"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 shouldAlwaysReturnSupportedTraits() throws Exception {\n // Given\n addGraphWithIds(ACC_ID_1, ID_PROPS_ACC_1, ID_SCHEMA_ENTITY);\n\n Set<StoreTrait> before = store.getTraits();\n\n // When\n addGraphWithPaths(ACC_ID_2, PROPERTIES_ALT, PATH_BASIC_ENT... | {
"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 Set<StoreTrait> getTraits() {\n return StoreTrait.ALL_TRAITS;\n }",
"class_method_signature": "FederatedStore.getTraits()",
"constructor": false,
"full_signature": "@Override public Set<StoreTrait> getTraits()",
"identifier": "getTraits",
"invocations": [],
"modi... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1278 | {
"fields": [
{
"declarator": "cache",
"modifier": "private static",
"original_string": "private static JcsCache<String, Integer> cache;",
"type": "JcsCache<String, Integer>",
"var_name": "cache"
}
],
"file": "library/cache-library/jcs-cache-service/src/test/java/uk/gov/gchq/... | {
"body": "@Test\n public void shouldThrowAnExceptionIfEntryAlreadyExistsWhenUsingPutSafe() {\n try {\n cache.put(\"test\", 1);\n cache.putSafe(\"test\", 1);\n fail();\n } catch (final OverwritingException | CacheOperationException e) {\n assertEquals(\"Cac... | {
"fields": [
{
"declarator": "cache",
"modifier": "private final",
"original_string": "private final GroupCacheAccess<K, V> cache;",
"type": "GroupCacheAccess<K, V>",
"var_name": "cache"
},
{
"declarator": "groupName",
"modifier": "private final",
"original... | {
"body": "@Override\n public void put(final K key, final V value) throws CacheOperationException {\n if (null == key) {\n throw new CacheOperationException(\"Key must not be null\");\n }\n try {\n cache.putInGroup(key, groupName, value);\n } catch (final CacheExce... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_250 | {
"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 shouldGetAllAvailableOperations() throws IOException {\n // When\n final Set<Class> supportedOperations = service.getOperations();\n\n // Then\n assertTrue(!supportedOperations.isEmpty());\n assertEquals(1, supportedOperations.size());\n }",
"c... | {
"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> getOperations() {\n return (Set) graphFactory.getGraph().getSupportedOperations();\n }",
"class_method_signature": "GraphConfigurationService.getOperations()",
"constructor": false,
"full_signature": "@Override public Set<Class> getOperations()",
"identifi... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_600 | {
"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 testCanSerialiseEdgeIdClass() throws SerialisationException {\n assertTrue(serialiser.canHandle(EdgeId.class));\n }",
"class_method_signature": "EdgeIdSerialiserTest.testCanSerialiseEdgeIdClass()",
"constructor": false,
"full_signature": "@Test public void testCanSeri... | {
"fields": [
{
"declarator": "serialVersionUID = -7123572023129773512L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -7123572023129773512L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "boo... | {
"body": "@Override\n public boolean canHandle(final Class clazz) {\n return EdgeId.class.isAssignableFrom(clazz);\n }",
"class_method_signature": "EdgeIdSerialiser.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_315 | {
"fields": [],
"file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/elementdefinition/view/ViewUtilTest.java",
"identifier": "ViewUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldThrowExceptionOnRemovalOfNullGroups() {\n final View view = new View.Builder()\n .edge(TestGroups.EDGE)\n .build();\n\n final Exception exception = assertThrows(IllegalArgumentException.class, () -> ViewUtil.removeGroups(view, null));... | {
"fields": [],
"file": "core/data/src/main/java/uk/gov/gchq/gaffer/data/elementdefinition/view/ViewUtil.java",
"identifier": "ViewUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "ViewUtil.ViewUtil()",
"constructor": true,
"full_signature": "private ViewUtil()",
... | {
"body": "public static View removeGroups(final View view, final String... groups) {\n if (null == view) {\n throw new IllegalArgumentException(\"View cannot be null\");\n }\n\n final LinkedHashMap<String, ViewElementDefinition> entities = new LinkedHashMap<>(view.getEntities());\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_745 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/handler/WhileHandlerTest.java",
"identifier": "WhileHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldNotRepeatWhileConditionIsFalse() throws OperationException {\n // Given\n final EntitySeed input = mock(EntitySeed.class);\n final int maxRepeats = 3;\n final boolean condition = false;\n final Operation delegate = mock(GetElements.class);\n ... | {
"fields": [
{
"declarator": "maxRepeats = While.MAX_REPEATS",
"modifier": "private",
"original_string": "private int maxRepeats = While.MAX_REPEATS;",
"type": "int",
"var_name": "maxRepeats"
}
],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/W... | {
"body": "@Override\n public Object doOperation(final While operation,\n final Context context,\n final Store store) throws OperationException {\n validateMaxRepeats(operation);\n\n Object input = operation.getInput();\n for (int repea... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1297 | {
"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 shouldReturnTrueIfNoUpperAndLowerBoundsAreProvided() {\n // When no bounds are provided\n // Then\n assertTrue(predicate.test(timestamps));\n }",
"class_method_signature": "RBMBackedTimestampSetInRangeTest.shouldReturnTrueIfNoUpperAndLowerBoundsAreProvided()... | {
"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": "@Override\n public boolean test(final RBMBackedTimestampSet rbmBackedTimestampSet) {\n if (rbmBackedTimestampSet == null) {\n throw new IllegalArgumentException(\"TimestampSet cannot be null\");\n }\n if (rbmBackedTimestampSet.getNumberOfTimestamps() == 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_196 | {
"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 shouldOnlyAcceptUndirectedEdges() throws OperationException, SerialisationException {\n // Given\n final ElementDedupeFilterProcessor processor = new ElementDedupeFilterProcessor(false, true, DirectedType.UNDIRECTED);\n\n // When / Then\n for (final Elemen... | {
"fields": [
{
"declarator": "elementSerialisation = new ElementSerialisation(null)",
"modifier": "private final",
"original_string": "private final ElementSerialisation elementSerialisation = new ElementSerialisation(null);",
"type": "ElementSerialisation",
"var_name": "elementSeri... | {
"body": "@Override\n public boolean test(final LazyElementCell elementCell) {\n final Cell cell = elementCell.getCell();\n final byte flag = getFlag(cell);\n final boolean isEdge = flag != HBaseStoreConstants.ENTITY;\n\n if (!edges && isEdge) {\n return false;\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_895 | {
"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 shouldNotBeAbleToAddPropertiesOnceBuilt() {\n // Given\n final T elementDef = createBuilder().build();\n\n // When / Then\n try {\n elementDef.getPropertyMap()\n .put(\"new property\", \"string\");\n fail(\"Exceptio... | {
"fields": [
{
"declarator": "elementDefValidator",
"modifier": "private final",
"original_string": "private final SchemaElementDefinitionValidator elementDefValidator;",
"type": "SchemaElementDefinitionValidator",
"var_name": "elementDefValidator"
},
{
"declarator": "... | {
"body": "@JsonGetter(\"properties\")\n public Map<String, String> getPropertyMap() {\n return Collections.unmodifiableMap(properties);\n }",
"class_method_signature": "SchemaElementDefinition.getPropertyMap()",
"constructor": false,
"full_signature": "@JsonGetter(\"properties\") public Map<String... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1014 | {
"fields": [],
"file": "core/serialisation/src/test/java/uk/gov/gchq/gaffer/serialisation/implementation/ordered/OrderedDoubleSerialiserTest.java",
"identifier": "OrderedDoubleSerialiserTest",
"interfaces": "",
"superclass": "extends ToBytesSerialisationTest<Double>"
} | {
"body": "@Test\n public void canSerialiseDoubleClass() {\n assertTrue(serialiser.canHandle(Double.class));\n }",
"class_method_signature": "OrderedDoubleSerialiserTest.canSerialiseDoubleClass()",
"constructor": false,
"full_signature": "@Test public void canSerialiseDoubleClass()",
"identifier"... | {
"fields": [
{
"declarator": "serialVersionUID = -4750738170126596560L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -4750738170126596560L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "LON... | {
"body": "@Override\n public boolean canHandle(final Class clazz) {\n return Double.class.equals(clazz);\n }",
"class_method_signature": "OrderedDoubleSerialiser.canHandle(final Class clazz)",
"constructor": false,
"full_signature": "@Override public boolean canHandle(final Class clazz)",
"ident... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1151 | {
"fields": [],
"file": "core/operation/src/test/java/uk/gov/gchq/gaffer/operation/data/EdgeSeedTest.java",
"identifier": "EdgeSeedTest",
"interfaces": "",
"superclass": "extends JSONSerialisationTest<EdgeSeed>"
} | {
"body": "@Test\n public void shouldBeNotEqualWhenDestinationNotEqual() {\n // Given\n final String source = \"source\";\n final String destination = \"destination\";\n final boolean directed = true;\n final EdgeId seed1 = new EdgeSeed(source, destination, directed);\n fi... | {
"fields": [
{
"declarator": "serialVersionUID = -8137886975649690000L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -8137886975649690000L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "VER... | {
"body": "@Override\n public boolean equals(final Object obj) {\n return null != obj\n && (obj instanceof EdgeSeed)\n && isEqual((EdgeSeed) obj);\n }",
"class_method_signature": "EdgeSeed.equals(final Object obj)",
"constructor": false,
"full_signature": "@Override 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_529 | {
"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 shouldDelegateCloseToWrappedIterator() {\n final CloseableIterator<Object> closeableIterator = mock(CloseableIterator.class);\n final WrappedCloseableIterator<Object> wrappedIterator = new WrappedCloseableIterator<>(closeableIterator);\n\n wrappedIterator.close()... | {
"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_179 | {
"fields": [],
"file": "store-implementation/hbase-store/src/test/java/uk/gov/gchq/gaffer/hbasestore/operation/handler/GetAdjacentIdsHandlerTest.java",
"identifier": "GetAdjacentIdsHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldDoNothingIfNoSeedsProvided() throws OperationException {\n // Given\n final GetAdjacentIdsHandler handler = new GetAdjacentIdsHandler();\n final GetAdjacentIds getAdjacentIds = new GetAdjacentIds();\n final Context context = mock(Context.class);\n ... | {
"fields": [],
"file": "store-implementation/hbase-store/src/main/java/uk/gov/gchq/gaffer/hbasestore/operation/handler/GetAdjacentIdsHandler.java",
"identifier": "GetAdjacentIdsHandler",
"interfaces": "implements OutputOperationHandler<GetAdjacentIds, CloseableIterable<? extends EntityId>>",
"methods": [
... | {
"body": "@Override\n public CloseableIterable<? extends EntityId> doOperation(final GetAdjacentIds operation,\n final Context context, final Store store)\n throws OperationException {\n return doOperation(operation, context.getUser(), ... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_483 | {
"fields": [],
"file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/OneOrMoreTest.java",
"identifier": "OneOrMoreTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldGetEmptyIterator() {\n // Given\n final OneOrMore<Integer> collection = new OneOrMore<>();\n\n // When\n final Iterator<Integer> itr = collection.iterator();\n\n // Then\n assertFalse(itr.hasNext());\n }",
"class_method_signature":... | {
"fields": [
{
"declarator": "newCollection",
"modifier": "private final",
"original_string": "private final Function<T, Collection<T>> newCollection;",
"type": "Function<T, Collection<T>>",
"var_name": "newCollection"
},
{
"declarator": "deduplicate",
"modifier"... | {
"body": "@Override\n public Iterator<T> iterator() {\n if (null == collection) {\n if (null == singleItem) {\n return Collections.emptyIterator();\n }\n\n return Iterators.singletonIterator(singleItem);\n }\n return collection.iterator();\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_657 | {
"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 shouldGetScoreForNestedOperationWithNullOperationList() throws OperationException {\n // Given\n final GetElements op1 = mock(GetElements.class);\n final AddElements op2 = mock(AddElements.class);\n final DefaultScoreResolver scoreResolver = new DefaultSco... | {
"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_207 | {
"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 shouldFilterOutInvalidEdge() throws OperationException, SerialisationException {\n // Given\n final PostAggregationFilterProcessor processor = new PostAggregationFilterProcessor(VIEW);\n\n // When / Then\n assertFalse(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_70 | {
"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 shouldMergeParquetJsonModulesAndDeduplicate() {\n // Given\n props.setJsonSerialiserModules(TestCustomJsonModules1.class.getName() + \",\" + SketchesJsonModules.class.getName());\n\n // When\n final String modules = props.getJsonSerialiserModules();\n\n ... | {
"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_712 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/handler/CountHandlerTest.java",
"identifier": "CountHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnCount() throws OperationException {\n // Given\n final CountHandler handler = new CountHandler();\n final Store store = mock(Store.class);\n final Count count = mock(Count.class);\n final CloseableIterable<Element> elements = CountGroups... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/CountHandler.java",
"identifier": "CountHandler",
"interfaces": "implements OutputOperationHandler<Count<T>, Long>",
"methods": [
{
"class_method_signature": "CountHandler.doOperation(final Count operation, ... | {
"body": "@Override\n public Long doOperation(final Count operation, final Context context, final Store store)\n throws OperationException {\n if (null == operation.getInput()) {\n throw new OperationException(\"Count operation has null iterable of items\");\n }\n return... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_342 | {
"fields": [
{
"declarator": "EDGE_AB = new Edge.Builder().group(TestGroups.EDGE).source(\"A\").dest(\"B\").directed(true).build()",
"modifier": "private static final",
"original_string": "private static final Edge EDGE_AB = new Edge.Builder().group(TestGroups.EDGE).source(\"A\").dest(\"B\").di... | {
"body": "@Test\n public void shouldGetTrail() {\n // Given\n // [A] -> [E] -> [D]\n // \\ \\ \\\n // (BasicEntity) (BasicEntity) (BasicEntity)\n\n // When\n final Walk walk = new Walk.Builder()\n .entity(ENTITY_A)\n... | {
"fields": [
{
"declarator": "edges",
"modifier": "private final",
"original_string": "private final List<Set<Edge>> edges;",
"type": "List<Set<Edge>>",
"var_name": "edges"
},
{
"declarator": "entities",
"modifier": "private final",
"original_string": "priv... | {
"body": "@JsonIgnore\n public boolean isTrail() {\n return Sets.newHashSet(edges).size() == edges.size();\n }",
"class_method_signature": "Walk.isTrail()",
"constructor": false,
"full_signature": "@JsonIgnore public boolean isTrail()",
"identifier": "isTrail",
"invocations": [
"size",
... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_968 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/schema/SchemaElementDefinitionValidatorTest.java",
"identifier": "SchemaElementDefinitionValidatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldValidateAndReturnTrueWhenAggregatorIsValid() {\n // Given\n final SchemaElementDefinitionValidator validator = new SchemaElementDefinitionValidator();\n final BinaryOperator<Integer> function1 = mock(BinaryOperator.class);\n final BinaryOperator func... | {
"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_1043 | {
"fields": [],
"file": "core/serialisation/src/test/java/uk/gov/gchq/gaffer/serialisation/implementation/raw/RawDoubleSerialiserTest.java",
"identifier": "RawDoubleSerialiserTest",
"interfaces": "",
"superclass": "extends ToBytesSerialisationTest<Double>"
} | {
"body": "@Test\n public void canSerialiseDoubleClass() {\n assertTrue(serialiser.canHandle(Double.class));\n }",
"class_method_signature": "RawDoubleSerialiserTest.canSerialiseDoubleClass()",
"constructor": false,
"full_signature": "@Test public void canSerialiseDoubleClass()",
"identifier": "c... | {
"fields": [
{
"declarator": "serialVersionUID = 1568251281744704278L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1568251281744704278L;",
"type": "long",
"var_name": "serialVersionUID"
}
],
"file": "core/serialisatio... | {
"body": "@Override\n public boolean canHandle(final Class clazz) {\n return Double.class.equals(clazz);\n }",
"class_method_signature": "RawDoubleSerialiser.canHandle(final Class clazz)",
"constructor": false,
"full_signature": "@Override public boolean canHandle(final Class clazz)",
"identifie... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_591 | {
"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 testGetGroup() throws SerialisationException {\n // Given\n final GroupedProperties groupedProperties = new GroupedProperties(TestGroups.EDGE);\n\n // When\n final byte[] serialisedEdge = serialiser.serialise(groupedProperties);\n\n // Then\n ... | {
"fields": [
{
"declarator": "serialVersionUID = 3307260143698122796L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 3307260143698122796L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "strin... | {
"body": "public String getGroup(final byte[] bytes) throws SerialisationException {\n return StringUtil.toString(LengthValueBytesSerialiserUtil.deserialise(bytes, 0));\n }",
"class_method_signature": "GroupedPropertiesSerialiser.getGroup(final byte[] bytes)",
"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_1106 | {
"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 shouldResolveNamedViewJsonWithParameters() throws CacheOperationFailedException {\n Map<String, Object> paramMap = Maps.newHashMap();\n paramMap.put(IS_MORE_THAN_X_PARAM_KEY, 7L);\n paramMap.put(SELECTION_PARAM_KEY, \"VERTEX\");\n\n ViewParameterDetail par... | {
"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_987 | {
"fields": [],
"file": "core/serialisation/src/test/java/uk/gov/gchq/gaffer/serialisation/util/JsonSerialisationUtilTest.java",
"identifier": "JsonSerialisationUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testClassWithNoFields() {\n // Given\n final String className = ClassWithNoFields.class.getName();\n\n // When\n final Map<String, String> result = JsonSerialisationUtil.getSerialisedFieldClasses(className);\n\n // Then\n assertTrue(result.en... | {
"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_66 | {
"fields": [
{
"declarator": "GRAPH_ID_A = \"a\"",
"modifier": "public static final",
"original_string": "public static final String GRAPH_ID_A = \"a\";",
"type": "String",
"var_name": "GRAPH_ID_A"
},
{
"declarator": "GRAPH_ID_B = \"b\"",
"modifier": "public stat... | {
"body": "@Test\n public void checkSchemaNotLeakedWhenAlreadyExistsUnderDifferentAccess() throws Exception {\n // Given\n Schema schemaNotToBeExposed = new Schema.Builder()\n .type(UNUSUAL_TYPE, String.class)\n .type(DIRECTED_EITHER, Boolean.class)\n .ent... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(FederatedGraphStorage.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(FederatedGraphStorage.class);",
"type": "Logger",
"var_name": "LOGGER"
... | {
"body": "public void put(final Collection<GraphSerialisable> graphs, final FederatedAccess access) throws StorageException {\n for (final GraphSerialisable graph : graphs) {\n put(graph, access);\n }\n }",
"class_method_signature": "FederatedGraphStorage.put(final Collection<GraphSeria... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1239 | {
"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 shouldJsonSerialiseAndDeserialiseWithSingleValue() {\n // Given\n final If op = new If.Builder<>()\n .input(new EntitySeed(\"1\"))\n .condition(true)\n .then(new GetElements())\n .otherwise(new GetAllElements()... | {
"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 String toString() {\n return new ToStringBuilder(this)\n .append(getInput())\n .append(condition)\n .append(conditional)\n .append(then)\n .append(otherwise)\n .append(options)\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_211 | {
"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 shouldNotFilterOutValidEntity() throws OperationException, SerialisationException {\n // Given\n final PreAggregationFilterProcessor processor = new PreAggregationFilterProcessor(VIEW);\n\n // When / Then\n assertTrue(processor.test(CellUtil.getLazyCell(ne... | {
"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.validateInput(elementCell.getElement());\n }",
"class_method_signature": "PreAggregationFilterProcessor.test(final LazyElementCell elementCell)",
"constructor": false,
"full_signature": "@Override pub... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_641 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/SerialisationFactoryTest.java",
"identifier": "SerialisationFactoryTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testAddSerialisers() throws SerialisationException {\n // Given\n final Serialiser[] serialisers = new Serialiser[]{\n new RawDateSerialiser(),\n new RawDoubleSerialiser(),\n new RawFloatSerialiser()\n };\n fina... | {
"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 void addSerialisers(final Serialiser... newSerialisers) {\n if (null != newSerialisers) {\n for (final Serialiser newSerialiser : newSerialisers) {\n if (!serialiserAlreadyinList(newSerialiser)) {\n serialisers.add(newSerialiser);\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_354 | {
"fields": [
{
"declarator": "EDGE_AB = new Edge.Builder().group(TestGroups.EDGE).source(\"A\").dest(\"B\").directed(true).build()",
"modifier": "private static final",
"original_string": "private static final Edge EDGE_AB = new Edge.Builder().group(TestGroups.EDGE).source(\"A\").dest(\"B\").di... | {
"body": "@Test\n public void shouldReturnEdgesFromWalkObject() {\n // Given\n final Function<Walk, Set<Entity>> function = new ExtractWalkEntitiesFromHop(2);\n final Walk walk = new Walk.Builder()\n .edge(EDGE_AB)\n .entity(ENTITY_B)\n .edge(EDGE_... | {
"fields": [
{
"declarator": "hop",
"modifier": "private",
"original_string": "private int hop;",
"type": "int",
"var_name": "hop"
}
],
"file": "core/data/src/main/java/uk/gov/gchq/gaffer/data/graph/function/walk/ExtractWalkEntitiesFromHop.java",
"identifier": "ExtractWalk... | {
"body": "@Override\n public Set<Entity> apply(final Walk walk) {\n if (null == walk) {\n throw new IllegalArgumentException(\"Walk cannot be null\");\n }\n return walk.getEntities().get(hop);\n }",
"class_method_signature": "ExtractWalkEntitiesFromHop.apply(final Walk walk)",... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_704 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/handler/compare/MinHandlerTest.java",
"identifier": "MinHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnNullIfOperationInputIsNull() throws OperationException {\n // Given\n final Min min = new Min.Builder().build();\n final MinHandler handler = new MinHandler();\n\n // When\n final Element result = handler.doOperation(min, null, null);\n\... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/compare/MinHandler.java",
"identifier": "MinHandler",
"interfaces": "implements OutputOperationHandler<Min, Element>",
"methods": [
{
"class_method_signature": "MinHandler.doOperation(final Min operation, fi... | {
"body": "@Override\n public Element doOperation(final Min operation, final Context context, final Store store) throws OperationException {\n // If there is no input or there are no comparators, we return null\n if (null == operation.getInput()\n || null == operation.getComparators()\... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_89 | {
"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 testGetPartitionIdsEmptyGroupPartitioner() {\n // Given\n final GroupPartitioner partitioner = new GroupPartitioner(\"GROUP\", new ArrayList<>());\n\n // When\n final List<Integer> partitionIds = partitioner.getPartitionIds(new Object[]{1L});\n\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<Integer> getPartitionIds(final Object[] partialKey) {\n if (null == partialKey) {\n throw new IllegalArgumentException(\"getPartitionIds cannot be called with null partialKey\");\n }\n if (splitPoints.isEmpty()) {\n return Collections.singletonList(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_587 | {
"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 shouldConvertStringToTypeValue() {\n // Given\n final ToTypeValue function = new ToTypeValue();\n final String value = \"value1\";\n\n // When\n final TypeValue result = function.apply(value);\n\n // Then\n assertEquals(new TypeValue(n... | {
"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_1055 | {
"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 canHandleUnParameterisedDAO() throws SerialisationException {\n assertTrue(JSONSerialiser.canHandle(SimpleTestObject.class));\n }",
"class_method_signature": "JSONSerialiserTest.canHandleUnParameterisedDAO()",
"constructor": false,
"full_signature": "@Test public void... | {
"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 boolean canHandle(final Class clazz) {\n return getInstance().mapper.canSerialize(clazz);\n }",
"class_method_signature": "JSONSerialiser.canHandle(final Class clazz)",
"constructor": false,
"full_signature": "public static boolean canHandle(final Class clazz)",
"identifier"... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_991 | {
"fields": [],
"file": "core/serialisation/src/test/java/uk/gov/gchq/gaffer/serialisation/util/JsonSerialisationUtilTest.java",
"identifier": "JsonSerialisationUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIsIn() {\n // Given\n final String className = IsIn.class.getName();\n\n // When\n final Map<String, String> result = JsonSerialisationUtil.getSerialisedFieldClasses(className);\n\n // Then\n final Map<String, String> expectedValues = new... | {
"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_1110 | {
"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 shouldThrowExceptionWhenNamedViewToBeMergedIsNotInCache() throws CacheOperationFailedException {\n // Given\n given(CACHE.getNamedView(NAMED_VIEW_NAME, CONTEXT.getUser())).willReturn(FULL_NAMED_VIEW_DETAIL);\n given(CACHE.getNamedView(NAMED_VIEW_NAME + 1, CONTEXT... | {
"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_568 | {
"fields": [],
"file": "core/type/src/test/java/uk/gov/gchq/gaffer/serialisation/AvroSerialiserTest.java",
"identifier": "AvroSerialiserTest",
"interfaces": "",
"superclass": "extends ToBytesSerialisationTest<Object>"
} | {
"body": "@Test\n public void testCanHandleObjectClass() {\n assertTrue(serialiser.canHandle(Object.class));\n }",
"class_method_signature": "AvroSerialiserTest.testCanHandleObjectClass()",
"constructor": false,
"full_signature": "@Test public void testCanHandleObjectClass()",
"identifier": "tes... | {
"fields": [
{
"declarator": "serialVersionUID = -6264923181170362212L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -6264923181170362212L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "LOG... | {
"body": "@Override\n public boolean canHandle(final Class clazz) {\n if (\"java.lang.Class\".equals(clazz.getName())) {\n return false;\n }\n try {\n ReflectData.get().getSchema(clazz);\n } catch (final RuntimeException e) {\n return false;\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_138 | {
"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 shouldSetupJob() throws IOException {\n // Given\n final JobConf localConf = createLocalConf();\n final FileSystem fs = FileSystem.getLocal(localConf);\n fs.mkdirs(new Path(outputDir));\n fs.mkdirs(new Path(splitsDir));\n try (final BufferedW... | {
"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_616 | {
"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 testCanSerialiseEntityIdClass() throws SerialisationException {\n assertTrue(serialiser.canHandle(EntityId.class));\n }",
"class_method_signature": "EntityIdSerialiserTest.testCanSerialiseEntityIdClass()",
"constructor": false,
"full_signature": "@Test public void tes... | {
"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 canHandle(final Class clazz) {\n return EntityId.class.isAssignableFrom(clazz);\n }",
"class_method_signature": "EntityIdSerialiser.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_246 | {
"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 shouldGetStoreTraits() throws IOException {\n // When\n final Set<StoreTrait> traits = service.getStoreTraits();\n // Then\n assertNotNull(traits);\n assertTrue(traits.size() == 6, \"Collection size should be 6\");\n assertTrue(traits.contain... | {
"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<StoreTrait> getStoreTraits() {\n return graphFactory.getGraph().getStoreTraits();\n }",
"class_method_signature": "GraphConfigurationService.getStoreTraits()",
"constructor": false,
"full_signature": "@Override public Set<StoreTrait> getStoreTraits()",
"identifie... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_31 | {
"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 shouldReturnGraphIds() throws Exception {\n // Given\n addGraphWithPaths(ACC_ID_1, PROPERTIES_ALT, PATH_BASIC_ENTITY_SCHEMA_JSON);\n addGraphWithPaths(ACC_ID_2, PROPERTIES_ALT, PATH_BASIC_EDGE_SCHEMA_JSON);\n\n // When\n Collection<String> allGraphI... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(Store.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(Store.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": ... | {
"body": "public Collection<String> getAllGraphIds(final User user) {\n return getAllGraphIds(user, false);\n }",
"class_method_signature": "FederatedStore.getAllGraphIds(final User user)",
"constructor": false,
"full_signature": "public Collection<String> getAllGraphIds(final User user)",
"identif... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1281 | {
"fields": [
{
"declarator": "service = new HazelcastCacheService()",
"modifier": "private static",
"original_string": "private static HazelcastCacheService service = new HazelcastCacheService();",
"type": "HazelcastCacheService",
"var_name": "service"
},
{
"declarator... | {
"body": "@Test\n public void shouldAllowUserToConfigureCacheUsingConfigFilePath(@TempDir Path tempDir) {\n\n // given\n initialiseWithTestConfig(tempDir);\n\n // when\n ICache<String, Integer> cache = service.getCache(CACHE_NAME);\n\n // then\n assertEquals(0, cache.size... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(HazelcastCacheService.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(HazelcastCacheService.class);",
"type": "Logger",
"var_name": "LOGGER"
... | {
"body": "@Override\n public <K, V> ICache<K, V> getCache(final String cacheName) {\n final ICache<K, V> cache;\n if (null != hazelcast) {\n cache = new HazelcastCache<>(hazelcast.getMap(cacheName));\n } else {\n cache = null;\n }\n\n return cache;\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_753 | {
"fields": [
{
"declarator": "handler",
"modifier": "private",
"original_string": "private GetSchemaHandler handler;",
"type": "GetSchemaHandler",
"var_name": "handler"
},
{
"declarator": "schema",
"modifier": "private",
"original_string": "private Schema s... | {
"body": "@Test\n public void shouldReturnCompactSchema() throws OperationException {\n given(store.getProperties()).willReturn(properties);\n given(store.getSchema()).willReturn(schema);\n given(context.getUser()).willReturn(user);\n\n final GetSchema operation = new GetSchema.Builder... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/GetSchemaHandler.java",
"identifier": "GetSchemaHandler",
"interfaces": "implements OutputOperationHandler<GetSchema, Schema>",
"methods": [
{
"class_method_signature": "GetSchemaHandler.doOperation(final Ge... | {
"body": "@Override\n public Schema doOperation(final GetSchema operation, final Context context, final Store store) throws OperationException {\n final Schema schema;\n if (null == operation) {\n throw new OperationException(\"Operation cannot be null\");\n }\n\n if (operat... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_303 | {
"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 shouldThrowExceptionWhenGlobalExcludeElementPropertiesAndEntityPropertiesSet() {\n // Given\n final View view = new View.Builder()\n .globalElements(new GlobalViewElementDefinition.Builder()\n .groups(TestGroups.ENTITY)\n ... | {
"fields": [
{
"declarator": "globalElements",
"modifier": "private",
"original_string": "private List<GlobalViewElementDefinition> globalElements;",
"type": "List<GlobalViewElementDefinition>",
"var_name": "globalElements"
},
{
"declarator": "globalEntities",
"m... | {
"body": "public void expandGlobalDefinitions() {\n if (null != globalEntities && !globalEntities.isEmpty()) {\n setEntities(expandGlobalDefinitions(getEntities(), getEntityGroups(), globalEntities, false));\n globalEntities = null;\n }\n\n if (null != globalEdges && !globa... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_929 | {
"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 shouldValidateAndReturnTrueWhenGroupByPropertiesInSchema() {\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_1002 | {
"fields": [],
"file": "core/serialisation/src/test/java/uk/gov/gchq/gaffer/serialisation/DoubleSerialiserTest.java",
"identifier": "DoubleSerialiserTest",
"interfaces": "",
"superclass": "extends ToBytesSerialisationTest<Double>"
} | {
"body": "@Test\n public void canSerialiseDoubleClass() {\n assertTrue(serialiser.canHandle(Double.class));\n }",
"class_method_signature": "DoubleSerialiserTest.canSerialiseDoubleClass()",
"constructor": false,
"full_signature": "@Test public void canSerialiseDoubleClass()",
"identifier": "canS... | {
"fields": [
{
"declarator": "serialVersionUID = 5647756843689779437L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 5647756843689779437L;",
"type": "long",
"var_name": "serialVersionUID"
}
],
"file": "core/serialisatio... | {
"body": "@Override\n public boolean canHandle(final Class clazz) {\n return Double.class.equals(clazz);\n }",
"class_method_signature": "DoubleSerialiser.canHandle(final Class clazz)",
"constructor": false,
"full_signature": "@Override public boolean canHandle(final Class clazz)",
"identifier":... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_883 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/ElementValidatorTest.java",
"identifier": "ElementValidatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnTrueWhenSchemaValidateWithValidElement() {\n // Given\n final Schema schema = mock(Schema.class);\n final String group = TestGroups.EDGE;\n final Element elm = mock(Element.class);\n final SchemaElementDefinition elementDef = mock(Schema... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(ElementValidator.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(ElementValidator.class);",
"type": "Logger",
"var_name": "LOGGER"
},
... | {
"body": "@Override\n public boolean validate(final Element element) {\n if (null == element) {\n return false;\n }\n\n if (null != schema) {\n return validateWithSchema(element);\n }\n\n if (null != view) {\n return validateAgainstViewFilter(ele... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_180 | {
"fields": [
{
"declarator": "SCHEMA = new Schema.Builder()\n .type(\"string\", new TypeDefinition.Builder()\n .clazz(String.class)\n .aggregateFunction(new StringConcat())\n .build())\n .type(\"type\", Boolean.class)\n ... | {
"body": "@Test\n public void shouldDelegatePreFlushToStoreScanner() throws IOException {\n // Given\n final ObserverContext<RegionCoprocessorEnvironment> e = mock(ObserverContext.class);\n final Store store = mock(Store.class);\n final InternalScanner scanner = mock(InternalScanner.cl... | {
"fields": [
{
"declarator": "schema",
"modifier": "private",
"original_string": "private Schema schema;",
"type": "Schema",
"var_name": "schema"
},
{
"declarator": "serialisation",
"modifier": "private",
"original_string": "private ElementSerialisation ser... | {
"body": "@Override\n public InternalScanner preFlush(final ObserverContext<RegionCoprocessorEnvironment> e,\n final Store store,\n final InternalScanner scanner) throws IOException {\n return new StoreScanner(scanner, schema, serialisat... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_495 | {
"fields": [],
"file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/StringUtilTest.java",
"identifier": "StringUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void toBytesWhenStringIsNull() {\n assertArrayEquals(new byte[0], StringUtil.toBytes(null));\n }",
"class_method_signature": "StringUtilTest.toBytesWhenStringIsNull()",
"constructor": false,
"full_signature": "@Test public void toBytesWhenStringIsNull()",
"identifier": "... | {
"fields": [
{
"declarator": "COMMA = ','",
"modifier": "public static final",
"original_string": "public static final char COMMA = ',';",
"type": "char",
"var_name": "COMMA"
},
{
"declarator": "ESCAPE_CHAR = '\\\\'",
"modifier": "private static final",
"or... | {
"body": "public static byte[] toBytes(final String string) {\n if (null == string) {\n return new byte[0];\n }\n try {\n return string.getBytes(CommonConstants.UTF_8);\n } catch (final UnsupportedEncodingException e) {\n throw new RuntimeException(\"Unabl... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1147 | {
"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 shouldBeEqualWhenVerticesEqual() {\n // Given\n final String vertex = \"vertex\";\n final EntityId seed1 = new EntitySeed(vertex);\n final EntityId seed2 = new EntitySeed(vertex);\n\n // Then\n assertEquals(seed1, seed2);\n assertEqual... | {
"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_1130 | {
"fields": [],
"file": "core/graph/src/test/java/uk/gov/gchq/gaffer/graph/hook/NamedOperationResolverTest.java",
"identifier": "NamedOperationResolverTest",
"interfaces": "",
"superclass": "extends GraphHookTest<NamedOperationResolver>"
} | {
"body": "@Test\n public void shouldResolveNamedOperation() throws CacheOperationFailedException {\n // Given\n final String opName = \"opName\";\n final NamedOperationCache cache = mock(NamedOperationCache.class);\n final NamedOperationResolver resolver = new NamedOperationResolver(ca... | {
"fields": [
{
"declarator": "cache",
"modifier": "private final",
"original_string": "private final NamedOperationCache cache;",
"type": "NamedOperationCache",
"var_name": "cache"
}
],
"file": "core/graph/src/main/java/uk/gov/gchq/gaffer/graph/hook/NamedOperationResolver.ja... | {
"body": "@Override\n public void preExecute(final OperationChain<?> opChain, final Context context) {\n resolveNamedOperations(opChain, context.getUser());\n }",
"class_method_signature": "NamedOperationResolver.preExecute(final OperationChain<?> opChain, final Context context)",
"constructor": fal... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_548 | {
"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 shouldSortLargeNumberOfItems() {\n // Given\n final int streamSize = 1000000;\n final int resultLimit = 10000;\n\n final IntStream stream = new Random()\n .ints(streamSize * 2) // generate a few extra in case there are duplicates\n ... | {
"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_118 | {
"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 shouldPassWithDuplicatedArrays() throws Exception {\n br1 = new BytesAndRange(a, 0, a.length);\n br2 = new BytesAndRange(b, 0, b.length);\n assertTrue(ByteUtils.areKeyBytesEqual(br1, br2));\n }",
"class_method_signature": "ByteUtilsTest.shouldPassWithDuplica... | {
"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_1075 | {
"fields": [
{
"declarator": "GRAPH_ID = \"graphId\"",
"modifier": "private static final",
"original_string": "private static final String GRAPH_ID = \"graphId\";",
"type": "String",
"var_name": "GRAPH_ID"
},
{
"declarator": "SCHEMA_ID_1 = \"schemaId1\"",
"modifi... | {
"body": "@Test\n public void shouldThrowExceptionOnExecuteJobUsingJobWithANullContext() throws OperationException {\n // Given\n final Context context = null;\n final OperationChain opChain = mock(OperationChain.class);\n\n final Graph graph = new Graph.Builder()\n .con... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(Graph.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(Graph.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": ... | {
"body": "public JobDetail executeJob(final Operation operation, final User user) throws OperationException {\n return executeJob(new GraphRequest<>(operation, user)).getResult();\n }",
"class_method_signature": "Graph.executeJob(final Operation operation, final User user)",
"constructor": false,
"fu... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_374 | {
"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 shouldCompareEqualCustomObjUsingToString() {\n final ComparableOrToStringComparator comparator = new ComparableOrToStringComparator();\n\n final int result = comparator.compare(new IntegerWrapper(1), new IntegerWrapper(1));\n\n assertEquals(0, result);\n }",
... | {
"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_724 | {
"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 shouldHandleNullFunction() {\n // Given\n final MapHandler<Integer, Integer> handler = new MapHandler<>();\n\n function = null;\n\n final Map<Integer, Integer> operation = new Map.Builder<Integer>()\n .input(input)\n .first(fu... | {
"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_46 | {
"fields": [
{
"declarator": "handler",
"modifier": "private",
"original_string": "private FederatedGetSchemaHandler handler;",
"type": "FederatedGetSchemaHandler",
"var_name": "handler"
},
{
"declarator": "fStore",
"modifier": "private",
"original_string":... | {
"body": "@Test\n public void shouldThrowExceptionForANullOperation() throws OperationException {\n library.addProperties(ACC_PROP_ID, PROPERTIES);\n fStore.setGraphLibrary(library);\n\n final GetSchema operation = null;\n\n try {\n handler.doOperation(operation, context, fS... | {
"fields": [],
"file": "store-implementation/federated-store/src/main/java/uk/gov/gchq/gaffer/federatedstore/operation/handler/FederatedGetSchemaHandler.java",
"identifier": "FederatedGetSchemaHandler",
"interfaces": "implements OutputOperationHandler<GetSchema, Schema>",
"methods": [
{
"class_meth... | {
"body": "@Override\n public Schema doOperation(final GetSchema operation, final Context context, final Store store) throws OperationException {\n if (null == operation) {\n throw new OperationException(\"Operation cannot be null\");\n }\n return ((FederatedStore) store).getSchema(... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1219 | {
"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 shouldDeserialiseOperationWithVerticesAndIds() throws SerialisationException {\n // Given\n final String json = String.format(\"{\\\"class\\\":\\\"uk.gov.gchq.gaffer.operation.impl.get.GetElements\\\",\" +\n \"\\\"input\\\":[\" +\n \"1,\" +... | {
"fields": [
{
"declarator": "seedMatching",
"modifier": "private",
"original_string": "private SeedMatchingType seedMatching;",
"type": "SeedMatchingType",
"var_name": "seedMatching"
},
{
"declarator": "view",
"modifier": "private",
"original_string": "pri... | {
"body": "@Override\n public Iterable<? extends ElementId> getInput() {\n return input;\n }",
"class_method_signature": "GetElements.getInput()",
"constructor": false,
"full_signature": "@Override public Iterable<? extends ElementId> getInput()",
"identifier": "getInput",
"invocations": [],
... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_231 | {
"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 shouldGetCorrectSerialisedFieldsForGetWalksClass() {\n // When\n final Map<String, String> fields = (Map<String, String>) service.getSerialisedFieldClasses(GetWalks.class.getName()).getEntity();\n\n final Map<String, String> expectedFields = new HashMap<>();\n ... | {
"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 getSerialisedFieldClasses(final String className) {\n return Response.ok(JsonSerialisationUtil.getSerialisedFieldClasses... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_661 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/resolver/WhileScoreResolverTest.java",
"identifier": "WhileScoreResolverTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldGetScoreWithOperationChainAsOperation() {\n // Given\n final Object input = new EntitySeed(3);\n final int repeats = 3;\n final GetElements getElements = mock(GetElements.class);\n final Map map = mock(Map.class);\n final ToSet toSet = ... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(WhileScoreResolver.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(WhileScoreResolver.class);",
"type": "Logger",
"var_name": "LOGGER"
}
... | {
"body": "@Override\n public Integer getScore(final While operation) {\n throw new UnsupportedOperationException(\"Default Score Resolver has not been provided.\");\n }",
"class_method_signature": "WhileScoreResolver.getScore(final While operation)",
"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_1167 | {
"fields": [],
"file": "core/operation/src/test/java/uk/gov/gchq/gaffer/operation/util/OperationUtilTest.java",
"identifier": "OperationUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldConvertFromEntityIds() {\n // Given\n final Iterable<ElementId> input = Arrays.asList(\n new EntitySeed(1),\n new EntitySeed(\"2\"),\n new EntitySeed(\"3\"),\n new Entity(\"group\", \"4\"),\n ... | {
"fields": [],
"file": "core/operation/src/main/java/uk/gov/gchq/gaffer/operation/util/OperationUtil.java",
"identifier": "OperationUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "OperationUtil.OperationUtil()",
"constructor": true,
"full_signature": "private Operati... | {
"body": "public static Iterable<?> fromElementIds(final Iterable<? extends ElementId> input) {\n if (null == input) {\n return null;\n }\n return IterableUtil.map(input, new FromElementId());\n }",
"class_method_signature": "OperationUtil.fromElementIds(final Iterable<? extends ... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_909 | {
"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 shouldOverrideSourceWhenMerging() {\n // Given\n final SchemaEdgeDefinition elementDef1 = new SchemaEdgeDefinition.Builder()\n .source(\"source.integer\")\n .build();\n\n final SchemaEdgeDefinition elementDef2 = new SchemaEdgeDefinit... | {
"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 getSource() {\n return getIdentifierTypeName(IdentifierType.SOURCE);\n }",
"class_method_signature": "SchemaEdgeDefinition.getSource()",
"constructor": false,
"full_signature": "public String getSource()",
"identifier": "getSource",
"invocations": [
"getIdentifierTypeN... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1022 | {
"fields": [],
"file": "core/serialisation/src/test/java/uk/gov/gchq/gaffer/serialisation/implementation/BytesSerialiserTest.java",
"identifier": "BytesSerialiserTest",
"interfaces": "",
"superclass": "extends ToBytesSerialisationTest<byte[]>"
} | {
"body": "@Test\n public void shouldDeserialiseBytesByJustReturningTheProvidedBytes() throws SerialisationException {\n // Given\n final byte[] bytes = {0, 1};\n\n // When\n final byte[] deserialisedBytes = serialiser.deserialise(bytes);\n\n // Then\n assertSame(bytes, de... | {
"fields": [
{
"declarator": "serialVersionUID = -7718650654168267452L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -7718650654168267452L;",
"type": "long",
"var_name": "serialVersionUID"
}
],
"file": "core/serialisat... | {
"body": "@Override\n public byte[] deserialise(final byte[] bytes) throws SerialisationException {\n return bytes;\n }",
"class_method_signature": "BytesSerialiser.deserialise(final byte[] bytes)",
"constructor": false,
"full_signature": "@Override public byte[] deserialise(final byte[] bytes)",
... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"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.