id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
6944525_489 | {
"fields": [
{
"declarator": "_mockRestLiRequestData",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private RestLiRequestData _mockRestLiRequestData;",
"type": "RestLiRequestData",
"var_name": "_mockRestLiRequestData"
},
{
"declarator": "_mockFilterChai... | {
"body": "@SuppressWarnings(\"unchecked\")\n @Test\n public void testFilterInvocationRequestErrorOnError() throws Exception\n {\n _restLiFilterChain = new RestLiFilterChain(Arrays.asList(_filters),\n _mockFilterChainDispatcher, _mockFilterChainCallback);\n _filters[1] = new CountFilterRequestErrorOnE... | {
"fields": [
{
"declarator": "_filterChainIterator",
"modifier": "private final",
"original_string": "private final RestLiFilterChainIterator _filterChainIterator;",
"type": "RestLiFilterChainIterator",
"var_name": "_filterChainIterator"
}
],
"file": "restli-server/src/main/... | {
"body": "public void onRequest(FilterRequestContext requestContext,\n RestLiFilterResponseContextFactory filterResponseContextFactory)\n {\n // Initiate the filter chain iterator. The RestLiCallback will be passed to the method invoker at the end of the\n // filter chain.\n _filterC... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_523 | {
"fields": [],
"file": "restli-server/src/test/java/com/linkedin/restli/internal/server/response/TestRestLiResponseEnvelope.java",
"identifier": "TestRestLiResponseEnvelope",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(dataProvider = \"envelopeResourceMethodDataProvider\")\n public void testEnvelopeResponseType(RestLiResponseEnvelope responseEnvelope, ResourceMethod resourceMethod)\n {\n if (!ResponseTypeUtil.isDynamicallyDetermined(resourceMethod))\n {\n ResponseType responseType = ResponseTypeUtil.fr... | {
"fields": [
{
"declarator": "_status",
"modifier": "private",
"original_string": "private HttpStatus _status;",
"type": "HttpStatus",
"var_name": "_status"
},
{
"declarator": "_exception",
"modifier": "private",
"original_string": "private RestLiServiceExc... | {
"body": "public abstract ResponseType getResponseType();",
"class_method_signature": "RestLiResponseEnvelope.getResponseType()",
"constructor": false,
"full_signature": "public abstract ResponseType getResponseType()",
"identifier": "getResponseType",
"invocations": [],
"modifiers": "public abstract",
... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_466 | {
"fields": [
{
"declarator": "JSON_TYPE = \"application/json\"",
"modifier": "private static final",
"original_string": "private static final String JSON_TYPE = \"application/json\";",
"type": "String",
"var_name": "JSON_TYPE"
},
{
"declarator": "PSON_TYPE = \"applicat... | {
"body": "@Test\n public void testRecord() throws CloneNotSupportedException\n {\n RecordBar bar = new RecordBar();\n bar.setLocation(\"mountain view\");\n RecordBar expected = bar.copy();\n\n // Introduce bad elements\n bar.data().put(\"SF\", \"CA\");\n\n Assert.assertEquals(bar.data().size(), 2... | {
"fields": [
{
"declarator": "EMPTY_DATAMAP = new DataMap()",
"modifier": "private static final",
"original_string": "private static final DataMap EMPTY_DATAMAP = new DataMap();",
"type": "DataMap",
"var_name": "EMPTY_DATAMAP"
}
],
"file": "restli-server/src/main/java/com/li... | {
"body": "public static void trimRecordTemplate(RecordTemplate recordTemplate, MaskTree override, final boolean failOnMismatch)\n {\n trimRecordTemplate(recordTemplate.data(), recordTemplate.schema(), override, failOnMismatch);\n }",
"class_method_signature": "RestUtils.trimRecordTemplate(RecordTemplate recor... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_348 | {
"fields": [
{
"declarator": "ITERATIONS = 100000",
"modifier": "private static final",
"original_string": "private static final int ITERATIONS = 100000;",
"type": "int",
"var_name": "ITERATIONS"
},
{
"declarator": "EXPECTED_PRECISSION = 0.5",
"modifier": "privat... | {
"body": "@Test\n public void testValuesOutOfRange()\n {\n BoundedCostBackupRequestsStrategy strategy = new BoundedCostBackupRequestsStrategy(5, 64, 1024, 128, 0);\n\n BackupRequestsSimulator simulator = new BackupRequestsSimulator(new PoissonEventsArrival(200, TimeUnit.SECONDS),\n new GaussianRespons... | {
"fields": [
{
"declarator": "UNREASONABLE_HISTORY_LENGTH = (128 * 1024 * 1024) / 8",
"modifier": "private static final",
"original_string": "private static final int UNREASONABLE_HISTORY_LENGTH = (128 * 1024 * 1024) / 8;",
"type": "int",
"var_name": "UNREASONABLE_HISTORY_LENGTH"
... | {
"body": "@Override\n public Optional<Long> getTimeUntilBackupRequestNano()\n {\n _costLimiter.arrive();\n\n synchronized (_lock)\n {\n if (_histogramReady)\n {\n return Optional.of(Math.max(_minBackupDelayNano, _histogram.getValueAtPercentile(_percentile)));\n } else\n {\n ... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_10 | {
"fields": [],
"file": "data-transform/src/test/java/com/linkedin/data/transform/TestEscaper.java",
"identifier": "TestEscaper",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testEscaping()\n {\n assertEquals(Escaper.replaceAll(\"\", \"$\", \"$$\"), \"\");\n assertEquals(Escaper.replaceAll(\"$\", \"$\", \"$$\"), \"$$\");\n assertEquals(Escaper.replaceAll(\" $\", \"$\", \"$$\"), \" $$\");\n assertEquals(Escaper.replaceAll(\" $ \", \"$\", \"$$\")... | {
"fields": [],
"file": "data-transform/src/main/java/com/linkedin/data/transform/Escaper.java",
"identifier": "Escaper",
"interfaces": "",
"methods": [
{
"class_method_signature": "Escaper.escapePathSegment(String segment)",
"constructor": false,
"full_signature": "public static String ... | {
"body": "public static String replaceAll(String s, final String what, final String withWhat)\n {\n StringBuilder sb = null;\n int fromIndex = 0; //index of last found '$' char + 1\n boolean found = false;\n int length = s.length();\n do\n {\n final int index = s.indexOf(what, fromIndex);... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_574 | {
"fields": [
{
"declarator": "DEBUG_HANDLER_RESPONSE_A = \"Response A\"",
"modifier": "private static final",
"original_string": "private static final String DEBUG_HANDLER_RESPONSE_A = \"Response A\";",
"type": "String",
"var_name": "DEBUG_HANDLER_RESPONSE_A"
},
{
"dec... | {
"body": "@Test(dataProvider = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + \"protocolVersions\")\n public void testPreprocessingError(final ProtocolVersion protocolVersion, final String errorResponseHeaderName,\n final RestOrStream restOrStream) throws Exception\n {\n //Bad ke... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(RestLiServer.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(RestLiServer.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
... | {
"body": "@Override\n public void handleRequest(RestRequest request, RequestContext requestContext, Callback<RestResponse> callback)\n {\n //This code path cannot accept content types or accept types that contain\n //multipart/related. This is because these types of requests will usually have very large payl... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_124 | {
"fields": [],
"file": "restli-client/src/test/java/com/linkedin/restli/internal/client/TestQueryParamsUtil.java",
"identifier": "TestQueryParamsUtil",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test (expectedExceptions = IllegalArgumentException.class,\n expectedExceptionsMessageRegExp = \"Map key '1' is not of type String\")\n public void testNonStringKeyToDataMap()\n {\n Map<String, Object> queryParams = new HashMap<>();\n\n Map<Object, Object> hashMapParam = new HashMap<>();\n ... | {
"fields": [],
"file": "restli-client/src/main/java/com/linkedin/restli/internal/client/QueryParamsUtil.java",
"identifier": "QueryParamsUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "QueryParamsUtil.convertToDataMap(Map<String, Object> queryParams)",
"constructor": false,... | {
"body": "public static DataMap convertToDataMap(Map<String, Object> queryParams)\n {\n return convertToDataMap(queryParams, Collections.<String, Class<?>>emptyMap(),\n AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(),\n RestLiProjectionDataMapSerializer.DEFAULT_SERIALIZER);\n }",
... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_3 | {
"fields": [],
"file": "data-transform/src/test/java/com/linkedin/data/transform/TestProjectionUtil.java",
"identifier": "TestProjectionUtil",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testNullFilter()\n {\n Assert.assertTrue(ProjectionUtil.isPathPresent(null, new PathSpec(\"foo\")));\n }",
"class_method_signature": "TestProjectionUtil.testNullFilter()",
"constructor": false,
"full_signature": "@Test public void testNullFilter()",
"identifier": "testNull... | {
"fields": [],
"file": "data-transform/src/main/java/com/linkedin/data/transform/ProjectionUtil.java",
"identifier": "ProjectionUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "ProjectionUtil.isPathPresent(MaskTree filter, PathSpec path)",
"constructor": false,
"full_s... | {
"body": "public static boolean isPathPresent(MaskTree filter, PathSpec path)\n {\n return !getPresentPaths(filter, Collections.singleton(path)).isEmpty();\n }",
"class_method_signature": "ProjectionUtil.isPathPresent(MaskTree filter, PathSpec path)",
"constructor": false,
"full_signature": "public static... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_431 | {
"fields": [
{
"declarator": "DEFAULT_PARTITION_ID = DefaultPartitionAccessor.DEFAULT_PARTITION_ID",
"modifier": "private static final",
"original_string": "private static final int DEFAULT_PARTITION_ID = DefaultPartitionAccessor.DEFAULT_PARTITION_ID;",
"type": "int",
"var_name": "D... | {
"body": "@Test(groups = { \"small\", \"back-end\" })\n public void testFactoryWithMultiProbeAndHashMethod() {\n RingFactory<String> factory = new DelegatingRingFactory<>(configBuilder(\"multiProbe\", \"uriRegex\"));\n Ring<String> ring = factory.createRing(buildPointsMap(10));\n\n assertTrue(ring instance... | {
"fields": [
{
"declarator": "POINT_BASED_CONSISTENT_HASH = \"pointBased\"",
"modifier": "public static final",
"original_string": "public static final String POINT_BASED_CONSISTENT_HASH = \"pointBased\";",
"type": "String",
"var_name": "POINT_BASED_CONSISTENT_HASH"
},
{
... | {
"body": "@Override\n public Ring<T> createRing(Map<T, Integer> pointsMap) {\n return _ringFactory.createRing(pointsMap);\n }",
"class_method_signature": "DelegatingRingFactory.createRing(Map<T, Integer> pointsMap)",
"constructor": false,
"full_signature": "@Override public Ring<T> createRing(Map<T, Integ... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_446 | {
"fields": [],
"file": "restli-server/src/test/java/com/linkedin/restli/internal/server/TestResourceContextImpl.java",
"identifier": "TestResourceContextImpl",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetEmptyCustomContextData() throws RestLiSyntaxException\n {\n final ResourceContextImpl context = new ResourceContextImpl();\n Optional<Object> foo = context.getCustomContextData(\"foo\");\n Assert.assertFalse(foo.isPresent());\n }",
"class_method_signature": "TestRes... | {
"fields": [
{
"declarator": "INITIAL_CUSTOM_REQUEST_CONTEXT_CAPACITY = 1",
"modifier": "private static final",
"original_string": "private static final int INITIAL_CUSTOM_REQUEST_CONTEXT_CAPACITY = 1;",
"type": "int",
"var_name": "INITIAL_CUSTOM_REQUEST_CONTEXT_CAPACITY"
},
... | {
"body": "@Override\n public Optional<Object> getCustomContextData(String key)\n {\n if (_customRequestContext != null && key != null && !key.isEmpty() && _customRequestContext.containsKey(key))\n {\n return Optional.of(_customRequestContext.get(key));\n }\n return Optional.empty();\n }",
"clas... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_153 | {
"fields": [],
"file": "restli-client/src/test/java/com/linkedin/restli/client/TestRequest.java",
"identifier": "TestRequest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testResourceProperties()\n {\n Set<ResourceMethod> expectedSupportedMethods = new HashSet<ResourceMethod>();\n expectedSupportedMethods.add(ResourceMethod.GET);\n expectedSupportedMethods.add(ResourceMethod.BATCH_PARTIAL_UPDATE);\n\n ResourceSpec expectedResourceSpec = new... | {
"fields": [
{
"declarator": "SLASH_PATTERN = Pattern.compile(\"/\")",
"modifier": "private static final",
"original_string": "private static final Pattern SLASH_PATTERN = Pattern.compile(\"/\");",
"type": "Pattern",
"var_name": "SLASH_PATTERN"
},
{
"declarator": "URI_... | {
"body": "public ResourceProperties getResourceProperties()\n {\n return _resourceProperties;\n }",
"class_method_signature": "Request.getResourceProperties()",
"constructor": false,
"full_signature": "public ResourceProperties getResourceProperties()",
"identifier": "getResourceProperties",
"invocati... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_503 | {
"fields": [],
"file": "restli-server/src/test/java/com/linkedin/restli/internal/server/methods/arguments/TestArgumentBuilder.java",
"identifier": "TestArgumentBuilder",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n @SuppressWarnings(\"deprecation\")\n public void testPathKeyParameterType()\n {\n String testParamKey = \"testParam\";\n String expectedTestParamValue = \"testParamValue\";\n\n // mock setup\n ServerResourceContext mockResourceContext = EasyMock.createMock(ServerResourceContext.class... | {
"fields": [],
"file": "restli-server/src/main/java/com/linkedin/restli/internal/server/methods/arguments/ArgumentBuilder.java",
"identifier": "ArgumentBuilder",
"interfaces": "",
"methods": [
{
"class_method_signature": "ArgumentBuilder.buildArgs(final Object[] positionalArguments,\n ... | {
"body": "@SuppressWarnings(\"deprecation\")\n static Object[] buildArgs(final Object[] positionalArguments,\n final ResourceMethodDescriptor resourceMethod,\n final ServerResourceContext context,\n final DynamicRe... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_67 | {
"fields": [
{
"declarator": "referenceList1 = new ArrayList<Object>()",
"modifier": "final static",
"original_string": "final static List<Object> referenceList1 = new ArrayList<Object>();",
"type": "List<Object>",
"var_name": "referenceList1"
},
{
"declarator": "RL1_B... | {
"body": "@Test\n public void testDataListNoCyclesOnAdd()\n {\n // test with DataList\n\n DataList a = new DataList();\n DataList b = new DataList();\n DataList c = new DataList();\n\n a.add(b);\n a.add(c);\n\n assertTrue(Data.objectIsAcyclic(a));\n\n DataList d = new DataList();\n b.add... | {
"fields": [
{
"declarator": "NULL = Null.getInstance()",
"modifier": "public static final",
"original_string": "public static final Null NULL = Null.getInstance();",
"type": "Null",
"var_name": "NULL"
},
{
"declarator": "UTF_8_CHARSET = Charset.forName(\"UTF-8\")",
... | {
"body": "static boolean objectIsAcyclic(Object object)\n {\n if (object == null)\n {\n return true;\n }\n\n Class<?> klass = object.getClass();\n if (isPrimitiveClass(klass))\n {\n return true;\n }\n else if (isComplexClass(klass))\n {\n DataComplex complex = (DataComplex)... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_295 | {
"fields": [],
"file": "r2-core/src/test/java/com/linkedin/r2/util/TestConfigValueExtractor.java",
"identifier": "TestConfigValueExtractor",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testListAndString()\n {\n List<String> inputList = new ArrayList<String>();\n inputList.add(\"foo\");\n inputList.add(\"bar\");\n inputList.add(\"baz\");\n\n List<String> configForList = ConfigValueExtractor.buildList(inputList, \",\");\n List<String> configForString... | {
"fields": [],
"file": "r2-core/src/main/java/com/linkedin/r2/util/ConfigValueExtractor.java",
"identifier": "ConfigValueExtractor",
"interfaces": "",
"methods": [
{
"class_method_signature": "ConfigValueExtractor.buildList(Object propertyValue, String listSeparator)",
"constructor": false,
... | {
"body": "public static List<String> buildList(Object propertyValue, String listSeparator)\n {\n List<String> valueList = new ArrayList<String>();\n if (propertyValue != null)\n {\n if (propertyValue instanceof List<?>)\n {\n @SuppressWarnings(\"unchecked\")\n List<String> list = (L... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_88 | {
"fields": [
{
"declarator": "fooSchemaText =\n \"{\" +\n \" \\\"name\\\" : \\\"Foo\\\",\" +\n \" \\\"type\\\" : \\\"record\\\",\" +\n \" \\\"fields\\\" : [\" +\n \" { \\\"name\\\" : \\\"intField\\\", \\\"type\\\" : \\\"int\\\", \\\"optional\\\" : true },\" +\n \" { \... | {
"body": "@Test\n public void testCopyField() throws Exception\n {\n RecordDataSchema fooSchema = (RecordDataSchema) TestUtil.dataSchemaFromString(fooSchemaText);\n RecordDataSchema.Field field = fooSchema.getField(\"intField\");\n // Use old field to do the exact copy\n RecordDataSchema.Field newField... | {
"fields": [],
"file": "data/src/main/java/com/linkedin/data/schema/util/CopySchemaUtil.java",
"identifier": "CopySchemaUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "CopySchemaUtil.buildSkeletonSchema(DataSchema schema)",
"constructor": false,
"full_signature": "pub... | {
"body": "public static RecordDataSchema.Field copyField(RecordDataSchema.Field originalField, DataSchema fieldSchemaToReplace)\n {\n RecordDataSchema.Field newField = new RecordDataSchema.Field(fieldSchemaToReplace);\n if (originalField.getAliases() != null)\n {\n newField.setAliases(originalField.ge... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_411 | {
"fields": [
{
"declarator": "CONTENT = ByteString.copy(new byte[8092])",
"modifier": "private static final",
"original_string": "private static final ByteString CONTENT = ByteString.copy(new byte[8092]);",
"type": "ByteString",
"var_name": "CONTENT"
},
{
"declarator":... | {
"body": "@Test\n public void testStreamRetryNoAvailableHosts() throws Exception\n {\n SimpleLoadBalancer balancer = prepareLoadBalancer(Arrays.asList(\"http://test.linkedin.com/retry1\", \"http://test.linkedin.com/retry2\"));\n\n DynamicClient dynamicClient = new DynamicClient(balancer, null);\n RetryCli... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(RetryClient.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(RetryClient.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator... | {
"body": "@Override\n public void streamRequest(StreamRequest request, Callback<StreamResponse> callback)\n {\n streamRequest(request, new RequestContext(), callback);\n }",
"class_method_signature": "RetryClient.streamRequest(StreamRequest request, Callback<StreamResponse> callback)",
"constructor": false... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_554 | {
"fields": [
{
"declarator": "CODEC = new JacksonDataCodec()",
"modifier": "private static final",
"original_string": "private static final JacksonDataCodec CODEC = new JacksonDataCodec();",
"type": "JacksonDataCodec",
"var_name": "CODEC"
},
{
"declarator": "MAXIMUM_RE... | {
"body": "@Test(dataProvider = \"multiplexerConfigurations\")\n public void testResponseCookiesAggregated(MultiplexerRunMode multiplexerRunMode) throws Exception\n {\n // Per security review: We should not make cookies for each individual responses visible to the client (especially if the cookie is HttpOnly).\n... | {
"fields": [
{
"declarator": "MUX_PLAN_CLASS = \"mux\"",
"modifier": "private static final",
"original_string": "private static final String MUX_PLAN_CLASS = \"mux\";",
"type": "String",
"var_name": "MUX_PLAN_CLASS"
},
{
"declarator": "MUX_URI_PATH = \"/mux\"",
"... | {
"body": "@Override\n public void handleRequest(RestRequest request, RequestContext requestContext, final Callback<RestResponse> callback)\n {\n if (HttpMethod.POST != HttpMethod.valueOf(request.getMethod()))\n {\n _log.error(\"POST is expected, but \" + request.getMethod() + \" received\");\n call... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_104 | {
"fields": [],
"file": "data/src/test/java/com/linkedin/util/TestFastByteArrayOutputStream.java",
"identifier": "TestFastByteArrayOutputStream",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n @SuppressWarnings(\"unchecked\")\n public void testAddBuffer() throws Exception\n {\n FastByteArrayOutputStream testStream = new FastByteArrayOutputStream();\n Field bufferListField = testStream.getClass().getDeclaredField(\"_bufferList\");\n bufferListField.setAccessible(true);\n //... | {
"fields": [
{
"declarator": "DEFAULT_BUFFER_SIZE = 256",
"modifier": "private static final",
"original_string": "private static final int DEFAULT_BUFFER_SIZE = 256;",
"type": "int",
"var_name": "DEFAULT_BUFFER_SIZE"
},
{
"declarator": "_bufferList = new LinkedList<byt... | {
"body": "private void addBuffer(int minCapacity)\n {\n if (this._bufferList.peekLast() != null)\n {\n this._alreadyBufferedSize += this._index;\n this._index = 0;\n }\n if (this._nextBufferSize < minCapacity)\n {\n this._nextBufferSize = nextPowerOf2(minCapacity);\n }\n\n // Mak... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_387 | {
"fields": [
{
"declarator": "HOST_OVERRIDE_LIST = \"HOST_OVERRIDE_LIST\"",
"modifier": "private static final",
"original_string": "private static final String HOST_OVERRIDE_LIST = \"HOST_OVERRIDE_LIST\";",
"type": "String",
"var_name": "HOST_OVERRIDE_LIST"
},
{
"decla... | {
"body": "@Test(dataProvider = \"provideKeys\")\n public void testClusterInfoProvider(int numHttp, int numHttps, int expectedNumHttp, int expectedNumHttps,\n int partitionIdForAdd, int partitionIdForCheck)\n throws InterruptedException, ExecutionException, ServiceUnavailableException\n {\n MockStore<S... | {
"fields": [
{
"declarator": "HOST_OVERRIDE_LIST = \"HOST_OVERRIDE_LIST\"",
"modifier": "private static final",
"original_string": "private static final String HOST_OVERRIDE_LIST = \"HOST_OVERRIDE_LIST\";",
"type": "String",
"var_name": "HOST_OVERRIDE_LIST"
},
{
"decla... | {
"body": "@Override\n public int getClusterCount(String clusterName, String scheme, int partitionId) throws ServiceUnavailableException\n {\n FutureCallback<Integer> clusterCountFutureCallback = new FutureCallback<>();\n\n _state.listenToCluster(clusterName, (type, name) ->\n {\n if (_state.getUriPro... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_30 | {
"fields": [],
"file": "r2-disruptor/src/test/java/com/linkedin/r2/disruptor/TestDisruptContexts.java",
"identifier": "TestDisruptContexts",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expectedExceptions = IllegalArgumentException.class)\n public void testErrorIllegal()\n {\n final long latency = -4200;\n DisruptContexts.error(latency);\n }",
"class_method_signature": "TestDisruptContexts.testErrorIllegal()",
"constructor": false,
"full_signature": "@Test(expectedExc... | {
"fields": [],
"file": "r2-disruptor/src/main/java/com/linkedin/r2/disruptor/DisruptContexts.java",
"identifier": "DisruptContexts",
"interfaces": "",
"methods": [
{
"class_method_signature": "DisruptContexts.delay(long delay)",
"constructor": false,
"full_signature": "public static Dis... | {
"body": "public static DisruptContext error(long latency)\n {\n if (latency < 0)\n {\n throw new IllegalArgumentException(\"Latency cannot be smaller than 0\");\n }\n return new ErrorDisruptContext(latency);\n }",
"class_method_signature": "DisruptContexts.error(long latency)",
"constructor":... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_368 | {
"fields": [
{
"declarator": "TOLERANCE = 0.05d",
"modifier": "private static final",
"original_string": "private static final double TOLERANCE = 0.05d;",
"type": "double",
"var_name": "TOLERANCE"
},
{
"declarator": "RANDOM_SEED = 42",
"modifier": "private static... | {
"body": "@Test(dataProvider = \"ringFactories\")\n public void testAllPartitionMultipleHostsStickKey(RingFactory<URI> ringFactory) throws URISyntaxException, ServiceUnavailableException\n {\n int numHost = 2;\n URI serviceURI = new URI(\"d2://articles\");\n\n ConsistentHashKeyMapper mapper = getConsisten... | {
"fields": [
{
"declarator": "_hashFunction",
"modifier": "private final",
"original_string": "private final HashFunction<String[]> _hashFunction;",
"type": "HashFunction<String[]>",
"var_name": "_hashFunction"
},
{
"declarator": "_ringProvider",
"modifier": "pri... | {
"body": "@Override\n public HostToKeyMapper<Integer> getAllPartitionsMultipleHosts(URI serviceUri, int numHostPerPartition)\n throws ServiceUnavailableException\n {\n return getHostToKeyMapper(serviceUri, null, numHostPerPartition, null);\n }",
"class_method_signature": "ConsistentHashKeyMapper.getAllP... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_407 | {
"fields": [
{
"declarator": "CONTENT = ByteString.copy(new byte[8092])",
"modifier": "private static final",
"original_string": "private static final ByteString CONTENT = ByteString.copy(new byte[8092]);",
"type": "ByteString",
"var_name": "CONTENT"
},
{
"declarator":... | {
"body": "@Test\n public void testStreamException() throws Exception\n {\n SimpleLoadBalancer balancer = prepareLoadBalancer(Arrays.asList(\"http://test.linkedin.com/retry1\", \"http://test.linkedin.com/bad\"));\n\n DynamicClient dynamicClient = new DynamicClient(balancer, null);\n RetryClient client = ne... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(RetryClient.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(RetryClient.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator... | {
"body": "@Override\n public void streamRequest(StreamRequest request, Callback<StreamResponse> callback)\n {\n streamRequest(request, new RequestContext(), callback);\n }",
"class_method_signature": "RetryClient.streamRequest(StreamRequest request, Callback<StreamResponse> callback)",
"constructor": false... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_112 | {
"fields": [],
"file": "restli-client-util-recorder/src/test/java/com/linkedin/restli/client/util/TestPatchTreeRecorder.java",
"identifier": "TestPatchTreeRecorder",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expectedExceptions = IllegalArgumentException.class)\n public void testPropagateIntoUnsupportedSimpleType()\n {\n PatchTreeRecorder<PatchTreeTestModel> pc = makeOne();\n pc.getRecordingProxy().getFooRequired();\n }",
"class_method_signature": "TestPatchTreeRecorder.testPropagateIntoUnsuppo... | {
"fields": [
{
"declarator": "_templateProxy",
"modifier": "private final",
"original_string": "private final T _templateProxy;",
"type": "T",
"var_name": "_templateProxy"
},
{
"declarator": "_patchTree",
"modifier": "private final",
"original_string": "pri... | {
"body": "public T getRecordingProxy()\n {\n return _templateProxy;\n }",
"class_method_signature": "PatchTreeRecorder.getRecordingProxy()",
"constructor": false,
"full_signature": "public T getRecordingProxy()",
"identifier": "getRecordingProxy",
"invocations": [],
"modifiers": "public",
"paramet... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_542 | {
"fields": [
{
"declarator": "WHITELISTED_FIELD_NAME = \"$URN\"",
"modifier": "private static final",
"original_string": "private static final String WHITELISTED_FIELD_NAME = \"$URN\";",
"type": "String",
"var_name": "WHITELISTED_FIELD_NAME"
},
{
"declarator": "filterR... | {
"body": "@Test(dataProvider = \"returnEntityValidateOnResponseData\")\n @SuppressWarnings({\"unchecked\", \"rawtypes\"})\n public void testReturnEntityValidateOnResponse(ResourceMethod resourceMethod, RestLiResponseData responseData,\n boolean isReturnEntityMethod, boolean isReturnEntityRequested)\n {\n ... | {
"fields": [
{
"declarator": "VALIDATING_SCHEMA_KEY = \"validatingSchema\"",
"modifier": "private static final",
"original_string": "private static final String VALIDATING_SCHEMA_KEY = \"validatingSchema\";",
"type": "String",
"var_name": "VALIDATING_SCHEMA_KEY"
},
{
"... | {
"body": "@SuppressWarnings(\"unchecked\")\n public CompletableFuture<Void> onResponse(final FilterRequestContext requestContext,\n final FilterResponseContext responseContext)\n {\n RestLiResponseData<?> responseData = responseContext.getResponseData();\n\n if (res... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_26 | {
"fields": [],
"file": "r2-disruptor/src/test/java/com/linkedin/r2/disruptor/TestDisruptContexts.java",
"identifier": "TestDisruptContexts",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expectedExceptions = IllegalArgumentException.class)\n public void testLatencyIllegal()\n {\n final long latency = -4200;\n DisruptContexts.delay(latency);\n }",
"class_method_signature": "TestDisruptContexts.testLatencyIllegal()",
"constructor": false,
"full_signature": "@Test(expecte... | {
"fields": [],
"file": "r2-disruptor/src/main/java/com/linkedin/r2/disruptor/DisruptContexts.java",
"identifier": "DisruptContexts",
"interfaces": "",
"methods": [
{
"class_method_signature": "DisruptContexts.delay(long delay)",
"constructor": false,
"full_signature": "public static Dis... | {
"body": "public static DisruptContext delay(long delay)\n {\n if (delay < 0)\n {\n throw new IllegalArgumentException(\"Delay cannot be smaller than 0\");\n }\n return new DelayDisruptContext(delay);\n }",
"class_method_signature": "DisruptContexts.delay(long delay)",
"constructor": false,
... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_391 | {
"fields": [
{
"declarator": "HOST_OVERRIDE_LIST = \"HOST_OVERRIDE_LIST\"",
"modifier": "private static final",
"original_string": "private static final String HOST_OVERRIDE_LIST = \"HOST_OVERRIDE_LIST\";",
"type": "String",
"var_name": "HOST_OVERRIDE_LIST"
},
{
"decla... | {
"body": "@Test (expectedExceptions = ServiceUnavailableException.class)\n @SuppressWarnings(\"deprecation\")\n public void testGetClient() throws Exception\n {\n\n Map<String, LoadBalancerStrategyFactory<? extends LoadBalancerStrategy>> loadBalancerStrategyFactories =\n new HashMap<String, LoadBalancer... | {
"fields": [
{
"declarator": "HOST_OVERRIDE_LIST = \"HOST_OVERRIDE_LIST\"",
"modifier": "private static final",
"original_string": "private static final String HOST_OVERRIDE_LIST = \"HOST_OVERRIDE_LIST\";",
"type": "String",
"var_name": "HOST_OVERRIDE_LIST"
},
{
"decla... | {
"body": "@Override\n public void getClient(Request request, RequestContext requestContext, Callback<TransportClient> clientCallback)\n {\n URI uri = request.getURI();\n debug(_log, \"get client for uri: \", uri);\n\n if (!D2_SCHEME_NAME.equalsIgnoreCase(uri.getScheme()))\n {\n throw new IllegalAr... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_684 | {
"fields": [
{
"declarator": "_res",
"modifier": "private",
"original_string": "private PhotoResource _res;",
"type": "PhotoResource",
"var_name": "_res"
}
],
"file": "restli-example-server/src/test/java/com/linkedin/restli/example/impl/TestPhotoResource.java",
"identifier... | {
"body": "@Test\n public void testResourcePurge()\n {\n // photo database is initialized to have 1 photo\n // at any time of the test, that initial photo should present for purge\n Assert.assertTrue(_res.purge() > 0);\n }",
"class_method_signature": "TestPhotoResource.testResourcePurge()",
"construct... | {
"fields": [
{
"declarator": "URN_ENTITY_TYPE = \"photo\"",
"modifier": "public final static",
"original_string": "public final static String URN_ENTITY_TYPE = \"photo\";",
"type": "String",
"var_name": "URN_ENTITY_TYPE"
},
{
"declarator": "_db",
"modifier": "@In... | {
"body": "@Action(name = \"purge\", resourceLevel = ResourceLevel.COLLECTION)\n public int purge()\n {\n final int numPurged = _db.getData().size();\n _db.getData().clear();\n\n AlbumEntryResource.purge(_entryDb, null, null);\n return numPurged;\n }",
"class_method_signature": "PhotoResource.purge()... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_450 | {
"fields": [],
"file": "restli-server/src/test/java/com/linkedin/restli/internal/server/TestResourceContextImpl.java",
"identifier": "TestResourceContextImpl",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testPathKeysImpl() throws RestLiSyntaxException\n {\n final ResourceContextImpl context = new ResourceContextImpl();\n MutablePathKeys mutablePathKeys = context.getPathKeys();\n mutablePathKeys.append(\"aKey\", \"aValue\")\n .append(\"bKey\", \"bValue\")\n .appe... | {
"fields": [
{
"declarator": "INITIAL_CUSTOM_REQUEST_CONTEXT_CAPACITY = 1",
"modifier": "private static final",
"original_string": "private static final int INITIAL_CUSTOM_REQUEST_CONTEXT_CAPACITY = 1;",
"type": "int",
"var_name": "INITIAL_CUSTOM_REQUEST_CONTEXT_CAPACITY"
},
... | {
"body": "@Override\n public MutablePathKeys getPathKeys()\n {\n return _pathKeys;\n }",
"class_method_signature": "ResourceContextImpl.getPathKeys()",
"constructor": false,
"full_signature": "@Override public MutablePathKeys getPathKeys()",
"identifier": "getPathKeys",
"invocations": [],
"modifier... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_515 | {
"fields": [
{
"declarator": "FS = File.separator",
"modifier": "final static",
"original_string": "final static String FS = File.separator;",
"type": "String",
"var_name": "FS"
},
{
"declarator": "testDir = System.getProperty(\"testDir\", new File(\"src/test\").getAbs... | {
"body": "@Test(dataProvider = \"default_serialization\")\n public void testGetAbsentFieldsDefaultValues(String caseFilename)\n {\n try\n {\n MultiFormatDataSchemaResolver schemaResolver = MultiFormatDataSchemaResolver.withBuiltinFormats(resolverDir);\n String expectedDataJsonFile = Files.readFile(... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ResponseUtils.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(ResponseUtils.class);",
"type": "Logger",
"var_name": "log"
}
],
"file": "rest... | {
"body": "public static Object fillInDataDefault(DataSchema schema, Object dataWithoutDefault)\n {\n try\n {\n switch (schema.getType())\n {\n case RECORD:\n return fillInDefaultOnRecord((RecordDataSchema) schema, (DataMap) dataWithoutDefault);\n case TYPEREF:\n retur... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_145 | {
"fields": [
{
"declarator": "TARGET_HOST_KEY_NAME = \"D2-KeyMapper-TargetHost\"",
"modifier": "private static final",
"original_string": "private static final String TARGET_HOST_KEY_NAME = \"D2-KeyMapper-TargetHost\";",
"type": "String",
"var_name": "TARGET_HOST_KEY_NAME"
},
... | {
"body": "@Test\n public void testMapUris() throws ServiceUnavailableException\n {\n URIMappingResult<Long> expectedMappingResult = new URIMappingResult<>(_mappedKeys, _unmappedKeys, _hostToPartitionId);\n when(_uriMapper.mapUris(_batchToUris)).thenReturn(expectedMappingResult);\n URIMappingResult<Long> m... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(DefaultScatterGatherStrategy.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(DefaultScatterGatherStrategy.class);",
"type": "Logger",
"var_name": "l... | {
"body": "@Override\n public <K> URIMappingResult<K> mapUris(List<URIKeyPair<K>> uris) throws ServiceUnavailableException\n {\n return _uriMapper.mapUris(uris);\n }",
"class_method_signature": "DefaultScatterGatherStrategy.mapUris(List<URIKeyPair<K>> uris)",
"constructor": false,
"full_signature": "@Over... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_71 | {
"fields": [],
"file": "data/src/test/java/com/linkedin/data/schema/TestDataSchema.java",
"identifier": "TestDataSchema",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testAliases() throws IOException\n {\n String[][] inputs =\n {\n {\n \"{ \\\"name\\\" : \\\"a\\\", \\\"type\\\" : \\\"fixed\\\", \\\"size\\\" : 5, \\\"aliases\\\" : [ \\\"b\\\", \\\"c.d\\\" ] }\",\n \"a\",\n \"b\",\n \"c.d\"\n },... | {
"fields": [
{
"declarator": "_type",
"modifier": "private final",
"original_string": "private final Type _type;",
"type": "Type",
"var_name": "_type"
},
{
"declarator": "_resolvedProperties = new HashMap<>()",
"modifier": "",
"original_string": "Map<String... | {
"body": "public abstract boolean hasError();",
"class_method_signature": "DataSchema.hasError()",
"constructor": false,
"full_signature": "public abstract boolean hasError()",
"identifier": "hasError",
"invocations": [],
"modifiers": "public abstract",
"parameters": "()",
"return": "boolean",
"sig... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_329 | {
"fields": [
{
"declarator": "_zkClient",
"modifier": "private",
"original_string": "private ZKConnection _zkClient;",
"type": "ZKConnection",
"var_name": "_zkClient"
},
{
"declarator": "_zkServer",
"modifier": "private",
"original_string": "private ZKServ... | {
"body": "@Test\n public void testMultiSymlink() throws InterruptedException\n {\n final CountDownLatch latch = new CountDownLatch(1);\n AsyncCallback.ChildrenCallback callback = new AsyncCallback.ChildrenCallback()\n {\n @Override\n public void processResult(int rc, String path, Object ctx, Lis... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(SymlinkAwareZooKeeper.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(SymlinkAwareZooKeeper.class);",
"type": "Logger",
"var_name": "LOG"
},
... | {
"body": "@Override\n public void getChildren(final String path, final boolean watch, final AsyncCallback.ChildrenCallback cb, final Object ctx)\n {\n if (!SymlinkUtil.containsSymlink(path))\n {\n _zk.getChildren(path, watch, cb, ctx);\n }\n else\n {\n SymlinkChildrenCallback compositeCall... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_283 | {
"fields": [
{
"declarator": "KEY = \"key\"",
"modifier": "private static final",
"original_string": "private static final String KEY = \"key\";",
"type": "String",
"var_name": "KEY"
},
{
"declarator": "VALUE = \"value\"",
"modifier": "private static final",
... | {
"body": "@Test\n public void testGetObjectWithKey()\n {\n _requestContext.putLocalAttr(KEY, VALUE);\n\n Assert.assertEquals(RequestContextUtil.getObjectWithKey(KEY, _requestContext, String.class), VALUE);\n }",
"class_method_signature": "TestRequestContextUtil.testGetObjectWithKey()",
"constructor": fa... | {
"fields": [],
"file": "r2-core/src/main/java/com/linkedin/r2/util/RequestContextUtil.java",
"identifier": "RequestContextUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "RequestContextUtil.RequestContextUtil()",
"constructor": true,
"full_signature": "private Request... | {
"body": "@SuppressWarnings(\"unchecked\")\n public static <T> T getObjectWithKey(String key, RequestContext requestContext, Class<T> clazz)\n {\n final Object object = requestContext.getLocalAttr(key);\n\n return (clazz.isInstance(object)) ? (T) object : null;\n }",
"class_method_signature": "RequestCont... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_581 | {
"fields": [
{
"declarator": "DEBUG_HANDLER_RESPONSE_A = \"Response A\"",
"modifier": "private static final",
"original_string": "private static final String DEBUG_HANDLER_RESPONSE_A = \"Response A\";",
"type": "String",
"var_name": "DEBUG_HANDLER_RESPONSE_A"
},
{
"dec... | {
"body": "@Test\n public void testRestRequestAttachmentsPresent() throws Exception\n {\n //This test verifies that a RestRequest sent to the RestLiServer throws an exception if the content type is multipart/related\n RestRequest contentTypeMultiPartRelated = new RestRequestBuilder(new URI(\"/statuses/abcd\")... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(RestLiServer.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(RestLiServer.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
... | {
"body": "@Override\n public void handleRequest(RestRequest request, RequestContext requestContext, Callback<RestResponse> callback)\n {\n //This code path cannot accept content types or accept types that contain\n //multipart/related. This is because these types of requests will usually have very large payl... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_352 | {
"fields": [],
"file": "d2/src/test/java/com/linkedin/d2/balancer/util/hashing/ConsistentHashRingTest.java",
"identifier": "ConsistentHashRingTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(groups = { \"small\", \"back-end\" })\n public void test2ItemsWithOnePoint()\n throws URISyntaxException\n {\n Map<URI, Integer> pointsMap = new HashMap<URI, Integer>();\n URI uri1 = new URI(\"http://ext23.corp.linkedin.com:231/ajdi\");\n URI uri2 = new URI(\"http://ext66.corp.linkedi... | {
"fields": [
{
"declarator": "_log = LoggerFactory.getLogger(ConsistentHashRing.class)",
"modifier": "private static final",
"original_string": "private static final Logger _log = LoggerFactory.getLogger(ConsistentHashRing.class);",
"type": "Logger",
"var_name": "_log"
},
{... | {
"body": "public T get(int key)\n {\n if (_points.isEmpty())\n {\n debug(_log, \"get called on a hash ring with nothing in it\");\n\n return null;\n }\n\n int index = getIndex(key);\n\n return _points.get(index).getT();\n }",
"class_method_signature": "ConsistentHashRing.get(int key)",
... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_217 | {
"fields": [],
"file": "restli-tools/src/test/java/com/linkedin/restli/tools/data/TestPredicateExpressionParser.java",
"identifier": "TestPredicateExpressionParser",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expectedExceptions = EmptyStackException.class)\n public void testAndMissingOperand2()\n {\n PredicateExpressionParser.parse(\"com.linkedin.data.it.AlwaysFalsePredicate & \");\n }",
"class_method_signature": "TestPredicateExpressionParser.testAndMissingOperand2()",
"constructor": false,
"... | {
"fields": [
{
"declarator": "TRIMMER_PATTERN = Pattern.compile(\"\\\\s\")",
"modifier": "private static final",
"original_string": "private static final Pattern TRIMMER_PATTERN = Pattern.compile(\"\\\\s\");",
"type": "Pattern",
"var_name": "TRIMMER_PATTERN"
},
{
"decl... | {
"body": "public static Predicate parse(String expression)\n {\n final Stack<Predicate> predicateStack = new Stack<Predicate>();\n final Stack<Character> operatorStack = new Stack<Character>();\n\n final String trimmedExpression = TRIMMER_PATTERN.matcher(expression).replaceAll(\"\");\n final StringToken... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_647 | {
"fields": [
{
"declarator": "NO_ESCAPING = URLEscaper.Escaping.NO_ESCAPING",
"modifier": "private static final",
"original_string": "private static final URLEscaper.Escaping NO_ESCAPING = URLEscaper.Escaping.NO_ESCAPING;",
"type": "URLEscaper.Escaping",
"var_name": "NO_ESCAPING"
... | {
"body": "@Test(dataProvider = \"lists\")\n public void testStringListElement(DataList list, String expectedElement)\n {\n String stringSimpleList = URIParamUtils.encodeElement(list, NO_ESCAPING, null);\n Assert.assertEquals(stringSimpleList, expectedElement);\n }",
"class_method_signature": "TestUriParam... | {
"fields": [
{
"declarator": "_EMPTY_STRING_ARRAY = new String[0]",
"modifier": "private static final",
"original_string": "private static final String[] _EMPTY_STRING_ARRAY = new String[0];",
"type": "String[]",
"var_name": "_EMPTY_STRING_ARRAY"
},
{
"declarator": "NO... | {
"body": "static String encodeElement(Object obj, URLEscaper.Escaping escaping, UriComponent.Type componentType)\n {\n StringBuilder builder = new StringBuilder();\n encodeDataObject(obj, escaping, componentType, builder);\n return builder.toString();\n }",
"class_method_signature": "URIParamUtils.encod... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_169 | {
"fields": [
{
"declarator": "DISRUPT_SOURCE_KEY = \"R2_DISRUPT_SOURCE\"",
"modifier": "public static final",
"original_string": "public static final String DISRUPT_SOURCE_KEY = \"R2_DISRUPT_SOURCE\";",
"type": "String",
"var_name": "DISRUPT_SOURCE_KEY"
},
{
"declarato... | {
"body": "@Test\n public void testSendRequest11()\n {\n when(_controller.getDisruptContext(any(String.class))).thenReturn(_disrupt);\n _client.sendRequest(_multiplexed);\n verify(_underlying, times(1)).sendRequest(eq(_multiplexed), any(RequestContext.class), any(Callback.class));;\n }",
"class_method_s... | {
"fields": [
{
"declarator": "_client",
"modifier": "private final",
"original_string": "private final Client _client;",
"type": "Client",
"var_name": "_client"
},
{
"declarator": "_controller",
"modifier": "private final",
"original_string": "private final... | {
"body": "@Override\n public <T> ResponseFuture<T> sendRequest(Request<T> request, RequestContext requestContext)\n {\n doEvaluateDisruptContext(request, requestContext);\n return _client.sendRequest(request, requestContext);\n }",
"class_method_signature": "DisruptRestClient.sendRequest(Request<T> reques... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_493 | {
"fields": [
{
"declarator": "context",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private ServerResourceContext context;",
"type": "ServerResourceContext",
"var_name": "context"
},
{
"declarator": "resourceMethod",
"modifier": "@Mock\n private... | {
"body": "@Test\n public void testGetActionReturnType()\n {\n when(resourceMethod.getMethodType()).thenReturn(ResourceMethod.ACTION);\n Mockito.doReturn(String.class).when(resourceMethod).getActionReturnType();\n FilterRequestContext filterContext = new FilterRequestContextInternalImpl(context, resourceMe... | {
"fields": [
{
"declarator": "_requestData",
"modifier": "private",
"original_string": "private RestLiRequestData _requestData;",
"type": "RestLiRequestData",
"var_name": "_requestData"
},
{
"declarator": "_context",
"modifier": "private final",
"original_s... | {
"body": "@Override\n public Class<?> getActionReturnType()\n {\n if (_resourceMethod.getMethodType() == ResourceMethod.ACTION)\n {\n return _resourceMethod.getActionReturnType();\n }\n return null;\n }",
"class_method_signature": "FilterRequestContextInternalImpl.getActionReturnType()",
"con... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_539 | {
"fields": [],
"file": "restli-server/src/test/java/com/linkedin/restli/server/resources/TestInjectResourceFactory.java",
"identifier": "TestInjectResourceFactory",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testAmbiguousBeanResolution() throws Exception\n {\n Map<String, ResourceModel> pathRootResourceMap =\n buildResourceModels(SomeResource1.class,\n SomeResource2.class,\n SomeResource4.class);\n\n // set up mock ApplicationCo... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(InjectResourceFactory.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(InjectResourceFactory.class);",
"type": "Logger",
"var_name": "log"
},
... | {
"body": "@Override\n public void setRootResources(final Map<String, ResourceModel> rootResources)\n {\n log.debug(\"Setting root resources\");\n\n _rootResources = rootResources;\n\n Collection<Class<?>> allResourceClasses = new HashSet<Class<?>>();\n for (ResourceModel resourceModel : _rootResources.... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_186 | {
"fields": [
{
"declarator": "testDir = System.getProperty(\"testDir\", new File(\"src/test\").getAbsolutePath())",
"modifier": "private",
"original_string": "private String testDir = System.getProperty(\"testDir\", new File(\"src/test\").getAbsolutePath());",
"type": "String",
"var... | {
"body": "@Test(dataProvider = \"extensionSchemaInputFiles\")\n public void testExtensionSchemaValidation(String inputDir, boolean isValid, String errorMessage)\n {\n String resolverPath = testPegasusDir;\n String inputPath = testExtensionDir + File.separator + inputDir;\n try\n {\n Exte... | {
"fields": [
{
"declarator": "_logger = LoggerFactory.getLogger(ExtensionSchemaValidationCmdLineApp.class)",
"modifier": "private static final",
"original_string": "private static final Logger _logger = LoggerFactory.getLogger(ExtensionSchemaValidationCmdLineApp.class);",
"type": "Logger"... | {
"body": "static void parseAndValidateExtensionSchemas(String resolverPath, File inputDir)\n throws IOException, InvalidExtensionSchemaException\n {\n // Parse each extension schema and validate it\n Iterator<File> iterator = FileUtils.iterateFiles(inputDir, new String[]{PDL}, true);\n DataSchemaResolver r... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_305 | {
"fields": [],
"file": "r2-core/src/test/java/com/linkedin/r2/util/TestLinkedDeque.java",
"identifier": "TestLinkedDeque",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testEmptyPeekFirst()\n {\n LinkedDeque<Object> q = new LinkedDeque<Object>();\n Assert.assertNull(q.peekFirst(), \"peekFirst on empty queue should return null\");\n }",
"class_method_signature": "TestLinkedDeque.testEmptyPeekFirst()",
"constructor": false,
"full_signature... | {
"fields": [
{
"declarator": "_head",
"modifier": "private",
"original_string": "private Node<T> _head;",
"type": "Node<T>",
"var_name": "_head"
},
{
"declarator": "_tail",
"modifier": "private",
"original_string": "private Node<T> _tail;",
"type": "N... | {
"body": "@Override\n public T peekFirst()\n {\n if (_head == null)\n {\n return null;\n }\n return _head._value;\n }",
"class_method_signature": "LinkedDeque.peekFirst()",
"constructor": false,
"full_signature": "@Override public T peekFirst()",
"identifier": "peekFirst",
"invocations"... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_610 | {
"fields": [],
"file": "restli-common/src/test/java/com/linkedin/restli/common/TestComplexResourceKey.java",
"identifier": "TestComplexResourceKey",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testEquals() throws CloneNotSupportedException\n {\n DataMap keyMap = new DataMap();\n keyMap.put(\"keyField1\", \"keyValue1\");\n EmptyRecord key1 = new EmptyRecord(keyMap);\n DataMap paramMap = new DataMap();\n paramMap.put(\"paramField1\", \"paramValue1\");\n Empt... | {
"fields": [
{
"declarator": "key",
"modifier": "protected final",
"original_string": "protected final K key;",
"type": "K",
"var_name": "key"
},
{
"declarator": "params",
"modifier": "protected final",
"original_string": "protected final P ... | {
"body": "@Override\n public boolean equals(Object obj)\n {\n if (this == obj)\n return true;\n if (obj == null)\n return false;\n if (getClass() != obj.getClass())\n return false;\n ComplexResourceKey<?, ?> other = (ComplexResourceKey<?, ?>) obj;\n // Key cannot be null\n return k... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_240 | {
"fields": [
{
"declarator": "FS = File.separator",
"modifier": "private final",
"original_string": "private final String FS = File.separator;",
"type": "String",
"var_name": "FS"
},
{
"declarator": "testDir = System.getProperty(\"testDir\", new File(\"src/test\").getA... | {
"body": "@Test(dataProvider = \"incompatibleInputFiles\")\n public void testIncompatiblePegasusSchemaSnapshot(String prevSchema, String currSchema,\n Collection<CompatibilityInfo> expectedIncompatibilityErrors, Collection<CompatibilityInfo> expectedCompatibilityDiffs )\n {\n PegasusSchemaSnapshotCompatibi... | {
"fields": [
{
"declarator": "_options = new Options()",
"modifier": "private static final",
"original_string": "private static final Options _options = new Options();",
"type": "Options",
"var_name": "_options"
},
{
"declarator": "_logger = LoggerFactory.getLogger(\n ... | {
"body": "public CompatibilityInfoMap checkPegasusSchemaCompatibility(String prevPegasusSchemaPath, String currentPegasusSchemaPath,\n CompatibilityOptions.Mode compatMode)\n {\n boolean newSchemaCreated = false;\n boolean preSchemaRemoved = false;\n\n DataSchema preSchema = null;\n try\n {\n ... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_485 | {
"fields": [],
"file": "restli-server/src/test/java/com/linkedin/restli/internal/server/model/TestRestLiApiBuilder.java",
"identifier": "TestRestLiApiBuilder",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(dataProvider = \"actionReturnTypeData\")\n public void testActionReturnType(Class<?> resourceClass, Class<?> expectedActionReturnType)\n {\n // Process the resource and collect the resource method descriptors\n Map<String, ResourceModel> models = RestLiApiBuilder.buildResourceModels(Collectio... | {
"fields": [
{
"declarator": "_log = LoggerFactory.getLogger(RestLiApiBuilder.class)",
"modifier": "private final static",
"original_string": "private final static Logger _log = LoggerFactory.getLogger(RestLiApiBuilder.class);",
"type": "Logger",
"var_name": "_log"
},
{
... | {
"body": "public static Map<String, ResourceModel> buildResourceModels(final Set<Class<?>> restliAnnotatedClasses)\n {\n Map<String, ResourceModel> rootResourceModels = new HashMap<String, ResourceModel>();\n Map<Class<?>, ResourceModel> resourceModels = new HashMap<Class<?>, ResourceModel>();\n\n for (Cla... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_190 | {
"fields": [],
"file": "restli-tools/src/test/java/com/linkedin/restli/tools/data/TestPredicateExpressionParser.java",
"identifier": "TestPredicateExpressionParser",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testAnd()\n {\n final Predicate parsed = PredicateExpressionParser.parse(\"com.linkedin.data.it.AlwaysTruePredicate & com.linkedin.data.it.AlwaysFalsePredicate\");\n Assert.assertEquals(parsed.getClass(), AndPredicate.class);\n\n final List<Predicate> children = ((AndPredicat... | {
"fields": [
{
"declarator": "TRIMMER_PATTERN = Pattern.compile(\"\\\\s\")",
"modifier": "private static final",
"original_string": "private static final Pattern TRIMMER_PATTERN = Pattern.compile(\"\\\\s\");",
"type": "Pattern",
"var_name": "TRIMMER_PATTERN"
},
{
"decl... | {
"body": "public static Predicate parse(String expression)\n {\n final Stack<Predicate> predicateStack = new Stack<Predicate>();\n final Stack<Character> operatorStack = new Stack<Character>();\n\n final String trimmedExpression = TRIMMER_PATTERN.matcher(expression).replaceAll(\"\");\n final StringToken... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_313 | {
"fields": [
{
"declarator": "WRITABLE_STACKTRACE_DISABLED = false",
"modifier": "private static final",
"original_string": "private static final boolean WRITABLE_STACKTRACE_DISABLED = false;",
"type": "boolean",
"var_name": "WRITABLE_STACKTRACE_DISABLED"
}
],
"file": "r2-co... | {
"body": "@Test\n public void testNoEntity()\n {\n final String TEST_STRING = \"Entity body should not be contained in RestException.toString()\";\n RestResponse response = new RestResponseBuilder().setEntity(ByteString.copyString(TEST_STRING, \"UTF-8\")).build();\n RestException e = new RestException(res... | {
"fields": [
{
"declarator": "serialVersionUID = 1",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "_response",
"modifier": "private fina... | {
"body": "@Override\n public String toString()\n {\n return \"RestException{\" +\n \"_response=\" + _response +\n \"} \";\n }",
"class_method_signature": "RestException.toString()",
"constructor": false,
"full_signature": "@Override public String toString()",
"identifier": "toStri... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_256 | {
"fields": [
{
"declarator": "FS = File.separator",
"modifier": "private static final",
"original_string": "private static final String FS = File.separator;",
"type": "String",
"var_name": "FS"
}
],
"file": "data-avro/src/test/java/com/linkedin/data/avro/TestSchemaTranslator... | {
"body": "@Test(dataProvider = \"embeddingSchemaWithDataPropertyData\")\n public void testEmbeddingSchemaWithDataProperty(String schemaText, String expected) throws IOException\n {\n DataToAvroSchemaTranslationOptions options = new DataToAvroSchemaTranslationOptions(JsonBuilder.Pretty.SPACES, EmbedSchemaMode.RO... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(SchemaTranslator.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(SchemaTranslator.class);",
"type": "Logger",
"var_name": "log"
},
{
"... | {
"body": "public static String dataToAvroSchemaJson(DataSchema dataSchema)\n {\n return dataToAvroSchemaJson(dataSchema, new DataToAvroSchemaTranslationOptions());\n }",
"class_method_signature": "SchemaTranslator.dataToAvroSchemaJson(DataSchema dataSchema)",
"constructor": false,
"full_signature": "publi... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_606 | {
"fields": [],
"file": "restli-common/src/test/java/com/linkedin/restli/common/util/TestProjectionMaskApplier.java",
"identifier": "TestProjectionMaskApplier",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(dataProvider = \"provideBuildSchemaByProjectionData\")\n public void testBuildSchemaByProjection(DataMap projectionMask, String[] expectedIncludedFields, String[] expectedExcludedFields)\n {\n DataSchema schema = DataTemplateUtil.getSchema(RecordTemplateWithPrimitiveKey.class);\n RecordDataSc... | {
"fields": [
{
"declarator": "ARRAY_RANGE_PARAMS =\n new HashSet<>(Arrays.asList(FilterConstants.START, FilterConstants.COUNT))",
"modifier": "private static final",
"original_string": "private static final Set<String> ARRAY_RANGE_PARAMS =\n new HashSet<>(Arrays.asList(FilterConstants... | {
"body": "public static DataSchema buildSchemaByProjection(DataSchema schema, DataMap maskMap)\n {\n return buildSchemaByProjection(schema, maskMap, Collections.emptyList());\n }",
"class_method_signature": "ProjectionMaskApplier.buildSchemaByProjection(DataSchema schema, DataMap maskMap)",
"constructor": f... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_128 | {
"fields": [
{
"declarator": "_keys",
"modifier": "private static final",
"original_string": "private static final List<String> _keys;",
"type": "List<String>",
"var_name": "_keys"
},
{
"declarator": "_record",
"modifier": "private static final",
"original_... | {
"body": "@Test(dataProvider = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + \"batchEntityResponseDataProvider\")\n public void testDecodingWithEmptyDataMap(List<String> keys, ProtocolVersion protocolVersion)\n throws InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException, ... | {
"fields": [
{
"declarator": "_entityType",
"modifier": "private final",
"original_string": "private final TypeSpec<V> _entityType;",
"type": "TypeSpec<V>",
"var_name": "_entityType"
},
{
"declarator": "_keyType",
"modifier": "private final",
"original_stri... | {
"body": "@Override\n public BatchKVResponse<K, EntityResponse<V>> wrapResponse(DataMap dataMap, Map<String, String> headers, ProtocolVersion version)\n throws InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException, IOException\n {\n if (dataMap == null)\n {\n ... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_578 | {
"fields": [
{
"declarator": "DEBUG_HANDLER_RESPONSE_A = \"Response A\"",
"modifier": "private static final",
"original_string": "private static final String DEBUG_HANDLER_RESPONSE_A = \"Response A\";",
"type": "String",
"var_name": "DEBUG_HANDLER_RESPONSE_A"
},
{
"dec... | {
"body": "@Test(dataProvider = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + \"protocolVersions\")\n public void testMessageAndDetailsErrorFormat(final ProtocolVersion protocolVersion, final String errorResponseHeaderName,\n final RestOrStream restOrStream) throws Exceptio... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(RestLiServer.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(RestLiServer.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
... | {
"body": "@Override\n public void handleRequest(RestRequest request, RequestContext requestContext, Callback<RestResponse> callback)\n {\n //This code path cannot accept content types or accept types that contain\n //multipart/related. This is because these types of requests will usually have very large payl... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_597 | {
"fields": [
{
"declarator": "ANY_URI = \"http://localhost:8080/foo/bar?q=baz\"",
"modifier": "private static final",
"original_string": "private static final String ANY_URI = \"http://localhost:8080/foo/bar?q=baz\";",
"type": "String",
"var_name": "ANY_URI"
},
{
"decl... | {
"body": "@Test\n public void testStreamToNettyRequest() throws Exception\n {\n StreamRequestBuilder streamRequestBuilder = new StreamRequestBuilder(new URI(ANY_URI));\n streamRequestBuilder.setMethod(\"POST\");\n streamRequestBuilder.setHeader(\"Content-Length\", Integer.toString(ANY_ENTITY.length()));\n... | {
"fields": [
{
"declarator": "HEADER_BLACKLIST = new HashSet<>()",
"modifier": "private static final",
"original_string": "private static final HashSet<String> HEADER_BLACKLIST = new HashSet<>();",
"type": "HashSet<String>",
"var_name": "HEADER_BLACKLIST"
}
],
"file": "r2-ne... | {
"body": "public static HttpRequest toNettyRequest(RestRequest request) throws Exception\n {\n HttpMethod nettyMethod = HttpMethod.valueOf(request.getMethod());\n URL url = new URL(request.getURI().toString());\n String path = url.getFile();\n // RFC 2616, section 5.1.2:\n // Note that the absolute... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_344 | {
"fields": [
{
"declarator": "_zooKeeperAnnouncerJmx",
"modifier": "private",
"original_string": "private ZooKeeperAnnouncerJmx _zooKeeperAnnouncerJmx;",
"type": "ZooKeeperAnnouncerJmx",
"var_name": "_zooKeeperAnnouncerJmx"
},
{
"declarator": "PARTITION_DATA_JSON = \"... | {
"body": "@Test\n public void setPartitionDataUsingJson() throws IOException\n {\n final Map<Integer,Double> partitionDataExpected = new HashMap<>();\n partitionDataExpected.put(1, 0.9);\n partitionDataExpected.put(2, 1.5);\n partitionDataExpected.put(29, 3.5);\n\n _zooKeeperAnnouncerJmx.setPartitio... | {
"fields": [
{
"declarator": "_announcer",
"modifier": "private final",
"original_string": "private final ZooKeeperAnnouncer _announcer;",
"type": "ZooKeeperAnnouncer",
"var_name": "_announcer"
}
],
"file": "d2/src/main/java/com/linkedin/d2/jmx/ZooKeeperAnnouncerJmx.java",
... | {
"body": "@Override\n public void setPartitionDataUsingJson(String partitionDataJson)\n throws IOException\n {\n Map<Integer, Double> rawObject =\n JacksonUtil.getObjectMapper().readValue(partitionDataJson, new TypeReference<HashMap<Integer, Double>>(){});\n Map<Integer, PartitionData> partitionD... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_651 | {
"fields": [
{
"declarator": "NO_ESCAPING = URLEscaper.Escaping.NO_ESCAPING",
"modifier": "private static final",
"original_string": "private static final URLEscaper.Escaping NO_ESCAPING = URLEscaper.Escaping.NO_ESCAPING;",
"type": "URLEscaper.Escaping",
"var_name": "NO_ESCAPING"
... | {
"body": "@Test(dataProvider = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + \"longKey\")\n public void testLongKeyToString(ProtocolVersion version, String expected)\n {\n Long longKey = 6L;\n String longKeyString = URIParamUtils.keyToString(longKey, NO_ESCAPING, null, true, version);\n Assert.assertEquals(l... | {
"fields": [
{
"declarator": "_EMPTY_STRING_ARRAY = new String[0]",
"modifier": "private static final",
"original_string": "private static final String[] _EMPTY_STRING_ARRAY = new String[0];",
"type": "String[]",
"var_name": "_EMPTY_STRING_ARRAY"
},
{
"declarator": "NO... | {
"body": "public static String keyToString(Object key,\n URLEscaper.Escaping escaping,\n UriComponent.Type componentType,\n boolean full,\n ProtocolVersion version)\n {\n if (ve... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_201 | {
"fields": [],
"file": "restli-tools/src/test/java/com/linkedin/restli/tools/data/TestPredicateExpressionParser.java",
"identifier": "TestPredicateExpressionParser",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testNotNotOr()\n {\n final Predicate parsed = PredicateExpressionParser.parse(\"!!com.linkedin.data.it.AlwaysTruePredicate | com.linkedin.data.it.AlwaysFalsePredicate\");\n Assert.assertEquals(parsed.getClass(), OrPredicate.class);\n\n final List<Predicate> orChildren = ((OrP... | {
"fields": [
{
"declarator": "TRIMMER_PATTERN = Pattern.compile(\"\\\\s\")",
"modifier": "private static final",
"original_string": "private static final Pattern TRIMMER_PATTERN = Pattern.compile(\"\\\\s\");",
"type": "Pattern",
"var_name": "TRIMMER_PATTERN"
},
{
"decl... | {
"body": "public static Predicate parse(String expression)\n {\n final Stack<Predicate> predicateStack = new Stack<Predicate>();\n final Stack<Character> operatorStack = new Stack<Character>();\n\n final String trimmedExpression = TRIMMER_PATTERN.matcher(expression).replaceAll(\"\");\n final StringToken... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
24503341_1 | {
"fields": [],
"file": "testsrc/com/locima/xml2csv/util/TupleTest.java",
"identifier": "TupleTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testTupleHashcode() {\n\t\tTuple<String, String> t1 = new Tuple<String, String>(\"S1\", \"S2\");\n\t\tTuple<String, String> t2 = new Tuple<String, String>(\"S1\", \"S2\");\n\t\tassertEquals(t1.hashCode(), t2.hashCode());\n\n\t\tTuple<String, String> t3 = new Tuple<String, String>(null,... | {
"fields": [
{
"declarator": "first",
"modifier": "private final",
"original_string": "private final T first;",
"type": "T",
"var_name": "first"
},
{
"declarator": "second",
"modifier": "private final",
"original_string": "private final U second;",
"t... | {
"body": "@Override\n\tpublic int hashCode() {\n\t\tif ((this.first == null) && (this.second == null)) {\n\t\t\treturn \"\".hashCode();\n\t\t}\n\t\treturn this.first == null ? this.second.hashCode() : this.first.hashCode() ^ this.second.hashCode();\n\t}",
"class_method_signature": "Tuple.hashCode()",
"constructo... | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 24503341,
"size": 1102,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/andybrodie/xml2csv"
} |
24503341_0 | {
"fields": [],
"file": "testsrc/com/locima/xml2csv/util/TupleTest.java",
"identifier": "TupleTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testTupleEquals() {\n\t\tTuple<String, String> t1 = new Tuple<String, String>(\"S1\", \"S2\");\n\t\tassertTrue(t1.equals(t1));\n\t\tassertFalse(t1.equals(null));\n\n\t\tTuple<String, String> t2 = new Tuple<String, String>(\"S1\", \"S2\");\n\t\tassertTrue(t1.equals(t2));\n\t\tassertTrue... | {
"fields": [
{
"declarator": "first",
"modifier": "private final",
"original_string": "private final T first;",
"type": "T",
"var_name": "first"
},
{
"declarator": "second",
"modifier": "private final",
"original_string": "private final U second;",
"t... | {
"body": "@Override\n\tpublic boolean equals(Object obj) {\n\t\tif ((obj == null) || (!(obj instanceof Tuple<?, ?>))) {\n\t\t\treturn false;\n\t\t}\n\t\tTuple<?, ?> that = (Tuple<?, ?>) obj;\n\t\treturn EqualsUtil.areEqual(this.first, that.first) && EqualsUtil.areEqual(this.second, that.second);\n\t}",
"class_meth... | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 24503341,
"size": 1102,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/andybrodie/xml2csv"
} |
56200448_0 | {
"fields": [
{
"declarator": "TAG = PlenProgramModelTest.class.getSimpleName()",
"modifier": "private static final",
"original_string": "private static final String TAG = PlenProgramModelTest.class.getSimpleName();",
"type": "String",
"var_name": "TAG"
},
{
"declarator... | {
"body": "@Test\n public void testFetch() throws Exception {\n PlenProgramModel model = PlenProgramModel.create(mContext, mMotionsFile, mSequenceFile);\n model.fetch().observeOn(AndroidSchedulers.mainThread())\n .subscribe(v -> Log.d(TAG, \"ok\"));\n }",
"class_method_signature":... | {
"fields": [
{
"declarator": "TAG = PlenProgramModel.class.getSimpleName()",
"modifier": "private static final",
"original_string": "private static final String TAG = PlenProgramModel.class.getSimpleName();",
"type": "String",
"var_name": "TAG"
},
{
"declarator": "mMot... | {
"body": "@NonNull\n public Observable<Void> fetch() {\n return processFetchRequest()\n .doOnNext(response -> {\n mMotionCategories.set(response.categories);\n mSequence.set(response.sequence);\n })\n .doOnError(e -> Log.e(T... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56200448,
"size": 18377,
"stargazer_count": 7,
"stars": null,
"updates": null,
"url": "https://github.com/plenprojectcompany/plen-PLENConnect_Android"
} |
56200448_1 | {
"fields": [
{
"declarator": "TAG = ReadOnlyPropertyTest.class.getSimpleName()",
"modifier": "private static final",
"original_string": "private static final String TAG = ReadOnlyPropertyTest.class.getSimpleName();",
"type": "String",
"var_name": "TAG"
}
],
"file": "app/src/... | {
"body": "@Test\n public void testGet() {\n ReadOnlyProperty<Integer> property;\n\n property = ReadOnlyProperty.create(Observable.empty());\n assertFalse(property.get().isPresent());\n\n property = ReadOnlyProperty.create(Observable.never());\n assertFalse(property.get().isPrese... | {
"fields": [
{
"declarator": "mObservable",
"modifier": "@NonNull private",
"original_string": "@NonNull private Observable<T> mObservable;",
"type": "Observable<T>",
"var_name": "mObservable"
}
],
"file": "app/src/main/java/jp/plen/rx/binding/ReadOnlyProperty.java",
"iden... | {
"body": "@NonNull\n public final Optional<T> get() {\n return getLatest();\n }",
"class_method_signature": "ReadOnlyProperty.get()",
"constructor": false,
"full_signature": "@NonNull public final Optional<T> get()",
"identifier": "get",
"invocations": [
"getLatest"
],
"modifiers": "@N... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 56200448,
"size": 18377,
"stargazer_count": 7,
"stars": null,
"updates": null,
"url": "https://github.com/plenprojectcompany/plen-PLENConnect_Android"
} |
78946145_6 | {
"fields": [],
"file": "json/src/test/java/org/typemeta/funcj/json/parser/JsonTokeniserTest.java",
"identifier": "JsonTokeniserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void test() throws Throwable {\n FileUtils.openResource(\"/example.json\")\n .map(JsonTokeniser::new)\n .map(jt -> {\n JsonEvent ev;\n while ((ev = jt.getNextEvent()) != JsonEvent.Type.EOF) {\n ... | {
"fields": [
{
"declarator": "TRUE = \"true\".toCharArray()",
"modifier": "private static final",
"original_string": "private static final char[] TRUE = \"true\".toCharArray();",
"type": "char[]",
"var_name": "TRUE"
},
{
"declarator": "FALSE = \"false\".toCharArray()",... | {
"body": "public JsonEvent getNextEvent() {\n if (rdr == null) {\n return JsonEvent.Type.EOF;\n }\n\n try {\n int ic = nextChar();\n char nc = (char)ic;\n while (ic != -1 && Character.isWhitespace(nc)) {\n ic = nextChar();\n ... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 78946145,
"size": 68098,
"stargazer_count": 41,
"stars": null,
"updates": null,
"url": "https://github.com/typemeta/funcj"
} |
78946145_13 | {
"fields": [
{
"declarator": "el = IList.of()",
"modifier": "final",
"original_string": "final IList<Integer> el = IList.of();",
"type": "IList<Integer>",
"var_name": "el"
},
{
"declarator": "nel = IList.of(1, 2, 3, 4)",
"modifier": "final",
"original_strin... | {
"body": "@Test\n public void testFoldRight() {\n assertEquals(\"Identity function on lists\", nel, nel.foldRight((i, acc) -> acc.add(i), IList.empty()));\n assertEquals(\"foldRight for an empty list\", \"X\", el.foldRight((v, acc) -> v + acc, \"X\"));\n assertEquals(\"foldRight for a non-emp... | {
"fields": [],
"file": "core/src/main/java/org/typemeta/funcj/data/IList.java",
"identifier": "IList",
"interfaces": "implements Iterable<T>",
"methods": [
{
"class_method_signature": "IList.empty()",
"constructor": false,
"full_signature": "@SuppressWarnings(\"unchecked\") public stati... | {
"body": "public abstract <U> U foldRight(F2<T, U, U> f, U z);",
"class_method_signature": "IList.foldRight(F2<T, U, U> f, U z)",
"constructor": false,
"full_signature": "public abstract U foldRight(F2<T, U, U> f, U z)",
"identifier": "foldRight",
"invocations": [],
"modifiers": "public abstract",
"par... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 78946145,
"size": 68098,
"stargazer_count": 41,
"stars": null,
"updates": null,
"url": "https://github.com/typemeta/funcj"
} |
78946145_12 | {
"fields": [
{
"declarator": "el = IList.of()",
"modifier": "final",
"original_string": "final IList<Integer> el = IList.of();",
"type": "IList<Integer>",
"var_name": "el"
},
{
"declarator": "nel = IList.of(1, 2, 3, 4)",
"modifier": "final",
"original_strin... | {
"body": "@Test\n public void testFoldLeft() {\n assertEquals(\"Reversal on lists\", nel.reverse(), nel.foldLeft(IList::add, IList.empty()));\n assertEquals(\"foldLeft for an empty list\", \"X\", el.foldLeft((acc, v) -> acc + v, \"X\"));\n assertEquals(\"foldLeft for a non-empty list\", \"X12... | {
"fields": [],
"file": "core/src/main/java/org/typemeta/funcj/data/IList.java",
"identifier": "IList",
"interfaces": "implements Iterable<T>",
"methods": [
{
"class_method_signature": "IList.empty()",
"constructor": false,
"full_signature": "@SuppressWarnings(\"unchecked\") public stati... | {
"body": "public abstract <U> U foldLeft(F2<U, T, U> f, U z);",
"class_method_signature": "IList.foldLeft(F2<U, T, U> f, U z)",
"constructor": false,
"full_signature": "public abstract U foldLeft(F2<U, T, U> f, U z)",
"identifier": "foldLeft",
"invocations": [],
"modifiers": "public abstract",
"paramet... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 78946145,
"size": 68098,
"stargazer_count": 41,
"stars": null,
"updates": null,
"url": "https://github.com/typemeta/funcj"
} |
78946145_7 | {
"fields": [
{
"declarator": "charData = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'}",
"modifier": "private static final",
"original_string": "private static final char[] charData = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'};",
"type": "char[]",
"var_name": "charData"
}
],
"fil... | {
"body": "@Test\n public void testStringInput() {\n testInput(Input.of(charData));\n }",
"class_method_signature": "InputTest.testStringInput()",
"constructor": false,
"full_signature": "@Test public void testStringInput()",
"identifier": "testStringInput",
"invocations": [
"testInput",
... | {
"fields": [
{
"declarator": "data",
"modifier": "private final",
"original_string": "private final char[] data;",
"type": "char[]",
"var_name": "data"
},
{
"declarator": "position",
"modifier": "private",
"original_string": "private int position;",
"... | {
"body": "StringInput(char[] data) {\n this.data = data;\n this.position = 0;\n this.other = new StringInput(this, data);\n }",
"class_method_signature": "StringInput.StringInput(char[] data)",
"constructor": true,
"full_signature": " StringInput(char[] data)",
"identifier": "StringI... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 78946145,
"size": 68098,
"stargazer_count": 41,
"stars": null,
"updates": null,
"url": "https://github.com/typemeta/funcj"
} |
78946145_19 | {
"fields": [
{
"declarator": "nextVal = 123",
"modifier": "private static",
"original_string": "private static int nextVal = 123;",
"type": "int",
"var_name": "nextVal"
}
],
"file": "core/src/test/java/org/typemeta/funcj/data/LazyTest.java",
"identifier": "LazyTest",
"in... | {
"body": "@Test(expected=InternalTestException.class)\n public void testThreadSafeLaziness2() {\n final Lazy<String> l = Lazy.of(() -> {throw new InternalTestException();});\n l.apply();\n }",
"class_method_signature": "LazyTest.testThreadSafeLaziness2()",
"constructor": false,
"full_signat... | {
"fields": [
{
"declarator": "get",
"modifier": "private",
"original_string": "private Functions.F0<T> get;",
"type": "Functions.F0<T>",
"var_name": "get"
}
],
"file": "core/src/main/java/org/typemeta/funcj/data/Lazy.java",
"identifier": "LazyImpl",
"interfaces": "implem... | {
"body": "@Override\n public T apply() {\n return get.apply();\n }",
"class_method_signature": "LazyImpl.apply()",
"constructor": false,
"full_signature": "@Override public T apply()",
"identifier": "apply",
"invocations": [
"apply"
],
"modifiers": "@Override public",
"parameters": "... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 78946145,
"size": 68098,
"stargazer_count": 41,
"stars": null,
"updates": null,
"url": "https://github.com/typemeta/funcj"
} |
78946145_0 | {
"fields": [],
"file": "codec/xml/src/test/java/org/typemeta/funcj/codec/xml/io/XmlUtilsTest.java",
"identifier": "XmlUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDirtyStrings() {\n assertEquals(\"&\", escapeTextChar(\"&\"));\n assertEquals(\"& \", escapeTextChar(\"& \"));\n assertEquals(\" &\", escapeTextChar(\" &\"));\n assertEquals(\" & \", escapeTextChar(\" & \"));\n assertEquals(\"&am... | {
"fields": [],
"file": "codec/xml/src/main/java/org/typemeta/funcj/codec/xml/io/XmlUtils.java",
"identifier": "XmlUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "XmlUtils.escapeTextChar(String text)",
"constructor": false,
"full_signature": "public static String esca... | {
"body": "public static String escapeTextChar(String text) {\n int s = 0;\n StringBuilder sb = null;\n for (int i = 0; i < text.length(); ++i) {\n char c = text.charAt(i);\n final String repl = escapeTextChar(c);\n if (repl != null) {\n if (sb == n... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 78946145,
"size": 68098,
"stargazer_count": 41,
"stars": null,
"updates": null,
"url": "https://github.com/typemeta/funcj"
} |
78946145_15 | {
"fields": [
{
"declarator": "el = IList.of()",
"modifier": "final",
"original_string": "final IList<Integer> el = IList.of();",
"type": "IList<Integer>",
"var_name": "el"
},
{
"declarator": "nel = IList.of(1, 2, 3, 4)",
"modifier": "final",
"original_strin... | {
"body": "@Test\n public void testFlatMap() {\n assertEquals(\"flatmap for an empty list\", IList.of(), el.flatMap(x -> IList.of(x, -x)));\n assertEquals(\"map for a non-empty list\", IList.of(1, -1, 2, -2, 3, -3, 4, -4), nel.flatMap(x -> IList.of(x, -x)));\n }",
"class_method_signature": "ILi... | {
"fields": [],
"file": "core/src/main/java/org/typemeta/funcj/data/IList.java",
"identifier": "IList",
"interfaces": "implements Iterable<T>",
"methods": [
{
"class_method_signature": "IList.empty()",
"constructor": false,
"full_signature": "@SuppressWarnings(\"unchecked\") public stati... | {
"body": "public abstract <U> IList<U> flatMap(F<? super T, IList<? extends U>> f);",
"class_method_signature": "IList.flatMap(F<? super T, IList<? extends U>> f)",
"constructor": false,
"full_signature": "public abstract IList<U> flatMap(F<? super T, IList<? extends U>> f)",
"identifier": "flatMap",
"invo... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 78946145,
"size": 68098,
"stargazer_count": 41,
"stars": null,
"updates": null,
"url": "https://github.com/typemeta/funcj"
} |
78946145_14 | {
"fields": [
{
"declarator": "el = IList.of()",
"modifier": "final",
"original_string": "final IList<Integer> el = IList.of();",
"type": "IList<Integer>",
"var_name": "el"
},
{
"declarator": "nel = IList.of(1, 2, 3, 4)",
"modifier": "final",
"original_strin... | {
"body": "@Test\n public void testMap() {\n assertEquals(\"map for an empty list\", IList.of(), el.map(x -> x * 2));\n assertEquals(\"map for a non-empty list\", IList.of(-1, -2, -3, -4), nel.map(i -> -i));\n }",
"class_method_signature": "IListTest.testMap()",
"constructor": false,
"full_s... | {
"fields": [],
"file": "core/src/main/java/org/typemeta/funcj/data/IList.java",
"identifier": "IList",
"interfaces": "implements Iterable<T>",
"methods": [
{
"class_method_signature": "IList.empty()",
"constructor": false,
"full_signature": "@SuppressWarnings(\"unchecked\") public stati... | {
"body": "public abstract <U> IList<U> map(F<? super T, ? extends U> f);",
"class_method_signature": "IList.map(F<? super T, ? extends U> f)",
"constructor": false,
"full_signature": "public abstract IList<U> map(F<? super T, ? extends U> f)",
"identifier": "map",
"invocations": [],
"modifiers": "public ... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 78946145,
"size": 68098,
"stargazer_count": 41,
"stars": null,
"updates": null,
"url": "https://github.com/typemeta/funcj"
} |
78946145_1 | {
"fields": [
{
"declarator": "test0 = \"[null]\"",
"modifier": "private static final",
"original_string": "private static final String test0 = \"[null]\";",
"type": "String",
"var_name": "test0"
},
{
"declarator": "test1 = \"[true]\"",
"modifier": "private static... | {
"body": "@Test\n public void testSuccessParse() {\n final Result<Chr, JsValue> result =\n JsonCombParser.parser.parse(\n Input.of(FileUtils.openResource(\"/example.json\").orElseThrow()));\n final JsValue node = result.getOrThrow();\n final String json2 = node.forma... | {
"fields": [
{
"declarator": "parser",
"modifier": "public static final",
"original_string": "public static final Parser<Chr, JsValue> parser;",
"type": "Parser<Chr, JsValue>",
"var_name": "parser"
}
],
"file": "json/src/main/java/org/typemeta/funcj/json/comb/JsonCombParser.... | {
"body": "public static Result<Chr, JsValue> parse(String str) {\n return parser.parse(Input.of(str));\n }",
"class_method_signature": "JsonCombParser.parse(String str)",
"constructor": false,
"full_signature": "public static Result<Chr, JsValue> parse(String str)",
"identifier": "parse",
"invoca... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 78946145,
"size": 68098,
"stargazer_count": 41,
"stars": null,
"updates": null,
"url": "https://github.com/typemeta/funcj"
} |
78946145_18 | {
"fields": [
{
"declarator": "nextVal = 123",
"modifier": "private static",
"original_string": "private static int nextVal = 123;",
"type": "int",
"var_name": "nextVal"
}
],
"file": "core/src/test/java/org/typemeta/funcj/data/LazyTest.java",
"identifier": "LazyTest",
"in... | {
"body": "@Test\n public void testGetReturnsSameValue() {\n final Lazy<Integer> l = Lazy.of(() -> nextVal++);\n assertEquals(l.apply(), l.apply());\n }",
"class_method_signature": "LazyTest.testGetReturnsSameValue()",
"constructor": false,
"full_signature": "@Test public void testGetReturns... | {
"fields": [
{
"declarator": "get",
"modifier": "private",
"original_string": "private Functions.F0<T> get;",
"type": "Functions.F0<T>",
"var_name": "get"
}
],
"file": "core/src/main/java/org/typemeta/funcj/data/Lazy.java",
"identifier": "LazyImpl",
"interfaces": "implem... | {
"body": "@Override\n public T apply() {\n return get.apply();\n }",
"class_method_signature": "LazyImpl.apply()",
"constructor": false,
"full_signature": "@Override public T apply()",
"identifier": "apply",
"invocations": [
"apply"
],
"modifiers": "@Override public",
"parameters": "... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 78946145,
"size": 68098,
"stargazer_count": 41,
"stars": null,
"updates": null,
"url": "https://github.com/typemeta/funcj"
} |
78946145_17 | {
"fields": [
{
"declarator": "nextVal = 123",
"modifier": "private static",
"original_string": "private static int nextVal = 123;",
"type": "int",
"var_name": "nextVal"
}
],
"file": "core/src/test/java/org/typemeta/funcj/data/LazyTest.java",
"identifier": "LazyTest",
"in... | {
"body": "@Test(expected=InternalTestException.class)\n public void testLaziness2() {\n final Lazy<String> l = Lazy.ofTS(() -> {throw new InternalTestException();});\n l.apply();\n }",
"class_method_signature": "LazyTest.testLaziness2()",
"constructor": false,
"full_signature": "@Test(expec... | {
"fields": [
{
"declarator": "get",
"modifier": "private",
"original_string": "private Functions.F0<T> get;",
"type": "Functions.F0<T>",
"var_name": "get"
}
],
"file": "core/src/main/java/org/typemeta/funcj/data/Lazy.java",
"identifier": "LazyImpl",
"interfaces": "implem... | {
"body": "@Override\n public T apply() {\n return get.apply();\n }",
"class_method_signature": "LazyImpl.apply()",
"constructor": false,
"full_signature": "@Override public T apply()",
"identifier": "apply",
"invocations": [
"apply"
],
"modifiers": "@Override public",
"parameters": "... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 78946145,
"size": 68098,
"stargazer_count": 41,
"stars": null,
"updates": null,
"url": "https://github.com/typemeta/funcj"
} |
78946145_2 | {
"fields": [
{
"declarator": "EOL = System.lineSeparator()",
"modifier": "private static final",
"original_string": "private static final String EOL = System.lineSeparator();",
"type": "String",
"var_name": "EOL"
},
{
"declarator": "TEST_JSON =\n obj(\n ... | {
"body": "@Test\n public void testNonIndent() {\n final String actual = JsonWriter.toString(TEST_JSON, new StringWriter()).toString();\n assertEquals(nonIndent, actual);\n }",
"class_method_signature": "JsonWriterTest.testNonIndent()",
"constructor": false,
"full_signature": "@Test public v... | {
"fields": [
{
"declarator": "INSTANCE = new JsonWriter()",
"modifier": "public static final",
"original_string": "public static final JsonWriter INSTANCE = new JsonWriter();",
"type": "JsonWriter",
"var_name": "INSTANCE"
}
],
"file": "json/src/main/java/org/typemeta/funcj/j... | {
"body": "public static Writer toString(JsValue jv, Writer w) {\n jv.apply(INSTANCE).apply(w);\n return w;\n }",
"class_method_signature": "JsonWriter.toString(JsValue jv, Writer w)",
"constructor": false,
"full_signature": "public static Writer toString(JsValue jv, Writer w)",
"identifier":... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 78946145,
"size": 68098,
"stargazer_count": 41,
"stars": null,
"updates": null,
"url": "https://github.com/typemeta/funcj"
} |
78946145_3 | {
"fields": [
{
"declarator": "EOL = System.lineSeparator()",
"modifier": "private static final",
"original_string": "private static final String EOL = System.lineSeparator();",
"type": "String",
"var_name": "EOL"
},
{
"declarator": "TEST_JSON =\n obj(\n ... | {
"body": "@Test\n public void testIndent() {\n final String actual = JsonIndentWriter.toString(TEST_JSON, new StringWriter(), 4).toString();\n //System.out.println(actual);\n assertEquals(indent, actual);\n }",
"class_method_signature": "JsonWriterTest.testIndent()",
"constructor": fal... | {
"fields": [
{
"declarator": "INSTANCE = new JsonWriter()",
"modifier": "public static final",
"original_string": "public static final JsonWriter INSTANCE = new JsonWriter();",
"type": "JsonWriter",
"var_name": "INSTANCE"
}
],
"file": "json/src/main/java/org/typemeta/funcj/j... | {
"body": "public static Writer toString(JsValue jv, Writer w) {\n jv.apply(INSTANCE).apply(w);\n return w;\n }",
"class_method_signature": "JsonWriter.toString(JsValue jv, Writer w)",
"constructor": false,
"full_signature": "public static Writer toString(JsValue jv, Writer w)",
"identifier":... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 78946145,
"size": 68098,
"stargazer_count": 41,
"stars": null,
"updates": null,
"url": "https://github.com/typemeta/funcj"
} |
78946145_16 | {
"fields": [
{
"declarator": "el = IList.of()",
"modifier": "final",
"original_string": "final IList<Integer> el = IList.of();",
"type": "IList<Integer>",
"var_name": "el"
},
{
"declarator": "nel = IList.of(1, 2, 3, 4)",
"modifier": "final",
"original_strin... | {
"body": "@Test\n public void testMatch() {\n Assert.assertTrue(\"match for an empty list\", el.match(n -> false, e -> true));\n Assert.assertTrue(\"match for a non-empty list\", nel.match(n -> true, e -> false));\n }",
"class_method_signature": "IListTest.testMatch()",
"constructor": false,
... | {
"fields": [],
"file": "core/src/main/java/org/typemeta/funcj/data/IList.java",
"identifier": "IList",
"interfaces": "implements Iterable<T>",
"methods": [
{
"class_method_signature": "IList.empty()",
"constructor": false,
"full_signature": "@SuppressWarnings(\"unchecked\") public stati... | {
"body": "public abstract <S> S match(F<NonEmpty<T>, S> nonEmptyF, F<Empty<T>, S> emptyF);",
"class_method_signature": "IList.match(F<NonEmpty<T>, S> nonEmptyF, F<Empty<T>, S> emptyF)",
"constructor": false,
"full_signature": "public abstract S match(F<NonEmpty<T>, S> nonEmptyF, F<Empty<T>, S> emptyF)",
"ide... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 78946145,
"size": 68098,
"stargazer_count": 41,
"stars": null,
"updates": null,
"url": "https://github.com/typemeta/funcj"
} |
78946145_20 | {
"fields": [
{
"declarator": "nextVal = 123",
"modifier": "private static",
"original_string": "private static int nextVal = 123;",
"type": "int",
"var_name": "nextVal"
}
],
"file": "core/src/test/java/org/typemeta/funcj/data/LazyTest.java",
"identifier": "LazyTest",
"in... | {
"body": "@Test\n public void testTSGetReturnsSameValue() {\n final Lazy<Integer> l = Lazy.of(() -> nextVal++);\n assertEquals(l.apply(), l.apply());\n }",
"class_method_signature": "LazyTest.testTSGetReturnsSameValue()",
"constructor": false,
"full_signature": "@Test public void testTSGetR... | {
"fields": [
{
"declarator": "get",
"modifier": "private",
"original_string": "private Functions.F0<T> get;",
"type": "Functions.F0<T>",
"var_name": "get"
}
],
"file": "core/src/main/java/org/typemeta/funcj/data/Lazy.java",
"identifier": "LazyImpl",
"interfaces": "implem... | {
"body": "@Override\n public T apply() {\n return get.apply();\n }",
"class_method_signature": "LazyImpl.apply()",
"constructor": false,
"full_signature": "@Override public T apply()",
"identifier": "apply",
"invocations": [
"apply"
],
"modifiers": "@Override public",
"parameters": "... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 78946145,
"size": 68098,
"stargazer_count": 41,
"stars": null,
"updates": null,
"url": "https://github.com/typemeta/funcj"
} |
78946145_11 | {
"fields": [
{
"declarator": "el = IList.of()",
"modifier": "final",
"original_string": "final IList<Integer> el = IList.of();",
"type": "IList<Integer>",
"var_name": "el"
},
{
"declarator": "nel = IList.of(1, 2, 3, 4)",
"modifier": "final",
"original_strin... | {
"body": "@Test\n public void testLength() {\n assertEquals(\"size for an empty list\", 0, el.size());\n assertEquals(\"[1,2,3,4].size for a non-empty list\", 4, nel.size());\n }",
"class_method_signature": "IListTest.testLength()",
"constructor": false,
"full_signature": "@Test public void... | {
"fields": [],
"file": "core/src/main/java/org/typemeta/funcj/data/IList.java",
"identifier": "IList",
"interfaces": "implements Iterable<T>",
"methods": [
{
"class_method_signature": "IList.empty()",
"constructor": false,
"full_signature": "@SuppressWarnings(\"unchecked\") public stati... | {
"body": "public abstract int size();",
"class_method_signature": "IList.size()",
"constructor": false,
"full_signature": "public abstract int size()",
"identifier": "size",
"invocations": [],
"modifiers": "public abstract",
"parameters": "()",
"return": "int",
"signature": "int size()",
"testcas... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 78946145,
"size": 68098,
"stargazer_count": 41,
"stars": null,
"updates": null,
"url": "https://github.com/typemeta/funcj"
} |
78946145_4 | {
"fields": [
{
"declarator": "test0 = \"[null]\"",
"modifier": "private static final",
"original_string": "private static final String test0 = \"[null]\";",
"type": "String",
"var_name": "test0"
},
{
"declarator": "test1 = \"[true, false ]\"",
"modifier": "privat... | {
"body": "@Test\n public void testParse() {\n Arrays.stream(tests).forEach(FileUtils::checkParse);\n }",
"class_method_signature": "JsonParserTest.testParse()",
"constructor": false,
"full_signature": "@Test public void testParse()",
"identifier": "testParse",
"invocations": [
"forEach",
... | {
"fields": [
{
"declarator": "tokeniser",
"modifier": "private final",
"original_string": "private final JsonTokeniser tokeniser;",
"type": "JsonTokeniser",
"var_name": "tokeniser"
},
{
"declarator": "nextEvent = null",
"modifier": "private",
"original_stri... | {
"body": "public static JsValue parse(String json) throws JsonException {\n return parse(new StringReader(json), Consume.ALL, Comments.DISALLOWED);\n }",
"class_method_signature": "JsonParser.parse(String json)",
"constructor": false,
"full_signature": "public static JsValue parse(String json)",
"i... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 78946145,
"size": 68098,
"stargazer_count": 41,
"stars": null,
"updates": null,
"url": "https://github.com/typemeta/funcj"
} |
78946145_8 | {
"fields": [
{
"declarator": "charData = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'}",
"modifier": "private static final",
"original_string": "private static final char[] charData = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'};",
"type": "char[]",
"var_name": "charData"
}
],
"fil... | {
"body": "@Test\n public void testReaderInput() {\n testInput(Input.of(new CharArrayReader(charData)));\n }",
"class_method_signature": "InputTest.testReaderInput()",
"constructor": false,
"full_signature": "@Test public void testReaderInput()",
"identifier": "testReaderInput",
"invocations": ... | {
"fields": [
{
"declarator": "position",
"modifier": "protected",
"original_string": "protected int position;",
"type": "int",
"var_name": "position"
},
{
"declarator": "reader",
"modifier": "protected final",
"original_string": "protected final Reader read... | {
"body": "ReaderInput(Reader reader) {\n this.position = 0;\n this.reader = reader;\n this.current = null;\n this.other = new ReaderInput(this, reader);\n }",
"class_method_signature": "ReaderInput.ReaderInput(Reader reader)",
"constructor": true,
"full_signature": " ReaderInput... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 78946145,
"size": 68098,
"stargazer_count": 41,
"stars": null,
"updates": null,
"url": "https://github.com/typemeta/funcj"
} |
78946145_9 | {
"fields": [
{
"declarator": "el = IList.of()",
"modifier": "final",
"original_string": "final IList<Integer> el = IList.of();",
"type": "IList<Integer>",
"var_name": "el"
},
{
"declarator": "nel = IList.of(1, 2, 3, 4)",
"modifier": "final",
"original_strin... | {
"body": "@Test\n public void testEquals() {\n assertEquals(\"equals for an empty list\", IList.of(), el);\n assertEquals(\"[equals for a non-empty list\", IList.of().add(4).add(3).add(2).add(1), nel);\n }",
"class_method_signature": "IListTest.testEquals()",
"constructor": false,
"full_sig... | {
"fields": [],
"file": "core/src/main/java/org/typemeta/funcj/data/IList.java",
"identifier": "IList",
"interfaces": "implements Iterable<T>",
"methods": [
{
"class_method_signature": "IList.empty()",
"constructor": false,
"full_signature": "@SuppressWarnings(\"unchecked\") public stati... | {
"body": "@Override\n @SuppressWarnings(\"unchecked\")\n public boolean equals(Object rhs) {\n return this == rhs ||\n (rhs != null &&\n getClass() == rhs.getClass() &&\n equals((IList<T>)rhs));\n }",
"class_method_signature": "IList.equals(Object rhs)",
"... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 78946145,
"size": 68098,
"stargazer_count": 41,
"stars": null,
"updates": null,
"url": "https://github.com/typemeta/funcj"
} |
78946145_5 | {
"fields": [
{
"declarator": "test0 = \"[null]\"",
"modifier": "private static final",
"original_string": "private static final String test0 = \"[null]\";",
"type": "String",
"var_name": "test0"
},
{
"declarator": "test1 = \"[true, false ]\"",
"modifier": "privat... | {
"body": "@Test\n public void testSuccessParse() {\n final JsValue node = JsonParser.parse(json);\n final String json2 = node.formatter().format();\n\n //System.out.println(node.toString());\n assertEquals(\"Round-tripped JSON\", json, json2);\n }",
"class_method_signature": "Json... | {
"fields": [
{
"declarator": "tokeniser",
"modifier": "private final",
"original_string": "private final JsonTokeniser tokeniser;",
"type": "JsonTokeniser",
"var_name": "tokeniser"
},
{
"declarator": "nextEvent = null",
"modifier": "private",
"original_stri... | {
"body": "public static JsValue parse(String json) throws JsonException {\n return parse(new StringReader(json), Consume.ALL, Comments.DISALLOWED);\n }",
"class_method_signature": "JsonParser.parse(String json)",
"constructor": false,
"full_signature": "public static JsValue parse(String json)",
"i... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 78946145,
"size": 68098,
"stargazer_count": 41,
"stars": null,
"updates": null,
"url": "https://github.com/typemeta/funcj"
} |
78946145_10 | {
"fields": [
{
"declarator": "el = IList.of()",
"modifier": "final",
"original_string": "final IList<Integer> el = IList.of();",
"type": "IList<Integer>",
"var_name": "el"
},
{
"declarator": "nel = IList.of(1, 2, 3, 4)",
"modifier": "final",
"original_strin... | {
"body": "@Test\n public void testIsEmpty() {\n Assert.assertTrue(\"isEmpty for an empty list\", el.isEmpty());\n Assert.assertFalse(\"isEmpty() for a non-empty list\", nel.isEmpty());\n }",
"class_method_signature": "IListTest.testIsEmpty()",
"constructor": false,
"full_signature": "@Test ... | {
"fields": [],
"file": "core/src/main/java/org/typemeta/funcj/data/IList.java",
"identifier": "IList",
"interfaces": "implements Iterable<T>",
"methods": [
{
"class_method_signature": "IList.empty()",
"constructor": false,
"full_signature": "@SuppressWarnings(\"unchecked\") public stati... | {
"body": "public abstract boolean isEmpty();",
"class_method_signature": "IList.isEmpty()",
"constructor": false,
"full_signature": "public abstract boolean isEmpty()",
"identifier": "isEmpty",
"invocations": [],
"modifiers": "public abstract",
"parameters": "()",
"return": "boolean",
"signature": ... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 78946145,
"size": 68098,
"stargazer_count": 41,
"stars": null,
"updates": null,
"url": "https://github.com/typemeta/funcj"
} |
118104847_0 | {
"fields": [],
"file": "easypermissions/src/test/java/pub/devrel/easypermissions/EasyPermissionsTest.java",
"identifier": "EasyPermissionsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testHasPermissions() {\n Application app = RuntimeEnvironment.application;\n\n String[] perms = new String[]{\n Manifest.permission.READ_SMS,\n Manifest.permission.ACCESS_FINE_LOCATION\n };\n\n // Wes should not have permissio... | {
"fields": [
{
"declarator": "TAG = \"EasyPermissions\"",
"modifier": "private static final",
"original_string": "private static final String TAG = \"EasyPermissions\";",
"type": "String",
"var_name": "TAG"
}
],
"file": "easypermissions/src/main/java/pub/devrel/easypermissio... | {
"body": "public static boolean hasPermissions(@NonNull Context context,\n @Size(min = 1) @NonNull String... perms) {\n // Always return true for SDK < M, let the system deal with the permissions\n if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {\n ... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 118104847,
"size": 181,
"stargazer_count": 9,
"stars": null,
"updates": null,
"url": "https://github.com/Diosamo/OkPermissions"
} |
3726486_5 | {
"fields": [
{
"declarator": "OS = System.getProperty(\"os.name\").toLowerCase()",
"modifier": "private static",
"original_string": "private static String OS = System.getProperty(\"os.name\").toLowerCase();",
"type": "String",
"var_name": "OS"
},
{
"declarator": "EMPTY... | {
"body": "@Test\n public void testBomFiles() throws IOException {\n HashCalculator hashCalculator = new HashCalculator();\n\n String filePath = getClass().getResource(\"/utf-bom/jquery-1.8.1-utf8.txt\").getFile();\n File file = new File(filePath);\n\n String filePathBom = getClass().ge... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(HashCalculator.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = LoggerFactory.getLogger(HashCalculator.class);",
"type": "org.slf4j.Logger",
"var_name": "log... | {
"body": "public String calculateSHA1(File resourceFile) throws IOException {\n return calculateHash(resourceFile, HashAlgorithm.SHA1);\n }",
"class_method_signature": "HashCalculator.calculateSHA1(File resourceFile)",
"constructor": false,
"full_signature": "public String calculateSHA1(File resource... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 3726486,
"size": 4961,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/whitesource/agents"
} |
3726486_9 | {
"fields": [
{
"declarator": "DLL_FILE = \"/pecoff4j/Signature.dll\"",
"modifier": "private static final",
"original_string": "private static final String DLL_FILE = \"/pecoff4j/Signature.dll\";",
"type": "String",
"var_name": "DLL_FILE"
},
{
"declarator": "EXE_FILE = ... | {
"body": "@Test\n public void testGetHintsExe() throws IOException {\n File file = getResourceFile(EXE_FILE);\n DependencyHintsInfo dependencyHintsInfo = HintUtils.getHints(file.getPath());\n Assert.assertNotNull(dependencyHintsInfo);\n Assert.assertNull(dependencyHintsInfo.getCompanyN... | {
"fields": [
{
"declarator": "logger = Logger.getLogger(HintUtils.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger logger = Logger.getLogger(HintUtils.class.getName());",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "public static DependencyHintsInfo getHints(String filename) {\n DependencyHintsInfo hints = null;\n if (StringUtils.isNotBlank(filename)) {\n if (filename.matches(PORTABLE_EXECUTABLES_PATTERN)) {\n hints = getPortableExecutableHints(filename);\n }\n ... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 3726486,
"size": 4961,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/whitesource/agents"
} |
3726486_8 | {
"fields": [
{
"declarator": "DLL_FILE = \"/pecoff4j/Signature.dll\"",
"modifier": "private static final",
"original_string": "private static final String DLL_FILE = \"/pecoff4j/Signature.dll\";",
"type": "String",
"var_name": "DLL_FILE"
},
{
"declarator": "EXE_FILE = ... | {
"body": "@Test\n public void testGetHintsDll() throws IOException {\n File file = getResourceFile(DLL_FILE);\n DependencyHintsInfo dependencyHintsInfo = HintUtils.getHints(file.getPath());\n Assert.assertNotNull(dependencyHintsInfo);\n Assert.assertEquals(\"Microsoft Corporation\", de... | {
"fields": [
{
"declarator": "logger = Logger.getLogger(HintUtils.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger logger = Logger.getLogger(HintUtils.class.getName());",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "public static DependencyHintsInfo getHints(String filename) {\n DependencyHintsInfo hints = null;\n if (StringUtils.isNotBlank(filename)) {\n if (filename.matches(PORTABLE_EXECUTABLES_PATTERN)) {\n hints = getPortableExecutableHints(filename);\n }\n ... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 3726486,
"size": 4961,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/whitesource/agents"
} |
3726486_4 | {
"fields": [
{
"declarator": "EMPTY_FILE_SHA1 = \"da39a3ee5e6b4b0d3255bfef95601890afd80709\"",
"modifier": "private static final",
"original_string": "private static final String EMPTY_FILE_SHA1 = \"da39a3ee5e6b4b0d3255bfef95601890afd80709\";",
"type": "String",
"var_name": "EMPTY_F... | {
"body": "@Test\n public void testMD5() throws IOException {\n String filePath = getClass().getResource(NON_EMPTY_FILE_TXT).getFile();\n File file = new File(URLDecoder.decode(filePath, UTF_8));\n String md5 = ChecksumUtils.calculateHash(file, HashAlgorithm.MD5);\n if (Platform.isWindo... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(ChecksumUtils.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(ChecksumUtils.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "public static String calculateHash(File resourceFile, HashAlgorithm algorithm) throws IOException {\n return new HashCalculator().calculateHash(resourceFile, algorithm);\n }",
"class_method_signature": "ChecksumUtils.calculateHash(File resourceFile, HashAlgorithm algorithm)",
"constructor": f... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 3726486,
"size": 4961,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/whitesource/agents"
} |
3726486_13 | {
"fields": [
{
"declarator": "temporaryFolder = new TemporaryFolder()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public TemporaryFolder temporaryFolder = new TemporaryFolder();",
"type": "TemporaryFolder",
"var_name": "temporaryFolder"
}
],
"file": "ws... | {
"body": "@Test(expected = IOException.class)\n public void testNonExistingOutoutDirectory() throws IOException, TemplateException {\n PolicyCheckReport report = new PolicyCheckReport(new CheckPoliciesResult());\n report.generate(new File(\"/non/existing/dir\"), false);\n }",
"class_method_sign... | {
"fields": [
{
"declarator": "TEMPLATE_FOLDER = \"templates/\"",
"modifier": "private static final",
"original_string": "private static final String TEMPLATE_FOLDER = \"templates/\";",
"type": "String",
"var_name": "TEMPLATE_FOLDER"
},
{
"declarator": "TEMPLATE_FILE = ... | {
"body": "public File generate(File outputDir, boolean pack) throws IOException, TemplateException {\n return generate(outputDir, pack, null);\n }",
"class_method_signature": "PolicyCheckReport.generate(File outputDir, boolean pack)",
"constructor": false,
"full_signature": "public File generate(File... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 3726486,
"size": 4961,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/whitesource/agents"
} |
3726486_3 | {
"fields": [
{
"declarator": "EMPTY_FILE_SHA1 = \"da39a3ee5e6b4b0d3255bfef95601890afd80709\"",
"modifier": "private static final",
"original_string": "private static final String EMPTY_FILE_SHA1 = \"da39a3ee5e6b4b0d3255bfef95601890afd80709\";",
"type": "String",
"var_name": "EMPTY_F... | {
"body": "@Test\n public void testEmptyFileMD5() throws IOException {\n String filePath = getClass().getResource(EMPTY_FILE_TXT).getFile();\n File file = new File(URLDecoder.decode(filePath, UTF_8));\n String md5 = ChecksumUtils.calculateHash(file, HashAlgorithm.MD5);\n Assert.assertEq... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(ChecksumUtils.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(ChecksumUtils.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "public static String calculateHash(File resourceFile, HashAlgorithm algorithm) throws IOException {\n return new HashCalculator().calculateHash(resourceFile, algorithm);\n }",
"class_method_signature": "ChecksumUtils.calculateHash(File resourceFile, HashAlgorithm algorithm)",
"constructor": f... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 3726486,
"size": 4961,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/whitesource/agents"
} |
3726486_2 | {
"fields": [
{
"declarator": "EMPTY_FILE_SHA1 = \"da39a3ee5e6b4b0d3255bfef95601890afd80709\"",
"modifier": "private static final",
"original_string": "private static final String EMPTY_FILE_SHA1 = \"da39a3ee5e6b4b0d3255bfef95601890afd80709\";",
"type": "String",
"var_name": "EMPTY_F... | {
"body": "@Test\n public void testSHA1() throws IOException {\n String filePath = getClass().getResource(NON_EMPTY_FILE_TXT).getFile();\n File file = new File(URLDecoder.decode(filePath, UTF_8));\n String sha1 = ChecksumUtils.calculateSHA1(file);\n if (Platform.isWindows()) {\n ... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(ChecksumUtils.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(ChecksumUtils.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "public static String calculateSHA1(File resourceFile) throws IOException {\n return calculateHash(resourceFile, HashAlgorithm.SHA1);\n }",
"class_method_signature": "ChecksumUtils.calculateSHA1(File resourceFile)",
"constructor": false,
"full_signature": "public static String calculateSHA1(... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 3726486,
"size": 4961,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/whitesource/agents"
} |
3726486_12 | {
"fields": [
{
"declarator": "temporaryFolder = new TemporaryFolder()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public TemporaryFolder temporaryFolder = new TemporaryFolder();",
"type": "TemporaryFolder",
"var_name": "temporaryFolder"
}
],
"file": "ws... | {
"body": "@Test(expected = IllegalStateException.class)\n public void testNullResult() throws IOException, TemplateException {\n PolicyCheckReport report = new PolicyCheckReport(null);\n report.generate(null, false);\n }",
"class_method_signature": "PolicyCheckReportTest.testNullResult()",
"c... | {
"fields": [
{
"declarator": "TEMPLATE_FOLDER = \"templates/\"",
"modifier": "private static final",
"original_string": "private static final String TEMPLATE_FOLDER = \"templates/\";",
"type": "String",
"var_name": "TEMPLATE_FOLDER"
},
{
"declarator": "TEMPLATE_FILE = ... | {
"body": "public File generate(File outputDir, boolean pack) throws IOException, TemplateException {\n return generate(outputDir, pack, null);\n }",
"class_method_signature": "PolicyCheckReport.generate(File outputDir, boolean pack)",
"constructor": false,
"full_signature": "public File generate(File... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 3726486,
"size": 4961,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/whitesource/agents"
} |
3726486_11 | {
"fields": [
{
"declarator": "DLL_FILE = \"/pecoff4j/Signature.dll\"",
"modifier": "private static final",
"original_string": "private static final String DLL_FILE = \"/pecoff4j/Signature.dll\";",
"type": "String",
"var_name": "DLL_FILE"
},
{
"declarator": "EXE_FILE = ... | {
"body": "@Test\n public void testGetHintsJar() throws IOException {\n File file = getResourceFile(JAR_FILE);\n DependencyHintsInfo dependencyHintsInfo = HintUtils.getHints(file.getPath());\n Assert.assertNull(dependencyHintsInfo);\n }",
"class_method_signature": "HintUtilsTest.testGetHi... | {
"fields": [
{
"declarator": "logger = Logger.getLogger(HintUtils.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger logger = Logger.getLogger(HintUtils.class.getName());",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "public static DependencyHintsInfo getHints(String filename) {\n DependencyHintsInfo hints = null;\n if (StringUtils.isNotBlank(filename)) {\n if (filename.matches(PORTABLE_EXECUTABLES_PATTERN)) {\n hints = getPortableExecutableHints(filename);\n }\n ... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 3726486,
"size": 4961,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/whitesource/agents"
} |
3726486_1 | {
"fields": [
{
"declarator": "EMPTY_FILE_SHA1 = \"da39a3ee5e6b4b0d3255bfef95601890afd80709\"",
"modifier": "private static final",
"original_string": "private static final String EMPTY_FILE_SHA1 = \"da39a3ee5e6b4b0d3255bfef95601890afd80709\";",
"type": "String",
"var_name": "EMPTY_F... | {
"body": "@Test\n public void testEmptyFileSHA1() throws IOException {\n String filePath = getClass().getResource(EMPTY_FILE_TXT).getFile();\n File file = new File(URLDecoder.decode(filePath, UTF_8));\n String sha1 = ChecksumUtils.calculateSHA1(file);\n Assert.assertEquals(EMPTY_FILE_S... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(ChecksumUtils.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(ChecksumUtils.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "public static String calculateSHA1(File resourceFile) throws IOException {\n return calculateHash(resourceFile, HashAlgorithm.SHA1);\n }",
"class_method_signature": "ChecksumUtils.calculateSHA1(File resourceFile)",
"constructor": false,
"full_signature": "public static String calculateSHA1(... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 3726486,
"size": 4961,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/whitesource/agents"
} |
3726486_0 | {
"fields": [],
"file": "wss-agent-utils/src/test/java/org/whitesource/agent/utils/JsonUtilsTest.java",
"identifier": "JsonUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Ignore\n @Test\n public void shouldDeserialize (){\n String currentDir = System.getProperty(\"user.dir\").toString();\n File input = Paths.get(currentDir, \"\\\\src\\\\test\\\\resources\\\\plain_request.txt\").toFile();\n try {\n try (FileInputStream fileInputStream =... | {
"fields": [
{
"declarator": "UTF_8 = \"UTF-8\"",
"modifier": "public static final",
"original_string": "public static final String UTF_8 = \"UTF-8\";",
"type": "String",
"var_name": "UTF_8"
},
{
"declarator": "logger = LoggerFactory.getLogger(JsonUtils.class)",
... | {
"body": "public static UpdateInventoryRequest readUpdateInventoryRequest(InputStream in) throws IOException {\n try (InputStreamReader inputStreamReader = new InputStreamReader(in, UTF_8);\n BufferedReader br = new BufferedReader(inputStreamReader);\n JsonReader reader = new JsonReade... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 3726486,
"size": 4961,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/whitesource/agents"
} |
3726486_10 | {
"fields": [
{
"declarator": "DLL_FILE = \"/pecoff4j/Signature.dll\"",
"modifier": "private static final",
"original_string": "private static final String DLL_FILE = \"/pecoff4j/Signature.dll\";",
"type": "String",
"var_name": "DLL_FILE"
},
{
"declarator": "EXE_FILE = ... | {
"body": "@Ignore\n @Test\n public void testGetHintsMsi() throws IOException {\n // TODO test when implemented\n File file = getResourceFile(MSI_FILE);\n DependencyHintsInfo dependencyHintsInfo = HintUtils.getHints(file.getPath());\n Assert.assertNotNull(dependencyHintsInfo);\n }... | {
"fields": [
{
"declarator": "logger = Logger.getLogger(HintUtils.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger logger = Logger.getLogger(HintUtils.class.getName());",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "public static DependencyHintsInfo getHints(String filename) {\n DependencyHintsInfo hints = null;\n if (StringUtils.isNotBlank(filename)) {\n if (filename.matches(PORTABLE_EXECUTABLES_PATTERN)) {\n hints = getPortableExecutableHints(filename);\n }\n ... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 3726486,
"size": 4961,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/whitesource/agents"
} |
3726486_7 | {
"fields": [
{
"declarator": "OS = System.getProperty(\"os.name\").toLowerCase()",
"modifier": "private static",
"original_string": "private static String OS = System.getProperty(\"os.name\").toLowerCase();",
"type": "String",
"var_name": "OS"
},
{
"declarator": "EMPTY... | {
"body": "@Test\n public void testSuperHash() throws IOException {\n HashCalculator hashCalculator = new HashCalculator();\n File originFile = new File(URLDecoder.decode(getClass().getResource(\"/superHash/origin.txt\").getFile(), \"utf-8\"));\n HashCalculationResult originFileHashResult = ha... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(HashCalculator.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = LoggerFactory.getLogger(HashCalculator.class);",
"type": "org.slf4j.Logger",
"var_name": "log... | {
"body": "public HashCalculationResult calculateSuperHash(File file) throws IOException {\n // Ignore files smaller than 0.5kb\n long fileSize = file.length();\n if (fileSize <= FILE_MIN_SIZE_THRESHOLD) {\n logger.debug(\"Ignored file \" + file.getName() + \" (\" + FileUtils.byteCount... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 3726486,
"size": 4961,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/whitesource/agents"
} |
3726486_6 | {
"fields": [
{
"declarator": "OS = System.getProperty(\"os.name\").toLowerCase()",
"modifier": "private static",
"original_string": "private static String OS = System.getProperty(\"os.name\").toLowerCase();",
"type": "String",
"var_name": "OS"
},
{
"declarator": "EMPTY... | {
"body": "@Test\n public void testSHA1() throws IOException {\n HashCalculator hashCalculator = new HashCalculator();\n \n String filePath = getClass().getResource(\"/empty-file.txt\").getFile();\n File file = new File(URLDecoder.decode(filePath, \"utf-8\"));\n String sha1 = has... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(HashCalculator.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = LoggerFactory.getLogger(HashCalculator.class);",
"type": "org.slf4j.Logger",
"var_name": "log... | {
"body": "public String calculateSHA1(File resourceFile) throws IOException {\n return calculateHash(resourceFile, HashAlgorithm.SHA1);\n }",
"class_method_signature": "HashCalculator.calculateSHA1(File resourceFile)",
"constructor": false,
"full_signature": "public String calculateSHA1(File resource... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 3726486,
"size": 4961,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/whitesource/agents"
} |
222455446_0 | {
"fields": [
{
"declarator": "userRepository = Mockito.mock(UserRepository.class)",
"modifier": "private final",
"original_string": "private final UserRepository userRepository = Mockito.mock(UserRepository.class);",
"type": "UserRepository",
"var_name": "userRepository"
},
... | {
"body": "@Test\n void getUser() {\n // just sample test\n final UserResponse user = userService.getUser(2);\n assertEquals(Integer.valueOf(2), user.getId());\n assertEquals(\"John Doe\", user.getName());\n }",
"class_method_signature": "UserServiceTest.getUser()",
"constructor"... | {
"fields": [
{
"declarator": "userRepository",
"modifier": "private final",
"original_string": "private final UserRepository userRepository;",
"type": "UserRepository",
"var_name": "userRepository"
}
],
"file": "application/src/main/java/com/codingbear/bss/application/servic... | {
"body": "@Transactional(readOnly = true)\n public UserResponse getUser(Integer userId) {\n final Optional<TestUser> user = userRepository.findById(userId);\n\n return user.map(UserService::toUserResponse).orElseThrow(NotFoundException::new);\n }",
"class_method_signature": "UserService.getUser... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 222455446,
"size": 92,
"stargazer_count": 7,
"stars": null,
"updates": null,
"url": "https://github.com/codingbearcom/bear-spring-starter"
} |
27292418_58 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public final",
"original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"... | {
"body": "@Test\n public void shouldTransformPatternSignatureWithParameterizedSum() {\n transform(\n \"module scotch.test\",\n \"find :: Map a b -> a -> Maybe b\"\n );\n shouldHaveSignature(\"scotch.test.find\", fn(sum(\"Map\", asList(var(\"a\"), var(\"b\"))), fn(var(\"a... | {
"fields": [
{
"declarator": "MAX_TUPLE_SIZE = 12",
"modifier": "private static final",
"original_string": "private static final int MAX_TUPLE_SIZE = 12;",
"type": "int",
"var_name": "MAX_TUPLE_SIZE"
},
{
"declarator": "definitions",
"modifier": "private final",
... | {
"body": "public DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap) {\n definition(null, RootDefinition.builder(),\n builder -> moduleMap.keySet().forEach(\n moduleName -> builder.withModule(transformModules(moduleName, moduleMap.get(moduleName)))));\n retur... | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 27292418,
"size": 2664,
"stargazer_count": 13,
"stars": null,
"updates": null,
"url": "https://github.com/lmcgrath/scotch-lang"
} |
27292418_19 | {
"fields": [
{
"declarator": "scope",
"modifier": "private",
"original_string": "private DefaultTypeScope scope;",
"type": "DefaultTypeScope",
"var_name": "scope"
}
],
"file": "scotch-compiler/src/test/java/scotch/compiler/syntax/type/ConstructorTypeTest.java",
"identifier... | {
"body": "@Test\n public void constructorShouldFlattenIntoSumIfHeadIsSum() {\n assertThat(ctor(sum(\"Map\", var(\"k\")), var(\"a\")).flatten(), is(sum(\"Map\", var(\"k\"), var(\"a\"))));\n }",
"class_method_signature": "ConstructorTypeTest.constructorShouldFlattenIntoSumIfHeadIsSum()",
"constructor"... | {
"fields": [
{
"declarator": "head",
"modifier": "private final",
"original_string": "private final Type head;",
"type": "Type",
"var_name": "head"
},
{
"declarator": "tail",
"modifier": "private final",
"original_string": "private final Type tail;",
... | {
"body": "@Override\n public Type flatten() {\n return head.flatten(tail.flatten_());\n }",
"class_method_signature": "ConstructorType.flatten()",
"constructor": false,
"full_signature": "@Override public Type flatten()",
"identifier": "flatten",
"invocations": [
"flatten",
"flatten_"
... | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 27292418,
"size": 2664,
"stargazer_count": 13,
"stars": null,
"updates": null,
"url": "https://github.com/lmcgrath/scotch-lang"
} |
27292418_62 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public final",
"original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"... | {
"body": "@Test\n public void shouldTransformFunctionLiteral() {\n transform(\n \"module scotch.test\",\n \"id = \\\\x -> x\"\n );\n shouldHaveValue(\"scotch.test.id\", matcher(\"scotch.test.(id#0)\", t(0), arg(\"#0\", t(2)),\n pattern(\"scotch.test.(id#0#0)\"... | {
"fields": [
{
"declarator": "MAX_TUPLE_SIZE = 12",
"modifier": "private static final",
"original_string": "private static final int MAX_TUPLE_SIZE = 12;",
"type": "int",
"var_name": "MAX_TUPLE_SIZE"
},
{
"declarator": "definitions",
"modifier": "private final",
... | {
"body": "public DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap) {\n definition(null, RootDefinition.builder(),\n builder -> moduleMap.keySet().forEach(\n moduleName -> builder.withModule(transformModules(moduleName, moduleMap.get(moduleName)))));\n retur... | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 27292418,
"size": 2664,
"stargazer_count": 13,
"stars": null,
"updates": null,
"url": "https://github.com/lmcgrath/scotch-lang"
} |
27292418_35 | {
"fields": [
{
"declarator": "resolver",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private SymbolResolver resolver;",
"type": "SymbolResolver",
"var_name": "resolver"
},
{
"declarator": "symbolGenerator",
"modifier": "@Mock\n private",
... | {
"body": "@Test\n public void shouldThrowBeEmpty_whenQualifyingUnqualifiedSymbol() {\n assertThat(rootScope.qualify(unqualified(\"fn\")), is(Optional.empty()));\n }",
"class_method_signature": "RootScopeTest.shouldThrowBeEmpty_whenQualifyingUnqualifiedSymbol()",
"constructor": false,
"full_signatu... | {
"fields": [
{
"declarator": "symbolGenerator",
"modifier": "private final",
"original_string": "private final SymbolGenerator symbolGenerator;",
"type": "SymbolGenerator",
"var_name": "symbolGenerator"
},
{
"declarator": "resolver",
"modifier": "private final... | {
"body": "@Override\n public Optional<Symbol> qualify(Symbol symbol) {\n return symbol.accept(new SymbolVisitor<Optional<Symbol>>() {\n @Override\n public Optional<Symbol> visit(QualifiedSymbol symbol) {\n if (resolver.isDefined(symbol)) {\n return Op... | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 27292418,
"size": 2664,
"stargazer_count": 13,
"stars": null,
"updates": null,
"url": "https://github.com/lmcgrath/scotch-lang"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.