id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
47973088_1173 | {
"fields": [],
"file": "core/operation/src/test/java/uk/gov/gchq/gaffer/operation/function/FromEntityIdTest.java",
"identifier": "FromEntityIdTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldUnwrapIfInputIsAnEntitySeed() {\n // Given\n final EntitySeed input = new EntitySeed(\"item\");\n final FromEntityId function = new FromEntityId();\n\n // When\n final Object output = function.apply(input);\n\n // Then\n assertSa... | {
"fields": [],
"file": "core/operation/src/main/java/uk/gov/gchq/gaffer/operation/function/FromEntityId.java",
"identifier": "FromEntityId",
"interfaces": "",
"methods": [
{
"class_method_signature": "FromEntityId.apply(final EntityId e)",
"constructor": false,
"full_signature": "@Overr... | {
"body": "@Override\n public Object apply(final EntityId e) {\n if (null == e) {\n return null;\n }\n return e.getVertex();\n }",
"class_method_signature": "FromEntityId.apply(final EntityId e)",
"constructor": false,
"full_signature": "@Override public Object apply(final ... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_13 | {
"fields": [],
"file": "store-implementation/federated-store/src/test/java/uk/gov/gchq/gaffer/federatedstore/util/FederatedStoreUtilTest.java",
"identifier": "FederatedStoreUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldGetNullStringsWhenNullCsv() {\n // Given\n final String csv = null;\n\n // When\n final List<String> values = FederatedStoreUtil.getCleanStrings(csv);\n\n // Then\n assertNull(values);\n }",
"class_method_signature": "FederatedStor... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(FederatedStoreUtil.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(FederatedStoreUtil.class);",
"type": "Logger",
"var_name": "LOGGER"
},
... | {
"body": "public static List<String> getCleanStrings(final String value) {\n final List<String> values;\n if (value != null) {\n values = Lists.newArrayList(StringUtils.stripAll(value.split(SCHEMA_DEL_REGEX)));\n values.removeAll(STRINGS_TO_REMOVE);\n } else {\n ... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_634 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/SerialisationFactoryTest.java",
"identifier": "SerialisationFactoryTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnOrderedSerialiserForAString() throws SerialisationException {\n // Given\n final SerialisationFactory factory = new SerialisationFactory();\n final Class<?> clazz = String.class;\n final boolean ordered = true;\n\n // When\n final... | {
"fields": [
{
"declarator": "serialisers",
"modifier": "private final",
"original_string": "private final List<Serialiser> serialisers;",
"type": "List<Serialiser>",
"var_name": "serialisers"
},
{
"declarator": "LAST_RESORT_FINALISER = new JavaSerialiser()",
"mo... | {
"body": "public Serialiser getSerialiser(final Class<?> objClass) {\n return getSerialiser(objClass, false, false);\n }",
"class_method_signature": "SerialisationFactory.getSerialiser(final Class<?> objClass)",
"constructor": false,
"full_signature": "public Serialiser getSerialiser(final Class<?> o... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_264 | {
"fields": [],
"file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/IsEdgeValidatorTest.java",
"identifier": "IsEdgeValidatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldNotValidateWhenEntity() {\n final Element element = new Entity.Builder()\n .group(TestGroups.ENTITY)\n .build();\n\n final boolean valid = new IsEdgeValidator().validate(element);\n\n assertFalse(valid);\n }",
"class_metho... | {
"fields": [],
"file": "core/data/src/main/java/uk/gov/gchq/gaffer/data/IsEdgeValidator.java",
"identifier": "IsEdgeValidator",
"interfaces": "implements Validator<Element>",
"methods": [
{
"class_method_signature": "IsEdgeValidator.validate(final Element element)",
"constructor": false,
... | {
"body": "@Override\n public boolean validate(final Element element) {\n return element instanceof Edge;\n }",
"class_method_signature": "IsEdgeValidator.validate(final Element element)",
"constructor": false,
"full_signature": "@Override public boolean validate(final Element element)",
"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_771 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/handler/ScoreOperationChainHandlerTest.java",
"identifier": "ScoreOperationChainHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldExecuteScoreChainOperation() throws OperationException {\n // Given\n final ScoreOperationChainHandler operationHandler = new ScoreOperationChainHandler();\n\n final Context context = mock(Context.class);\n final Store store = mock(Store.class);\n ... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(ScoreOperationChainHandler.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(ScoreOperationChainHandler.class);",
"type": "Logger",
"var_name": ... | {
"body": "@Override\n public Integer doOperation(final ScoreOperationChain operation, final Context context, final Store store) throws OperationException {\n return getChainScore(operation.getOperationChain(), context.getUser());\n\n }",
"class_method_signature": "ScoreOperationChainHandler.doOperatio... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_321 | {
"fields": [],
"file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/graph/entity/EntityMapTest.java",
"identifier": "EntityMapTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldGetEmptyEntitySet() {\n final EntityMap entityMap = new EntityMap();\n\n final Set<Object> results = entityMap.getVertices();\n\n assertThat(results, is(empty()));\n }",
"class_method_signature": "EntityMapTest.shouldGetEmptyEntitySet()",
"constructo... | {
"fields": [
{
"declarator": "backingMap = HashMultimap.create()",
"modifier": "private final",
"original_string": "private final SetMultimap<Object, Entity> backingMap = HashMultimap.create();",
"type": "SetMultimap<Object, Entity>",
"var_name": "backingMap"
}
],
"file": "c... | {
"body": "public Set<Object> getVertices() {\n return Collections.unmodifiableSet(backingMap.keySet());\n }",
"class_method_signature": "EntityMap.getVertices()",
"constructor": false,
"full_signature": "public Set<Object> getVertices()",
"identifier": "getVertices",
"invocations": [
"unmodif... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1309 | {
"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 testAggregateWhenAIsInNotFullStateAndBIsInSampleState() {\n // Given\n final BoundedTimestampSet boundedTimestampSet1 = new BoundedTimestampSet(CommonTimeUtil.TimeBucket.SECOND, 10);\n final Set<Instant> instants1 = new HashSet<>();\n instants1.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_458 | {
"fields": [],
"file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/JsonUtilTest.java",
"identifier": "JsonUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnFalseWhenJsonObjectsAreDifferentSizes() {\n final String json1 = \"{\\\"a\\\": 1, \\\"b\\\": 2}\";\n final String json2 = \"{\\\"a\\\": 1, \\\"b\\\": 2, \\\"c\\\": 3}\";\n\n assertFalse(JsonUtil.equals(json1, json2));\n assertFalse(JsonUtil.equ... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(JsonUtil.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(JsonUtil.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declara... | {
"body": "public static boolean equals(final String expectedJson, final String actualJson) {\n try {\n final Map expectedSchemaMap = null != expectedJson ? OBJECT_MAPPER.readValue(expectedJson, Map.class) : Collections.emptyMap();\n final Map actualSchemaMap = null != actualJson ? OBJECT... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1020 | {
"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 canSerialiseByteArrayClass() {\n assertTrue(serialiser.canHandle(byte[].class));\n }",
"class_method_signature": "BytesSerialiserTest.canSerialiseByteArrayClass()",
"constructor": false,
"full_signature": "@Test public void canSerialiseByteArrayClass()",
"identifier... | {
"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 boolean canHandle(final Class clazz) {\n return byte[].class.equals(clazz) || Byte[].class.equals(clazz);\n }",
"class_method_signature": "BytesSerialiser.canHandle(final Class clazz)",
"constructor": false,
"full_signature": "@Override public boolean canHandle(final 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_1165 | {
"fields": [],
"file": "core/operation/src/test/java/uk/gov/gchq/gaffer/operation/util/OperationUtilTest.java",
"identifier": "OperationUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldConvertIterableToEntityIds() {\n // Given\n final Iterable<Object> input = Arrays.asList(\n 1,\n \"2\",\n new EntitySeed(\"3\"),\n new Entity(\"group\", \"4\"),\n null\n );\n\n ... | {
"fields": [],
"file": "core/operation/src/main/java/uk/gov/gchq/gaffer/operation/util/OperationUtil.java",
"identifier": "OperationUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "OperationUtil.OperationUtil()",
"constructor": true,
"full_signature": "private Operati... | {
"body": "public static Iterable<? extends EntityId> toEntityIds(final Object... input) {\n if (null == input) {\n return null;\n }\n return Arrays.stream(input).map(new ToEntityId()).collect(Collectors.toList());\n }",
"class_method_signature": "OperationUtil.toEntityIds(final 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_233 | {
"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() {\n // When\n final Set<StoreTrait> traits = (Set<StoreTrait>) service.getStoreTraits().getEntity();\n\n // Then\n assertNotNull(traits);\n assertEquals(6, traits.size(), \"Collection size should be 6\");\n assertTrue(t... | {
"fields": [
{
"declarator": "graphFactory",
"modifier": "@Inject\n private",
"original_string": "@Inject\n private GraphFactory graphFactory;",
"type": "GraphFactory",
"var_name": "graphFactory"
},
{
"declarator": "userFactory",
"modifier": "@Inject\n p... | {
"body": "@Override\n public Response getStoreTraits() {\n return Response.ok(graphFactory.getGraph().getStoreTraits())\n .header(GAFFER_MEDIA_TYPE_HEADER, GAFFER_MEDIA_TYPE)\n .build();\n }",
"class_method_signature": "GraphConfigurationServiceV2.getStoreTraits()",
"co... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_663 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/resolver/IfScoreResolverTest.java",
"identifier": "IfScoreResolverTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldGetDefaultScoreWithNoOperationScores() {\n // Given\n final IfScoreResolver resolver = new IfScoreResolver();\n final DefaultScoreResolver defaultResolver = new DefaultScoreResolver(new LinkedHashMap<>());\n\n final If operation = new If();\n\n ... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(IfScoreResolver.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(IfScoreResolver.class);",
"type": "Logger",
"var_name": "LOGGER"
}
],
... | {
"body": "@Override\n public Integer getScore(final If operation) {\n throw new UnsupportedOperationException(\"Default Score Resolver has not been provided.\");\n }",
"class_method_signature": "IfScoreResolver.getScore(final If operation)",
"constructor": false,
"full_signature": "@Override publi... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_399 | {
"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 shouldExecuteOrPredicates() {\n final ElementFilter filter = new ElementFilter.Builder()\n .select(TestPropertyNames.PROP_1, TestPropertyNames.PROP_2)\n .execute(new Or.Builder<>()\n .select(0)\n .exec... | {
"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": "public boolean test(final Element element) {\n elementTuple.setElement(element);\n return test(elementTuple);\n }",
"class_method_signature": "ElementFilter.test(final Element element)",
"constructor": false,
"full_signature": "public boolean test(final Element element)",
"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_44 | {
"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 shouldReturnSchema() throws OperationException {\n library.addProperties(ACC_PROP_ID, PROPERTIES);\n fStore.setGraphLibrary(library);\n\n final Schema edgeSchema = new Schema.Builder()\n .edge(\"edge\", new SchemaEdgeDefinition.Builder()\n ... | {
"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_376 | {
"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 shouldCompareWhenBothElementsHaveMissingProperties() {\n // Given\n final Entity smallEntity = makeEntity(TestGroups.ENTITY, TestPropertyNames.PROP_1, 1);\n final Entity largeEntity = makeEntity(TestGroups.ENTITY, TestPropertyNames.PROP_1, 2);\n\n final El... | {
"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_726 | {
"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 shouldMapSingleObject() throws OperationException {\n // Given\n final MapHandler<Integer, String> handler = new MapHandler<>();\n\n final Map<Integer, String> operation = new Map.Builder<Integer>()\n .input(7)\n .first(Object::toStr... | {
"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_1077 | {
"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 shouldThrowExceptionOnExecuteJobUsingJobWithANullJob() throws OperationException {\n // Given\n final Context context = new Context();\n\n final Graph graph = new Graph.Builder()\n .config(new GraphConfig.Builder()\n .graphId... | {
"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_1098 | {
"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 shouldRejectOperationChainWhenUserHasNoAuthWithAConfiguredScore() {\n // Given\n final OperationChainLimiter hook = fromJson(OP_CHAIN_LIMITER_PATH);\n final OperationChain opChain = new OperationChain.Builder()\n .first(new GetElements())\n ... | {
"fields": [
{
"declarator": "scorer = new ScoreOperationChainHandler()",
"modifier": "private",
"original_string": "private ScoreOperationChainHandler scorer = new ScoreOperationChainHandler();",
"type": "ScoreOperationChainHandler",
"var_name": "scorer"
}
],
"file": "core/... | {
"body": "@Override\n public void preExecute(final OperationChain<?> opChain, final Context context) {\n if (null != opChain) {\n Integer chainScore = scorer.getChainScore(opChain, context.getUser());\n Integer maxAuthScore = scorer.getMaxUserAuthScore(context.getUser().getOpAuths());... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_819 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/handler/output/ToCsvHandlerTest.java",
"identifier": "ToCsvHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldConvertToCsv() throws OperationException {\n // Given\n final List<Element> elements = Lists.newArrayList(\n makeEntity(\"vertex1\", \"count\", 1),\n makeEntity(\"vertex2\"),\n makeEdge(\"source1\", \"count\", 1),\n ... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/output/ToCsvHandler.java",
"identifier": "ToCsvHandler",
"interfaces": "implements OutputOperationHandler<ToCsv, Iterable<? extends String>>",
"methods": [
{
"class_method_signature": "ToCsvHandler.doOperati... | {
"body": "@Override\n public Iterable<? extends String> doOperation(final ToCsv operation, final Context context, final Store store) throws OperationException {\n if (null == operation.getInput()) {\n return null;\n }\n\n if (null == operation.getElementGenerator()) {\n ... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1132 | {
"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 shouldExecuteNamedOperationWithoutOverridingInput() throws OperationException, CacheOperationFailedException {\n // Given\n final String opName = \"opName\";\n final NamedOperationCache cache = mock(NamedOperationCache.class);\n final NamedOperationResolve... | {
"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_1263 | {
"fields": [
{
"declarator": "serviceLoaderProperties = new Properties()",
"modifier": "private",
"original_string": "private Properties serviceLoaderProperties = new Properties();",
"type": "Properties",
"var_name": "serviceLoaderProperties"
}
],
"file": "core/cache/src/tes... | {
"body": "@Test\n public void shouldThrowAnExceptionWhenSystemVariableIsInvalid() {\n final String invalidClassName = \"invalid.cache.name\";\n serviceLoaderProperties.setProperty(CacheProperties.CACHE_SERVICE_CLASS, invalidClassName);\n\n final Exception exception = assertThrows(IllegalArgum... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(CacheServiceLoader.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(CacheServiceLoader.class);",
"type": "Logger",
"var_name": "LOGGER"
},
... | {
"body": "public static void initialise(final Properties properties) {\n if (null == properties) {\n LOGGER.warn(\"received null properties - exiting initialise method without creating service\");\n return;\n }\n final String cacheClass = properties.getProperty(CachePropert... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1326 | {
"fields": [
{
"declarator": "DELTA = 0.0000000001",
"modifier": "private static final",
"original_string": "private static final double DELTA = 0.0000000001;",
"type": "double",
"var_name": "DELTA"
},
{
"declarator": "UNION_CONVERTER = new UnionConverter()",
"mo... | {
"body": "@Test\n public void testConverter() throws ConversionException {\n final Union union = SetOperation.builder().buildUnion();\n union.update(1.0D);\n union.update(2.0D);\n union.update(3.0D);\n assertEquals(union.getResult().getEstimate(), UNION_CONVERTER.convert(union),... | {
"fields": [
{
"declarator": "serialVersionUID = -7267397762494567236L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -7267397762494567236L;",
"type": "long",
"var_name": "serialVersionUID"
}
],
"file": "library/spark/s... | {
"body": "@Override\n public Double convert(final Object object) throws ConversionException {\n return ((Union) object).getResult().getEstimate();\n }",
"class_method_signature": "UnionConverter.convert(final Object object)",
"constructor": false,
"full_signature": "@Override public Double convert... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_477 | {
"fields": [],
"file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/elementvisibilityutil/AuthorisationsTest.java",
"identifier": "AuthorisationsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testEncodeDecode() {\n final Authorisations a = new Authorisations(\"a\", \"abcdefg\", \"hijklmno\", \",\");\n final byte[] array = a.getAuthorisationsArray();\n final Authorisations b = new Authorisations(array);\n\n assertEquals(a, b);\n }",
"class_... | {
"fields": [
{
"declarator": "serialVersionUID = 8931467369628123909L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 8931467369628123909L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "auths... | {
"body": "public byte[] getAuthorisationsArray() {\n return serialise().getBytes(UTF_8);\n }",
"class_method_signature": "Authorisations.getAuthorisationsArray()",
"constructor": false,
"full_signature": "public byte[] getAuthorisationsArray()",
"identifier": "getAuthorisationsArray",
"invocation... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_924 | {
"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 shouldValidateAndReturnTrueWhenEdgeTransformerSelectionUnknownProperty() {\n // Given\n final ViewValidator validator = new ViewValidator();\n final View view = new View.Builder()\n .edge(TestGroups.EDGE, new ViewElementDefinition.Builder()\n ... | {
"fields": [
{
"declarator": "SKIP_VIEW_VALIDATION = \"skipViewValidation\"",
"modifier": "public static final",
"original_string": "public static final String SKIP_VIEW_VALIDATION = \"skipViewValidation\";",
"type": "String",
"var_name": "SKIP_VIEW_VALIDATION"
},
{
"d... | {
"body": "public ValidationResult validate(final View view, final Schema schema, final Set<StoreTrait> storeTraits) {\n final boolean isStoreOrdered = storeTraits.contains(StoreTrait.ORDERED);\n\n final ValidationResult result = new ValidationResult();\n\n if (null != view) {\n valida... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_861 | {
"fields": [
{
"declarator": "cache",
"modifier": "private static",
"original_string": "private static NamedViewCache cache;",
"type": "NamedViewCache",
"var_name": "cache"
},
{
"declarator": "GAFFER_USER = \"gaffer user\"",
"modifier": "private static final",
... | {
"body": "@Test\n public void shouldThrowExceptionWhenDeletingIfKeyIsNull() throws CacheOperationFailedException {\n try {\n cache.deleteNamedView(null, standardUser);\n fail(EXCEPTION_EXPECTED);\n } catch (IllegalArgumentException e) {\n assertTrue(e.getMessage().co... | {
"fields": [
{
"declarator": "CACHE_NAME = \"NamedView\"",
"modifier": "private static final",
"original_string": "private static final String CACHE_NAME = \"NamedView\";",
"type": "String",
"var_name": "CACHE_NAME"
}
],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/s... | {
"body": "@Deprecated\n public void deleteNamedView(final String name) throws CacheOperationFailedException {\n deleteNamedView(name, null);\n }",
"class_method_signature": "NamedViewCache.deleteNamedView(final String name)",
"constructor": false,
"full_signature": "@Deprecated public void deleteN... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_532 | {
"fields": [],
"file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/iterable/ChainedIterableTest.java",
"identifier": "ChainedIterableTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldRemoveElementFromFirstIterable() {\n // Given\n final List<String> itr1 = Lists.newArrayList(\"a\");\n final List<String> emptyItr2 = new ArrayList<>(0);\n final List<String> itr3 = Lists.newArrayList(\"b\", \"c\", \"d\", \"e\");\n final List<... | {
"fields": [
{
"declarator": "itrs",
"modifier": "private final",
"original_string": "private final Iterable<T>[] itrs;",
"type": "Iterable<T>[]",
"var_name": "itrs"
},
{
"declarator": "n",
"modifier": "private final",
"original_string": "private final int ... | {
"body": "@Override\n public CloseableIterator<T> iterator() {\n return new IteratorWrapper();\n }",
"class_method_signature": "ChainedIterable.iterator()",
"constructor": false,
"full_signature": "@Override public CloseableIterator<T> iterator()",
"identifier": "iterator",
"invocations": [],
... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_162 | {
"fields": [
{
"declarator": "serialisation",
"modifier": "private",
"original_string": "private ElementSerialisation serialisation;",
"type": "ElementSerialisation",
"var_name": "serialisation"
}
],
"file": "store-implementation/hbase-store/src/test/java/uk/gov/gchq/gaffer/... | {
"body": "@Test\n public void shouldBuildRandomTimeBasedTimestamp() throws Exception {\n // Given\n final Properties properties = new Properties();\n properties.put(HBasePropertyNames.COLUMN_QUALIFIER, 1);\n properties.put(HBasePropertyNames.PROP_1, 2);\n\n // When\n fina... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(ElementSerialisation.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(ElementSerialisation.class);",
"type": "Logger",
"var_name": "LOGGER"
... | {
"body": "public long getTimestamp(final Element element) throws SerialisationException {\n return getTimestamp(element.getProperties());\n }",
"class_method_signature": "ElementSerialisation.getTimestamp(final Element element)",
"constructor": false,
"full_signature": "public long getTimestamp(final... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_498 | {
"fields": [],
"file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/CommonTimeUtilTest.java",
"identifier": "CommonTimeUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldCorrectlyPlaceTimestampsIntoBuckets() {\n final OffsetDateTime offsetDateTime = OffsetDateTime.parse(\"2000-01-01T12:34:56.789Z\");\n final long time = offsetDateTime.toInstant().toEpochMilli();\n\n final OffsetDateTime yearOffsetDateTime = OffsetDateTime.p... | {
"fields": [
{
"declarator": "MILLISECONDS_IN_SECOND = 1000L",
"modifier": "public static final",
"original_string": "public static final long MILLISECONDS_IN_SECOND = 1000L;",
"type": "long",
"var_name": "MILLISECONDS_IN_SECOND"
},
{
"declarator": "MILLISECONDS_IN_MIN... | {
"body": "public static long timeToBucket(final long time, final TimeBucket bucket) {\n final OffsetDateTime dateTime = Instant.ofEpochMilli(time).atOffset(ZoneOffset.UTC);\n\n final long timeBucket;\n\n switch (bucket) {\n case MILLISECOND:\n timeBucket = dateTime.trun... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1234 | {
"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 shouldThrowErrorForTryingToUpdateOperationsWithEmptyList() {\n // Given\n final If<Object, Object> ifOp = new If.Builder<>()\n .condition(true)\n .build();\n\n final Collection<Operation> opList = Collections.emptyList();\n\n ... | {
"fields": [
{
"declarator": "condition",
"modifier": "private",
"original_string": "private Boolean condition;",
"type": "Boolean",
"var_name": "condition"
},
{
"declarator": "conditional",
"modifier": "private",
"original_string": "private Conditional con... | {
"body": "@Override\n public void updateOperations(final Collection<Operation> operations) {\n if (null == operations || 3 != operations.size()) {\n throw new IllegalArgumentException(\"Unable to update operations - exactly 3 operations are required. Received \" + (null != operations ? operation... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_84 | {
"fields": [
{
"declarator": "VERTEX = \"vertex\"",
"modifier": "private static final",
"original_string": "private static final String VERTEX = \"vertex\";",
"type": "String",
"var_name": "VERTEX"
},
{
"declarator": "schema = new Schema.Builder()\n .type(Te... | {
"body": "@Test\n public void shouldFailSettingSnapshotWhenSnapshotNotExists(@TempDir java.nio.file.Path tempDir)\n throws IOException {\n //Given\n final ParquetStoreProperties properties = getParquetStoreProperties(tempDir);\n ParquetStore store = (ParquetStore)\n ... | {
"fields": [
{
"declarator": "GROUP = \"group\"",
"modifier": "public static final",
"original_string": "public static final String GROUP = \"group\";",
"type": "String",
"var_name": "GROUP"
},
{
"declarator": "GRAPH = \"graph\"",
"modifier": "public static final... | {
"body": "public void setLatestSnapshot(final long snapshot) throws StoreException {\n final Path snapshotPath = new Path(getDataDir(), getSnapshotPath(snapshot));\n try {\n if (!fs.exists(snapshotPath)) {\n throw new StoreException(String.format(\"Failed setting currentSnapsh... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1371 | {
"fields": [
{
"declarator": "hyperLogLogPlusWithCardinality5",
"modifier": "private static",
"original_string": "private static HyperLogLogPlus hyperLogLogPlusWithCardinality5;",
"type": "HyperLogLogPlus",
"var_name": "hyperLogLogPlusWithCardinality5"
},
{
"declarator... | {
"body": "@Test\n @Override\n public void shouldJsonSerialiseAndDeserialise() throws SerialisationException {\n // Given\n final long controlValue = 15;\n final HyperLogLogPlusIsLessThan filter = new HyperLogLogPlusIsLessThan(controlValue);\n\n // When 1\n final String json =... | {
"fields": [
{
"declarator": "controlValue",
"modifier": "private",
"original_string": "private long controlValue;",
"type": "long",
"var_name": "controlValue"
},
{
"declarator": "orEqualTo",
"modifier": "private",
"original_string": "private boolean orEqua... | {
"body": "@JsonProperty(\"value\")\n public long getControlValue() {\n return controlValue;\n }",
"class_method_signature": "HyperLogLogPlusIsLessThan.getControlValue()",
"constructor": false,
"full_signature": "@JsonProperty(\"value\") public long getControlValue()",
"identifier": "getControlVa... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_709 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/handler/OperationChainHandlerTest.java",
"identifier": "OperationChainHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldHandleOperationChain() throws OperationException {\n // Given\n final OperationChainValidator opChainValidator = mock(OperationChainValidator.class);\n final List<OperationChainOptimiser> opChainOptimisers = Collections.emptyList();\n\n final Operati... | {
"fields": [
{
"declarator": "opChainValidator",
"modifier": "private final",
"original_string": "private final OperationChainValidator opChainValidator;",
"type": "OperationChainValidator",
"var_name": "opChainValidator"
},
{
"declarator": "opChainOptimisers",
"... | {
"body": "@Override\n public OUT doOperation(final OperationChain<OUT> operationChain, final Context context, final Store store) throws OperationException {\n\n prepareOperationChain(operationChain, context, store);\n\n Object result = null;\n for (final Operation op : operationChain.getOpera... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_359 | {
"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 shouldMatchStringComparison() {\n final ComparableOrToStringComparator comparator = new ComparableOrToStringComparator();\n\n final int result = comparator.compare(\"1\", \"2\");\n\n assertTrue(result < 0, \"Both should be less than 0\");\n }",
"class_method... | {
"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_973 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/schema/SchemaElementDefinitionValidatorTest.java",
"identifier": "SchemaElementDefinitionValidatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldValidateAndReturnFalseWhenAggregatorHasIdentifierInSelection() {\n // Given\n final SchemaElementDefinitionValidator validator = new SchemaElementDefinitionValidator();\n final BinaryOperator<Integer> function1 = mock(BinaryOperator.class);\n final S... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(SchemaElementDefinitionValidator.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(SchemaElementDefinitionValidator.class);",
"type": "Logger",
... | {
"body": "public ValidationResult validate(final SchemaElementDefinition elementDef) {\n final ValidationResult result = new ValidationResult();\n\n final ElementFilter validator = elementDef.getValidator();\n final ElementAggregator aggregator = elementDef.getFullAggregator();\n result.a... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1058 | {
"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 canHandleParameterisedDAO() throws SerialisationException {\n assertTrue(JSONSerialiser.canHandle(ParameterisedTestObject.class));\n }",
"class_method_signature": "JSONSerialiserTest.canHandleParameterisedDAO()",
"constructor": false,
"full_signature": "@Test public v... | {
"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_420 | {
"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 @Override\n public void shouldJsonSerialiseAndDeserialise() throws SerialisationException {\n final ExtractId function = getInstance();\n\n final byte[] json = JSONSerialiser.serialise(function);\n final ExtractId deserialisedObj = JSONSerialiser.deserialise(json, Extract... | {
"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": "public IdentifierType getId() {\n return id;\n }",
"class_method_signature": "ExtractId.getId()",
"constructor": false,
"full_signature": "public IdentifierType getId()",
"identifier": "getId",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "IdentifierType... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_135 | {
"fields": [
{
"declarator": "GRAPH_ID = \"graph1\"",
"modifier": "private static final",
"original_string": "private static final String GRAPH_ID = \"graph1\";",
"type": "String",
"var_name": "GRAPH_ID"
},
{
"declarator": "LOCALITY_GRAPH_ID = \"localityTest\"",
... | {
"body": "@Test\n public void shouldCreateTableCorrectlyIfSchemaContainsNoAggregators() throws Exception {\n // Given\n final AccumuloStore store = new SingleUseAccumuloStore();\n final Schema schema = new Schema.Builder()\n .type(TestTypes.ID_STRING, new TypeDefinition.Builder... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(TableUtils.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(TableUtils.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"dec... | {
"body": "public static synchronized void createTable(final AccumuloStore store)\n throws StoreException, TableExistsException {\n // Create table and namespace (if provided)\n final String tableName = store.getTableName();\n if (null == tableName) {\n throw new AccumuloRun... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_565 | {
"fields": [],
"file": "core/type/src/test/java/uk/gov/gchq/gaffer/serialisation/IntegerFreqMapSerialiserTest.java",
"identifier": "IntegerFreqMapSerialiserTest",
"interfaces": "",
"superclass": "extends ToBytesSerialisationTest<IntegerFreqMap>"
} | {
"body": "@Test\n public void canSerialiseFreqMap() {\n assertTrue(serialiser.canHandle(IntegerFreqMap.class));\n }",
"class_method_signature": "IntegerFreqMapSerialiserTest.canSerialiseFreqMap()",
"constructor": false,
"full_signature": "@Test public void canSerialiseFreqMap()",
"identifier": "... | {
"fields": [
{
"declarator": "serialVersionUID = 3772387954385745791L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 3772387954385745791L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "SEPER... | {
"body": "@Override\n public boolean canHandle(final Class clazz) {\n return IntegerFreqMap.class.equals(clazz);\n }",
"class_method_signature": "IntegerFreqMapSerialiser.canHandle(final Class clazz)",
"constructor": false,
"full_signature": "@Override public boolean canHandle(final Class clazz)",... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_836 | {
"fields": [
{
"declarator": "vertex1",
"modifier": "private",
"original_string": "private Object vertex1, vertex2, vertex3,\n vertex4, vertex5, vertex6,\n vertex7, vertex8;",
"type": "Object",
"var_name": "vertex1"
}
],
"file": "core/store/src/test/jav... | {
"body": "@Test\n public void shouldCorrectlyConvertEdgeSeedsWithEqualUseMatchedVertex() throws OperationException {\n // Given\n final List elementIds = Arrays.asList(\n new EdgeSeed(vertex1, vertex2, false, null),\n new EdgeSeed(vertex3, vertex4, false, null),\n ... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/output/ToVerticesHandler.java",
"identifier": "ToVerticesHandler",
"interfaces": "implements OutputOperationHandler<ToVertices, Iterable<? extends Object>>",
"methods": [
{
"class_method_signature": "ToVerti... | {
"body": "@Override\n public Iterable<Object> doOperation(final ToVertices operation, final Context context, final Store store) throws OperationException {\n if (null == operation.getInput()) {\n return null;\n }\n\n return new StreamFlatMapIterable<>(operation.getInput(), elementI... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1222 | {
"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 shouldSetOptionToValue() {\n // When\n final GetElements op = new GetElements.Builder()\n .option(\"key\", \"value\")\n .input(new EntitySeed())\n .build();\n\n // Then\n assertThat(op.getOptions(), is(notNullVa... | {
"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 Map<String, String> getOptions() {\n return options;\n }",
"class_method_signature": "GetElements.getOptions()",
"constructor": false,
"full_signature": "@Override public Map<String, String> getOptions()",
"identifier": "getOptions",
"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_1367 | {
"fields": [
{
"declarator": "hyperLogLogPlusWithCardinality5",
"modifier": "private static",
"original_string": "private static HyperLogLogPlus hyperLogLogPlusWithCardinality5;",
"type": "HyperLogLogPlus",
"var_name": "hyperLogLogPlusWithCardinality5"
},
{
"declarator... | {
"body": "@Test\n public void shouldRejectWhenEqualToAndEqualToIsFalse() {\n // Given\n final HyperLogLogPlusIsLessThan filter = new HyperLogLogPlusIsLessThan(15);\n // When\n boolean accepted = filter.test(hyperLogLogPlusWithCardinality15);\n // Then\n assertFalse(accept... | {
"fields": [
{
"declarator": "controlValue",
"modifier": "private",
"original_string": "private long controlValue;",
"type": "long",
"var_name": "controlValue"
},
{
"declarator": "orEqualTo",
"modifier": "private",
"original_string": "private boolean orEqua... | {
"body": "@Override\n public boolean test(final HyperLogLogPlus input) {\n if (null == input) {\n return false;\n }\n final long cardinality = input.cardinality();\n if (orEqualTo) {\n if (cardinality <= controlValue) {\n return true;\n }... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_92 | {
"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 testGetPartitions() {\n // Given\n final PartitionKey key1 = new PartitionKey(new Object[]{1L, \"B\"});\n final PartitionKey key2 = new PartitionKey(new Object[]{5L, \"A\"});\n final PartitionKey key3 = new PartitionKey(new Object[]{100L, \"Z\"});\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<Partition> getPartitions() {\n return this.partitions;\n }",
"class_method_signature": "GroupPartitioner.getPartitions()",
"constructor": false,
"full_signature": "public List<Partition> getPartitions()",
"identifier": "getPartitions",
"invocations": [],
"modifiers": "publ... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_436 | {
"fields": [],
"file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/element/LazyEdgeTest.java",
"identifier": "LazyEdgeTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldUnwrapEdge() {\n // Given\n final Edge edge = new Edge.Builder().build();\n final ElementValueLoader edgeLoader = mock(ElementValueLoader.class);\n final LazyEdge lazyEdge = new LazyEdge(edge, edgeLoader);\n\n // When\n final Edge resul... | {
"fields": [
{
"declarator": "serialVersionUID = 3950963135470686691L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 3950963135470686691L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "edge"... | {
"body": "@Override\n public Edge getElement() {\n return edge;\n }",
"class_method_signature": "LazyEdge.getElement()",
"constructor": false,
"full_signature": "@Override public Edge getElement()",
"identifier": "getElement",
"invocations": [],
"modifiers": "@Override public",
"parameters... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_965 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/schema/SchemaElementDefinitionValidatorTest.java",
"identifier": "SchemaElementDefinitionValidatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldValidateFunctionSelectionsAndReturnFalseWhenFunctionTypeDoesNotEqualSelectionType() {\n // Given\n final SchemaElementDefinition elementDef = mock(SchemaElementDefinition.class);\n given(elementDef.getPropertyClass(\"selection\")).willReturn((Class) String.... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(SchemaElementDefinitionValidator.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(SchemaElementDefinitionValidator.class);",
"type": "Logger",
... | {
"body": "protected ValidationResult validateFunctionArgumentTypes(\n final ElementFilter filter, final SchemaElementDefinition schemaElDef) {\n final ValidationResult result = new ValidationResult();\n if (null != filter && null != filter.getComponents()) {\n for (final TupleAdap... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_820 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/handler/output/ToCsvHandlerTest.java",
"identifier": "ToCsvHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldConvertToQuotedCsv() throws OperationException {\n // Given\n final List<Element> elements = Lists.newArrayList(\n makeEntity(\"vertex1\", \"count\", 1),\n makeEntity(\"vertex2\"),\n makeEdge(\"source1\", \"count\", 1),... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/output/ToCsvHandler.java",
"identifier": "ToCsvHandler",
"interfaces": "implements OutputOperationHandler<ToCsv, Iterable<? extends String>>",
"methods": [
{
"class_method_signature": "ToCsvHandler.doOperati... | {
"body": "@Override\n public Iterable<? extends String> doOperation(final ToCsv operation, final Context context, final Store store) throws OperationException {\n if (null == operation.getInput()) {\n return null;\n }\n\n if (null == operation.getElementGenerator()) {\n ... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_573 | {
"fields": [],
"file": "core/type/src/test/java/uk/gov/gchq/gaffer/types/CustomMapTest.java",
"identifier": "CustomMapTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldJSONSerialiseFloatRDM() throws IOException {\n //given\n System.setProperty(JSONSerialiser.JSON_SERIALISER_MODULES, BitmapJsonModules.class.getCanonicalName());\n\n final RBMBackedTimestampSet timestampSet1 = new RBMBackedTimestampSet.Builder()\n ... | {
"fields": [
{
"declarator": "keySerialiser",
"modifier": "private final",
"original_string": "private final ToBytesSerialiser<? super K> keySerialiser;",
"type": "ToBytesSerialiser<? super K>",
"var_name": "keySerialiser"
},
{
"declarator": "valueSerialiser",
"m... | {
"body": "public V put(final K key, final V value) {\n return delegateMap.put(key, value);\n }",
"class_method_signature": "CustomMap.put(final K key, final V value)",
"constructor": false,
"full_signature": "public V put(final K key, final V value)",
"identifier": "put",
"invocations": [
"pu... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_123 | {
"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 shouldFailWithDifferentSizedBackingArrays() throws Exception {\n br1 = new BytesAndRange(a, 0, a.length);\n br2 = new BytesAndRange(c, 0, c.length);\n assertFalse(ByteUtils.areKeyBytesEqual(br1, br2));\n }",
"class_method_signature": "ByteUtilsTest.shouldFai... | {
"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_1275 | {
"fields": [
{
"declarator": "service = new JcsCacheService()",
"modifier": "private",
"original_string": "private JcsCacheService service = new JcsCacheService();",
"type": "JcsCacheService",
"var_name": "service"
},
{
"declarator": "TEST_REGION = \"test\"",
"mo... | {
"body": "@Test\n public void shouldGetAllValues() throws CacheOperationException {\n service.initialise(serviceProps);\n service.putInCache(TEST_REGION, \"test1\", 1);\n service.putInCache(TEST_REGION, \"test2\", 2);\n service.putInCache(TEST_REGION, \"test3\", 3);\n service.pu... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(JcsCacheService.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(JcsCacheService.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
... | {
"body": "@Override\n public void initialise(final Properties properties) {\n String configFile = properties.getProperty(CacheProperties.CACHE_CONFIG_FILE);\n manager = CompositeCacheManager.getUnconfiguredInstance();\n\n if (null != configFile) {\n try {\n Propertie... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1330 | {
"fields": [
{
"declarator": "FREQ_MAP_CONVERTER = new FreqMapConverter()",
"modifier": "private static final",
"original_string": "private static final FreqMapConverter FREQ_MAP_CONVERTER = new FreqMapConverter();",
"type": "FreqMapConverter",
"var_name": "FREQ_MAP_CONVERTER"
}... | {
"body": "@Test\n public void testConverter() throws ConversionException {\n final FreqMap freqMap = new FreqMap();\n freqMap.put(\"x\", 10L);\n freqMap.put(\"y\", 5L);\n freqMap.put(\"z\", 20L);\n final scala.collection.mutable.Map<String, Long> expectedResult = scala.collectio... | {
"fields": [
{
"declarator": "serialVersionUID = -1247681579101863145L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -1247681579101863145L;",
"type": "long",
"var_name": "serialVersionUID"
}
],
"file": "library/spark/s... | {
"body": "@Override\n public scala.collection.mutable.Map<String, Long> convert(final Object object) throws ConversionException {\n return JavaConverters.mapAsScalaMapConverter((FreqMap) object).asScala();\n }",
"class_method_signature": "FreqMapConverter.convert(final Object object)",
"constructor"... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_748 | {
"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 shouldUpdateTransformInputAndTestAgainstPredicate() throws OperationException {\n final Edge input = new Edge.Builder()\n .group(\"testEdge\")\n .source(\"src\")\n .dest(\"dest\")\n .directed(true)\n .p... | {
"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_318 | {
"fields": [
{
"declarator": "TEST_VIEW_NAME = \"testViewName\"",
"modifier": "private static final",
"original_string": "private static final String TEST_VIEW_NAME = \"testViewName\";",
"type": "String",
"var_name": "TEST_VIEW_NAME"
},
{
"declarator": "TEST_PARAM_KEY ... | {
"body": "@Test\n public void shouldNotAddNameToMergedNamedViewsListIfNameIsTheSameAsTheNamedViewName() {\n final String namedViewName = \"namedViewName\";\n\n final NamedView namedViewToMerge = new NamedView.Builder()\n .name(namedViewName)\n .edge(TestGroups.EDGE)\n ... | {
"fields": [
{
"declarator": "name",
"modifier": "@Required\n private",
"original_string": "@Required\n private String name;",
"type": "String",
"var_name": "name"
},
{
"declarator": "parameters",
"modifier": "private",
"original_string": "private Map... | {
"body": "public List<String> getMergedNamedViewNames() {\n return mergedNamedViewNames;\n }",
"class_method_signature": "NamedView.getMergedNamedViewNames()",
"constructor": false,
"full_signature": "public List<String> getMergedNamedViewNames()",
"identifier": "getMergedNamedViewNames",
"invoca... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_932 | {
"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 shouldValidateAndReturnTrueWhenPostTransformerFilterSet() {\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_1019 | {
"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 cantSerialiseLongClass() {\n assertFalse(serialiser.canHandle(Long.class));\n }",
"class_method_signature": "BytesSerialiserTest.cantSerialiseLongClass()",
"constructor": false,
"full_signature": "@Test public void cantSerialiseLongClass()",
"identifier": "cantSeria... | {
"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 boolean canHandle(final Class clazz) {\n return byte[].class.equals(clazz) || Byte[].class.equals(clazz);\n }",
"class_method_signature": "BytesSerialiser.canHandle(final Class clazz)",
"constructor": false,
"full_signature": "@Override public boolean canHandle(final 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_898 | {
"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 shouldNotBeAbleToModifyParentsOnceBuilt() {\n // Given\n final T elementDef = createBuilder()\n .property(\"property\", PROPERTY_STRING_TYPE)\n .parents(\"parentGroup1\")\n .build();\n\n // When / Then\n try {\n... | {
"fields": [
{
"declarator": "elementDefValidator",
"modifier": "private final",
"original_string": "private final SchemaElementDefinitionValidator elementDefValidator;",
"type": "SchemaElementDefinitionValidator",
"var_name": "elementDefValidator"
},
{
"declarator": "... | {
"body": "@JsonIgnore\n protected Set<String> getParents() {\n return parents;\n }",
"class_method_signature": "SchemaElementDefinition.getParents()",
"constructor": false,
"full_signature": "@JsonIgnore protected Set<String> getParents()",
"identifier": "getParents",
"invocations": [],
"mod... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_461 | {
"fields": [],
"file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/JsonUtilTest.java",
"identifier": "JsonUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnFalseWhenJsonArraysAreNotEqual() {\n // Given\n final String json1 = \"[1,2,3]\";\n final String json2 = \"[1,2,4]\";\n\n assertFalse(JsonUtil.equals(json1, json2));\n assertFalse(JsonUtil.equals(json1.getBytes(), json2.getBytes()));\n\n... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(JsonUtil.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(JsonUtil.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declara... | {
"body": "public static boolean equals(final String expectedJson, final String actualJson) {\n try {\n final Map expectedSchemaMap = null != expectedJson ? OBJECT_MAPPER.readValue(expectedJson, Map.class) : Collections.emptyMap();\n final Map actualSchemaMap = null != actualJson ? OBJECT... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_0 | {
"fields": [
{
"declarator": "TEST_USER = new User.Builder().userId(\"TestUser\").opAuths(\"auth1\", \"auth2\").build()",
"modifier": "private static final",
"original_string": "private static final User TEST_USER = new User.Builder().userId(\"TestUser\").opAuths(\"auth1\", \"auth2\").build();"... | {
"body": "@Test\n public void shouldReturnTrueForResourceCreator() {\n assertTrue(createAccessPredicate(TEST_USER.getUserId(), NO_AUTHS, NON_PUBLIC).test(TEST_USER, null));\n }",
"class_method_signature": "FederatedGraphReadAccessPredicateTest.shouldReturnTrueForResourceCreator()",
"constructor": fa... | {
"fields": [],
"file": "store-implementation/federated-store/src/main/java/uk/gov/gchq/gaffer/federatedstore/access/predicate/FederatedGraphReadAccessPredicate.java",
"identifier": "FederatedGraphReadAccessPredicate",
"interfaces": "",
"methods": [
{
"class_method_signature": "FederatedGraphReadAcc... | {
"body": "@Override\n public boolean test(final User user, final String adminAuth) {\n return super.test(user, adminAuth);\n }",
"class_method_signature": "FederatedGraphReadAccessPredicate.test(final User user, final String adminAuth)",
"constructor": false,
"full_signature": "@Override public bo... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_174 | {
"fields": [],
"file": "store-implementation/hbase-store/src/test/java/uk/gov/gchq/gaffer/hbasestore/operation/handler/GetElementsHandlerTest.java",
"identifier": "GetElementsHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnHBaseRetrieverWithIncludeMatchedVertexWhenSeedMatchingIsNull() throws OperationException, StoreException {\n // Given\n final Iterable<EntityId> ids = mock(Iterable.class);\n final Context context = mock(Context.class);\n final User user = mock... | {
"fields": [],
"file": "store-implementation/hbase-store/src/main/java/uk/gov/gchq/gaffer/hbasestore/operation/handler/GetElementsHandler.java",
"identifier": "GetElementsHandler",
"interfaces": "implements OutputOperationHandler<GetElements, CloseableIterable<? extends Element>>",
"methods": [
{
"... | {
"body": "@Override\n public CloseableIterable<? extends Element> doOperation(final GetElements operation, final Context context, final Store store) throws OperationException {\n return doOperation(operation, context.getUser(), (HBaseStore) store);\n }",
"class_method_signature": "GetElementsHandler.d... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_524 | {
"fields": [],
"file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/stream/StreamsTest.java",
"identifier": "StreamsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldCloseIteratorWhenParallelStreamIsClosed() throws Throwable {\n // Given\n final CloseableIterator<String> iterator = mock(CloseableIterator.class);\n given(iterator.hasNext()).willReturn(true, false);\n final String first = \"first item\";\n g... | {
"fields": [],
"file": "core/common-util/src/main/java/uk/gov/gchq/gaffer/commonutil/stream/Streams.java",
"identifier": "Streams",
"interfaces": "",
"methods": [
{
"class_method_signature": "Streams.toStream(final Iterable<T> iterable)",
"constructor": false,
"full_signature": "public ... | {
"body": "public static <T> Stream<T> toParallelStream(final Iterable<T> iterable) {\n if (iterable instanceof StreamIterable) {\n return ((StreamIterable<T>) iterable).getStream().parallel();\n }\n\n return StreamSupport.stream(iterable.spliterator(), true)\n .onClose(... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_877 | {
"fields": [
{
"declarator": "cache = new NamedOperationCache()",
"modifier": "private final",
"original_string": "private final NamedOperationCache cache = new NamedOperationCache();",
"type": "NamedOperationCache",
"var_name": "cache"
},
{
"declarator": "addNamedOper... | {
"body": "@Test\n public void shouldReturnNullLabelWhenLabelIsNullFromAddNamedOperationRequest() throws Exception {\n final AddNamedOperation addNamedOperationWithNullLabel = new AddNamedOperation.Builder()\n .name(\"My Operation With Label\")\n .labels(null)\n ... | {
"fields": [
{
"declarator": "cache",
"modifier": "private final",
"original_string": "private final NamedOperationCache cache;",
"type": "NamedOperationCache",
"var_name": "cache"
}
],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/named/GetAll... | {
"body": "@Override\n public CloseableIterable<NamedOperationDetail> doOperation(final GetAllNamedOperations operation, final Context context, final Store store) throws OperationException {\n final CloseableIterable<NamedOperationDetail> ops = cache.getAllNamedOperations(context.getUser(), store.getPropert... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_733 | {
"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 shouldProcessWalksInOperationChain() throws OperationException {\n // Given\n final Iterable<Iterable<Set<Edge>>> walks = Arrays.asList(walk, walk1);\n\n final Map<Iterable<Iterable<Set<Edge>>>, Iterable<Edge>> map = new Map.Builder<Iterable<Iterable<Set<Edge>>>>... | {
"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_363 | {
"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 shouldCompareNullWithValue() {\n final ComparableOrToStringComparator comparator = new ComparableOrToStringComparator();\n\n final int result = comparator.compare(null, 1);\n\n assertTrue(result > 0, \"Should be more than 0\");\n }",
"class_method_signature"... | {
"fields": [],
"file": "core/data/src/main/java/uk/gov/gchq/gaffer/data/element/comparison/ComparableOrToStringComparator.java",
"identifier": "ComparableOrToStringComparator",
"interfaces": "implements Comparator<Object>, Serializable",
"methods": [
{
"class_method_signature": "ComparableOrToStrin... | {
"body": "@Override\n public int compare(final Object vertex1, final Object vertex2) {\n if (null == vertex1) {\n if (null == vertex2) {\n return 0;\n }\n return 1;\n }\n\n if (null == vertex2) {\n return -1;\n }\n\n if ... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_699 | {
"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 shouldReturnNullIfBothComparatorsAreNull() throws OperationException {\n // Given\n final List<Entity> input = Lists.newArrayList();\n final Max max = new Max.Builder().input(input)\n .build();\n\n final MaxHandler handler = new MaxHandler()... | {
"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_676 | {
"fields": [
{
"declarator": "schema = new Schema.Builder()\n .entity(TestGroups.ENTITY, new SchemaEntityDefinition.Builder()\n .vertex(TestTypes.ID_STRING)\n .build())\n .edge(TestGroups.EDGE, new SchemaEdgeDefinition.Builder()\n ... | {
"body": "@Test\n public void shouldFilterOutNulls() throws OperationException {\n // Given\n final int numSplits = 3;\n final List<Element> elements =\n IntStream.range(0, numSplits)\n .mapToObj(i -> new Entity(TestGroups.ENTITY, \"vertex_\" + i))\n ... | {
"fields": [
{
"declarator": "MAX_SAMPLED_ELEMENTS_DEFAULT = 10000000",
"modifier": "public static final",
"original_string": "public static final int MAX_SAMPLED_ELEMENTS_DEFAULT = 10000000;",
"type": "int",
"var_name": "MAX_SAMPLED_ELEMENTS_DEFAULT"
},
{
"declarator"... | {
"body": "@Override\n public List<T> doOperation(final SampleElementsForSplitPoints<T> operation, final Context context, final Store store) throws OperationException {\n final S typedStore = (S) store;\n\n validate(operation, typedStore);\n\n final Integer numSplits = getNumSplits(operation, ... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_226 | {
"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 shouldGetFilterFunctionsWithInputClass() {\n // When\n final Set<Class> classes = (Set<Class>) service.getFilterFunction(Long.class.getName()).getEntity();\n\n // Then\n assertThat(classes, IsCollectionContaining.hasItem(IsLessThan.class));\n assert... | {
"fields": [
{
"declarator": "graphFactory",
"modifier": "@Inject\n private",
"original_string": "@Inject\n private GraphFactory graphFactory;",
"type": "GraphFactory",
"var_name": "graphFactory"
},
{
"declarator": "userFactory",
"modifier": "@Inject\n p... | {
"body": "@Override\n public Response getFilterFunction() {\n return Response.ok(ReflectionUtil.getSubTypes(Predicate.class))\n .header(GAFFER_MEDIA_TYPE_HEADER, GAFFER_MEDIA_TYPE)\n .build();\n }",
"class_method_signature": "GraphConfigurationServiceV2.getFilterFunction(... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_51 | {
"fields": [
{
"declarator": "TEST_ENTITY = \"TestEntity\"",
"modifier": "public static final",
"original_string": "public static final String TEST_ENTITY = \"TestEntity\";",
"type": "String",
"var_name": "TEST_ENTITY"
},
{
"declarator": "TEST_GRAPH_ID = \"testGraphId\... | {
"body": "@Test\n public void shouldNotThrowException() throws Exception {\n // Given\n // Given\n final OP op = getExampleOperation();\n op.addOption(KEY_OPERATION_OPTIONS_GRAPH_IDS, \"1,3\");\n op.addOption(KEY_SKIP_FAILED_FEDERATED_STORE_EXECUTE, String.valueOf(true));\n\n ... | {
"fields": [],
"file": "store-implementation/federated-store/src/main/java/uk/gov/gchq/gaffer/federatedstore/operation/handler/FederatedOperationOutputHandler.java",
"identifier": "FederatedOperationOutputHandler",
"interfaces": "implements OutputOperationHandler<OP, O>",
"methods": [
{
"class_meth... | {
"body": "@Override\n public O doOperation(final OP operation, final Context context, final Store store) throws OperationException {\n final Collection<Graph> graphs = ((FederatedStore) store).getGraphs(context.getUser(), operation.getOption(KEY_OPERATION_OPTIONS_GRAPH_IDS), operation);\n final List... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1127 | {
"fields": [
{
"declarator": "ADD_OPERATIONS_TO_CHAIN_RESOURCE_PATH = \"addOperationsToChain.json\"",
"modifier": "private static final",
"original_string": "private static final String ADD_OPERATIONS_TO_CHAIN_RESOURCE_PATH = \"addOperationsToChain.json\";",
"type": "String",
"var_n... | {
"body": "@Test\n public void shouldHandleNestedOperationChain() throws SerialisationException {\n // Given\n AddOperationsToChain hook = fromJson(ADD_OPERATIONS_TO_CHAIN_RESOURCE_PATH);\n\n Operation discardOutput = new DiscardOutput();\n Operation splitStore = new SplitStoreFromFile(... | {
"fields": [
{
"declarator": "defaultOperations = new AdditionalOperations()",
"modifier": "private final",
"original_string": "private final AdditionalOperations defaultOperations = new AdditionalOperations();",
"type": "AdditionalOperations",
"var_name": "defaultOperations"
},... | {
"body": "@Override\n public void preExecute(final OperationChain<?> opChain, final Context context) {\n final List<Operation> newOpList = new ArrayList<>();\n\n boolean hasAuth = false;\n if (!authorisedOps.isEmpty() && !context.getUser().getOpAuths().isEmpty()) {\n for (final Str... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_949 | {
"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 shouldSerialiseToCompactJson() {\n // Given - schema loaded from file\n\n // When\n final String compactJson = new String(schema.toCompactJson());\n\n // Then - no description fields or new lines\n assertF... | {
"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 byte[] toCompactJson() throws SchemaException {\n return toJson(false, \"description\");\n }",
"class_method_signature": "Schema.toCompactJson()",
"constructor": false,
"full_signature": "public byte[] toCompactJson()",
"identifier": "toCompactJson",
"invocations": [
"toJson"... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1062 | {
"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 shouldThrowExceptionWhenUpdateInstanceWithInvalidModuleClass() throws Exception {\n // Given\n System.setProperty(JSONSerialiser.JSON_SERIALISER_MODULES, \"module1\");\n\n // When / Then\n try {\n JSONSerialiser.update();\n fail(\"Exc... | {
"fields": [
{
"declarator": "JSON_SERIALISER_CLASS_KEY = \"gaffer.serialiser.json.class\"",
"modifier": "public static final",
"original_string": "public static final String JSON_SERIALISER_CLASS_KEY = \"gaffer.serialiser.json.class\";",
"type": "String",
"var_name": "JSON_SERIALIS... | {
"body": "@Deprecated\n public static void update(final String jsonSerialiserClass, final String jsonSerialiserModules) {\n update(jsonSerialiserClass, jsonSerialiserModules, null);\n }",
"class_method_signature": "JSONSerialiser.update(final String jsonSerialiserClass, final String jsonSerialiserModu... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_334 | {
"fields": [],
"file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/graph/adjacency/AdjacencyMapTest.java",
"identifier": "AdjacencyMapTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldContainSource() {\n // Given\n final AdjacencyMap adjacencyMap = getAdjacencyMap();\n\n // When\n final boolean result = adjacencyMap.containsSource(2);\n\n // Then\n assertThat(result, is(true));\n }",
"class_method_signature": "A... | {
"fields": [
{
"declarator": "edgeGraph = HashBasedTable.create()",
"modifier": "private final",
"original_string": "private final HashBasedTable<Object, Object, Set<Edge>> edgeGraph = HashBasedTable.create();",
"type": "HashBasedTable<Object, Object, Set<Edge>>",
"var_name": "edgeG... | {
"body": "public boolean containsSource(final Object source) {\n return edgeGraph.rowKeySet().contains(source);\n }",
"class_method_signature": "AdjacencyMap.containsSource(final Object source)",
"constructor": false,
"full_signature": "public boolean containsSource(final Object source)",
"identifi... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_764 | {
"fields": [
{
"declarator": "TEST_ENTITY_GROUP = \"testEntity1\"",
"modifier": "private static final",
"original_string": "private static final String TEST_ENTITY_GROUP = \"testEntity1\";",
"type": "String",
"var_name": "TEST_ENTITY_GROUP"
},
{
"declarator": "TEST_ENT... | {
"body": "@Test\n public void shouldThrowExceptionIfListIsNull() {\n // given\n KeyFunctionMatch match = new KeyFunctionMatch.Builder().build();\n\n // when / then\n\n try {\n match.init(null);\n } catch (IllegalArgumentException e) {\n assertEquals(\"Itera... | {
"fields": [
{
"declarator": "NULL_FUNCTION_ERROR_MESSAGE = \"Key functions for left and right input cannot be null\"",
"modifier": "private static final",
"original_string": "private static final String NULL_FUNCTION_ERROR_MESSAGE = \"Key functions for left and right input cannot be null\";",
... | {
"body": "@Override\n public void init(final Iterable matchCandidates) {\n\n if (matchCandidates == null) {\n throw new IllegalArgumentException(NULL_MATCH_CANDIDATES_ERROR_MESSAGE);\n }\n // Iterates over match candidates, creates an index using second key function.\n for (... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1259 | {
"fields": [
{
"declarator": "USER = \"User\"",
"modifier": "public static final",
"original_string": "public static final String USER = \"User\";",
"type": "String",
"var_name": "USER"
},
{
"declarator": "OPERATION_CHAIN = new OperationChain.Builder().first(new GetAdj... | {
"body": "@Test\n public void shouldGetOperationsWithDefaultParameters() {\n // Given\n final AddNamedOperation addNamedOperation = new AddNamedOperation.Builder()\n .operationChain(\"{\\\"operations\\\":[{\\\"class\\\": \\\"uk.gov.gchq.gaffer.operation.impl.get.GetAdjacentIds\\\", \\... | {
"fields": [
{
"declarator": "operations",
"modifier": "@Required\n private",
"original_string": "@Required\n private String operations;",
"type": "String",
"var_name": "operations"
},
{
"declarator": "operationName",
"modifier": "private",
"original_... | {
"body": "@Override\n @JsonIgnore\n public Collection<Operation> getOperations() {\n return getOperationsWithDefaultParams();\n }",
"class_method_signature": "AddNamedOperation.getOperations()",
"constructor": false,
"full_signature": "@Override @JsonIgnore public Collection<Operation> getOpera... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_271 | {
"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 shouldReturnTrueWhenViewHasPostAggEntityFilters() {\n // Given\n final View view = new View.Builder()\n .entity(TestGroups.ENTITY, new ViewElementDefinition.Builder()\n .postAggregationFilter(new ElementFilter.Builder()\n ... | {
"fields": [
{
"declarator": "globalElements",
"modifier": "private",
"original_string": "private List<GlobalViewElementDefinition> globalElements;",
"type": "List<GlobalViewElementDefinition>",
"var_name": "globalElements"
},
{
"declarator": "globalEntities",
"m... | {
"body": "public boolean hasPostAggregationFilters() {\n return hasFilters(ViewElementDefinition::hasPostAggregationFilters);\n }",
"class_method_signature": "View.hasPostAggregationFilters()",
"constructor": false,
"full_signature": "public boolean hasPostAggregationFilters()",
"identifier": "hasP... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_621 | {
"fields": [
{
"declarator": "user = new User(\"user01\")",
"modifier": "private final",
"original_string": "private final User user = new User(\"user01\");",
"type": "User",
"var_name": "user"
},
{
"declarator": "context = new Context(user)",
"modifier": "privat... | {
"body": "@Test\n public void shouldThrowExceptionWhenPropertyIsNotSerialisable() throws StoreException {\n // Given\n final Schema mySchema = new Schema.Builder()\n .edge(TestGroups.EDGE, new SchemaEdgeDefinition.Builder()\n .property(TestPropertyNames.PROP_1, ... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(Store.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(Store.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": ... | {
"body": "public void initialise(final String graphId, final Schema schema, final StoreProperties properties) throws StoreException {\n LOGGER.debug(\"Initialising {}\", getClass().getSimpleName());\n if (null == graphId) {\n throw new IllegalArgumentException(\"graphId is required\");\n ... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1170 | {
"fields": [],
"file": "core/operation/src/test/java/uk/gov/gchq/gaffer/operation/function/FromElementIdTest.java",
"identifier": "FromElementIdTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldUnwrapIfInputIsAnEntity() {\n // Given\n final Entity input = new Entity(\"group\", \"item\");\n final FromElementId function = new FromElementId();\n\n // When\n final Object output = function.apply(input);\n\n // Then\n assertS... | {
"fields": [],
"file": "core/operation/src/main/java/uk/gov/gchq/gaffer/operation/function/FromElementId.java",
"identifier": "FromElementId",
"interfaces": "",
"methods": [
{
"class_method_signature": "FromElementId.apply(final ElementId e)",
"constructor": false,
"full_signature": "@O... | {
"body": "@Override\n public Object apply(final ElementId e) {\n if (null == e) {\n return null;\n }\n return e instanceof EntityId ? ((EntityId) e).getVertex() : e;\n }",
"class_method_signature": "FromElementId.apply(final ElementId e)",
"constructor": false,
"full_signa... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_508 | {
"fields": [],
"file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/CollectionUtilTest.java",
"identifier": "CollectionUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldConvertMapToClassKeys() throws ClassNotFoundException {\n // Given\n final Map<String, String> map = new HashMap<>();\n populateStringKeyMap(map);\n\n // When\n final Map<Class<? extends Number>, String> result = CollectionUtil.toMapWithClassK... | {
"fields": [],
"file": "core/common-util/src/main/java/uk/gov/gchq/gaffer/commonutil/CollectionUtil.java",
"identifier": "CollectionUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "CollectionUtil.CollectionUtil()",
"constructor": true,
"full_signature": "private Colle... | {
"body": "public static <K, V> void toMapWithClassKeys(final Map<String, V> mapAsStrings, final Map<Class<? extends K>, V> map) throws ClassNotFoundException {\n for (final Map.Entry<String, V> entry : mapAsStrings.entrySet()) {\n map.put(\n (Class) Class.forName(SimpleClassNameI... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_158 | {
"fields": [],
"file": "store-implementation/hbase-store/src/test/java/uk/gov/gchq/gaffer/hbasestore/HBasePropertiesTest.java",
"identifier": "HBasePropertiesTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldMergeHBaseJsonModulesAndDeduplicate() {\n // Given\n final HBaseProperties props = new HBaseProperties();\n props.setJsonSerialiserModules(TestCustomJsonModules1.class.getName() + \",\" + SketchesJsonModules.class.getName());\n\n // When\n fin... | {
"fields": [
{
"declarator": "ZOOKEEPERS = \"hbase.zookeepers\"",
"modifier": "public static final",
"original_string": "public static final String ZOOKEEPERS = \"hbase.zookeepers\";",
"type": "String",
"var_name": "ZOOKEEPERS"
},
{
"declarator": "TABLE = \"hbase.table... | {
"body": "@Override\n public String getJsonSerialiserModules() {\n return new StringDeduplicateConcat().apply(\n SketchesJsonModules.class.getName(),\n super.getJsonSerialiserModules()\n );\n }",
"class_method_signature": "HBaseProperties.getJsonSerialiserModules()... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1035 | {
"fields": [],
"file": "core/serialisation/src/test/java/uk/gov/gchq/gaffer/serialisation/implementation/TreeSetStringSerialiserTest.java",
"identifier": "TreeSetStringSerialiserTest",
"interfaces": "",
"superclass": "extends ToBytesSerialisationTest<TreeSet<String>>"
} | {
"body": "@Test\n public void shouldBeAbleToHandleATreeSet() {\n // Given\n final Class testClass = TreeSet.class;\n\n // When\n final boolean canHandle = serialiser.canHandle(testClass);\n\n // Then\n assertTrue(canHandle);\n }",
"class_method_signature": "TreeSetSt... | {
"fields": [
{
"declarator": "serialVersionUID = -8241328807929077861L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -8241328807929077861L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "COM... | {
"body": "@Override\n public boolean canHandle(final Class clazz) {\n return TreeSet.class.isAssignableFrom(clazz);\n }",
"class_method_signature": "TreeSetStringSerialiser.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_772 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/handler/ScoreOperationChainHandlerTest.java",
"identifier": "ScoreOperationChainHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldExecuteScoreChainOperationForNestedOperationChain() throws OperationException {\n // Given\n final ScoreOperationChainHandler operationHandler = new ScoreOperationChainHandler();\n\n final Context context = mock(Context.class);\n final Store store = ... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(ScoreOperationChainHandler.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(ScoreOperationChainHandler.class);",
"type": "Logger",
"var_name": ... | {
"body": "@Override\n public Integer doOperation(final ScoreOperationChain operation, final Context context, final Store store) throws OperationException {\n return getChainScore(operation.getOperationChain(), context.getUser());\n\n }",
"class_method_signature": "ScoreOperationChainHandler.doOperatio... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_288 | {
"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 shouldSetEmptyEdgePropertiesGivenEmptyGlobalProperties() {\n // Given\n final View view = new View.Builder()\n .globalEdges(new GlobalViewElementDefinition.Builder()\n .groups(TestGroups.EDGE)\n .properties()\... | {
"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_322 | {
"fields": [],
"file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/graph/entity/EntityMapTest.java",
"identifier": "EntityMapTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldGetVertices() {\n final EntityMap entityMap = getEntityMap();\n\n final Set<Object> results = entityMap.getVertices();\n\n assertThat(results, hasItems(1, 2, 3, 4, 5, 6));\n }",
"class_method_signature": "EntityMapTest.shouldGetVertices()",
"construc... | {
"fields": [
{
"declarator": "backingMap = HashMultimap.create()",
"modifier": "private final",
"original_string": "private final SetMultimap<Object, Entity> backingMap = HashMultimap.create();",
"type": "SetMultimap<Object, Entity>",
"var_name": "backingMap"
}
],
"file": "c... | {
"body": "public Set<Object> getVertices() {\n return Collections.unmodifiableSet(backingMap.keySet());\n }",
"class_method_signature": "EntityMap.getVertices()",
"constructor": false,
"full_signature": "public Set<Object> getVertices()",
"identifier": "getVertices",
"invocations": [
"unmodif... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_637 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/SerialisationFactoryTest.java",
"identifier": "SerialisationFactoryTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldThrowExceptionIfClassIsNull() throws SerialisationException {\n // Given\n final SerialisationFactory factory = new SerialisationFactory();\n final Class<?> clazz = null;\n\n // When / Then\n try {\n factory.getSerialiser(clazz);\n ... | {
"fields": [
{
"declarator": "serialisers",
"modifier": "private final",
"original_string": "private final List<Serialiser> serialisers;",
"type": "List<Serialiser>",
"var_name": "serialisers"
},
{
"declarator": "LAST_RESORT_FINALISER = new JavaSerialiser()",
"mo... | {
"body": "public Serialiser getSerialiser(final Class<?> objClass) {\n return getSerialiser(objClass, false, false);\n }",
"class_method_signature": "SerialisationFactory.getSerialiser(final Class<?> objClass)",
"constructor": false,
"full_signature": "public Serialiser getSerialiser(final Class<?> o... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_267 | {
"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 shouldReturnTrueWhenViewHasPreAggEntityFilters() {\n // Given\n final View view = new View.Builder()\n .entity(TestGroups.ENTITY, new ViewElementDefinition.Builder()\n .preAggregationFilter(new ElementFilter.Builder()\n ... | {
"fields": [
{
"declarator": "globalElements",
"modifier": "private",
"original_string": "private List<GlobalViewElementDefinition> globalElements;",
"type": "List<GlobalViewElementDefinition>",
"var_name": "globalElements"
},
{
"declarator": "globalEntities",
"m... | {
"body": "public boolean hasPreAggregationFilters() {\n return hasFilters(ViewElementDefinition::hasPreAggregationFilters);\n }",
"class_method_signature": "View.hasPreAggregationFilters()",
"constructor": false,
"full_signature": "public boolean hasPreAggregationFilters()",
"identifier": "hasPreAg... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_10 | {
"fields": [],
"file": "store-implementation/federated-store/src/test/java/uk/gov/gchq/gaffer/federatedstore/util/FederatedStoreUtilTest.java",
"identifier": "FederatedStoreUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldGetEmptyGraphIdsWhenEmptyCsvValue() {\n // Given\n final Map<String, String> config = new HashMap<>();\n config.put(FederatedStoreConstants.KEY_OPERATION_OPTIONS_GRAPH_IDS, \"\");\n\n // When\n final List<String> graphIds = FederatedStoreUtil.... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(FederatedStoreUtil.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(FederatedStoreUtil.class);",
"type": "Logger",
"var_name": "LOGGER"
},
... | {
"body": "public static List<String> getGraphIds(final Map<String, String> config) {\n if (null == config) {\n return null;\n }\n\n return getCleanStrings(config.get(KEY_OPERATION_OPTIONS_GRAPH_IDS));\n }",
"class_method_signature": "FederatedStoreUtil.getGraphIds(final Map<Strin... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1166 | {
"fields": [],
"file": "core/operation/src/test/java/uk/gov/gchq/gaffer/operation/util/OperationUtilTest.java",
"identifier": "OperationUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnNullIfConvertFromEntityIdsWithNullInput() {\n // Given\n final Iterable<? extends EntityId> input = null;\n\n // When\n final Iterable<?> output = OperationUtil.fromEntityIds(input);\n\n // Then\n assertNull(output);\n }",
"c... | {
"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<?> fromEntityIds(final Iterable<? extends EntityId> input) {\n if (null == input) {\n return null;\n }\n return IterableUtil.map(input, new FromEntityId());\n }",
"class_method_signature": "OperationUtil.fromEntityIds(final Iterable<? extends Enti... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_908 | {
"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 shouldReturnQueryAggregatorWithMultiPropertyAggregatorWithSingleGroupBy() {\n // Given\n final T elementDef = createBuilder()\n .property(\"property1\", PROPERTY_STRING_TYPE)\n .property(\"property2\", PROPERTY_STRING_TYPE)\n ... | {
"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_1023 | {
"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 @Override\n public void shouldDeserialiseEmpty() throws SerialisationException {\n // Given When\n final byte[] value = serialiser.deserialiseEmpty();\n\n // Then\n assertEquals(0, value.length);\n }",
"class_method_signature": "BytesSerialiserTest.shouldDeser... | {
"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[] deserialiseEmpty() {\n return new byte[0];\n }",
"class_method_signature": "BytesSerialiser.deserialiseEmpty()",
"constructor": false,
"full_signature": "@Override public byte[] deserialiseEmpty()",
"identifier": "deserialiseEmpty",
"invocations": [],
"mod... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1189 | {
"fields": [],
"file": "core/operation/src/test/java/uk/gov/gchq/gaffer/operation/impl/DiscardOutputTest.java",
"identifier": "DiscardOutputTest",
"interfaces": "",
"superclass": "extends OperationTest<DiscardOutput>"
} | {
"body": "@Test\n @Override\n public void shouldShallowCloneOperation() {\n // Given\n final DiscardOutput op = getTestObject();\n\n // When\n final DiscardOutput clone = op.shallowClone();\n\n // Then\n assertNotSame(op, clone);\n }",
"class_method_signature": "D... | {
"fields": [
{
"declarator": "options",
"modifier": "private",
"original_string": "private Map<String, String> options;",
"type": "Map<String, String>",
"var_name": "options"
}
],
"file": "core/operation/src/main/java/uk/gov/gchq/gaffer/operation/impl/DiscardOutput.java",
... | {
"body": "@Override\n public DiscardOutput shallowClone() throws CloneFailedException {\n return new DiscardOutput.Builder()\n .options(options)\n .build();\n }",
"class_method_signature": "DiscardOutput.shallowClone()",
"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_375 | {
"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 shouldCompare() {\n // Given\n final Entity smallEntity = makeEntity(TestGroups.ENTITY, TestPropertyNames.PROP_1, 1);\n final Entity largeEntity = makeEntity(TestGroups.ENTITY, TestPropertyNames.PROP_1, 2);\n\n final ElementPropertyComparator comparator = ... | {
"fields": [
{
"declarator": "comparator",
"modifier": "private",
"original_string": "private Comparator comparator;",
"type": "Comparator",
"var_name": "comparator"
},
{
"declarator": "count = 0",
"modifier": "public static",
"original_string": "public sta... | {
"body": "@Override\n public int compare(final Element e1, final Element e2) {\n count++;\n\n if (null == e1) {\n if (null == e2) {\n return 0;\n }\n return 1;\n }\n if (null == e2) {\n return -1;\n }\n\n if (!gro... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_725 | {
"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 shouldReturnItemFromOperationWithMockFunction() throws OperationException {\n // Given\n final MapHandler<Integer, Integer> handler = new MapHandler<>();\n\n final Map<Integer, Integer> operation = new Map.Builder<Integer>()\n .input(input)\n ... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/MapHandler.java",
"identifier": "MapHandler",
"interfaces": "implements OutputOperationHandler<Map<I, O>, O>",
"methods": [
{
"class_method_signature": "MapHandler.doOperation(final Map<I, O> operation, fina... | {
"body": "@Override\n public O doOperation(final Map<I, O> operation, final Context context, final Store store) throws OperationException {\n if (null == operation) {\n throw new OperationException(\"Operation cannot be null\");\n }\n\n Object input = operation.getInput();\n\n ... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_47 | {
"fields": [
{
"declarator": "TEST_ENTITY = \"TestEntity\"",
"modifier": "public static final",
"original_string": "public static final String TEST_ENTITY = \"TestEntity\";",
"type": "String",
"var_name": "TEST_ENTITY"
},
{
"declarator": "TEST_GRAPH_ID = \"testGraphId\... | {
"body": "@Test\n public void shouldMergeResultsFromFieldObjects() throws Exception {\n // Given\n final OP op = getExampleOperation();\n\n Schema unusedSchema = new Schema.Builder().build();\n StoreProperties storeProperties = new StoreProperties();\n\n Store mockStore1 = getMo... | {
"fields": [],
"file": "store-implementation/federated-store/src/main/java/uk/gov/gchq/gaffer/federatedstore/operation/handler/FederatedOperationOutputHandler.java",
"identifier": "FederatedOperationOutputHandler",
"interfaces": "implements OutputOperationHandler<OP, O>",
"methods": [
{
"class_meth... | {
"body": "@Override\n public O doOperation(final OP operation, final Context context, final Store store) throws OperationException {\n final Collection<Graph> graphs = ((FederatedStore) store).getGraphs(context.getUser(), operation.getOption(KEY_OPERATION_OPTIONS_GRAPH_IDS), operation);\n final List... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1218 | {
"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 shouldDeserialiseOperationWithVertices() throws SerialisationException {\n // Given\n final String json = \"{\\\"class\\\":\\\"uk.gov.gchq.gaffer.operation.impl.get.GetElements\\\",\" +\n \"\\\"input\\\":[\" +\n \"1,\" +\n \"... | {
"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_230 | {
"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 shouldGetCorrectSerialisedFieldsForEdgeClass() {\n // When\n final Map<String, String> fields = (Map<String, String>) service.getSerialisedFieldClasses(Edge.class.getName()).getEntity();\n\n final Map<String, String> expectedFields = new HashMap<>();\n exp... | {
"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_660 | {
"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 shouldGetScoreWithFullyPopulatedOperation() {\n // Given\n final Object input = new EntitySeed(2);\n final Count count = mock(Count.class);\n final int repeats = 5;\n final GetElements getElements = mock(GetElements.class);\n final Conditiona... | {
"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_1131 | {
"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 shouldResolveNestedNamedOperation() throws OperationException, CacheOperationFailedException {\n // Given\n final String opName = \"opName\";\n final NamedOperationCache cache = mock(NamedOperationCache.class);\n final NamedOperationResolver resolver = new... | {
"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_549 | {
"fields": [],
"file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/iterable/SuppliedIterableTest.java",
"identifier": "SuppliedIterableTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldRequestNewIterableFromSupplierWhenIteratorInvoked() {\n // Given\n final Supplier<Iterable<Integer>> supplier = mock(Supplier.class);\n final Iterable<Integer> iterable1 = Arrays.asList(1, 2, 3);\n final Iterable<Integer> iterable2 = Arrays.asList(4,... | {
"fields": [
{
"declarator": "closeables = new ArrayList<>()",
"modifier": "private",
"original_string": "private List<Iterable<T>> closeables = new ArrayList<>();",
"type": "List<Iterable<T>>",
"var_name": "closeables"
},
{
"declarator": "supplier",
"modifier": ... | {
"body": "@Override\n public CloseableIterator<T> iterator() {\n final Iterable<T> iterable = supplier.get();\n closeables.add(iterable);\n return new WrappedCloseableIterable<>(iterable).iterator();\n }",
"class_method_signature": "SuppliedIterable.iterator()",
"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_119 | {
"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 shouldPassWithDifferentSizedBackingArraysButMatchingSelectedRange() throws Exception {\n br1 = new BytesAndRange(a, 0, a.length - 1);\n br2 = new BytesAndRange(c, 0, c.length);\n assertTrue(ByteUtils.areKeyBytesEqual(br1, br2));\n }",
"class_method_signature... | {
"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_1074 | {
"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 shouldThrowExceptionOnExecuteJobWithANullUser() throws OperationException {\n // Given\n final User user = null;\n final OperationChain opChain = mock(OperationChain.class);\n\n final Graph graph = new Graph.Builder()\n .config(new GraphConf... | {
"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_928 | {
"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 shouldValidateAndReturnTrueForNullView() {\n // Given\n final ViewValidator validator = new ViewValidator();\n final View view = new View.Builder().build();\n final Schema schema = new Schema.Builder()\n .type(\"vertex\", String.class)\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_1003 | {
"fields": [],
"file": "core/serialisation/src/test/java/uk/gov/gchq/gaffer/serialisation/implementation/ordered/OrderedFloatSerialiserTest.java",
"identifier": "OrderedFloatSerialiserTest",
"interfaces": "",
"superclass": "extends ToBytesSerialisationTest<Float>"
} | {
"body": "@Test\n public void checkOrderPreserved() throws SerialisationException {\n // Given\n byte[] startBytes = serialiser.serialise(0.0f);\n for (float test = 1.0f; test >= 5; test += 0.1f) {\n // When\n byte[] newTestBytes = serialiser.serialise(test);\n\n ... | {
"fields": [
{
"declarator": "serialVersionUID = 6829577492677279853L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 6829577492677279853L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "INTEG... | {
"body": "@Override\n public byte[] serialise(final Float object) {\n int i = Float.floatToRawIntBits(object);\n if (i < 0) {\n i = ~i;\n } else {\n i = i ^ 0x80000000;\n }\n return INTEGER_SERIALISER.serialise(i);\n }",
"class_method_signature": "Orde... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_882 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/OperationChainValidatorTest.java",
"identifier": "OperationChainValidatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldNotValidateInvalidOperationChain() {\n\n //Given\n Operation operation = Mockito.mock(Operation.class);\n given(operation.validate()).willReturn(new ValidationResult(\"SparkContext is required\"));\n\n OperationChain opChain = new OperationChain(oper... | {
"fields": [
{
"declarator": "viewValidator",
"modifier": "private final",
"original_string": "private final ViewValidator viewValidator;",
"type": "ViewValidator",
"var_name": "viewValidator"
}
],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/Operatio... | {
"body": "public ValidationResult validate(final OperationChain<?> operationChain, final User user, final Store store) {\n final ValidationResult validationResult = new ValidationResult();\n if (operationChain.getOperations().isEmpty()) {\n validationResult.addError(\"Operation chain contain... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"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.