id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
47973088_1322 | {
"fields": [
{
"declarator": "instants = new TreeSet<>()",
"modifier": "private",
"original_string": "private SortedSet<Instant> instants = new TreeSet<>();",
"type": "SortedSet<Instant>",
"var_name": "instants"
},
{
"declarator": "instant1",
"modifier": "private... | {
"body": "@Test\n public void shouldSerialiseAndDeserialise() throws SerialisationException {\n // Given\n final RBMBackedTimestampSet boundedTimestampSet = new RBMBackedTimestampSet(CommonTimeUtil.TimeBucket.SECOND);\n IntStream.range(0, 20)\n .forEach(i -> {\n ... | {
"fields": [
{
"declarator": "MIN_TIME = Instant.ofEpochMilli(0L)",
"modifier": "private static final",
"original_string": "private static final Instant MIN_TIME = Instant.ofEpochMilli(0L);",
"type": "Instant",
"var_name": "MIN_TIME"
},
{
"declarator": "MAX_TIME = Inst... | {
"body": "@Override\n public void add(final Instant instant) {\n if (instant.isBefore(MIN_TIME) || instant.isAfter(MAX_TIME)) {\n throw new IllegalArgumentException(\"Invalid instant of \" + instant);\n }\n rbm.add(toInt(instant.toEpochMilli()));\n }",
"class_method_signature"... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1288 | {
"fields": [
{
"declarator": "MAX_QUEUE_SIZE_OPTION = \"10\"",
"modifier": "private static final",
"original_string": "private static final String MAX_QUEUE_SIZE_OPTION = \"10\";",
"type": "String",
"var_name": "MAX_QUEUE_SIZE_OPTION"
},
{
"declarator": "MAX_QUEUE_SIZE... | {
"body": "@Test\n public void shouldRestartAddElementsIfPauseInIngest() throws Exception {\n // Given\n final AddElementsFromSocket op = mock(AddElementsFromSocket.class);\n final Store store = mock(Store.class);\n given(store.getProperties()).willReturn(new StoreProperties());\n ... | {
"fields": [
{
"declarator": "serialVersionUID = -3418606107861031989L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -3418606107861031989L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "MAX... | {
"body": "public void add(final Element element) {\n if (null == element) {\n return;\n }\n\n if (null == queue) {\n queue = new ConsumableBlockingQueue<>(maxQueueSize);\n restart = true;\n }\n\n try {\n queue.put(element);\n } cat... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1267 | {
"fields": [
{
"declarator": "service = new HashMapCacheService()",
"modifier": "private",
"original_string": "private HashMapCacheService service = new HashMapCacheService();",
"type": "HashMapCacheService",
"var_name": "service"
},
{
"declarator": "CACHE_NAME = \"tes... | {
"body": "@Test\n public void shouldCreateNewHashMapCacheIfOneDoesNotExist() {\n // When\n final ICache cache = service.getCache(CACHE_NAME);\n\n // Then\n assertEquals(0, cache.size());\n }",
"class_method_signature": "HashMapCacheServiceTest.shouldCreateNewHashMapCacheIfOneDoesN... | {
"fields": [
{
"declarator": "STATIC_CACHE = \"gaffer.cache.hashmap.static\"",
"modifier": "public static final",
"original_string": "public static final String STATIC_CACHE = \"gaffer.cache.hashmap.static\";",
"type": "String",
"var_name": "STATIC_CACHE"
},
{
"declara... | {
"body": "@Override\n public <K, V> ICache<K, V> getCache(final String cacheName) {\n HashMapCache<K, V> cache = caches.computeIfAbsent(cacheName, k -> new HashMapCache<>(useJavaSerialisation));\n\n return cache;\n }",
"class_method_signature": "HashMapCacheService.getCache(final String cacheNa... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_38 | {
"fields": [
{
"declarator": "ID_SCHEMA_ENTITY = \"basicEntitySchema\"",
"modifier": "public static final",
"original_string": "public static final String ID_SCHEMA_ENTITY = \"basicEntitySchema\";",
"type": "String",
"var_name": "ID_SCHEMA_ENTITY"
},
{
"declarator": "I... | {
"body": "@Test\n public void shouldReturnGraphsWithLeadingCommaString() throws Exception {\n // Given\n final List<Collection<GraphSerialisable>> graphLists = populateGraphs(2, 4);\n final Collection<GraphSerialisable> expectedGraphs = graphLists.get(0);\n final Collection<GraphSerial... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(Store.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(Store.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": ... | {
"body": "public Collection<Graph> getGraphs(final User user, final String graphIdsCsv, final Operation operation) {\n Collection<Graph> rtn = new ArrayList<>();\n if (nonNull(operation)) {\n String optionKey = FEDERATED_STORE_PROCESSED + id;\n boolean isIdFound = !operation.getOp... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1323 | {
"fields": [
{
"declarator": "instants = new TreeSet<>()",
"modifier": "private",
"original_string": "private SortedSet<Instant> instants = new TreeSet<>();",
"type": "SortedSet<Instant>",
"var_name": "instants"
},
{
"declarator": "instant1",
"modifier": "private... | {
"body": "@Test\n public void testGet() {\n testGet(instants);\n\n final SortedSet<Instant> randomDates = new TreeSet<>();\n IntStream.range(0, 100)\n .forEach(i -> randomDates.add(Instant.ofEpochMilli(instant1.toEpochMilli() + i * 12345678L)));\n testGet(randomDates);\n... | {
"fields": [
{
"declarator": "MIN_TIME = Instant.ofEpochMilli(0L)",
"modifier": "private static final",
"original_string": "private static final Instant MIN_TIME = Instant.ofEpochMilli(0L);",
"type": "Instant",
"var_name": "MIN_TIME"
},
{
"declarator": "MAX_TIME = Inst... | {
"body": "@Override\n public void add(final Instant instant) {\n if (instant.isBefore(MIN_TIME) || instant.isAfter(MAX_TIME)) {\n throw new IllegalArgumentException(\"Invalid instant of \" + instant);\n }\n rbm.add(toInt(instant.toEpochMilli()));\n }",
"class_method_signature"... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1289 | {
"fields": [
{
"declarator": "MAX_QUEUE_SIZE_OPTION = \"10\"",
"modifier": "private static final",
"original_string": "private static final String MAX_QUEUE_SIZE_OPTION = \"10\";",
"type": "String",
"var_name": "MAX_QUEUE_SIZE_OPTION"
},
{
"declarator": "MAX_QUEUE_SIZE... | {
"body": "@Test\n public void shouldAddElementsIfInvokeCalledMultipleTimes() throws Exception {\n // Given\n final int duplicates = 4;\n final AddElementsFromSocket op = mock(AddElementsFromSocket.class);\n final Store store = mock(Store.class);\n given(store.getProperties()).wi... | {
"fields": [
{
"declarator": "serialVersionUID = -3418606107861031989L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -3418606107861031989L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "MAX... | {
"body": "public void add(final Element element) {\n if (null == element) {\n return;\n }\n\n if (null == queue) {\n queue = new ConsumableBlockingQueue<>(maxQueueSize);\n restart = true;\n }\n\n try {\n queue.put(element);\n } cat... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1266 | {
"fields": [
{
"declarator": "service = new HashMapCacheService()",
"modifier": "private",
"original_string": "private HashMapCacheService service = new HashMapCacheService();",
"type": "HashMapCacheService",
"var_name": "service"
},
{
"declarator": "CACHE_NAME = \"tes... | {
"body": "@Test\n public void shouldReturnInstanceOfHashMapCache() {\n // When\n final ICache cache = service.getCache(CACHE_NAME);\n\n // Then\n assertTrue(cache instanceof HashMapCache);\n }",
"class_method_signature": "HashMapCacheServiceTest.shouldReturnInstanceOfHashMapCache(... | {
"fields": [
{
"declarator": "STATIC_CACHE = \"gaffer.cache.hashmap.static\"",
"modifier": "public static final",
"original_string": "public static final String STATIC_CACHE = \"gaffer.cache.hashmap.static\";",
"type": "String",
"var_name": "STATIC_CACHE"
},
{
"declara... | {
"body": "@Override\n public <K, V> ICache<K, V> getCache(final String cacheName) {\n HashMapCache<K, V> cache = caches.computeIfAbsent(cacheName, k -> new HashMapCache<>(useJavaSerialisation));\n\n return cache;\n }",
"class_method_signature": "HashMapCacheService.getCache(final String cacheNa... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_39 | {
"fields": [
{
"declarator": "ID_SCHEMA_ENTITY = \"basicEntitySchema\"",
"modifier": "public static final",
"original_string": "public static final String ID_SCHEMA_ENTITY = \"basicEntitySchema\";",
"type": "String",
"var_name": "ID_SCHEMA_ENTITY"
},
{
"declarator": "I... | {
"body": "@Test\n public void shouldReturnASingleGraph() throws Exception {\n // Given\n final List<Collection<GraphSerialisable>> graphLists = populateGraphs(1);\n final Collection<GraphSerialisable> expectedGraphs = graphLists.get(0);\n final Collection<GraphSerialisable> unexpectedG... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(Store.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(Store.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": ... | {
"body": "public Collection<Graph> getGraphs(final User user, final String graphIdsCsv, final Operation operation) {\n Collection<Graph> rtn = new ArrayList<>();\n if (nonNull(operation)) {\n String optionKey = FEDERATED_STORE_PROCESSED + id;\n boolean isIdFound = !operation.getOp... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_864 | {
"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 shouldThrowExceptionIfUnauthorisedUserTriesToOverwriteView() throws CacheOperationFailedException {\n cache.addNamedView(alternative, false, standardUser, EMPTY_ADMIN_AUTH);\n try {\n cache.addNamedView(standard, true, blankUser, EMPTY_ADMIN_AUTH);\n }... | {
"fields": [
{
"declarator": "CACHE_NAME = \"NamedView\"",
"modifier": "private static final",
"original_string": "private static final String CACHE_NAME = \"NamedView\";",
"type": "String",
"var_name": "CACHE_NAME"
}
],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/s... | {
"body": "public void addNamedView(final NamedViewDetail namedViewDetail, final boolean overwrite) throws CacheOperationFailedException {\n add(namedViewDetail, overwrite, null, null);\n }",
"class_method_signature": "NamedViewCache.addNamedView(final NamedViewDetail namedViewDetail, final boolean overwr... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_537 | {
"fields": [],
"file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/iterable/WrappedCloseableIterableTest.java",
"identifier": "WrappedCloseableIterableTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldDoNothingWhenCloseCalledOnNoncloseableIterable() {\n final Iterable<Object> iterable = mock(Iterable.class);\n final WrappedCloseableIterable<Object> wrappedIterable = new WrappedCloseableIterable<>(iterable);\n\n assertDoesNotThrow(() -> wrappedIterable.cl... | {
"fields": [
{
"declarator": "iterable",
"modifier": "private final",
"original_string": "private final Iterable<T> iterable;",
"type": "Iterable<T>",
"var_name": "iterable"
}
],
"file": "core/common-util/src/main/java/uk/gov/gchq/gaffer/commonutil/iterable/WrappedCloseableI... | {
"body": "@Override\n public void close() {\n CloseableUtil.close(iterable);\n }",
"class_method_signature": "WrappedCloseableIterable.close()",
"constructor": false,
"full_signature": "@Override public void close()",
"identifier": "close",
"invocations": [
"close"
],
"modifiers": "@Ov... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_167 | {
"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 shouldSerialiseWithHistoricValues() throws Exception {\n // Given\n Properties properties = new Properties();\n properties.put(HBasePropertyNames.PROP_1, 60);\n properties.put(HBasePropertyNames.PROP_2, Integer.MAX_VALUE);\n properties.put(HBaseProp... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(ElementSerialisation.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(ElementSerialisation.class);",
"type": "Logger",
"var_name": "LOGGER"
... | {
"body": "public byte[] getValue(final Element element) throws SerialisationException {\n return getValue(element.getGroup(), element.getProperties());\n }",
"class_method_signature": "ElementSerialisation.getValue(final Element element)",
"constructor": false,
"full_signature": "public byte[] getVal... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_472 | {
"fields": [
{
"declarator": "abs",
"modifier": "",
"original_string": "ArrayByteSequence abs;",
"type": "ArrayByteSequence",
"var_name": "abs"
},
{
"declarator": "data",
"modifier": "",
"original_string": "byte[] data;",
"type": "byte[]",
"var_... | {
"body": "@Test\n public void testInvalidSubsequence3ShouldThrowIAX() {\n assertThrows(IllegalArgumentException.class, () -> abs.subSequence(0, 10));\n }",
"class_method_signature": "ArrayByteSequenceTest.testInvalidSubsequence3ShouldThrowIAX()",
"constructor": false,
"full_signature": "@Test publ... | {
"fields": [
{
"declarator": "serialVersionUID = 4850846929226802566L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 4850846929226802566L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "data"... | {
"body": "public ArrayByteSequence subSequence(final int start, final int end) {\n\n if (start > end || start < 0 || end > length) {\n throw new IllegalArgumentException(\"Bad start and/end start = \" + start + \" end=\" + end + \" offset=\" + offset + \" length=\" + length);\n }\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_188 | {
"fields": [
{
"declarator": "SCHEMA = new Schema.Builder()\n .type(\"string\", new TypeDefinition.Builder()\n .clazz(String.class)\n .aggregateFunction(new StringConcat())\n .build())\n .type(\"type\", Boolean.class)\n ... | {
"body": "@Test\n public void shouldConstructProcessorsWithNoAggregation() throws OperationException, IOException {\n // Given\n final Scan scan = mock(Scan.class);\n given(scan.getAttribute(HBaseStoreConstants.VIEW)).willReturn(VIEW.toCompactJson());\n given(scan.getAttribute(HBaseSto... | {
"fields": [],
"file": "store-implementation/hbase-store/src/main/java/uk/gov/gchq/gaffer/hbasestore/coprocessor/scanner/StoreScanner.java",
"identifier": "StoreScanner",
"interfaces": "",
"methods": [
{
"class_method_signature": "StoreScanner.StoreScanner(final InternalScanner scanner,\n ... | {
"body": "protected static List<GafferScannerProcessor> createProcessors(final Schema schema, final ElementSerialisation serialisation) {\n final List<GafferScannerProcessor> processors = new ArrayList<>();\n if (schema.isAggregationEnabled()) {\n processors.add(new StoreAggregationProcessor... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_921 | {
"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 shouldValidateAndReturnFalseWhenEdgeTransientPropertyIsInSchema() {\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_81 | {
"fields": [],
"file": "store-implementation/parquet-store/src/test/java/uk/gov/gchq/gaffer/parquetstore/operation/handler/utilities/CalculatePartitionerTest.java",
"identifier": "CalculatePartitionerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void calculatePartitionerTest(@TempDir java.nio.file.Path tempDir)\n throws IOException {\n // Given\n final FileSystem fs = FileSystem.get(new Configuration());\n final Schema schema = getSchema();\n final SchemaUtils schemaUtils = new SchemaUtils(s... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(CalculatePartitioner.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(CalculatePartitioner.class);",
"type": "Logger",
"var_name": "LOGGER"
... | {
"body": "public CalculatePartitioner(final Path path, final Schema schema, final FileSystem fs) {\n this.path = path;\n this.schema = schema;\n this.fs = fs;\n }",
"class_method_signature": "CalculatePartitioner.CalculatePartitioner(final Path path, final Schema schema, final FileSystem fs... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_649 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/resolver/DefaultScoreResolverTest.java",
"identifier": "DefaultScoreResolverTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldGetScoreForOperationChain() {\n // Given\n final GetAdjacentIds getAdjacentIds = mock(GetAdjacentIds.class);\n final GetElements getElements = mock(GetElements.class);\n final Limit limit = mock(Limit.class);\n final List<Operation> opList = A... | {
"fields": [
{
"declarator": "DEFAULT_OPERATION_SCORE = 1",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_OPERATION_SCORE = 1;",
"type": "int",
"var_name": "DEFAULT_OPERATION_SCORE"
},
{
"declarator": "scoreResolvers",
"mo... | {
"body": "@Override\n public Integer getScore(final Operation operation) {\n if (null == operation) {\n return 0;\n }\n\n // Named operations should use their custom resolver despite implementing Operations\n if (operation instanceof Operations && !(operation instanceof Name... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_219 | {
"fields": [],
"file": "store-implementation/map-store/src/test/java/uk/gov/gchq/gaffer/mapstore/multimap/MapOfSetsTest.java",
"identifier": "MapOfSetsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldGetSetFromMap() throws StoreException {\n // Given\n final String key = \"key1\";\n final Set<String> set = mock(Set.class);\n final Map<String, Set<String>> map = mock(Map.class);\n final MapOfSets<String, String> mapOfSets = new MapOfSets<>(... | {
"fields": [
{
"declarator": "multiMap",
"modifier": "private final",
"original_string": "private final Map<K, Set<V>> multiMap;",
"type": "Map<K, Set<V>>",
"var_name": "multiMap"
},
{
"declarator": "setClass",
"modifier": "private final",
"original_string"... | {
"body": "@Override\n public Collection<V> get(final K key) {\n return multiMap.get(key);\n }",
"class_method_signature": "MapOfSets.get(final K key)",
"constructor": false,
"full_signature": "@Override public Collection<V> get(final K key)",
"identifier": "get",
"invocations": [
"get"
]... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1231 | {
"fields": [],
"file": "core/operation/src/test/java/uk/gov/gchq/gaffer/operation/impl/get/GetAllElementsTest.java",
"identifier": "GetAllElementsTest",
"interfaces": "",
"superclass": "extends OperationTest<GetAllElements>"
} | {
"body": "@Test\n public void shouldSetOptionToValue() {\n // When\n final GetAllElements op = new GetAllElements.Builder()\n .option(\"key\", \"value\")\n .build();\n\n // Then\n assertThat(op.getOptions(), is(notNullValue()));\n assertThat(op.getO... | {
"fields": [
{
"declarator": "view",
"modifier": "private",
"original_string": "private View view;",
"type": "View",
"var_name": "view"
},
{
"declarator": "directedType",
"modifier": "private",
"original_string": "private DirectedType directedType;",
... | {
"body": "@Override\n public Map<String, String> getOptions() {\n return options;\n }",
"class_method_signature": "GetAllElements.getOptions()",
"constructor": false,
"full_signature": "@Override public Map<String, String> getOptions()",
"identifier": "getOptions",
"invocations": [],
"modifi... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_130 | {
"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 shouldFailWithEmptyAndZeroRange() throws Exception {\n br1 = new BytesAndRange(a, 0, 0);\n br2 = new BytesAndRange(f, 0, 0);\n assertTrue(ByteUtils.areKeyBytesEqual(br1, br2));\n }",
"class_method_signature": "ByteUtilsTest.shouldFailWithEmptyAndZeroRange()"... | {
"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_560 | {
"fields": [],
"file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/CloseableUtilTest.java",
"identifier": "CloseableUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldCloseAllCloseables() throws IOException {\n final Closeable closeable1 = mock(Closeable.class);\n final Closeable closeable2 = mock(Closeable.class);\n final Object nonCloseable = mock(Object.class);\n\n CloseableUtil.close(closeable1, nonCloseable, ... | {
"fields": [],
"file": "core/common-util/src/main/java/uk/gov/gchq/gaffer/commonutil/CloseableUtil.java",
"identifier": "CloseableUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "CloseableUtil.CloseableUtil()",
"constructor": true,
"full_signature": "private Closeable... | {
"body": "public static void close(final Object... objs) {\n for (final Object obj : objs) {\n close(obj);\n }\n }",
"class_method_signature": "CloseableUtil.close(final Object... objs)",
"constructor": false,
"full_signature": "public static void close(final Object... objs)",
"id... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_833 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/handler/output/ToSetHandlerTest.java",
"identifier": "ToSetHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldHandleNullInput() throws OperationException {\n // Given\n final ToSetHandler<Integer> handler = new ToSetHandler<>();\n final ToSet<Integer> operation = mock(ToSet.class);\n\n given(operation.getInput()).willReturn(null);\n\n // When\n ... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/output/ToSetHandler.java",
"identifier": "ToSetHandler",
"interfaces": "implements OutputOperationHandler<ToSet<T>, Set<? extends T>>",
"methods": [
{
"class_method_signature": "ToSetHandler.doOperation(fina... | {
"body": "@Override\n public Set<T> doOperation(final ToSet<T> operation, final Context context, final Store store) throws OperationException {\n if (null == operation.getInput()) {\n return null;\n }\n\n return Streams.toStream(operation.getInput())\n .collect... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1118 | {
"fields": [
{
"declarator": "OP_AUTHS_PATH = \"/opAuthoriser.json\"",
"modifier": "private static final",
"original_string": "private static final String OP_AUTHS_PATH = \"/opAuthoriser.json\";",
"type": "String",
"var_name": "OP_AUTHS_PATH"
},
{
"declarator": "USER =... | {
"body": "@Test\n public void shouldRejectOperationChainWhenUserDoesntHaveAnyOpAuths() throws OperationException {\n // Given\n final OperationAuthoriser hook = fromJson(OP_AUTHS_PATH);\n final OperationChain opChain = new OperationChain.Builder()\n .first(new GetAdjacentIds())... | {
"fields": [
{
"declarator": "allAuths = new HashSet<>()",
"modifier": "private final",
"original_string": "private final Set<String> allAuths = new HashSet<>();",
"type": "Set<String>",
"var_name": "allAuths"
},
{
"declarator": "auths = new HashMap<>()",
"modifi... | {
"body": "@Override\n public void preExecute(final OperationChain<?> opChain, final Context context) {\n if (null != opChain) {\n for (final Operation operation : opChain.getOperations()) {\n authorise(operation, context.getUser());\n }\n authorise(opChain, c... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_999 | {
"fields": [],
"file": "core/serialisation/src/test/java/uk/gov/gchq/gaffer/serialisation/LongSerialiserTest.java",
"identifier": "LongSerialiserTest",
"interfaces": "",
"superclass": "extends ToBytesSerialisationTest<Long>"
} | {
"body": "@Test\n public void cantSerialiseStringClass() {\n assertFalse(serialiser.canHandle(String.class));\n }",
"class_method_signature": "LongSerialiserTest.cantSerialiseStringClass()",
"constructor": false,
"full_signature": "@Test public void cantSerialiseStringClass()",
"identifier": "ca... | {
"fields": [
{
"declarator": "serialVersionUID = 5647756843689779437L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 5647756843689779437L;",
"type": "long",
"var_name": "serialVersionUID"
}
],
"file": "core/serialisatio... | {
"body": "@Override\n public boolean canHandle(final Class clazz) {\n return Long.class.equals(clazz);\n }",
"class_method_signature": "LongSerialiser.canHandle(final Class clazz)",
"constructor": false,
"full_signature": "@Override public boolean canHandle(final Class clazz)",
"identifier": "ca... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_976 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/schema/SchemaElementDefinitionValidatorTest.java",
"identifier": "SchemaElementDefinitionValidatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldValidateAndReturnFalseWhenTimestampIsAggregatedWithAGroupByProperty() {\n // Given\n final SchemaElementDefinitionValidator validator = new SchemaElementDefinitionValidator();\n final BinaryOperator<Integer> function1 = mock(BinaryOperator.class);\n ... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(SchemaElementDefinitionValidator.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(SchemaElementDefinitionValidator.class);",
"type": "Logger",
... | {
"body": "public ValidationResult validate(final SchemaElementDefinition elementDef) {\n final ValidationResult result = new ValidationResult();\n\n final ElementFilter validator = elementDef.getValidator();\n final ElementAggregator aggregator = elementDef.getFullAggregator();\n result.a... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_425 | {
"fields": [],
"file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/element/function/ToPropertiesTupleTest.java",
"identifier": "ToPropertiesTupleTest",
"interfaces": "",
"superclass": "extends FunctionTest"
} | {
"body": "@Test\n public void shouldConvertAnPropertiesIntoAnPropertiesTuple() {\n final Properties properties = new Properties();\n properties.put(TestPropertyNames.COUNT, 1);\n final ToPropertiesTuple function = new ToPropertiesTuple();\n\n final Object result = function.apply(proper... | {
"fields": [],
"file": "core/data/src/main/java/uk/gov/gchq/gaffer/data/element/function/ToPropertiesTuple.java",
"identifier": "ToPropertiesTuple",
"interfaces": "",
"methods": [
{
"class_method_signature": "ToPropertiesTuple.apply(final Properties properties)",
"constructor": false,
"... | {
"body": "@Override\n public PropertiesTuple apply(final Properties properties) {\n if (isNull(properties)) {\n return null;\n }\n\n return new PropertiesTuple(properties);\n }",
"class_method_signature": "ToPropertiesTuple.apply(final Properties properties)",
"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_1362 | {
"fields": [
{
"declarator": "DELTA = 0.00001D",
"modifier": "private static final",
"original_string": "private static final double DELTA = 0.00001D;",
"type": "double",
"var_name": "DELTA"
},
{
"declarator": "hllSketchWithCardinality5",
"modifier": "private sta... | {
"body": "@Test\n public void shouldRejectWhenMoreThan() {\n // Given\n final HllSketchIsLessThan filter = new HllSketchIsLessThan(15);\n // When\n boolean accepted = filter.test(hllSketchWithCardinality32);\n // Then\n assertFalse(accepted);\n }",
"class_method_sign... | {
"fields": [
{
"declarator": "controlValue",
"modifier": "private",
"original_string": "private long controlValue;",
"type": "long",
"var_name": "controlValue"
},
{
"declarator": "orEqualTo",
"modifier": "private",
"original_string": "private boolean orEqua... | {
"body": "@Override\n public boolean test(final HllSketch input) {\n if (null == input) {\n return false;\n }\n final long cardinality = Math.round(input.getEstimate());\n if (orEqualTo) {\n return cardinality <= controlValue;\n } else {\n return... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_97 | {
"fields": [],
"file": "store-implementation/parquet-store/src/test/java/uk/gov/gchq/gaffer/parquetstore/partitioner/PartitionKeyTest.java",
"identifier": "PartitionKeyTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testLengthMethod() {\n // Given\n final PartitionKey partitionKey1 = new PartitionKey(new Object[]{1L, 50, \"A\"});\n final PartitionKey partitionKey2 = new PartitionKey(new Object[]{1L, 50, \"A\", \"X\"});\n\n // When\n final int partitionKey1Lengt... | {
"fields": [
{
"declarator": "partitionKey",
"modifier": "private final",
"original_string": "private final Object[] partitionKey;",
"type": "Object[]",
"var_name": "partitionKey"
}
],
"file": "store-implementation/parquet-store/src/main/java/uk/gov/gchq/gaffer/parquetstore/... | {
"body": "public int getLength() {\n return partitionKey.length;\n }",
"class_method_signature": "PartitionKey.getLength()",
"constructor": false,
"full_signature": "public int getLength()",
"identifier": "getLength",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1227 | {
"fields": [],
"file": "core/operation/src/test/java/uk/gov/gchq/gaffer/operation/impl/get/GetAdjacentIdsTest.java",
"identifier": "GetAdjacentIdsTest",
"interfaces": "",
"superclass": "extends OperationTest<GetAdjacentIds>"
} | {
"body": "@Test\n public void shouldSetOptionToValue() {\n // When\n final GetAdjacentIds op = new GetAdjacentIds.Builder()\n .option(\"key\", \"value\")\n .build();\n\n // Then\n assertThat(op.getOptions(), is(notNullValue()));\n assertThat(op.getO... | {
"fields": [
{
"declarator": "view",
"modifier": "private",
"original_string": "private View view;",
"type": "View",
"var_name": "view"
},
{
"declarator": "input",
"modifier": "private",
"original_string": "private Iterable<? extends EntityId> input;",
... | {
"body": "@Override\n public Map<String, String> getOptions() {\n return options;\n }",
"class_method_signature": "GetAdjacentIds.getOptions()",
"constructor": false,
"full_signature": "@Override public Map<String, String> getOptions()",
"identifier": "getOptions",
"invocations": [],
"modifi... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_78 | {
"fields": [],
"file": "store-implementation/parquet-store/src/test/java/uk/gov/gchq/gaffer/parquetstore/operation/handler/AddElementsHandlerTest.java",
"identifier": "AddElementsHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testOnePartitionOneGroup(@TempDir java.nio.file.Path tempDir)\n throws OperationException, IOException, StoreException {\n // Given\n final List<Element> elementsToAdd = new ArrayList<>();\n elementsToAdd.addAll(AggregateAndSortDataTest.generateData())... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(AddElementsHandler.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(AddElementsHandler.class);",
"type": "Logger",
"var_name": "LOGGER"
}
... | {
"body": "@Override\n public Void doOperation(final AddElements operation,\n final Context context,\n final Store store) throws OperationException {\n addElements(operation, context, (ParquetStore) store);\n return null;\n }",
"class_method_... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_825 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/handler/output/ToArrayHandlerTest.java",
"identifier": "ToArrayHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldConvertIterableOfElementIdsToArray() throws OperationException {\n // Given\n final ElementId[] originalArray = new ElementId[]{new EntitySeed(\"vertex\"), new EdgeSeed(\"src\", \"dest\", true)};\n\n final Iterable<ElementId> originalResults = new WrappedCl... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/output/ToArrayHandler.java",
"identifier": "ToArrayHandler",
"interfaces": "implements OutputOperationHandler<ToArray<T>, T[]>",
"methods": [
{
"class_method_signature": "ToArrayHandler.doOperation(final ToA... | {
"body": "@SuppressFBWarnings(value = \"PZLA_PREFER_ZERO_LENGTH_ARRAYS\")\n @Override\n public T[] doOperation(final ToArray<T> operation, final Context context, final Store store) throws OperationException {\n if (null == operation.getInput() || Iterables.isEmpty(operation.getInput())) {\n r... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_576 | {
"fields": [
{
"declarator": "freqMap",
"modifier": "private",
"original_string": "private FreqMap freqMap;",
"type": "FreqMap",
"var_name": "freqMap"
}
],
"file": "core/type/src/test/java/uk/gov/gchq/gaffer/types/function/FreqMapPredicatorTest.java",
"identifier": "FreqMa... | {
"body": "@Test\n public void shouldFilterMapWithMultipleResults() {\n //given\n final Regex predicate = new Regex(\"^\\\\wo\\\\w$\");\n final FreqMapPredicator fRegexPredicator = new FreqMapPredicator(predicate);\n\n //when\n final FreqMap fRegex = fRegexPredicator.apply(freqMa... | {
"fields": [
{
"declarator": "predicate",
"modifier": "private",
"original_string": "private KoryphePredicate<String> predicate;",
"type": "KoryphePredicate<String>",
"var_name": "predicate"
}
],
"file": "core/type/src/main/java/uk/gov/gchq/gaffer/types/function/FreqMapPredi... | {
"body": "@Override\n public FreqMap apply(final FreqMap freqMap) {\n return filterPredicate(freqMap);\n }",
"class_method_signature": "FreqMapPredicator.apply(final FreqMap freqMap)",
"constructor": false,
"full_signature": "@Override public FreqMap apply(final FreqMap freqMap)",
"identifier": ... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_126 | {
"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 shouldFailWithCorrectBackingArraysButInvalidNotMatchingLength() throws Exception {\n br1 = new BytesAndRange(a, 0, 6666);\n br2 = new BytesAndRange(b, 0, 9999);\n assertFalse(ByteUtils.areKeyBytesEqual(br1, br2));\n }",
"class_method_signature": "ByteUtilsTe... | {
"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_433 | {
"fields": [],
"file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/element/function/ElementTransformerTest.java",
"identifier": "ElementTransformerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldTransformElementUsingInlineFunction() {\n // Given\n final Function<String, Integer> function = String::length;\n final ElementTransformer transformer = new ElementTransformer.Builder()\n .select(\"prop1\")\n .execute(function)... | {
"fields": [
{
"declarator": "elementTuple = new ElementTuple()",
"modifier": "private final",
"original_string": "private final ElementTuple elementTuple = new ElementTuple();",
"type": "ElementTuple",
"var_name": "elementTuple"
}
],
"file": "core/data/src/main/java/uk/gov/... | {
"body": "public Element apply(final Element element) {\n elementTuple.setElement(element);\n apply(elementTuple);\n return element;\n }",
"class_method_signature": "ElementTransformer.apply(final Element element)",
"constructor": false,
"full_signature": "public Element apply(final Ele... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_599 | {
"fields": [
{
"declarator": "schema",
"modifier": "private static",
"original_string": "private static Schema schema;",
"type": "Schema",
"var_name": "schema"
},
{
"declarator": "serialiser",
"modifier": "private static",
"original_string": "private static... | {
"body": "@Test\n public void testCantSerialiseIntegerClass() throws SerialisationException {\n assertFalse(serialiser.canHandle(Integer.class));\n }",
"class_method_signature": "EdgeIdSerialiserTest.testCantSerialiseIntegerClass()",
"constructor": false,
"full_signature": "@Test public void testC... | {
"fields": [
{
"declarator": "serialVersionUID = -7123572023129773512L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -7123572023129773512L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "boo... | {
"body": "@Override\n public boolean canHandle(final Class clazz) {\n return EdgeId.class.isAssignableFrom(clazz);\n }",
"class_method_signature": "EdgeIdSerialiser.canHandle(final Class clazz)",
"constructor": false,
"full_signature": "@Override public boolean canHandle(final Class clazz)",
"id... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_960 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/schema/SchemaElementDefinitionValidatorTest.java",
"identifier": "SchemaElementDefinitionValidatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldValidateComponentTypesAndReturnTrueWhenIdentifiersAndPropertiesHaveClasses() {\n // Given\n final SchemaElementDefinition elementDef = mock(SchemaElementDefinition.class);\n final SchemaElementDefinitionValidator validator = new SchemaElementDefinitionValid... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(SchemaElementDefinitionValidator.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(SchemaElementDefinitionValidator.class);",
"type": "Logger",
... | {
"body": "protected ValidationResult validateComponentTypes(final SchemaElementDefinition elementDef) {\n final ValidationResult result = new ValidationResult();\n for (final IdentifierType idType : elementDef.getIdentifiers()) {\n try {\n if (null == elementDef.getIdentifierC... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1335 | {
"fields": [],
"file": "library/spark/spark-library/src/test/java/uk/gov/gchq/gaffer/spark/operation/graphframe/GetGraphFrameOfElementsTest.java",
"identifier": "GetGraphFrameOfElementsTest",
"interfaces": "",
"superclass": "extends OperationTest<GetGraphFrameOfElements>"
} | {
"body": "@Test\n @Override\n public void builderShouldCreatePopulatedOperation() {\n // Given\n final GetGraphFrameOfElements op = new GetGraphFrameOfElements.Builder()\n .view(new View.Builder()\n .edge(TestGroups.EDGE)\n .entity(Test... | {
"fields": [
{
"declarator": "converters",
"modifier": "private",
"original_string": "private List<Converter> converters;",
"type": "List<Converter>",
"var_name": "converters"
},
{
"declarator": "options",
"modifier": "private",
"original_string": "private ... | {
"body": "@Override\n public View getView() {\n return view;\n }",
"class_method_signature": "GetGraphFrameOfElements.getView()",
"constructor": false,
"full_signature": "@Override public View getView()",
"identifier": "getView",
"invocations": [],
"modifiers": "@Override public",
"paramet... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_608 | {
"fields": [
{
"declarator": "schema",
"modifier": "private static",
"original_string": "private static Schema schema;",
"type": "Schema",
"var_name": "schema"
},
{
"declarator": "serialiser",
"modifier": "private static",
"original_string": "private static... | {
"body": "@Test\n public void testCanSerialiseElementIdClass() throws SerialisationException {\n assertTrue(serialiser.canHandle(ElementId.class));\n }",
"class_method_signature": "ElementIdSerialiserTest.testCanSerialiseElementIdClass()",
"constructor": false,
"full_signature": "@Test public void... | {
"fields": [
{
"declarator": "serialVersionUID = 2116809339334801784L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 2116809339334801784L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "entit... | {
"body": "@Override\n public boolean canHandle(final Class clazz) {\n return ElementId.class.isAssignableFrom(clazz);\n }",
"class_method_signature": "ElementIdSerialiser.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_258 | {
"fields": [],
"file": "core/access/src/test/java/uk/gov/gchq/gaffer/user/UserTest.java",
"identifier": "UserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReplaceNullIdWithUnknownIdWhenBuildingUser() {\n // Given\n final String userId = null;\n\n // When\n final User user = new User.Builder()\n .userId(userId)\n .build();\n\n // Then\n assertEquals(User.UNKNO... | {
"fields": [
{
"declarator": "serialVersionUID = -2446354817298439281L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -2446354817298439281L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "UNK... | {
"body": "public String getUserId() {\n return userId;\n }",
"class_method_signature": "User.getUserId()",
"constructor": false,
"full_signature": "public String getUserId()",
"identifier": "getUserId",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "String",
"sig... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1270 | {
"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 shouldAddEntriesToCache() throws CacheOperationException {\n service.initialise(serviceProps);\n service.putInCache(TEST_REGION, \"test\", 1);\n\n assertEquals((Integer) 1, service.getFromCache(TEST_REGION, \"test\"));\n }",
"class_method_signature": "JcsCac... | {
"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_5 | {
"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 shouldReturnFalseForUserWhoIsNotAdministrator() {\n assertFalse(createAccessPredicate(TEST_USER.getUserId(), NO_AUTHS, NON_PUBLIC).test(new User.Builder().userId(\"NonAdminUser\").opAuths(\"auth1\", \"auth2\").build(), \"auth3\"));\n }",
"class_method_signature": "Federat... | {
"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_171 | {
"fields": [
{
"declarator": "SCHEMA = new Schema.Builder()\n .type(\"string\", new TypeDefinition.Builder()\n .clazz(String.class)\n .serialiser(new StringSerialiser())\n .build())\n .type(\"int\", new TypeDefinition.Builder()\... | {
"body": "@Test\n public void shouldThrowNoExceptionsWhenValidateFlagSetToFalse() throws OperationException, StoreException {\n final AddElements addElements = new AddElements.Builder()\n .input(new Edge(\"Unknown group\", \"source\", \"dest\", true))\n .validate(false)\n ... | {
"fields": [],
"file": "store-implementation/hbase-store/src/main/java/uk/gov/gchq/gaffer/hbasestore/operation/handler/AddElementsHandler.java",
"identifier": "AddElementsHandler",
"interfaces": "implements OperationHandler<AddElements>",
"methods": [
{
"class_method_signature": "AddElementsHandler... | {
"body": "@Override\n public Void doOperation(final AddElements operation,\n final Context context, final Store store)\n throws OperationException {\n addElements(operation, (HBaseStore) store);\n return null;\n }",
"class_method_signature": "AddElementsHan... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_521 | {
"fields": [],
"file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/CollectionUtilTest.java",
"identifier": "CollectionUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnFalseWhenDistinctCalledWithCollectionOfNonUniqueValues() {\n // Given\n final Collection<Integer> collection = Lists.newArrayList(1, 2, 3, 1, 2);\n\n // When\n final boolean result = CollectionUtil.distinct(collection);\n\n // Then\n ... | {
"fields": [],
"file": "core/common-util/src/main/java/uk/gov/gchq/gaffer/commonutil/CollectionUtil.java",
"identifier": "CollectionUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "CollectionUtil.CollectionUtil()",
"constructor": true,
"full_signature": "private Colle... | {
"body": "public static <T> boolean distinct(final Collection<T> collection) {\n final Set<T> set = new HashSet<>();\n\n for (final T t : collection) {\n if (!set.add(t)) {\n return false;\n }\n }\n\n return true;\n }",
"class_method_signature": "... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_872 | {
"fields": [
{
"declarator": "namedViewCache = new NamedViewCache()",
"modifier": "private final",
"original_string": "private final NamedViewCache namedViewCache = new NamedViewCache();",
"type": "NamedViewCache",
"var_name": "namedViewCache"
},
{
"declarator": "handl... | {
"body": "@Test\n public void shouldAddNamedViewCorrectly() throws OperationException, CacheOperationFailedException {\n handler.doOperation(addNamedView, context, store);\n\n final NamedViewDetail result = namedViewCache.getNamedView(testNamedViewName);\n\n assertTrue(cacheContains(testNamed... | {
"fields": [
{
"declarator": "cache",
"modifier": "private final",
"original_string": "private final NamedViewCache cache;",
"type": "NamedViewCache",
"var_name": "cache"
}
],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/named/AddNamedViewHand... | {
"body": "@Override\n public Object doOperation(final AddNamedView operation, final Context context, final Store store) throws OperationException {\n if (null == operation.getName() || operation.getName().isEmpty()) {\n throw new IllegalArgumentException(\"NamedView name must be set and not empt... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1159 | {
"fields": [],
"file": "core/operation/src/test/java/uk/gov/gchq/gaffer/operation/util/OperationUtilTest.java",
"identifier": "OperationUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldConvertObjectArrayToElementIds() {\n // Given\n final Object[] input = {\n 1,\n \"2\",\n new EntitySeed(\"3\"),\n new Entity(\"group\", \"4\"),\n new EdgeSeed(\"5\", 6),\n ne... | {
"fields": [],
"file": "core/operation/src/main/java/uk/gov/gchq/gaffer/operation/util/OperationUtil.java",
"identifier": "OperationUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "OperationUtil.OperationUtil()",
"constructor": true,
"full_signature": "private Operati... | {
"body": "public static Iterable<? extends ElementId> toElementIds(final Object... input) {\n if (null == input) {\n return null;\n }\n return Arrays.stream(input).map(new ToElementId()).collect(Collectors.toList());\n }",
"class_method_signature": "OperationUtil.toElementIds(fin... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_937 | {
"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 shouldValidateAndReturnFalseForAndFilterWithIncompatibleProperties() {\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_464 | {
"fields": [
{
"declarator": "ve = new VisibilityEvaluator(new Authorisations(\"one\", \"two\", \"three\", \"four\"))",
"modifier": "final",
"original_string": "final VisibilityEvaluator ve = new VisibilityEvaluator(new Authorisations(\"one\", \"two\", \"three\", \"four\"));",
"type": "Vi... | {
"body": "@Test\n public void testVisibilityEvaluator() throws VisibilityParseException {\n // test for empty vis\n assertTrue(ve.evaluate(new ElementVisibility(new byte[0])));\n\n // test for and\n assertTrue(ve.evaluate(new ElementVisibility(\"one&two\")), \"'and' test\");\n\n ... | {
"fields": [
{
"declarator": "auths",
"modifier": "private",
"original_string": "private Authorisations auths;",
"type": "Authorisations",
"var_name": "auths"
}
],
"file": "core/common-util/src/main/java/uk/gov/gchq/gaffer/commonutil/elementvisibilityutil/VisibilityEvaluator... | {
"body": "public VisibilityEvaluator(final Authorisations auths) {\n this.auths = auths;\n }",
"class_method_signature": "VisibilityEvaluator.VisibilityEvaluator(final Authorisations auths)",
"constructor": true,
"full_signature": "public VisibilityEvaluator(final Authorisations auths)",
"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_673 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/GetSchemaTest.java",
"identifier": "GetSchemaTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void builderShouldCreatePopulatedOperation() {\n // Given\n final GetSchema operation = new GetSchema.Builder()\n .compact(false)\n .options(new HashMap<>())\n .build();\n\n // Then\n assertThat(operation.getOptions(... | {
"fields": [
{
"declarator": "options",
"modifier": "private",
"original_string": "private Map<String, String> options;",
"type": "Map<String, String>",
"var_name": "options"
},
{
"declarator": "compact = false",
"modifier": "private",
"original_string": "p... | {
"body": "@Override\n public Map<String, String> getOptions() {\n return options;\n }",
"class_method_signature": "GetSchema.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_389 | {
"fields": [],
"file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/element/LazyEntityTest.java",
"identifier": "LazyEntityTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldDelegateGetGroupToEntity() {\n // Given\n final String group = \"group\";\n final Entity entity = new Entity(group);\n final ElementValueLoader entityLoader = mock(ElementValueLoader.class);\n final LazyEntity lazyEntity = new LazyEntity(entit... | {
"fields": [
{
"declarator": "serialVersionUID = 8067424362415322354L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 8067424362415322354L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "entit... | {
"body": "@Override\n public String getGroup() {\n return entity.getGroup();\n }",
"class_method_signature": "LazyEntity.getGroup()",
"constructor": false,
"full_signature": "@Override public String getGroup()",
"identifier": "getGroup",
"invocations": [
"getGroup"
],
"modifiers": "@Ov... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_223 | {
"fields": [],
"file": "store-implementation/map-store/src/test/java/uk/gov/gchq/gaffer/mapstore/impl/AddElementsHandlerTest.java",
"identifier": "AddElementsHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldAddWithNoGroupByProperties() throws OperationException, StoreException {\n // Given\n final AddElements addElements = mock(AddElements.class);\n given(addElements.getInput()).willReturn((Iterable) Arrays.asList(new Edge(\"group1\")));\n final Context... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(AddElementsHandler.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(AddElementsHandler.class);",
"type": "Logger",
"var_name": "LOGGER"
}
... | {
"body": "@Override\n public Void doOperation(final AddElements addElements, final Context context, final Store store) throws OperationException {\n Iterable<? extends Element> elements = addElements.getInput();\n if (addElements.isValidate()) {\n elements = new ValidatedElements(elements... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_54 | {
"fields": [
{
"declarator": "TEST_GRAPH_ID = \"testGraphId\"",
"modifier": "private static final",
"original_string": "private static final String TEST_GRAPH_ID = \"testGraphId\";",
"type": "String",
"var_name": "TEST_GRAPH_ID"
},
{
"declarator": "user",
"modifi... | {
"body": "@Test\n public void shouldThrowException() throws Exception {\n String message = \"test exception\";\n final Operation op = mock(Operation.class);\n final String graphID = \"1,3\";\n given(op.getOption(KEY_OPERATION_OPTIONS_GRAPH_IDS)).willReturn(graphID);\n\n\n Schema... | {
"fields": [],
"file": "store-implementation/federated-store/src/main/java/uk/gov/gchq/gaffer/federatedstore/operation/handler/FederatedOperationHandler.java",
"identifier": "FederatedOperationHandler",
"interfaces": "implements OperationHandler<Operation>",
"methods": [
{
"class_method_signature":... | {
"body": "public Object doOperation(final Operation operation, final Context context, final Store store) throws OperationException {\n final Collection<Graph> graphs = ((FederatedStore) store).getGraphs(context.getUser(), operation.getOption(KEY_OPERATION_OPTIONS_GRAPH_IDS), operation);\n for (final Gr... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_736 | {
"fields": [
{
"declarator": "ENDPOINT_BASE_PATH = \"http://127.0.0.1:\"",
"modifier": "private static final",
"original_string": "private static final String ENDPOINT_BASE_PATH = \"http://127.0.0.1:\";",
"type": "String",
"var_name": "ENDPOINT_BASE_PATH"
},
{
"declara... | {
"body": "@Test\n public void shouldGetElementsFromEndpoint() throws OperationException {\n // Given\n mockServer.when(request()\n .withMethod(\"GET\")\n .withPath(ENDPOINT_PATH))\n .respond(response()\n .withStatusCode(200)\n ... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/GetFromEndpointHandler.java",
"identifier": "GetFromEndpointHandler",
"interfaces": "implements OutputOperationHandler<GetFromEndpoint, String>",
"methods": [
{
"class_method_signature": "GetFromEndpointHand... | {
"body": "@Override\n public String doOperation(final GetFromEndpoint operation, final Context context, final Store store) throws OperationException {\n try {\n return IOUtils.toString(new URL(operation.getEndpoint()));\n } catch (final IOException e) {\n throw new OperationExc... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_366 | {
"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 shouldCompareIntegersReversed() {\n final ComparableOrToStringComparator comparator = new ComparableOrToStringComparator();\n\n final int result = comparator.compare(2, 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_1067 | {
"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 shouldBuildGraphUsingGraphIdAndLookupSchema() throws Exception {\n // Given\n final StoreProperties storeProperties = new StoreProperties();\n storeProperties.setStoreClass(TestStoreImpl.class.getName());\n\n final Schema schemaModule1 = new Schema.Builder... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(Graph.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(Graph.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": ... | {
"body": "public Schema getSchema() {\n return store.getOriginalSchema();\n }",
"class_method_signature": "Graph.getSchema()",
"constructor": false,
"full_signature": "public Schema getSchema()",
"identifier": "getSchema",
"invocations": [
"getOriginalSchema"
],
"modifiers": "public",
"... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_809 | {
"fields": [
{
"declarator": "input",
"modifier": "private",
"original_string": "private List<Element> input;",
"type": "List<Element>",
"var_name": "input"
},
{
"declarator": "expected",
"modifier": "private",
"original_string": "private List<Element> expe... | {
"body": "@Test\n public void shouldFailValidationWhenElementTransformerOperationIsNull() {\n // Given\n given(store.getSchema()).willReturn(schema);\n\n final Entity entity = new Entity.Builder()\n .group(TestGroups.ENTITY)\n .property(TestPropertyNames.PROP_1, ... | {
"fields": [
{
"declarator": "validator = new TransformValidator()",
"modifier": "private final",
"original_string": "private final FunctionValidator<Transform> validator = new TransformValidator();",
"type": "FunctionValidator<Transform>",
"var_name": "validator"
}
],
"file... | {
"body": "@Override\n public Iterable<? extends Element> doOperation(final Transform operation, final Context context, final Store store) throws OperationException {\n return doOperation(operation, store.getSchema());\n }",
"class_method_signature": "TransformHandler.doOperation(final Transform operat... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1122 | {
"fields": [],
"file": "core/graph/src/test/java/uk/gov/gchq/gaffer/graph/hook/Log4jLoggerTest.java",
"identifier": "Log4jLoggerTest",
"interfaces": "",
"superclass": "extends GraphHookTest<Log4jLogger>"
} | {
"body": "@Test\n public void shouldReturnResultWithoutModification() {\n // Given\n final Log4jLogger hook = getTestObject();\n final Object result = mock(Object.class);\n final OperationChain opChain = new OperationChain.Builder()\n .first(new GenerateObjects<>())\n ... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(Log4jLogger.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(Log4jLogger.class);",
"type": "Logger",
"var_name": "LOGGER"
}
],
"file": ... | {
"body": "@Override\n public <T> T postExecute(final T result, final OperationChain<?> operationChain, final Context context) {\n // No logging required.\n return result;\n }",
"class_method_signature": "Log4jLogger.postExecute(final T result, final OperationChain<?> operationChain, final Conte... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1088 | {
"fields": [
{
"declarator": "TEST_WITH_VALUE = \"withTestValue\"",
"modifier": "public static final",
"original_string": "public static final String TEST_WITH_VALUE = \"withTestValue\";",
"type": "String",
"var_name": "TEST_WITH_VALUE"
},
{
"declarator": "TEST_WITHOUT... | {
"body": "@Test\n public void shouldPassSubsetAuth() throws Exception {\n userAuths.add(A);\n validAuths.add(A);\n validAuths.add(B);\n\n assertTrue(updateViewHook.validateAuths(userAuths, validAuths, true));\n }",
"class_method_signature": "UpdateViewHookTest.shouldPassSubsetAuth... | {
"fields": [
{
"declarator": "ADD_EXTRA_GROUPS_DEFAULT = false",
"modifier": "public static final",
"original_string": "public static final boolean ADD_EXTRA_GROUPS_DEFAULT = false;",
"type": "boolean",
"var_name": "ADD_EXTRA_GROUPS_DEFAULT"
},
{
"declarator": "withOpA... | {
"body": "protected final boolean validateAuths(final Set<String> userAuths, final Set<String> validAuth, final boolean ifValidAuthIsNull) {\n boolean rtn = ifValidAuthIsNull;\n if (null != validAuth) {\n if (null == userAuths) {\n rtn = validAuth.isEmpty();\n } els... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_274 | {
"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 shouldReturnFalseWhenViewHasEmptyPostAggEdgeFilters() {\n // Given\n final View view = new View.Builder()\n .edge(TestGroups.EDGE, 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_624 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/util/AggregatorUtilTest.java",
"identifier": "AggregatorUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldThrowExceptionWhenIngestAggregatedIfSchemaIsNull() {\n // given\n final Schema schema = null;\n\n // When / Then\n try {\n AggregatorUtil.ingestAggregate(Collections.emptyList(), schema);\n fail(\"Exception expected\");\n ... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/util/AggregatorUtil.java",
"identifier": "AggregatorUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "AggregatorUtil.AggregatorUtil()",
"constructor": true,
"full_signature": "private AggregatorU... | {
"body": "public static CloseableIterable<Element> ingestAggregate(final Iterable<? extends Element> elements, final Schema schema) {\n if (null == schema) {\n throw new IllegalArgumentException(\"Schema is required\");\n }\n final Collection<String> aggregatedGroups = schema.getAggre... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_331 | {
"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 shouldGetEntry() {\n final AdjacencyMap adjacencyMap = getAdjacencyMap();\n\n final Set<Edge> results = adjacencyMap.getEdges(1, 2);\n\n assertThat(results, equalTo(Collections.singleton(makeEdge(1, 2))));\n }",
"class_method_signature": "AdjacencyMapTest.sh... | {
"fields": [
{
"declarator": "edgeGraph = HashBasedTable.create()",
"modifier": "private final",
"original_string": "private final HashBasedTable<Object, Object, Set<Edge>> edgeGraph = HashBasedTable.create();",
"type": "HashBasedTable<Object, Object, Set<Edge>>",
"var_name": "edgeG... | {
"body": "public Set<Edge> getEdges(final Object source, final Object destination) {\n final Set<Edge> results = edgeGraph.get(source, destination);\n return null != results ? results : Collections.emptySet();\n }",
"class_method_signature": "AdjacencyMap.getEdges(final Object source, final Object... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_761 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/handler/join/match/ElementMatchTest.java",
"identifier": "ElementMatchTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldThrowExceptionIfInitialisedWithNullValue() {\n // Given\n\n ElementMatch elementMatch = new ElementMatch();\n\n // When / Then\n\n try {\n elementMatch.init(null);\n fail(\"Exception expected\");\n } catch (final IllegalA... | {
"fields": [
{
"declarator": "elementJoinComparator",
"modifier": "private",
"original_string": "private ElementJoinComparator elementJoinComparator;",
"type": "ElementJoinComparator",
"var_name": "elementJoinComparator"
},
{
"declarator": "matchCandidates",
"mod... | {
"body": "@Override\n public void init(final Iterable matchCandidates) {\n if (matchCandidates == null) {\n throw new IllegalArgumentException(NULL_MATCH_CANDIDATES_ERROR_MESSAGE);\n }\n this.matchCandidates = matchCandidates;\n }",
"class_method_signature": "ElementMatch.init... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1319 | {
"fields": [],
"file": "library/time-library/src/test/java/uk/gov/gchq/gaffer/time/serialisation/BoundedTimestampSetSerialiserTest.java",
"identifier": "BoundedTimestampSetSerialiserTest",
"interfaces": "",
"superclass": "extends ToBytesSerialisationTest<BoundedTimestampSet>"
} | {
"body": "@Test\n public void testCanHandle() throws SerialisationException {\n assertTrue(serialiser.canHandle(BoundedTimestampSet.class));\n assertFalse(serialiser.canHandle(String.class));\n }",
"class_method_signature": "BoundedTimestampSetSerialiserTest.testCanHandle()",
"constructor": f... | {
"fields": [
{
"declarator": "serialVersionUID = 6242522763501581598L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 6242522763501581598L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "NOT_F... | {
"body": "@Override\n public boolean canHandle(final Class clazz) {\n return BoundedTimestampSet.class.equals(clazz);\n }",
"class_method_signature": "BoundedTimestampSetSerialiser.canHandle(final Class clazz)",
"constructor": false,
"full_signature": "@Override public boolean canHandle(final Clas... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_448 | {
"fields": [],
"file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/IsElementValidatorTest.java",
"identifier": "IsElementValidatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldValidateWhenEntity() {\n final Element element = new Entity.Builder()\n .group(TestGroups.ENTITY)\n .build();\n\n final boolean valid = new IsElementValidator().validate(element);\n\n assertTrue(valid);\n }",
"class_method... | {
"fields": [],
"file": "core/data/src/main/java/uk/gov/gchq/gaffer/data/IsElementValidator.java",
"identifier": "IsElementValidator",
"interfaces": "implements Validator<Object>",
"methods": [
{
"class_method_signature": "IsElementValidator.validate(final Object object)",
"constructor": false... | {
"body": "@Override\n public boolean validate(final Object object) {\n return object instanceof Element;\n }",
"class_method_signature": "IsElementValidator.validate(final Object object)",
"constructor": false,
"full_signature": "@Override public boolean validate(final Object object)",
"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_1030 | {
"fields": [],
"file": "core/serialisation/src/test/java/uk/gov/gchq/gaffer/serialisation/implementation/NullSerialiserTest.java",
"identifier": "NullSerialiserTest",
"interfaces": "",
"superclass": "extends ToBytesSerialisationTest<Object>"
} | {
"body": "@Test\n public void shouldPreserveOrdering() {\n assertTrue(serialiser.preservesObjectOrdering());\n }",
"class_method_signature": "NullSerialiserTest.shouldPreserveOrdering()",
"constructor": false,
"full_signature": "@Test public void shouldPreserveOrdering()",
"identifier": "shouldP... | {
"fields": [
{
"declarator": "serialVersionUID = 282624951140644367L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 282624951140644367L;",
"type": "long",
"var_name": "serialVersionUID"
}
],
"file": "core/serialisation/... | {
"body": "@Override\n public boolean preservesObjectOrdering() {\n return true;\n }",
"class_method_signature": "NullSerialiser.preservesObjectOrdering()",
"constructor": false,
"full_signature": "@Override public boolean preservesObjectOrdering()",
"identifier": "preservesObjectOrdering",
"in... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1175 | {
"fields": [],
"file": "core/operation/src/test/java/uk/gov/gchq/gaffer/operation/function/ToEntityIdTest.java",
"identifier": "ToEntityIdTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnNullIfTheInputIsNull() {\n // Given\n final Object input = null;\n final ToEntityId function = new ToEntityId();\n\n // When\n final EntityId output = function.apply(input);\n\n // Then\n assertNull(output);\n }",
"cla... | {
"fields": [],
"file": "core/operation/src/main/java/uk/gov/gchq/gaffer/operation/function/ToEntityId.java",
"identifier": "ToEntityId",
"interfaces": "",
"methods": [
{
"class_method_signature": "ToEntityId.apply(final Object obj)",
"constructor": false,
"full_signature": "@Override pu... | {
"body": "@Override\n public EntityId apply(final Object obj) {\n if (null == obj) {\n return null;\n }\n return obj instanceof EntityId ? (EntityId) obj : new EntitySeed(obj);\n }",
"class_method_signature": "ToEntityId.apply(final Object obj)",
"constructor": false,
"ful... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_632 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/util/AggregatorUtilTest.java",
"identifier": "AggregatorUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldQueryAggregateElementsWhenProvidedIterableCanOnlyBeConsumedOnce() {\n // given\n final Schema schema = Schema.fromJson(StreamUtil.openStreams(getClass(), \"schema-groupby\"));\n final View view = new View.Builder()\n .entity(TestGroups.ENTITY... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/util/AggregatorUtil.java",
"identifier": "AggregatorUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "AggregatorUtil.AggregatorUtil()",
"constructor": true,
"full_signature": "private AggregatorU... | {
"body": "public static CloseableIterable<Element> queryAggregate(final Iterable<? extends Element> elements, final Schema schema, final View view) {\n if (null == schema) {\n throw new IllegalArgumentException(\"Schema is required\");\n }\n if (null == view) {\n throw new ... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_262 | {
"fields": [],
"file": "core/access/src/test/java/uk/gov/gchq/gaffer/user/UserTest.java",
"identifier": "UserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldNotAllowChangingOpAuths() {\n // Given\n final String userId = \"user 01\";\n final String opAuth1 = \"opAuth 1\";\n final String opAuth2 = \"opAuth 2\";\n final String newOpAuth = \"new opAuth\";\n final User user = new User.Builder()\... | {
"fields": [
{
"declarator": "serialVersionUID = -2446354817298439281L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -2446354817298439281L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "UNK... | {
"body": "public Set<String> getOpAuths() {\n return Collections.unmodifiableSet(opAuths);\n }",
"class_method_signature": "User.getOpAuths()",
"constructor": false,
"full_signature": "public Set<String> getOpAuths()",
"identifier": "getOpAuths",
"invocations": [
"unmodifiableSet"
],
"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_798 | {
"fields": [
{
"declarator": "SCHEMA = new Schema.Builder()\n .edge(TestGroups.EDGE, new SchemaEdgeDefinition())\n .edge(TestGroups.EDGE_2, new SchemaEdgeDefinition())\n .entity(TestGroups.ENTITY, new SchemaEntityDefinition())\n .entity(TestGroups.ENTITY_2, new S... | {
"body": "@Test\n public void shouldReturnNoResultsWhenGlobalElementsFails() throws OperationException {\n // Given\n given(store.getSchema()).willReturn(SCHEMA);\n\n final Edge edge = new Edge.Builder()\n .group(TestGroups.EDGE)\n .source(\"junctionA\")\n ... | {
"fields": [
{
"declarator": "validator = new FilterValidator()",
"modifier": "private final",
"original_string": "private final FunctionValidator<Filter> validator = new FilterValidator();",
"type": "FunctionValidator<Filter>",
"var_name": "validator"
}
],
"file": "core/sto... | {
"body": "@Override\n public Iterable<? extends Element> doOperation(final Filter operation, final Context context, final Store store) throws OperationException {\n return doOperation(operation, store.getSchema());\n }",
"class_method_signature": "FilterHandler.doOperation(final Filter operation, fina... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_15 | {
"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 shouldGetCleanStrings() {\n // Given\n final String csv = \" 1,2, 3\";\n\n // When\n final List<String> values = FederatedStoreUtil.getCleanStrings(csv);\n\n // Then\n assertEquals(Arrays.asList(\"1\", \"2\", \"3\"), values);\n }",
"clas... | {
"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_777 | {
"fields": [
{
"declarator": "schema = new Schema.Builder().build()",
"modifier": "protected",
"original_string": "protected Schema schema = new Schema.Builder().build();",
"type": "Schema",
"var_name": "schema"
}
],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store... | {
"body": "@Test\n public void shouldThrowExceptionForNullInput() throws OperationException {\n // Given\n final AbstractGenerateSplitPointsFromSampleHandler<?, S> handler = createHandler();\n final GenerateSplitPointsFromSample operation = new GenerateSplitPointsFromSample.Builder<>()\n ... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/AbstractGenerateSplitPointsFromSampleHandler.java",
"identifier": "AbstractGenerateSplitPointsFromSampleHandler",
"interfaces": "implements OutputOperationHandler<GenerateSplitPointsFromSample<T>, List<T>>",
"methods"... | {
"body": "@Override\n public List<T> doOperation(final GenerateSplitPointsFromSample<T> operation, final Context context, final Store store) throws OperationException {\n\n final S typedStore = (S) store;\n\n validate(operation, typedStore);\n\n final Integer numSplits = getNumSplits(operatio... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_327 | {
"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 shouldGetDestinations() {\n final AdjacencyMap adjacencyMap = getAdjacencyMap();\n\n final Set<Object> results = adjacencyMap.getDestinations(1);\n\n assertThat(results, hasItems(1, 2, 5));\n }",
"class_method_signature": "AdjacencyMapTest.shouldGetDestinati... | {
"fields": [
{
"declarator": "edgeGraph = HashBasedTable.create()",
"modifier": "private final",
"original_string": "private final HashBasedTable<Object, Object, Set<Edge>> edgeGraph = HashBasedTable.create();",
"type": "HashBasedTable<Object, Object, Set<Edge>>",
"var_name": "edgeG... | {
"body": "public Set<Object> getDestinations(final Object source) {\n return Collections.unmodifiableSet(edgeGraph.row(source).keySet());\n }",
"class_method_signature": "AdjacencyMap.getDestinations(final Object source)",
"constructor": false,
"full_signature": "public Set<Object> getDestinations(fi... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1026 | {
"fields": [],
"file": "core/serialisation/src/test/java/uk/gov/gchq/gaffer/serialisation/implementation/StringSerialiserTest.java",
"identifier": "StringSerialiserTest",
"interfaces": "",
"superclass": "extends ToBytesSerialisationTest<String>"
} | {
"body": "@Test\n @Override\n public void shouldDeserialiseEmpty() throws SerialisationException {\n // When\n final String value = serialiser.deserialiseEmpty();\n\n // Then\n assertEquals(\"\", value);\n }",
"class_method_signature": "StringSerialiserTest.shouldDeserialiseEmp... | {
"fields": [
{
"declarator": "serialVersionUID = 5647756843689779437L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 5647756843689779437L;",
"type": "long",
"var_name": "serialVersionUID"
}
],
"file": "core/serialisatio... | {
"body": "@Override\n public String deserialiseEmpty() {\n return \"\";\n }",
"class_method_signature": "StringSerialiser.deserialiseEmpty()",
"constructor": false,
"full_signature": "@Override public String deserialiseEmpty()",
"identifier": "deserialiseEmpty",
"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_848 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/handler/job/GetAllJobDetailsHandlerTest.java",
"identifier": "GetAllJobDetailsHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldThrowExceptionIfJobTrackerIsNotConfigured() {\n // Given\n final GetAllJobDetailsHandler handler = new GetAllJobDetailsHandler();\n final GetAllJobDetails operation = mock(GetAllJobDetails.class);\n final Store store = mock(Store.class);\n fin... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/job/GetAllJobDetailsHandler.java",
"identifier": "GetAllJobDetailsHandler",
"interfaces": "implements OutputOperationHandler<GetAllJobDetails, CloseableIterable<JobDetail>>",
"methods": [
{
"class_method_sig... | {
"body": "@Override\n public CloseableIterable<JobDetail> doOperation(final GetAllJobDetails operation, final Context context, final Store store) throws OperationException {\n if (null == store.getJobTracker()) {\n throw new OperationException(\"The Job Tracker has not been configured\", SERVICE... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1163 | {
"fields": [],
"file": "core/operation/src/test/java/uk/gov/gchq/gaffer/operation/util/OperationUtilTest.java",
"identifier": "OperationUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnNullIfConvertObjectArrayToEntityIdsWithNullInput() {\n // Given\n final Object[] input = null;\n\n // When\n final Iterable<? extends EntityId> output = OperationUtil.toEntityIds(input);\n\n // Then\n assertNull(OperationUtil.toEn... | {
"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_42 | {
"fields": [
{
"declarator": "ID_SCHEMA_ENTITY = \"basicEntitySchema\"",
"modifier": "public static final",
"original_string": "public static final String ID_SCHEMA_ENTITY = \"basicEntitySchema\";",
"type": "String",
"var_name": "ID_SCHEMA_ENTITY"
},
{
"declarator": "I... | {
"body": "@Test\n public void shouldNotThrowExceptionWhenInitialisedWithNoCacheClassInProperties() throws StoreException {\n // Given\n federatedProperties = new FederatedStoreProperties();\n\n // When / Then\n try {\n store.initialise(FEDERATED_STORE_ID, null, federatedProp... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(Store.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(Store.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": ... | {
"body": "@Override\n public void initialise(final String graphId, final Schema unused, final StoreProperties properties) throws StoreException {\n super.initialise(graphId, new Schema(), properties);\n customPropertiesAuths = getCustomPropertiesAuths();\n isPublicAccessAllowed = Boolean.valu... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_235 | {
"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 shouldGetElementGenerators() {\n // When\n final Set<Class> classes = (Set<Class>) service.getElementGenerators().getEntity();\n\n // Then\n assertFalse(classes.isEmpty());\n }",
"class_method_signature": "GraphConfigurationServiceV2Test.shouldGetElem... | {
"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 getElementGenerators() {\n return Response.ok(ReflectionUtil.getSubTypes(ElementGenerator.class))\n .header(GAFFER_MEDIA_TYPE_HEADER, GAFFER_MEDIA_TYPE)\n .build();\n }",
"class_method_signature": "GraphConfigurationServiceV2.getEleme... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_665 | {
"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 shouldGetScoreWithOperationChainAsAnOperation() {\n // Given\n final GetElements getElements = mock(GetElements.class);\n final ToMap toMap = mock(ToMap.class);\n final Map map = mock(Map.class);\n final OperationChain conditionalChain = mock(Operat... | {
"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_370 | {
"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 shouldCompareIntegerArraysReversed() {\n final ComparableOrToStringComparator comparator = new ComparableOrToStringComparator();\n\n final int result = comparator.compare(new Integer[] {1, 2}, new Integer[] {1, 1});\n\n assertTrue(result > 0, \"Should be more tha... | {
"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_720 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/handler/SetVariableHandlerTest.java",
"identifier": "SetVariableHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldNotAllowNullInputVariableToBeAdded() throws OperationException {\n // Given\n final Context context = new Context(new User());\n final Store store = mock(Store.class);\n final String testVarName = \"testVarName\";\n final Object testVarValue =... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/SetVariableHandler.java",
"identifier": "SetVariableHandler",
"interfaces": "implements OperationHandler<SetVariable>",
"methods": [
{
"class_method_signature": "SetVariableHandler.doOperation(final SetVaria... | {
"body": "@Override\n public Void doOperation(final SetVariable operation, final Context context, final Store store) throws OperationException {\n if (null == operation.getVariableName()) {\n throw new IllegalArgumentException(\"Variable name cannot be null\");\n }\n\n if (null == ... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1358 | {
"fields": [],
"file": "library/sketches-library/src/test/java/uk/gov/gchq/gaffer/sketches/datasketches/quantiles/serialisation/StringsUnionSerialiserTest.java",
"identifier": "StringsUnionSerialiserTest",
"interfaces": "",
"superclass": "extends ViaCalculatedValueSerialiserTest<ItemsUnion<String>, String>"
... | {
"body": "@Test\n public void testCanHandleItemsUnion() {\n assertTrue(serialiser.canHandle(ItemsUnion.class));\n assertFalse(serialiser.canHandle(String.class));\n }",
"class_method_signature": "StringsUnionSerialiserTest.testCanHandleItemsUnion()",
"constructor": false,
"full_signature": ... | {
"fields": [
{
"declarator": "serialVersionUID = 7091724743812159058L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 7091724743812159058L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "SERIA... | {
"body": "@Override\n public boolean canHandle(final Class clazz) {\n return ItemsUnion.class.equals(clazz);\n }",
"class_method_signature": "StringsUnionSerialiser.canHandle(final Class clazz)",
"constructor": false,
"full_signature": "@Override public boolean canHandle(final Class clazz)",
"id... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_409 | {
"fields": [],
"file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/element/function/ElementAggregatorTest.java",
"identifier": "ElementAggregatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldBuildAggregator() {\n // Given\n final String property1 = \"property 1\";\n final String property2a = \"property 2a\";\n final String property2b = \"property 2b\";\n final String property3 = \"property 3\";\n\n final BinaryOperator func... | {
"fields": [
{
"declarator": "stateTuple = new PropertiesTuple()",
"modifier": "private final",
"original_string": "private final PropertiesTuple stateTuple = new PropertiesTuple();",
"type": "PropertiesTuple",
"var_name": "stateTuple"
},
{
"declarator": "propertiesTup... | {
"body": "@Override\n public List<TupleAdaptedBinaryOperator<String, ?>> getComponents() {\n if (readOnly) {\n return Collections.unmodifiableList(super.getComponents());\n }\n\n return super.getComponents();\n }",
"class_method_signature": "ElementAggregator.getComponents()",... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1071 | {
"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 shouldThrowExceptionOnExecuteWithANullContext() throws OperationException {\n // Given\n final Context context = null;\n final OperationChain opChain = mock(OperationChain.class);\n\n final Graph graph = new Graph.Builder()\n .config(new Gra... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(Graph.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(Graph.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": ... | {
"body": "public void execute(final Operation operation, final User user) throws OperationException {\n execute(new GraphRequest<>(operation, user));\n }",
"class_method_signature": "Graph.execute(final Operation operation, final User user)",
"constructor": false,
"full_signature": "public void execu... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1134 | {
"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 shouldNotExecuteNamedOperationWithParameterOfWrongType() throws OperationException, CacheOperationFailedException {\n // Given\n final String opName = \"opName\";\n final NamedOperationCache cache = mock(NamedOperationCache.class);\n final NamedOperationRe... | {
"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_491 | {
"fields": [],
"file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/StringUtilTest.java",
"identifier": "StringUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void unescapeCommaShouldRemoveBackslash() {\n assertEquals(\"removeBackslash\", StringUtil.unescapeComma(\"remove\\\\Backslash\"));\n }",
"class_method_signature": "StringUtilTest.unescapeCommaShouldRemoveBackslash()",
"constructor": false,
"full_signature": "@Test public ... | {
"fields": [
{
"declarator": "COMMA = ','",
"modifier": "public static final",
"original_string": "public static final char COMMA = ',';",
"type": "char",
"var_name": "COMMA"
},
{
"declarator": "ESCAPE_CHAR = '\\\\'",
"modifier": "private static final",
"or... | {
"body": "public static String unescapeComma(final String escapedStr) {\n final StringBuilder str = new StringBuilder(escapedStr.length());\n boolean isEscaped = false;\n for (int i = 0; i < escapedStr.length(); i++) {\n char c = escapedStr.charAt(i);\n if (isEscaped) {\n ... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_868 | {
"fields": [
{
"declarator": "cache",
"modifier": "private static",
"original_string": "private static NamedOperationCache cache;",
"type": "NamedOperationCache",
"var_name": "cache"
},
{
"declarator": "GAFFER_USER = \"gaffer user\"",
"modifier": "private static ... | {
"body": "@Test\n public void shouldThrowExceptionIfNamedOperationIsNull() throws CacheOperationFailedException {\n assertThrows(CacheOperationFailedException.class, () -> cache.addNamedOperation(null, false, standardUser));\n }",
"class_method_signature": "NamedOperationCacheTest.shouldThrowException... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(NamedOperationCache.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(NamedOperationCache.class);",
"type": "Logger",
"var_name": "LOGGER"
}... | {
"body": "public void addNamedOperation(final NamedOperationDetail namedOperation, final boolean overwrite, final User user) throws CacheOperationFailedException {\n add(namedOperation, overwrite, user, null);\n }",
"class_method_signature": "NamedOperationCache.addNamedOperation(final NamedOperationDeta... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1143 | {
"fields": [
{
"declarator": "validEdge = new Edge.Builder()\n .group(\"result\")\n .source(\"jobId\")\n .dest(\"exportId\")\n .directed(true)\n .property(\"opAuths\", CollectionUtil.treeSet(\"user01\"))\n .property(\"timestamp\", System.cur... | {
"body": "@Test\n public void shouldCreateGraphWithValidSchema() {\n // Given\n final Graph graph = GafferResultCacheUtil.createGraph(\"graphId\", StreamUtil.STORE_PROPERTIES, GafferResultCacheUtil.DEFAULT_TIME_TO_LIVE);\n final Schema schema = graph.getSchema();\n\n\n // When\n ... | {
"fields": [
{
"declarator": "ONE_DAY_IN_MILLISECONDS = 24 * 60 * 60 * 1000L",
"modifier": "public static final",
"original_string": "public static final long ONE_DAY_IN_MILLISECONDS = 24 * 60 * 60 * 1000L;",
"type": "long",
"var_name": "ONE_DAY_IN_MILLISECONDS"
},
{
"... | {
"body": "public static Graph createGraph(final String graphId, final String cacheStorePropertiesPath, final Long timeToLive) {\n if (null == cacheStorePropertiesPath) {\n throw new IllegalArgumentException(\"Gaffer result cache Store properties are required\");\n }\n\n final Graph.Bu... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1006 | {
"fields": [],
"file": "core/serialisation/src/test/java/uk/gov/gchq/gaffer/serialisation/implementation/ordered/OrderedLongSerialiserTest.java",
"identifier": "OrderedLongSerialiserTest",
"interfaces": "",
"superclass": "extends ToBytesSerialisationTest<Long>"
} | {
"body": "@Test\n public void checkOrderPreserved() throws SerialisationException {\n // Given\n byte[] startBytes = serialiser.serialise(0L);\n for (Long test = 1L; test >= 10L; test++) {\n // When\n byte[] newTestBytes = serialiser.serialise(test);\n\n // Th... | {
"fields": [
{
"declarator": "serialVersionUID = -8948380879926929233L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -8948380879926929233L;",
"type": "long",
"var_name": "serialVersionUID"
}
],
"file": "core/serialisat... | {
"body": "@Override\n public byte[] serialise(final Long object) {\n final Long signedL = object ^ 0x8000000000000000L;\n int shift = 56;\n int index;\n int prefix = signedL < 0 ? 0xff : 0x00;\n\n for (index = 0; index < 8; index++) {\n if (((signedL >> shift) & 0xff)... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_887 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/ElementValidatorTest.java",
"identifier": "ElementValidatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnFailedValidationResultWhenSchemaValidateWithInvalidElement() {\n // Given\n final Schema schema = mock(Schema.class);\n final String group = TestGroups.EDGE;\n final Element elm = mock(Element.class);\n final SchemaElementDefinition elem... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(ElementValidator.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(ElementValidator.class);",
"type": "Logger",
"var_name": "LOGGER"
},
... | {
"body": "@Override\n public ValidationResult validateWithValidationResult(final Element element) {\n final ValidationResult validationResult = new ValidationResult();\n if (null == element) {\n validationResult.addError(\"Element was null\");\n } else if (null != schema) {\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_184 | {
"fields": [
{
"declarator": "SCHEMA = new Schema.Builder()\n .type(\"string\", new TypeDefinition.Builder()\n .clazz(String.class)\n .aggregateFunction(new StringConcat())\n .build())\n .type(\"type\", Boolean.class)\n ... | {
"body": "@Test\n public void shouldConstructProcessorsWhenViewIsNull() throws OperationException, IOException {\n // Given\n final Scan scan = mock(Scan.class);\n given(scan.getAttribute(HBaseStoreConstants.VIEW)).willReturn(null);\n\n // When\n final List<GafferScannerProcesso... | {
"fields": [],
"file": "store-implementation/hbase-store/src/main/java/uk/gov/gchq/gaffer/hbasestore/coprocessor/scanner/QueryScanner.java",
"identifier": "QueryScanner",
"interfaces": "implements RegionScanner",
"methods": [
{
"class_method_signature": "QueryScanner.QueryScanner(final RegionScanne... | {
"body": "protected static List<GafferScannerProcessor> createProcessors(\n final Scan scan,\n final Schema schema,\n final ElementSerialisation serialisation) {\n final List<GafferScannerProcessor> processors = new ArrayList<>();\n final Set<Class<? extends GafferScann... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1285 | {
"fields": [
{
"declarator": "cache",
"modifier": "private static",
"original_string": "private static HazelcastCache<String, Integer> cache;",
"type": "HazelcastCache<String, Integer>",
"var_name": "cache"
}
],
"file": "library/cache-library/hazelcast-cache-service/src/test... | {
"body": "@Test\n public void shouldThrowExceptionIfAddingNullValue() {\n try {\n cache.put(\"test\", null);\n fail(\"Expected an exception\");\n } catch (final CacheOperationException e) {\n assertNotNull(e.getMessage());\n }\n }",
"class_method_signatur... | {
"fields": [
{
"declarator": "distributedMap",
"modifier": "private final",
"original_string": "private final IMap<K, V> distributedMap;",
"type": "IMap<K, V>",
"var_name": "distributedMap"
}
],
"file": "library/cache-library/hazelcast-cache-service/src/main/java/uk/gov/gchq... | {
"body": "@Override\n public void put(final K key, final V value) throws CacheOperationException {\n try {\n distributedMap.put(key, value);\n } catch (final Exception e) {\n throw new CacheOperationException(e);\n }\n }",
"class_method_signature": "HazelcastCache.p... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_757 | {
"fields": [
{
"declarator": "store = mock(Store.class)",
"modifier": "private final",
"original_string": "private final Store store = mock(Store.class);",
"type": "Store",
"var_name": "store"
},
{
"declarator": "key1 = \"key1\"",
"modifier": "private final",
... | {
"body": "@Test\n public void shouldReturnEmptyMapWhenNoValuesPresent() throws OperationException {\n // Given\n final Context context = mock(Context.class);\n given(context.getVariable(key1)).willReturn(null);\n given(context.getVariable(key2)).willReturn(null);\n given(context... | {
"fields": [],
"file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/GetVariablesHandler.java",
"identifier": "GetVariablesHandler",
"interfaces": "implements OperationHandler<GetVariables>",
"methods": [
{
"class_method_signature": "GetVariablesHandler.doOperation(final GetV... | {
"body": "@Override\n public Map<String, Object> doOperation(final GetVariables operation, final Context context, final Store store) throws OperationException {\n final Map<String, Object> variableMap = new HashMap<>();\n List<String> variableNames = operation.getVariableNames() != null ? operation.... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_307 | {
"fields": [
{
"declarator": "READ_ACCESS_PREDICATE = new AccessPredicate(new CustomUserPredicate())",
"modifier": "private static final",
"original_string": "private static final AccessPredicate READ_ACCESS_PREDICATE = new AccessPredicate(new CustomUserPredicate());",
"type": "AccessPred... | {
"body": "@Test\n public void shouldConfigureDefaultAccessPredicateForWriteAccessTestByDefault() {\n final NamedViewDetail namedViewDetail = createNamedViewDetailBuilder().build();\n assertEquals(\n new NamedViewWriteAccessPredicate(new User.Builder().userId(\"creator\").build(), asLi... | {
"fields": [
{
"declarator": "serialVersionUID = -8354836093398004122L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -8354836093398004122L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "CHA... | {
"body": "public AccessPredicate getWriteAccessPredicate() {\n return writeAccessPredicate != null ? deserialise(writeAccessPredicate) : null;\n }",
"class_method_signature": "NamedViewDetail.getWriteAccessPredicate()",
"constructor": false,
"full_signature": "public AccessPredicate getWriteAccessPre... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_612 | {
"fields": [
{
"declarator": "schema",
"modifier": "private static",
"original_string": "private static Schema schema;",
"type": "Schema",
"var_name": "schema"
},
{
"declarator": "serialiser",
"modifier": "private static",
"original_string": "private static... | {
"body": "@Test\n public void testCantSerialiseIntegerClass() throws SerialisationException {\n assertFalse(serialiser.canHandle(Integer.class));\n }",
"class_method_signature": "EdgeSerialiserTest.testCantSerialiseIntegerClass()",
"constructor": false,
"full_signature": "@Test public void testCan... | {
"fields": [
{
"declarator": "serialVersionUID = 2205438497836765935L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 2205438497836765935L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "boole... | {
"body": "@Override\n public boolean canHandle(final Class clazz) {\n return Edge.class.isAssignableFrom(clazz);\n }",
"class_method_signature": "EdgeSerialiser.canHandle(final Class clazz)",
"constructor": false,
"full_signature": "@Override public boolean canHandle(final Class clazz)",
"identi... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_242 | {
"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 shouldThrowExceptionWhenGetSerialisedFieldsWithUnknownClassName() throws IOException {\n // When / Then\n try {\n service.getSerialisedFields(\"an unknown class name\");\n fail(\"Exception expected\");\n } catch (final IllegalArgumentExcepti... | {
"fields": [
{
"declarator": "graphFactory",
"modifier": "@Inject\n private",
"original_string": "@Inject\n private GraphFactory graphFactory;",
"type": "GraphFactory",
"var_name": "graphFactory"
},
{
"declarator": "userFactory",
"modifier": "@Inject\n p... | {
"body": "@SuppressFBWarnings(value = \"REC_CATCH_EXCEPTION\", justification = \"Need to wrap all runtime exceptions before they are given to the user\")\n @Override\n public Set<String> getSerialisedFields(final String className) {\n final Class<?> clazz;\n try {\n clazz = Class.forNa... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_35 | {
"fields": [
{
"declarator": "ID_SCHEMA_ENTITY = \"basicEntitySchema\"",
"modifier": "public static final",
"original_string": "public static final String ID_SCHEMA_ENTITY = \"basicEntitySchema\";",
"type": "String",
"var_name": "ID_SCHEMA_ENTITY"
},
{
"declarator": "I... | {
"body": "@Test\n public void shouldReturnEnabledByDefaultGraphsForNullString() throws Exception {\n // Given\n populateGraphs();\n\n // When\n final Collection<Graph> returnedGraphs = store.getGraphs(blankUser, null, ignore);\n\n // Then\n final Set<String> graphIds = re... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(Store.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(Store.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": ... | {
"body": "public Collection<Graph> getGraphs(final User user, final String graphIdsCsv, final Operation operation) {\n Collection<Graph> rtn = new ArrayList<>();\n if (nonNull(operation)) {\n String optionKey = FEDERATED_STORE_PROCESSED + id;\n boolean isIdFound = !operation.getOp... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_995 | {
"fields": [],
"file": "core/serialisation/src/test/java/uk/gov/gchq/gaffer/serialisation/util/JsonSerialisationUtilTest.java",
"identifier": "JsonSerialisationUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testClassWithJustTypeParam() {\n // Given\n final String classWithTypeParamName = ClassWithTypeParam.class.getName();\n\n // When\n final Map<String, String> result = JsonSerialisationUtil.getSerialisedFieldClasses(classWithTypeParamName);\n\n // Th... | {
"fields": [
{
"declarator": "cache = Collections.emptyMap()",
"modifier": "private static",
"original_string": "private static Map<String, Map<String, String>> cache = Collections.emptyMap();",
"type": "Map<String, Map<String, String>>",
"var_name": "cache"
}
],
"file": "co... | {
"body": "public static Map<String, String> getSerialisedFieldClasses(final String className) {\n final Map<String, String> cachedResult = cache.get(className);\n if (null != cachedResult) {\n return cachedResult;\n }\n\n final Class<?> clazz;\n try {\n clazz ... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1114 | {
"fields": [
{
"declarator": "OP_AUTHS_PATH = \"/opAuthoriser.json\"",
"modifier": "private static final",
"original_string": "private static final String OP_AUTHS_PATH = \"/opAuthoriser.json\";",
"type": "String",
"var_name": "OP_AUTHS_PATH"
},
{
"declarator": "USER =... | {
"body": "@Test\n public void shouldRejectOperationChainWhenUserDoesntHaveAllOpAuthsForAddNamedOperation() {\n // Given\n final OperationAuthoriser hook = fromJson(OP_AUTHS_PATH);\n final AddNamedOperation addNamedOperation = new AddNamedOperation.Builder()\n .operationChain(\"... | {
"fields": [
{
"declarator": "allAuths = new HashSet<>()",
"modifier": "private final",
"original_string": "private final Set<String> allAuths = new HashSet<>();",
"type": "Set<String>",
"var_name": "allAuths"
},
{
"declarator": "auths = new HashMap<>()",
"modifi... | {
"body": "@Override\n public void preExecute(final OperationChain<?> opChain, final Context context) {\n if (null != opChain) {\n for (final Operation operation : opChain.getOperations()) {\n authorise(operation, context.getUser());\n }\n authorise(opChain, c... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_429 | {
"fields": [],
"file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/element/function/UnwrapEntityIdTest.java",
"identifier": "UnwrapEntityIdTest",
"interfaces": "",
"superclass": "extends FunctionTest"
} | {
"body": "@Test\n public void shouldReturnOriginalValueForEdgeIds() {\n // Given\n final EdgeId value = mock(EdgeId.class);\n final UnwrapEntityId function = new UnwrapEntityId();\n\n // When\n final Object result = function.apply(value);\n\n // Then\n assertSame(v... | {
"fields": [],
"file": "core/data/src/main/java/uk/gov/gchq/gaffer/data/element/function/UnwrapEntityId.java",
"identifier": "UnwrapEntityId",
"interfaces": "",
"methods": [
{
"class_method_signature": "UnwrapEntityId.apply(final Object item)",
"constructor": false,
"full_signature": "@... | {
"body": "@Override\n public Object apply(final Object item) {\n return null != item ? item instanceof EntityId ? ((EntityId) item).getVertex() : item : null;\n }",
"class_method_signature": "UnwrapEntityId.apply(final Object item)",
"constructor": false,
"full_signature": "@Override public 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_583 | {
"fields": [],
"file": "core/type/src/test/java/uk/gov/gchq/gaffer/types/function/ToTypeSubTypeValueTest.java",
"identifier": "ToTypeSubTypeValueTest",
"interfaces": "",
"superclass": "extends FunctionTest"
} | {
"body": "@Test\n public void shouldConvertNullToTypeSubTypeValue() {\n // Given\n final ToTypeSubTypeValue function = new ToTypeSubTypeValue();\n\n // When\n final TypeSubTypeValue result = function.apply(null);\n\n // Then\n assertEquals(new TypeSubTypeValue(null, null,... | {
"fields": [],
"file": "core/type/src/main/java/uk/gov/gchq/gaffer/types/function/ToTypeSubTypeValue.java",
"identifier": "ToTypeSubTypeValue",
"interfaces": "",
"methods": [
{
"class_method_signature": "ToTypeSubTypeValue.apply(final Object value)",
"constructor": false,
"full_signatur... | {
"body": "@Override\n public TypeSubTypeValue apply(final Object value) {\n return new TypeSubTypeValue(null, null, null != value ? value.toString() : null);\n }",
"class_method_signature": "ToTypeSubTypeValue.apply(final Object value)",
"constructor": false,
"full_signature": "@Override public Ty... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1051 | {
"fields": [],
"file": "core/serialisation/src/test/java/uk/gov/gchq/gaffer/serialisation/implementation/raw/RawFloatSerialiserTest.java",
"identifier": "RawFloatSerialiserTest",
"interfaces": "",
"superclass": "extends ToBytesSerialisationTest<Float>"
} | {
"body": "@Test\n public void cantSerialiseStringClass() {\n assertFalse(serialiser.canHandle(String.class));\n }",
"class_method_signature": "RawFloatSerialiserTest.cantSerialiseStringClass()",
"constructor": false,
"full_signature": "@Test public void cantSerialiseStringClass()",
"identifier":... | {
"fields": [
{
"declarator": "serialVersionUID = -8573401558869574875L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -8573401558869574875L;",
"type": "long",
"var_name": "serialVersionUID"
}
],
"file": "core/serialisat... | {
"body": "@Override\n public boolean canHandle(final Class clazz) {\n return Float.class.equals(clazz);\n }",
"class_method_signature": "RawFloatSerialiser.canHandle(final Class clazz)",
"constructor": false,
"full_signature": "@Override public boolean canHandle(final Class clazz)",
"identifier"... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_350 | {
"fields": [
{
"declarator": "EDGE_AB = new Edge.Builder().group(TestGroups.EDGE).source(\"A\").dest(\"B\").directed(true).build()",
"modifier": "private static final",
"original_string": "private static final Edge EDGE_AB = new Edge.Builder().group(TestGroups.EDGE).source(\"A\").dest(\"B\").di... | {
"body": "@Test\n public void shouldReturnEdgesFromWalkObject() {\n // Given\n final Function<Walk, Iterable<Set<Edge>>> function = new ExtractWalkEdges();\n final Walk walk = new Walk.Builder()\n .edge(EDGE_AB)\n .entity(ENTITY_B)\n .edge(EDGE_BC)... | {
"fields": [],
"file": "core/data/src/main/java/uk/gov/gchq/gaffer/data/graph/function/walk/ExtractWalkEdges.java",
"identifier": "ExtractWalkEdges",
"interfaces": "",
"methods": [
{
"class_method_signature": "ExtractWalkEdges.apply(final Walk walk)",
"constructor": false,
"full_signatu... | {
"body": "@Override\n public Iterable<Set<Edge>> apply(final Walk walk) {\n if (null == walk) {\n throw new IllegalArgumentException(\"Walk cannot be null\");\n }\n return walk.getEdges();\n }",
"class_method_signature": "ExtractWalkEdges.apply(final Walk walk)",
"constructo... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.