id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
105770301_15 | {
"fields": [
{
"declarator": "AGE = 27",
"modifier": "final",
"original_string": "final int AGE = 27;",
"type": "int",
"var_name": "AGE"
},
{
"declarator": "NAME = \"William\"",
"modifier": "final",
"original_string": "final String NAME = \"William\";",
... | {
"body": "@Test\n public void testXmlToObject() {\n WorkItemManager manager = new TestWorkItemManager();\n WorkItemImpl workItem = new WorkItemImpl();\n workItem.setParameter(ParserWorkItemHandler.INPUT,\n PERSON_XML);\n workItem.setParameter(ParserWorkItem... | {
"fields": [
{
"declarator": "JSON = \"JSON\"",
"modifier": "public static final",
"original_string": "public static final String JSON = \"JSON\";",
"type": "String",
"var_name": "JSON"
},
{
"declarator": "XML = \"XML\"",
"modifier": "public static final",
... | {
"body": "public void executeWorkItem(WorkItem wi,\n WorkItemManager wim) {\n Object input;\n Object result = null;\n boolean toObject;\n Map<String, Object> results = new HashMap<String, Object>();\n try {\n\n RequiredParameterValidator.va... | {
"created": "10/4/2017 1:15:54 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 105770301,
"size": null,
"stargazer_count": null,
"stars": 24,
"updates": "2020-01-20T08:34:36+00:00",
"url": "https://github.com/kiegroup/jbpm-wo... |
105770301_5 | {
"fields": [],
"file": "exec-workitem/src/test/java/org/jbpm/process/workitem/exec/ExecWorkItemHandlerTest.java",
"identifier": "ExecWorkItemHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testExecCommandInvalidParam() throws Exception {\n TestWorkItemManager manager = new TestWorkItemManager();\n WorkItemImpl workItem = new WorkItemImpl();\n\n ExecWorkItemHandler handler = new ExecWorkItemHandler();\n handler.setLogThrownException(true);\n\... | {
"fields": [
{
"declarator": "RESULT = \"Output\"",
"modifier": "public static final",
"original_string": "public static final String RESULT = \"Output\";",
"type": "String",
"var_name": "RESULT"
},
{
"declarator": "parsedCommandStr = \"\"",
"modifier": "private"... | {
"body": "public void executeWorkItem(WorkItem workItem,\n WorkItemManager manager) {\n\n try {\n\n RequiredParameterValidator.validate(this.getClass(),\n workItem);\n\n String command = (String) workItem.getPa... | {
"created": "10/4/2017 1:15:54 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 105770301,
"size": null,
"stargazer_count": null,
"stars": 24,
"updates": "2020-01-20T08:34:36+00:00",
"url": "https://github.com/kiegroup/jbpm-wo... |
105770301_19 | {
"fields": [
{
"declarator": "AGE = 27",
"modifier": "final",
"original_string": "final int AGE = 27;",
"type": "int",
"var_name": "AGE"
},
{
"declarator": "NAME = \"William\"",
"modifier": "final",
"original_string": "final String NAME = \"William\";",
... | {
"body": "@Test\n public void testObjectToJson() {\n WorkItemManager manager = new TestWorkItemManager();\n Person p = new Person(NAME,\n AGE);\n WorkItemImpl workItem = new WorkItemImpl();\n workItem.setParameter(ParserWorkItemHandler.INPUT,\n ... | {
"fields": [
{
"declarator": "JSON = \"JSON\"",
"modifier": "public static final",
"original_string": "public static final String JSON = \"JSON\";",
"type": "String",
"var_name": "JSON"
},
{
"declarator": "XML = \"XML\"",
"modifier": "public static final",
... | {
"body": "public void executeWorkItem(WorkItem wi,\n WorkItemManager wim) {\n Object input;\n Object result = null;\n boolean toObject;\n Map<String, Object> results = new HashMap<String, Object>();\n try {\n\n RequiredParameterValidator.va... | {
"created": "10/4/2017 1:15:54 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 105770301,
"size": null,
"stargazer_count": null,
"stars": 24,
"updates": "2020-01-20T08:34:36+00:00",
"url": "https://github.com/kiegroup/jbpm-wo... |
105770301_9 | {
"fields": [
{
"declarator": "P_UNIT = \"org.jbpm.test.jpaWIH\"",
"modifier": "private static final",
"original_string": "private static final String P_UNIT = \"org.jbpm.test.jpaWIH\";",
"type": "String",
"var_name": "P_UNIT"
},
{
"declarator": "emf",
"modifier":... | {
"body": "@Test\n public void queryWithParameterActionTest() throws Exception {\n WorkItemManager manager = new TestWorkItemManager();\n String DESC = \"Cheese\";\n Product p1 = new Product(\"Bread\",\n 2f);\n Product p2 = new Product(\"Milk\",\n ... | {
"fields": [
{
"declarator": "logger = LoggerFactory\n .getLogger(JPAWorkItemHandler.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory\n .getLogger(JPAWorkItemHandler.class);",
"type": "Logger",
... | {
"body": "public void executeWorkItem(WorkItem wi,\n WorkItemManager wim) {\n Object actionParam = wi.getParameter(P_ACTION);\n Object entity = wi.getParameter(P_ENTITY);\n Object id = wi.getParameter(P_ID);\n Object type = wi.getParameter(P_TYPE);\n ... | {
"created": "10/4/2017 1:15:54 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 105770301,
"size": null,
"stargazer_count": null,
"stars": 24,
"updates": "2020-01-20T08:34:36+00:00",
"url": "https://github.com/kiegroup/jbpm-wo... |
105770301_23 | {
"fields": [],
"file": "mavenembedder-workitem/src/test/java/org/jbpm/process/workitem/mavenembedder/MavenEmbedderWorkitemHandlerTest.java",
"identifier": "MavenEmbedderWorkitemHandlerTest",
"interfaces": "",
"superclass": "extends AbstractBaseTest"
} | {
"body": "@Test\n public void testCleanInstallSimpleProjecAsynctWithCLOptions() throws Exception {\n TestWorkItemManager manager = new TestWorkItemManager();\n File simpleTestProjectDir = new File(\"src/test/resources/simple\");\n\n WorkItemImpl workItem = new WorkItemImpl();\n workIte... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(MavenEmbedderWorkItemHandler.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(MavenEmbedderWorkItemHandler.class);",
"type": "Logger",
"var_nam... | {
"body": "public void executeWorkItem(WorkItem workItem,\n WorkItemManager workItemManager) {\n\n try {\n\n RequiredParameterValidator.validate(this.getClass(),\n workItem);\n\n String goals = (String) workItem... | {
"created": "10/4/2017 1:15:54 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 105770301,
"size": null,
"stargazer_count": null,
"stars": 24,
"updates": "2020-01-20T08:34:36+00:00",
"url": "https://github.com/kiegroup/jbpm-wo... |
105770301_22 | {
"fields": [],
"file": "mavenembedder-workitem/src/test/java/org/jbpm/process/workitem/mavenembedder/MavenEmbedderWorkitemHandlerTest.java",
"identifier": "MavenEmbedderWorkitemHandlerTest",
"interfaces": "",
"superclass": "extends AbstractBaseTest"
} | {
"body": "@Test\n public void testCleanInstallSimpleProjecSynctWithCLOptions() {\n TestWorkItemManager manager = new TestWorkItemManager();\n File simpleTestProjectDir = new File(\"src/test/resources/simple\");\n\n WorkItemImpl workItem = new WorkItemImpl();\n workItem.setParameter(\"G... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(MavenEmbedderWorkItemHandler.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(MavenEmbedderWorkItemHandler.class);",
"type": "Logger",
"var_nam... | {
"body": "public void executeWorkItem(WorkItem workItem,\n WorkItemManager workItemManager) {\n\n try {\n\n RequiredParameterValidator.validate(this.getClass(),\n workItem);\n\n String goals = (String) workItem... | {
"created": "10/4/2017 1:15:54 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 105770301,
"size": null,
"stargazer_count": null,
"stars": 24,
"updates": "2020-01-20T08:34:36+00:00",
"url": "https://github.com/kiegroup/jbpm-wo... |
105770301_8 | {
"fields": [
{
"declarator": "P_UNIT = \"org.jbpm.test.jpaWIH\"",
"modifier": "private static final",
"original_string": "private static final String P_UNIT = \"org.jbpm.test.jpaWIH\";",
"type": "String",
"var_name": "P_UNIT"
},
{
"declarator": "emf",
"modifier":... | {
"body": "@Test\n public void updateOnProcessTest() throws Exception {\n String DESC = \"Table\";\n String NEW_DESC = \"Red Table\";\n Product p = new Product(DESC,\n 10f);\n ut.begin();\n EntityManager em = emf.createEntityManager();\n em.p... | {
"fields": [
{
"declarator": "logger = LoggerFactory\n .getLogger(JPAWorkItemHandler.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory\n .getLogger(JPAWorkItemHandler.class);",
"type": "Logger",
... | {
"body": "public void close() {\n emf.close();\n }",
"class_method_signature": "JPAWorkItemHandler.close()",
"constructor": false,
"full_signature": "public void close()",
"identifier": "close",
"invocations": [
"close"
],
"modifiers": "public",
"parameters": "()",
"return": "void",
... | {
"created": "10/4/2017 1:15:54 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 105770301,
"size": null,
"stargazer_count": null,
"stars": 24,
"updates": "2020-01-20T08:34:36+00:00",
"url": "https://github.com/kiegroup/jbpm-wo... |
105770301_18 | {
"fields": [
{
"declarator": "AGE = 27",
"modifier": "final",
"original_string": "final int AGE = 27;",
"type": "int",
"var_name": "AGE"
},
{
"declarator": "NAME = \"William\"",
"modifier": "final",
"original_string": "final String NAME = \"William\";",
... | {
"body": "@Test\n public void testJsonToObject() {\n WorkItemManager manager = new TestWorkItemManager();\n WorkItemImpl workItem = new WorkItemImpl();\n workItem.setParameter(ParserWorkItemHandler.INPUT,\n PERSON_JSON);\n workItem.setParameter(ParserWorkIt... | {
"fields": [
{
"declarator": "JSON = \"JSON\"",
"modifier": "public static final",
"original_string": "public static final String JSON = \"JSON\";",
"type": "String",
"var_name": "JSON"
},
{
"declarator": "XML = \"XML\"",
"modifier": "public static final",
... | {
"body": "public void executeWorkItem(WorkItem wi,\n WorkItemManager wim) {\n Object input;\n Object result = null;\n boolean toObject;\n Map<String, Object> results = new HashMap<String, Object>();\n try {\n\n RequiredParameterValidator.va... | {
"created": "10/4/2017 1:15:54 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 105770301,
"size": null,
"stargazer_count": null,
"stars": 24,
"updates": "2020-01-20T08:34:36+00:00",
"url": "https://github.com/kiegroup/jbpm-wo... |
105770301_4 | {
"fields": [],
"file": "exec-workitem/src/test/java/org/jbpm/process/workitem/exec/ExecShellScriptWorkItemHandlerTest.java",
"identifier": "ExecShellScriptWorkItemHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testExecShellScriptCommandInvalidParam() throws Exception {\n TestWorkItemManager manager = new TestWorkItemManager();\n WorkItemImpl workItem = new WorkItemImpl();\n\n ExecShellScriptWorkItemHandler handler = new ExecShellScriptWorkItemHandler();\n handle... | {
"fields": [
{
"declarator": "RESULT = \"Output\"",
"modifier": "public static final",
"original_string": "public static final String RESULT = \"Output\";",
"type": "String",
"var_name": "RESULT"
},
{
"declarator": "logger = LoggerFactory.getLogger(ExecShellScriptWorkI... | {
"body": "public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {\n\n try {\n\n RequiredParameterValidator.validate(this.getClass(), workItem);\n String shellScriptLocation = (String) workItem.getParameter(\"ShellScriptLocation\");\n String tout = (String) wo... | {
"created": "10/4/2017 1:15:54 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 105770301,
"size": null,
"stargazer_count": null,
"stars": 24,
"updates": "2020-01-20T08:34:36+00:00",
"url": "https://github.com/kiegroup/jbpm-wo... |
105770301_14 | {
"fields": [
{
"declarator": "TOPIC_FIELD = \"Topic\"",
"modifier": "private static final",
"original_string": "private static final String TOPIC_FIELD = \"Topic\";",
"type": "String",
"var_name": "TOPIC_FIELD"
},
{
"declarator": "KEY_FIELD = \"Key\"",
"modifier"... | {
"body": "@Test\n public void testExceptionHandlingWhenClosed() throws Exception{\n buildKafkaWIH(true);\n\n mockProducerString.close();\n\n assertExceptionAfterExecuteWorkItem(workItem);\n }",
"class_method_signature": "KafkaWorkItemHandlerTest.testExceptionHandlingWhenClosed()",
"con... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(KafkaWorkItemHandler.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(KafkaWorkItemHandler.class);",
"type": "Logger",
"var_name": "LOG"
},
{... | {
"body": "@Override\n public void close() {\n if (producer != null) {\n producer.flush();\n producer.close();\n }\n }",
"class_method_signature": "KafkaWorkItemHandler.close()",
"constructor": false,
"full_signature": "@Override public void close()",
"identifier": "c... | {
"created": "10/4/2017 1:15:54 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 105770301,
"size": null,
"stargazer_count": null,
"stars": 24,
"updates": "2020-01-20T08:34:36+00:00",
"url": "https://github.com/kiegroup/jbpm-wo... |
105770301_7 | {
"fields": [
{
"declarator": "P_UNIT = \"org.jbpm.test.jpaWIH\"",
"modifier": "private static final",
"original_string": "private static final String P_UNIT = \"org.jbpm.test.jpaWIH\";",
"type": "String",
"var_name": "P_UNIT"
},
{
"declarator": "emf",
"modifier":... | {
"body": "@Test\n public void removeOnProcessTest() throws Exception {\n Product p = new Product(\"A Product\",\n 10f);\n ut.begin();\n EntityManager em = emf.createEntityManager();\n em.persist(p);\n long id = p.getId();\n em.close();\n ... | {
"fields": [
{
"declarator": "logger = LoggerFactory\n .getLogger(JPAWorkItemHandler.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory\n .getLogger(JPAWorkItemHandler.class);",
"type": "Logger",
... | {
"body": "public void close() {\n emf.close();\n }",
"class_method_signature": "JPAWorkItemHandler.close()",
"constructor": false,
"full_signature": "public void close()",
"identifier": "close",
"invocations": [
"close"
],
"modifiers": "public",
"parameters": "()",
"return": "void",
... | {
"created": "10/4/2017 1:15:54 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 105770301,
"size": null,
"stargazer_count": null,
"stars": 24,
"updates": "2020-01-20T08:34:36+00:00",
"url": "https://github.com/kiegroup/jbpm-wo... |
105770301_17 | {
"fields": [
{
"declarator": "AGE = 27",
"modifier": "final",
"original_string": "final int AGE = 27;",
"type": "int",
"var_name": "AGE"
},
{
"declarator": "NAME = \"William\"",
"modifier": "final",
"original_string": "final String NAME = \"William\";",
... | {
"body": "@Test\n public void testObjectToXml() {\n WorkItemManager manager = new TestWorkItemManager();\n Person p = new Person(NAME,\n AGE);\n WorkItemImpl workItem = new WorkItemImpl();\n workItem.setParameter(ParserWorkItemHandler.INPUT,\n ... | {
"fields": [
{
"declarator": "JSON = \"JSON\"",
"modifier": "public static final",
"original_string": "public static final String JSON = \"JSON\";",
"type": "String",
"var_name": "JSON"
},
{
"declarator": "XML = \"XML\"",
"modifier": "public static final",
... | {
"body": "public void executeWorkItem(WorkItem wi,\n WorkItemManager wim) {\n Object input;\n Object result = null;\n boolean toObject;\n Map<String, Object> results = new HashMap<String, Object>();\n try {\n\n RequiredParameterValidator.va... | {
"created": "10/4/2017 1:15:54 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 105770301,
"size": null,
"stargazer_count": null,
"stars": 24,
"updates": "2020-01-20T08:34:36+00:00",
"url": "https://github.com/kiegroup/jbpm-wo... |
105770301_21 | {
"fields": [],
"file": "mavenembedder-workitem/src/test/java/org/jbpm/process/workitem/mavenembedder/MavenEmbedderWorkitemHandlerTest.java",
"identifier": "MavenEmbedderWorkitemHandlerTest",
"interfaces": "",
"superclass": "extends AbstractBaseTest"
} | {
"body": "@Test\n public void testCleanInstallSimpleProjectAsync() throws Exception {\n TestWorkItemManager manager = new TestWorkItemManager();\n File simpleTestProjectDir = new File(\"src/test/resources/simple\");\n\n WorkItemImpl workItem = new WorkItemImpl();\n workItem.setParamete... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(MavenEmbedderWorkItemHandler.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(MavenEmbedderWorkItemHandler.class);",
"type": "Logger",
"var_nam... | {
"body": "public void executeWorkItem(WorkItem workItem,\n WorkItemManager workItemManager) {\n\n try {\n\n RequiredParameterValidator.validate(this.getClass(),\n workItem);\n\n String goals = (String) workItem... | {
"created": "10/4/2017 1:15:54 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 105770301,
"size": null,
"stargazer_count": null,
"stars": 24,
"updates": "2020-01-20T08:34:36+00:00",
"url": "https://github.com/kiegroup/jbpm-wo... |
105770301_20 | {
"fields": [],
"file": "mavenembedder-workitem/src/test/java/org/jbpm/process/workitem/mavenembedder/MavenEmbedderWorkitemHandlerTest.java",
"identifier": "MavenEmbedderWorkitemHandlerTest",
"interfaces": "",
"superclass": "extends AbstractBaseTest"
} | {
"body": "@Test\n public void testCleanInstallSimpleProjectSync() {\n TestWorkItemManager manager = new TestWorkItemManager();\n File simpleTestProjectDir = new File(\"src/test/resources/simple\");\n\n WorkItemImpl workItem = new WorkItemImpl();\n workItem.setParameter(\"Goals\",\n ... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(MavenEmbedderWorkItemHandler.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(MavenEmbedderWorkItemHandler.class);",
"type": "Logger",
"var_nam... | {
"body": "public void executeWorkItem(WorkItem workItem,\n WorkItemManager workItemManager) {\n\n try {\n\n RequiredParameterValidator.validate(this.getClass(),\n workItem);\n\n String goals = (String) workItem... | {
"created": "10/4/2017 1:15:54 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 105770301,
"size": null,
"stargazer_count": null,
"stars": 24,
"updates": "2020-01-20T08:34:36+00:00",
"url": "https://github.com/kiegroup/jbpm-wo... |
105770301_16 | {
"fields": [
{
"declarator": "AGE = 27",
"modifier": "final",
"original_string": "final int AGE = 27;",
"type": "int",
"var_name": "AGE"
},
{
"declarator": "NAME = \"William\"",
"modifier": "final",
"original_string": "final String NAME = \"William\";",
... | {
"body": "@Test(expected = WorkItemHandlerRuntimeException.class)\n public void testXmlToObjectInvalidParams() {\n WorkItemManager manager = new TestWorkItemManager();\n WorkItemImpl workItem = new WorkItemImpl();\n handler.executeWorkItem(workItem,\n manager);\... | {
"fields": [
{
"declarator": "JSON = \"JSON\"",
"modifier": "public static final",
"original_string": "public static final String JSON = \"JSON\";",
"type": "String",
"var_name": "JSON"
},
{
"declarator": "XML = \"XML\"",
"modifier": "public static final",
... | {
"body": "public void executeWorkItem(WorkItem wi,\n WorkItemManager wim) {\n Object input;\n Object result = null;\n boolean toObject;\n Map<String, Object> results = new HashMap<String, Object>();\n try {\n\n RequiredParameterValidator.va... | {
"created": "10/4/2017 1:15:54 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 105770301,
"size": null,
"stargazer_count": null,
"stars": 24,
"updates": "2020-01-20T08:34:36+00:00",
"url": "https://github.com/kiegroup/jbpm-wo... |
105770301_6 | {
"fields": [
{
"declarator": "P_UNIT = \"org.jbpm.test.jpaWIH\"",
"modifier": "private static final",
"original_string": "private static final String P_UNIT = \"org.jbpm.test.jpaWIH\";",
"type": "String",
"var_name": "P_UNIT"
},
{
"declarator": "emf",
"modifier":... | {
"body": "@Test\n public void createOnProcessTest() throws Exception {\n String DESC = \"Table\";\n Product p = new Product(DESC,\n 10f);\n startJPAWIHProcess(JPAWorkItemHandler.CREATE_ACTION,\n p);\n UserTransaction ut = getUser... | {
"fields": [
{
"declarator": "logger = LoggerFactory\n .getLogger(JPAWorkItemHandler.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory\n .getLogger(JPAWorkItemHandler.class);",
"type": "Logger",
... | {
"body": "public void close() {\n emf.close();\n }",
"class_method_signature": "JPAWorkItemHandler.close()",
"constructor": false,
"full_signature": "public void close()",
"identifier": "close",
"invocations": [
"close"
],
"modifiers": "public",
"parameters": "()",
"return": "void",
... | {
"created": "10/4/2017 1:15:54 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 105770301,
"size": null,
"stargazer_count": null,
"stars": 24,
"updates": "2020-01-20T08:34:36+00:00",
"url": "https://github.com/kiegroup/jbpm-wo... |
105770301_27 | {
"fields": [
{
"declarator": "DS_NAME = \"executeSqlData\"",
"modifier": "private static final",
"original_string": "private static final String DS_NAME = \"executeSqlData\";",
"type": "String",
"var_name": "DS_NAME"
},
{
"declarator": "h2Server",
"modifier": "pr... | {
"body": "@Test\n public void testNoResults() throws Exception {\n TestWorkItemManager manager = new TestWorkItemManager();\n WorkItemImpl workItem = new WorkItemImpl();\n workItem.setParameter(\"SQLStatement\",\n \"select * from Person where id = 100\");\n ... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(ExecuteSqlWorkItemHandler.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(ExecuteSqlWorkItemHandler.class);",
"type": "Logger",
"var_name": "l... | {
"body": "public void executeWorkItem(WorkItem workItem,\n WorkItemManager workItemManager) {\n Connection connection = null;\n PreparedStatement statement = null;\n ResultSet resultSet = null;\n\n try {\n RequiredParameterValidator.validate(this.... | {
"created": "10/4/2017 1:15:54 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 105770301,
"size": null,
"stargazer_count": null,
"stars": 24,
"updates": "2020-01-20T08:34:36+00:00",
"url": "https://github.com/kiegroup/jbpm-wo... |
105770301_1 | {
"fields": [],
"file": "exec-workitem/src/test/java/org/jbpm/process/workitem/exec/ExecShellScriptWorkItemHandlerTest.java",
"identifier": "ExecShellScriptWorkItemHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testExecShellScriptCommandWithTimeout() throws Exception {\n TestWorkItemManager manager = new TestWorkItemManager();\n WorkItemImpl workItem = new WorkItemImpl();\n workItem.setParameter(\"ShellScriptLocation\", \"src/test/resources/TestScript.sh\");\n wo... | {
"fields": [
{
"declarator": "RESULT = \"Output\"",
"modifier": "public static final",
"original_string": "public static final String RESULT = \"Output\";",
"type": "String",
"var_name": "RESULT"
},
{
"declarator": "logger = LoggerFactory.getLogger(ExecShellScriptWorkI... | {
"body": "public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {\n\n try {\n\n RequiredParameterValidator.validate(this.getClass(), workItem);\n String shellScriptLocation = (String) workItem.getParameter(\"ShellScriptLocation\");\n String tout = (String) wo... | {
"created": "10/4/2017 1:15:54 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 105770301,
"size": null,
"stargazer_count": null,
"stars": 24,
"updates": "2020-01-20T08:34:36+00:00",
"url": "https://github.com/kiegroup/jbpm-wo... |
105770301_11 | {
"fields": [
{
"declarator": "tempFolder = new TemporaryFolder()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public TemporaryFolder tempFolder = new TemporaryFolder();",
"type": "TemporaryFolder",
"var_name": "tempFolder"
}
],
"file": "archive-workitem/... | {
"body": "@Test\n public void testNoFilesSpecified() {\n TestWorkItemManager manager = new TestWorkItemManager();\n WorkItemImpl workItem = new WorkItemImpl();\n workItem.setParameter(\"Archive\",\n \"testfile.txt\");\n workItem.setParameter(\"Files\",\n ... | {
"fields": [],
"file": "archive-workitem/src/main/java/org/jbpm/process/workitem/archive/ArchiveWorkItemHandler.java",
"identifier": "ArchiveWorkItemHandler",
"interfaces": "",
"methods": [
{
"class_method_signature": "ArchiveWorkItemHandler.executeWorkItem(WorkItem workItem,\n ... | {
"body": "public void executeWorkItem(WorkItem workItem,\n WorkItemManager manager) {\n String archive = (String) workItem.getParameter(\"Archive\");\n List<File> files = (List<File>) workItem.getParameter(\"Files\");\n\n try {\n RequiredParameterValidat... | {
"created": "10/4/2017 1:15:54 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 105770301,
"size": null,
"stargazer_count": null,
"stars": 24,
"updates": "2020-01-20T08:34:36+00:00",
"url": "https://github.com/kiegroup/jbpm-wo... |
105770301_10 | {
"fields": [
{
"declarator": "P_UNIT = \"org.jbpm.test.jpaWIH\"",
"modifier": "private static final",
"original_string": "private static final String P_UNIT = \"org.jbpm.test.jpaWIH\";",
"type": "String",
"var_name": "P_UNIT"
},
{
"declarator": "emf",
"modifier":... | {
"body": "@Test(expected = WorkItemHandlerRuntimeException.class)\n public void queryWithParameterActionTestInvalidParams() throws Exception {\n WorkItemManager manager = new TestWorkItemManager();\n String DESC = \"Cheese\";\n Product p1 = new Product(\"Bread\",\n ... | {
"fields": [
{
"declarator": "logger = LoggerFactory\n .getLogger(JPAWorkItemHandler.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory\n .getLogger(JPAWorkItemHandler.class);",
"type": "Logger",
... | {
"body": "public void executeWorkItem(WorkItem wi,\n WorkItemManager wim) {\n Object actionParam = wi.getParameter(P_ACTION);\n Object entity = wi.getParameter(P_ENTITY);\n Object id = wi.getParameter(P_ID);\n Object type = wi.getParameter(P_TYPE);\n ... | {
"created": "10/4/2017 1:15:54 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 105770301,
"size": null,
"stargazer_count": null,
"stars": 24,
"updates": "2020-01-20T08:34:36+00:00",
"url": "https://github.com/kiegroup/jbpm-wo... |
105770301_0 | {
"fields": [],
"file": "exec-workitem/src/test/java/org/jbpm/process/workitem/exec/ExecShellScriptWorkItemHandlerTest.java",
"identifier": "ExecShellScriptWorkItemHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testExecShellScriptCommand() throws Exception {\n TestWorkItemManager manager = new TestWorkItemManager();\n WorkItemImpl workItem = new WorkItemImpl();\n workItem.setParameter(\"ShellScriptLocation\", \"src/test/resources/TestScript.sh\");\n ExecShellScri... | {
"fields": [
{
"declarator": "RESULT = \"Output\"",
"modifier": "public static final",
"original_string": "public static final String RESULT = \"Output\";",
"type": "String",
"var_name": "RESULT"
},
{
"declarator": "logger = LoggerFactory.getLogger(ExecShellScriptWorkI... | {
"body": "public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {\n\n try {\n\n RequiredParameterValidator.validate(this.getClass(), workItem);\n String shellScriptLocation = (String) workItem.getParameter(\"ShellScriptLocation\");\n String tout = (String) wo... | {
"created": "10/4/2017 1:15:54 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 105770301,
"size": null,
"stargazer_count": null,
"stars": 24,
"updates": "2020-01-20T08:34:36+00:00",
"url": "https://github.com/kiegroup/jbpm-wo... |
105770301_26 | {
"fields": [
{
"declarator": "DS_NAME = \"executeSqlData\"",
"modifier": "private static final",
"original_string": "private static final String DS_NAME = \"executeSqlData\";",
"type": "String",
"var_name": "DS_NAME"
},
{
"declarator": "h2Server",
"modifier": "pr... | {
"body": "@Test\n public void testFetchSpecificRow() throws Exception {\n TestWorkItemManager manager = new TestWorkItemManager();\n WorkItemImpl workItem = new WorkItemImpl();\n workItem.setParameter(\"SQLStatement\",\n \"select * from Person where id = 1\");\n ... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(ExecuteSqlWorkItemHandler.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(ExecuteSqlWorkItemHandler.class);",
"type": "Logger",
"var_name": "l... | {
"body": "public void executeWorkItem(WorkItem workItem,\n WorkItemManager workItemManager) {\n Connection connection = null;\n PreparedStatement statement = null;\n ResultSet resultSet = null;\n\n try {\n RequiredParameterValidator.validate(this.... | {
"created": "10/4/2017 1:15:54 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 105770301,
"size": null,
"stargazer_count": null,
"stars": 24,
"updates": "2020-01-20T08:34:36+00:00",
"url": "https://github.com/kiegroup/jbpm-wo... |
35402802_1 | {
"fields": [],
"file": "app/libs/socket.io-client.java-master/src/test/java/com/github/nkzawa/hasbinary/HasBinaryTest.java",
"identifier": "HasBinaryTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void anArrayThatDoesNotContainByteArray() throws JSONException {\n JSONArray arr = new JSONArray(\"[1, \\\"cool\\\", 2]\");\n assertTrue(!HasBinary.hasBinary(arr));\n }",
"class_method_signature": "HasBinaryTest.anArrayThatDoesNotContainByteArray()",
"constructor": fa... | {
"fields": [],
"file": "app/libs/socket.io-client.java-master/src/main/java/com/github/nkzawa/hasbinary/HasBinary.java",
"identifier": "HasBinary",
"interfaces": "",
"methods": [
{
"class_method_signature": "HasBinary.HasBinary()",
"constructor": true,
"full_signature": "private HasBin... | {
"body": "private HasBinary() {}",
"class_method_signature": "HasBinary.HasBinary()",
"constructor": true,
"full_signature": "private HasBinary()",
"identifier": "HasBinary",
"invocations": [],
"modifiers": "private",
"parameters": "()",
"return": "",
"signature": " HasBinary()",
"testcase": fal... | {
"created": null,
"fork": null,
"fork_count": 13,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35402802,
"size": 278,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/sreejesh79/android-socket.io-demo"
} |
35402802_0 | {
"fields": [],
"file": "app/libs/socket.io-client.java-master/src/test/java/com/github/nkzawa/hasbinary/HasBinaryTest.java",
"identifier": "HasBinaryTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void byteArray() {\n assertTrue(HasBinary.hasBinary(new byte[0]));\n }",
"class_method_signature": "HasBinaryTest.byteArray()",
"constructor": false,
"full_signature": "@Test public void byteArray()",
"identifier": "byteArray",
"invocations": [
"assertTrue",
"h... | {
"fields": [],
"file": "app/libs/socket.io-client.java-master/src/main/java/com/github/nkzawa/hasbinary/HasBinary.java",
"identifier": "HasBinary",
"interfaces": "",
"methods": [
{
"class_method_signature": "HasBinary.HasBinary()",
"constructor": true,
"full_signature": "private HasBin... | {
"body": "private HasBinary() {}",
"class_method_signature": "HasBinary.HasBinary()",
"constructor": true,
"full_signature": "private HasBinary()",
"identifier": "HasBinary",
"invocations": [],
"modifiers": "private",
"parameters": "()",
"return": "",
"signature": " HasBinary()",
"testcase": fal... | {
"created": null,
"fork": null,
"fork_count": 13,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35402802,
"size": 278,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/sreejesh79/android-socket.io-demo"
} |
35402802_11 | {
"fields": [],
"file": "app/libs/socket.io-client.java-master/src/test/java/com/github/nkzawa/socketio/client/UrlTest.java",
"identifier": "UrlTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void parseNamespace() throws MalformedURLException, URISyntaxException {\n assertThat(Url.parse(\"http://woot.com/woot\").getPath(), is(\"/woot\"));\n assertThat(Url.parse(\"http://google.com\").getPath(), is(\"/\"));\n assertThat(Url.parse(\"http://google.com/\").get... | {
"fields": [
{
"declarator": "PATTERN_HTTP = Pattern.compile(\"^http|ws$\")",
"modifier": "private static",
"original_string": "private static Pattern PATTERN_HTTP = Pattern.compile(\"^http|ws$\");",
"type": "Pattern",
"var_name": "PATTERN_HTTP"
},
{
"declarator": "PAT... | {
"body": "public static URL parse(String uri) throws URISyntaxException, MalformedURLException {\n return parse(new URI(uri));\n }",
"class_method_signature": "Url.parse(String uri)",
"constructor": false,
"full_signature": "public static URL parse(String uri)",
"identifier": "parse",
"invocation... | {
"created": null,
"fork": null,
"fork_count": 13,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35402802,
"size": 278,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/sreejesh79/android-socket.io-demo"
} |
35402802_7 | {
"fields": [],
"file": "app/libs/socket.io-client.java-master/src/test/java/com/github/nkzawa/hasbinary/HasBinaryTest.java",
"identifier": "HasBinaryTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void aComplexObjectThatContainsBinary() throws JSONException {\n JSONObject ob = new JSONObject();\n ob.put(\"x\", new JSONArray(\"[\\\"a\\\", \\\"b\\\", 123]\"));\n ob.put(\"y\", JSONObject.NULL);\n ob.put(\"z\", new JSONObject(\"{\\\"a\\\": \\\"x\\\", \\\"b\\... | {
"fields": [],
"file": "app/libs/socket.io-client.java-master/src/main/java/com/github/nkzawa/hasbinary/HasBinary.java",
"identifier": "HasBinary",
"interfaces": "",
"methods": [
{
"class_method_signature": "HasBinary.HasBinary()",
"constructor": true,
"full_signature": "private HasBin... | {
"body": "private HasBinary() {}",
"class_method_signature": "HasBinary.HasBinary()",
"constructor": true,
"full_signature": "private HasBinary()",
"identifier": "HasBinary",
"invocations": [],
"modifiers": "private",
"parameters": "()",
"return": "",
"signature": " HasBinary()",
"testcase": fal... | {
"created": null,
"fork": null,
"fork_count": 13,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35402802,
"size": 278,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/sreejesh79/android-socket.io-demo"
} |
35402802_6 | {
"fields": [],
"file": "app/libs/socket.io-client.java-master/src/test/java/com/github/nkzawa/hasbinary/HasBinaryTest.java",
"identifier": "HasBinaryTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void aComplexObjectThatContainsNoBinary() throws JSONException {\n JSONObject ob = new JSONObject();\n ob.put(\"x\", new JSONArray(\"[\\\"a\\\", \\\"b\\\", 123]\"));\n ob.put(\"y\", JSONObject.NULL);\n ob.put(\"z\", new JSONObject(\"{\\\"a\\\": \\\"x\\\", \\\"b... | {
"fields": [],
"file": "app/libs/socket.io-client.java-master/src/main/java/com/github/nkzawa/hasbinary/HasBinary.java",
"identifier": "HasBinary",
"interfaces": "",
"methods": [
{
"class_method_signature": "HasBinary.HasBinary()",
"constructor": true,
"full_signature": "private HasBin... | {
"body": "private HasBinary() {}",
"class_method_signature": "HasBinary.HasBinary()",
"constructor": true,
"full_signature": "private HasBinary()",
"identifier": "HasBinary",
"invocations": [],
"modifiers": "private",
"parameters": "()",
"return": "",
"signature": " HasBinary()",
"testcase": fal... | {
"created": null,
"fork": null,
"fork_count": 13,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35402802,
"size": 278,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/sreejesh79/android-socket.io-demo"
} |
35402802_10 | {
"fields": [],
"file": "app/libs/socket.io-client.java-master/src/test/java/com/github/nkzawa/socketio/client/UrlTest.java",
"identifier": "UrlTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void parseNoProtocol() throws MalformedURLException, URISyntaxException {\n URL url = Url.parse(\"//localhost:3000\");\n assertThat(url.getProtocol(), is(\"https\"));\n assertThat(url.getHost(), is(\"localhost\"));\n assertThat(url.getPort(), is(3000));\n }"... | {
"fields": [
{
"declarator": "PATTERN_HTTP = Pattern.compile(\"^http|ws$\")",
"modifier": "private static",
"original_string": "private static Pattern PATTERN_HTTP = Pattern.compile(\"^http|ws$\");",
"type": "Pattern",
"var_name": "PATTERN_HTTP"
},
{
"declarator": "PAT... | {
"body": "public static URL parse(String uri) throws URISyntaxException, MalformedURLException {\n return parse(new URI(uri));\n }",
"class_method_signature": "Url.parse(String uri)",
"constructor": false,
"full_signature": "public static URL parse(String uri)",
"identifier": "parse",
"invocation... | {
"created": null,
"fork": null,
"fork_count": 13,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35402802,
"size": 278,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/sreejesh79/android-socket.io-demo"
} |
35402802_5 | {
"fields": [],
"file": "app/libs/socket.io-client.java-master/src/test/java/com/github/nkzawa/hasbinary/HasBinaryTest.java",
"identifier": "HasBinaryTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testNull() {\n assertTrue(!HasBinary.hasBinary(null));\n }",
"class_method_signature": "HasBinaryTest.testNull()",
"constructor": false,
"full_signature": "@Test public void testNull()",
"identifier": "testNull",
"invocations": [
"assertTrue",
"hasBinary"
... | {
"fields": [],
"file": "app/libs/socket.io-client.java-master/src/main/java/com/github/nkzawa/hasbinary/HasBinary.java",
"identifier": "HasBinary",
"interfaces": "",
"methods": [
{
"class_method_signature": "HasBinary.HasBinary()",
"constructor": true,
"full_signature": "private HasBin... | {
"body": "private HasBinary() {}",
"class_method_signature": "HasBinary.HasBinary()",
"constructor": true,
"full_signature": "private HasBinary()",
"identifier": "HasBinary",
"invocations": [],
"modifiers": "private",
"parameters": "()",
"return": "",
"signature": " HasBinary()",
"testcase": fal... | {
"created": null,
"fork": null,
"fork_count": 13,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35402802,
"size": 278,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/sreejesh79/android-socket.io-demo"
} |
35402802_13 | {
"fields": [],
"file": "app/libs/socket.io-client.java-master/src/test/java/com/github/nkzawa/socketio/client/UrlTest.java",
"identifier": "UrlTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void extractId() throws MalformedURLException {\n String id1 = Url.extractId(\"http://google.com:80/\");\n String id2 = Url.extractId(\"http://google.com/\");\n String id3 = Url.extractId(\"https://google.com/\");\n assertThat(id1, is(id2));\n assertThat... | {
"fields": [
{
"declarator": "PATTERN_HTTP = Pattern.compile(\"^http|ws$\")",
"modifier": "private static",
"original_string": "private static Pattern PATTERN_HTTP = Pattern.compile(\"^http|ws$\");",
"type": "Pattern",
"var_name": "PATTERN_HTTP"
},
{
"declarator": "PAT... | {
"body": "public static String extractId(String url) throws MalformedURLException {\n return extractId(new URL(url));\n }",
"class_method_signature": "Url.extractId(String url)",
"constructor": false,
"full_signature": "public static String extractId(String url)",
"identifier": "extractId",
"invo... | {
"created": null,
"fork": null,
"fork_count": 13,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35402802,
"size": 278,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/sreejesh79/android-socket.io-demo"
} |
35402802_9 | {
"fields": [],
"file": "app/libs/socket.io-client.java-master/src/test/java/com/github/nkzawa/socketio/client/UrlTest.java",
"identifier": "UrlTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void parseRelativePath() throws MalformedURLException, URISyntaxException {\n URL url = Url.parse(\"https://woot.com/test\");\n assertThat(url.getProtocol(), is(\"https\"));\n assertThat(url.getHost(), is(\"woot.com\"));\n assertThat(url.getPath(), is(\"/test\"... | {
"fields": [
{
"declarator": "PATTERN_HTTP = Pattern.compile(\"^http|ws$\")",
"modifier": "private static",
"original_string": "private static Pattern PATTERN_HTTP = Pattern.compile(\"^http|ws$\");",
"type": "Pattern",
"var_name": "PATTERN_HTTP"
},
{
"declarator": "PAT... | {
"body": "public static URL parse(String uri) throws URISyntaxException, MalformedURLException {\n return parse(new URI(uri));\n }",
"class_method_signature": "Url.parse(String uri)",
"constructor": false,
"full_signature": "public static URL parse(String uri)",
"identifier": "parse",
"invocation... | {
"created": null,
"fork": null,
"fork_count": 13,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35402802,
"size": 278,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/sreejesh79/android-socket.io-demo"
} |
35402802_8 | {
"fields": [],
"file": "app/libs/socket.io-client.java-master/src/test/java/com/github/nkzawa/socketio/client/UrlTest.java",
"identifier": "UrlTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void parse() throws MalformedURLException, URISyntaxException {\n assertThat(Url.parse(\"http://username:password@host:8080/directory/file?query#ref\").toString(),\n is(\"http://username:password@host:8080/directory/file?query#ref\"));\n }",
"class_method_signat... | {
"fields": [
{
"declarator": "PATTERN_HTTP = Pattern.compile(\"^http|ws$\")",
"modifier": "private static",
"original_string": "private static Pattern PATTERN_HTTP = Pattern.compile(\"^http|ws$\");",
"type": "Pattern",
"var_name": "PATTERN_HTTP"
},
{
"declarator": "PAT... | {
"body": "public static URL parse(String uri) throws URISyntaxException, MalformedURLException {\n return parse(new URI(uri));\n }",
"class_method_signature": "Url.parse(String uri)",
"constructor": false,
"full_signature": "public static URL parse(String uri)",
"identifier": "parse",
"invocation... | {
"created": null,
"fork": null,
"fork_count": 13,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35402802,
"size": 278,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/sreejesh79/android-socket.io-demo"
} |
35402802_12 | {
"fields": [],
"file": "app/libs/socket.io-client.java-master/src/test/java/com/github/nkzawa/socketio/client/UrlTest.java",
"identifier": "UrlTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void parseDefaultPort() throws MalformedURLException, URISyntaxException {\n assertThat(Url.parse(\"http://google.com/\").toString(), is(\"http://google.com:80/\"));\n assertThat(Url.parse(\"https://google.com/\").toString(), is(\"https://google.com:443/\"));\n }",
"cla... | {
"fields": [
{
"declarator": "PATTERN_HTTP = Pattern.compile(\"^http|ws$\")",
"modifier": "private static",
"original_string": "private static Pattern PATTERN_HTTP = Pattern.compile(\"^http|ws$\");",
"type": "Pattern",
"var_name": "PATTERN_HTTP"
},
{
"declarator": "PAT... | {
"body": "public static URL parse(String uri) throws URISyntaxException, MalformedURLException {\n return parse(new URI(uri));\n }",
"class_method_signature": "Url.parse(String uri)",
"constructor": false,
"full_signature": "public static URL parse(String uri)",
"identifier": "parse",
"invocation... | {
"created": null,
"fork": null,
"fork_count": 13,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35402802,
"size": 278,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/sreejesh79/android-socket.io-demo"
} |
35402802_4 | {
"fields": [],
"file": "app/libs/socket.io-client.java-master/src/test/java/com/github/nkzawa/hasbinary/HasBinaryTest.java",
"identifier": "HasBinaryTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void anObjectThatContainsByteArray() throws JSONException {\n JSONObject ob = new JSONObject(\"{\\\"a\\\": \\\"a\\\", \\\"b\\\": null, \\\"c\\\": 1234}\");\n ob.put(\"b\", \"abc\".getBytes(Charset.forName(\"UTF-8\")));\n assertTrue(HasBinary.hasBinary(ob));\n }",
... | {
"fields": [],
"file": "app/libs/socket.io-client.java-master/src/main/java/com/github/nkzawa/hasbinary/HasBinary.java",
"identifier": "HasBinary",
"interfaces": "",
"methods": [
{
"class_method_signature": "HasBinary.HasBinary()",
"constructor": true,
"full_signature": "private HasBin... | {
"body": "private HasBinary() {}",
"class_method_signature": "HasBinary.HasBinary()",
"constructor": true,
"full_signature": "private HasBinary()",
"identifier": "HasBinary",
"invocations": [],
"modifiers": "private",
"parameters": "()",
"return": "",
"signature": " HasBinary()",
"testcase": fal... | {
"created": null,
"fork": null,
"fork_count": 13,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35402802,
"size": 278,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/sreejesh79/android-socket.io-demo"
} |
35402802_3 | {
"fields": [],
"file": "app/libs/socket.io-client.java-master/src/test/java/com/github/nkzawa/hasbinary/HasBinaryTest.java",
"identifier": "HasBinaryTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void anObjectThatDoesNotContainByteArray() throws JSONException {\n JSONObject ob = new JSONObject(\"{\\\"a\\\": \\\"a\\\", \\\"b\\\": [], \\\"c\\\": 1234}\");\n assertTrue(!HasBinary.hasBinary(ob));\n }",
"class_method_signature": "HasBinaryTest.anObjectThatDoesNotCont... | {
"fields": [],
"file": "app/libs/socket.io-client.java-master/src/main/java/com/github/nkzawa/hasbinary/HasBinary.java",
"identifier": "HasBinary",
"interfaces": "",
"methods": [
{
"class_method_signature": "HasBinary.HasBinary()",
"constructor": true,
"full_signature": "private HasBin... | {
"body": "private HasBinary() {}",
"class_method_signature": "HasBinary.HasBinary()",
"constructor": true,
"full_signature": "private HasBinary()",
"identifier": "HasBinary",
"invocations": [],
"modifiers": "private",
"parameters": "()",
"return": "",
"signature": " HasBinary()",
"testcase": fal... | {
"created": null,
"fork": null,
"fork_count": 13,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35402802,
"size": 278,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/sreejesh79/android-socket.io-demo"
} |
35402802_2 | {
"fields": [],
"file": "app/libs/socket.io-client.java-master/src/test/java/com/github/nkzawa/hasbinary/HasBinaryTest.java",
"identifier": "HasBinaryTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void anArrayContainsByteArray() throws JSONException {\n JSONArray arr = new JSONArray(\"[1, null, 2]\");\n arr.put(1, \"asdfasdf\".getBytes(Charset.forName(\"UTF-8\")));\n assertTrue(HasBinary.hasBinary(arr));\n }",
"class_method_signature": "HasBinaryTest.anArr... | {
"fields": [],
"file": "app/libs/socket.io-client.java-master/src/main/java/com/github/nkzawa/hasbinary/HasBinary.java",
"identifier": "HasBinary",
"interfaces": "",
"methods": [
{
"class_method_signature": "HasBinary.HasBinary()",
"constructor": true,
"full_signature": "private HasBin... | {
"body": "private HasBinary() {}",
"class_method_signature": "HasBinary.HasBinary()",
"constructor": true,
"full_signature": "private HasBinary()",
"identifier": "HasBinary",
"invocations": [],
"modifiers": "private",
"parameters": "()",
"return": "",
"signature": " HasBinary()",
"testcase": fal... | {
"created": null,
"fork": null,
"fork_count": 13,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 35402802,
"size": 278,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/sreejesh79/android-socket.io-demo"
} |
69207015_7 | {
"fields": [
{
"declarator": "stringSlot = new Slot<String>()\n {\n @Override\n public Optional<SlotMatch<String>> match(String token, Context context)\n {\n return Optional.of(new SlotMatch<>(this, token, token));\n }\n\n @Override\n public String getName()\n {\n return nul... | {
"body": "@Test\n public void canConstructWithDifferentTypes()\n {\n CompoundSlot<Number> compoundSlot = new CompoundSlot<>(\"compound\", integerSlot, doubleSlot);\n Optional<SlotMatch<Number>> match = compoundSlot.match(\"123\", null);\n assertTrue(match.isPresent());\n assertEquals(match.get().getVal... | {
"fields": [
{
"declarator": "firstSlot",
"modifier": "private final",
"original_string": "private final Slot<? extends T> firstSlot;",
"type": "Slot<? extends T>",
"var_name": "firstSlot"
},
{
"declarator": "secondSlot",
"modifier": "private final",
"origi... | {
"body": "@SuppressWarnings(\"unchecked\")\n @Override\n public Optional<SlotMatch<T>> match(String token, Context context)\n {\n Optional<? extends SlotMatch<? extends T>> match = firstSlot.match(token, context);\n if (!match.isPresent())\n {\n match = secondSlot.match(token, context);\n }\n ... | {
"created": null,
"fork": null,
"fork_count": 40,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 69207015,
"size": 743,
"stargazer_count": 154,
"stars": null,
"updates": null,
"url": "https://github.com/rabidgremlin/Mutters"
} |
69207015_28 | {
"fields": [],
"file": "mutters-slots/src/test/java/com/rabidgremlin/mutters/slots/CustomSlotTest.java",
"identifier": "CustomSlotTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testConstructWithMap()\n {\n Map<String, String> map = new HashMap<>();\n map.put(\"keyA\", \"valueA\");\n map.put(\"keyB\", \"valueB\");\n CustomSlot customSlot = new CustomSlot(\"custom-slot\", map);\n\n Optional<SlotMatch<String>> match = customSlot.match(\"keya\", n... | {
"fields": [
{
"declarator": "options = new HashMap<>()",
"modifier": "private final",
"original_string": "private final Map<String, String> options = new HashMap<>();",
"type": "Map<String, String>",
"var_name": "options"
}
],
"file": "mutters-slots/src/main/java/com/rabidg... | {
"body": "@Override\n public Optional<SlotMatch<String>> match(String token, Context context)\n {\n String id = token.toLowerCase();\n return Optional.ofNullable(options.get(id)).map(option -> new SlotMatch<>(this, token, option));\n }",
"class_method_signature": "CustomSlot.match(String token, Context co... | {
"created": null,
"fork": null,
"fork_count": 40,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 69207015,
"size": 743,
"stargazer_count": 154,
"stars": null,
"updates": null,
"url": "https://github.com/rabidgremlin/Mutters"
} |
69207015_12 | {
"fields": [],
"file": "mutters-core/src/test/java/com/rabidgremlin/mutters/core/session/TestSession.java",
"identifier": "TestSession",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testReset()\n {\n Session session = new Session();\n\n session.setAttribute(\"bob\", \"alice\");\n session.setLongTermAttribute(\"bobLT\", \"aliceLT\");\n\n session.reset();\n\n assertThat(session.getLongTermAttribute(\"bob\"), is(nullValue()));\n assertThat(session.... | {
"fields": [
{
"declarator": "attributes = new HashMap<>()",
"modifier": "private",
"original_string": "private HashMap<String, Object> attributes = new HashMap<>();",
"type": "HashMap<String, Object>",
"var_name": "attributes"
},
{
"declarator": "longTermAttributes = ... | {
"body": "public void reset()\n {\n attributes = new HashMap<>();\n }",
"class_method_signature": "Session.reset()",
"constructor": false,
"full_signature": "public void reset()",
"identifier": "reset",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature"... | {
"created": null,
"fork": null,
"fork_count": 40,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 69207015,
"size": 743,
"stargazer_count": 154,
"stars": null,
"updates": null,
"url": "https://github.com/rabidgremlin/Mutters"
} |
69207015_32 | {
"fields": [],
"file": "mutters-slots/src/test/java/com/rabidgremlin/mutters/slots/FuzzySlotTest.java",
"identifier": "FuzzySlotTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testConstructWithListDefaultTolerance()\n {\n List<String> options = Arrays.asList(\"optionA\", \"optionB\");\n FuzzySlot fuzzySlot = new FuzzySlot(\"fuzzy-slot\", options);\n\n Optional<SlotMatch<String>> match = fuzzySlot.match(\"optiona\", null);\n\n assertTrue(match.is... | {
"fields": [
{
"declarator": "DEFAULT_TOLERANCE = 0.95d",
"modifier": "private static final",
"original_string": "private static final double DEFAULT_TOLERANCE = 0.95d;",
"type": "double",
"var_name": "DEFAULT_TOLERANCE"
},
{
"declarator": "tolerance",
"modifier"... | {
"body": "@Override\n public Optional<SlotMatch<String>> match(String token, Context context)\n {\n String lowerToken = token.toLowerCase();\n double bestMatchScore = 0;\n String bestMatch = null;\n\n for (String option : options)\n {\n double score = StringUtils.getJaroWinklerDistance(lowerTok... | {
"created": null,
"fork": null,
"fork_count": 40,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 69207015,
"size": 743,
"stargazer_count": 154,
"stars": null,
"updates": null,
"url": "https://github.com/rabidgremlin/Mutters"
} |
69207015_24 | {
"fields": [],
"file": "mutters-slots/src/test/java/com/rabidgremlin/mutters/slots/CustomSlotWithDefaultValueTest.java",
"identifier": "CustomSlotWithDefaultValueTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testConstructWithList()\n {\n List<String> options = Arrays.asList(\"optionA\", \"optionB\");\n CustomSlotWithDefaultValue customSlot = new CustomSlotWithDefaultValue(\"custom-slot\", options, \"defaultValue\");\n\n Optional<SlotMatch<String>> match = customSlot.match(\"optio... | {
"fields": [
{
"declarator": "defaultValue",
"modifier": "private final",
"original_string": "private final String defaultValue;",
"type": "String",
"var_name": "defaultValue"
}
],
"file": "mutters-slots/src/main/java/com/rabidgremlin/mutters/slots/CustomSlotWithDefaultValue... | {
"body": "@Override\n public String getDefaultValue()\n {\n return defaultValue;\n }",
"class_method_signature": "CustomSlotWithDefaultValue.getDefaultValue()",
"constructor": false,
"full_signature": "@Override public String getDefaultValue()",
"identifier": "getDefaultValue",
"invocations": [],
"... | {
"created": null,
"fork": null,
"fork_count": 40,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 69207015,
"size": 743,
"stargazer_count": 154,
"stars": null,
"updates": null,
"url": "https://github.com/rabidgremlin/Mutters"
} |
69207015_25 | {
"fields": [],
"file": "mutters-slots/src/test/java/com/rabidgremlin/mutters/slots/CustomSlotWithDefaultValueTest.java",
"identifier": "CustomSlotWithDefaultValueTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testConstructWithMap()\n {\n Map<String, String> options = new HashMap<>();\n options.put(\"keyA\", \"valueA\");\n options.put(\"keyB\", \"valueB\");\n CustomSlotWithDefaultValue customSlot = new CustomSlotWithDefaultValue(\"custom-slot\", options, \"defaultValue\");\n\n ... | {
"fields": [
{
"declarator": "defaultValue",
"modifier": "private final",
"original_string": "private final String defaultValue;",
"type": "String",
"var_name": "defaultValue"
}
],
"file": "mutters-slots/src/main/java/com/rabidgremlin/mutters/slots/CustomSlotWithDefaultValue... | {
"body": "@Override\n public String getDefaultValue()\n {\n return defaultValue;\n }",
"class_method_signature": "CustomSlotWithDefaultValue.getDefaultValue()",
"constructor": false,
"full_signature": "@Override public String getDefaultValue()",
"identifier": "getDefaultValue",
"invocations": [],
"... | {
"created": null,
"fork": null,
"fork_count": 40,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 69207015,
"size": 743,
"stargazer_count": 154,
"stars": null,
"updates": null,
"url": "https://github.com/rabidgremlin/Mutters"
} |
69207015_33 | {
"fields": [],
"file": "mutters-slots/src/test/java/com/rabidgremlin/mutters/slots/FuzzySlotTest.java",
"identifier": "FuzzySlotTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testConstructWithArrayCustomTolerance()\n {\n String[] options = { \"optionA\", \"optionB\" };\n FuzzySlot fuzzySlot = new FuzzySlot(\"fuzzy-slot\", options, 0.99);\n\n Optional<SlotMatch<String>> match = fuzzySlot.match(\"optiona\", null);\n\n assertTrue(match.isPresent()... | {
"fields": [
{
"declarator": "DEFAULT_TOLERANCE = 0.95d",
"modifier": "private static final",
"original_string": "private static final double DEFAULT_TOLERANCE = 0.95d;",
"type": "double",
"var_name": "DEFAULT_TOLERANCE"
},
{
"declarator": "tolerance",
"modifier"... | {
"body": "@Override\n public Optional<SlotMatch<String>> match(String token, Context context)\n {\n String lowerToken = token.toLowerCase();\n double bestMatchScore = 0;\n String bestMatch = null;\n\n for (String option : options)\n {\n double score = StringUtils.getJaroWinklerDistance(lowerTok... | {
"created": null,
"fork": null,
"fork_count": 40,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 69207015,
"size": 743,
"stargazer_count": 154,
"stars": null,
"updates": null,
"url": "https://github.com/rabidgremlin/Mutters"
} |
69207015_13 | {
"fields": [],
"file": "mutters-core/src/test/java/com/rabidgremlin/mutters/core/session/TestSession.java",
"identifier": "TestSession",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testResetAll()\n {\n Session session = new Session();\n\n session.setAttribute(\"bob\", \"alice\");\n session.setLongTermAttribute(\"bobLT\", \"aliceLT\");\n\n session.resetAll();\n\n assertThat(session.getLongTermAttribute(\"bob\"), is(nullValue()));\n assertThat(se... | {
"fields": [
{
"declarator": "attributes = new HashMap<>()",
"modifier": "private",
"original_string": "private HashMap<String, Object> attributes = new HashMap<>();",
"type": "HashMap<String, Object>",
"var_name": "attributes"
},
{
"declarator": "longTermAttributes = ... | {
"body": "public void resetAll()\n {\n attributes = new HashMap<>();\n longTermAttributes = new HashMap<>();\n }",
"class_method_signature": "Session.resetAll()",
"constructor": false,
"full_signature": "public void resetAll()",
"identifier": "resetAll",
"invocations": [],
"modifiers": "public",
... | {
"created": null,
"fork": null,
"fork_count": 40,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 69207015,
"size": 743,
"stargazer_count": 154,
"stars": null,
"updates": null,
"url": "https://github.com/rabidgremlin/Mutters"
} |
69207015_29 | {
"fields": [],
"file": "mutters-slots/src/test/java/com/rabidgremlin/mutters/slots/CustomSlotTest.java",
"identifier": "CustomSlotTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testToStringConstructedWithList()\n {\n CustomSlot customSlot = new CustomSlot(\"custom-slot\", Arrays.asList(\"ABC\", \"xyz\"));\n\n assertThat(customSlot.toString(), is(\"CustomSlot [name=custom-slot, options={abc=ABC, xyz=xyz}]\"));\n }",
"class_method_signature": "CustomS... | {
"fields": [
{
"declarator": "options = new HashMap<>()",
"modifier": "private final",
"original_string": "private final Map<String, String> options = new HashMap<>();",
"type": "Map<String, String>",
"var_name": "options"
}
],
"file": "mutters-slots/src/main/java/com/rabidg... | {
"body": "@Override\n public String toString()\n {\n return \"CustomSlot [name=\" + getName() + \", options=\" + options + \"]\";\n }",
"class_method_signature": "CustomSlot.toString()",
"constructor": false,
"full_signature": "@Override public String toString()",
"identifier": "toString",
"invocatio... | {
"created": null,
"fork": null,
"fork_count": 40,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 69207015,
"size": 743,
"stargazer_count": 154,
"stars": null,
"updates": null,
"url": "https://github.com/rabidgremlin/Mutters"
} |
69207015_6 | {
"fields": [
{
"declarator": "stringSlot = new Slot<String>()\n {\n @Override\n public Optional<SlotMatch<String>> match(String token, Context context)\n {\n return Optional.of(new SlotMatch<>(this, token, token));\n }\n\n @Override\n public String getName()\n {\n return nul... | {
"body": "@Test\n public void canConstructWithSameType()\n {\n CompoundSlot<String> compoundSlot = new CompoundSlot<>(\"compound\", stringSlot, stringSlot);\n Optional<SlotMatch<String>> match = compoundSlot.match(\"hi\", null);\n assertTrue(match.isPresent());\n assertEquals(match.get().getValue(), \"... | {
"fields": [
{
"declarator": "firstSlot",
"modifier": "private final",
"original_string": "private final Slot<? extends T> firstSlot;",
"type": "Slot<? extends T>",
"var_name": "firstSlot"
},
{
"declarator": "secondSlot",
"modifier": "private final",
"origi... | {
"body": "@SuppressWarnings(\"unchecked\")\n @Override\n public Optional<SlotMatch<T>> match(String token, Context context)\n {\n Optional<? extends SlotMatch<? extends T>> match = firstSlot.match(token, context);\n if (!match.isPresent())\n {\n match = secondSlot.match(token, context);\n }\n ... | {
"created": null,
"fork": null,
"fork_count": 40,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 69207015,
"size": 743,
"stargazer_count": 154,
"stars": null,
"updates": null,
"url": "https://github.com/rabidgremlin/Mutters"
} |
69207015_34 | {
"fields": [],
"file": "mutters-slots/src/test/java/com/rabidgremlin/mutters/slots/FuzzySlotTest.java",
"identifier": "FuzzySlotTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testConstructWithListCustomTolerance()\n {\n List<String> options = Arrays.asList(\"optionA\", \"optionB\");\n FuzzySlot fuzzySlot = new FuzzySlot(\"fuzzy-slot\", options, 0.99);\n\n Optional<SlotMatch<String>> match = fuzzySlot.match(\"optiona\", null);\n\n assertTrue(mat... | {
"fields": [
{
"declarator": "DEFAULT_TOLERANCE = 0.95d",
"modifier": "private static final",
"original_string": "private static final double DEFAULT_TOLERANCE = 0.95d;",
"type": "double",
"var_name": "DEFAULT_TOLERANCE"
},
{
"declarator": "tolerance",
"modifier"... | {
"body": "@Override\n public Optional<SlotMatch<String>> match(String token, Context context)\n {\n String lowerToken = token.toLowerCase();\n double bestMatchScore = 0;\n String bestMatch = null;\n\n for (String option : options)\n {\n double score = StringUtils.getJaroWinklerDistance(lowerTok... | {
"created": null,
"fork": null,
"fork_count": 40,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 69207015,
"size": 743,
"stargazer_count": 154,
"stars": null,
"updates": null,
"url": "https://github.com/rabidgremlin/Mutters"
} |
69207015_22 | {
"fields": [],
"file": "mutters-core/src/test/java/com/rabidgremlin/mutters/core/CompoundIntentMatcherTest.java",
"identifier": "CompoundIntentMatcherTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testConstructWithArrayOfMatchersRejectsEmptyArray()\n {\n try\n {\n // Given\n IntentMatcher[] intentMatchers = {};\n\n // When\n CompoundIntentMatcher.compose(intentMatchers);\n\n // Then\n fail();\n }\n catch (IllegalArgumentException expect... | {
"fields": [
{
"declarator": "firstMatcher",
"modifier": "private final",
"original_string": "private final IntentMatcher firstMatcher;",
"type": "IntentMatcher",
"var_name": "firstMatcher"
},
{
"declarator": "secondMatcher",
"modifier": "private final",
"o... | {
"body": "public static IntentMatcher compose(List<IntentMatcher> intentMatchers)\n {\n return compose((a, b) -> new MatcherScores(), intentMatchers);\n }",
"class_method_signature": "CompoundIntentMatcher.compose(List<IntentMatcher> intentMatchers)",
"constructor": false,
"full_signature": "public static... | {
"created": null,
"fork": null,
"fork_count": 40,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 69207015,
"size": 743,
"stargazer_count": 154,
"stars": null,
"updates": null,
"url": "https://github.com/rabidgremlin/Mutters"
} |
69207015_18 | {
"fields": [],
"file": "mutters-core/src/test/java/com/rabidgremlin/mutters/core/CompoundIntentMatcherTest.java",
"identifier": "CompoundIntentMatcherTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldIgnoreSecondMatcherIfFirstMatcherMatches()\n {\n AlwaysMatcher alwaysMatcher = new AlwaysMatcher();\n NeverMatcher neverMatcher = new NeverMatcher();\n\n CompoundIntentMatcher compoundMatcher = new CompoundIntentMatcher(alwaysMatcher, neverMatcher);\n\n IntentMatch m... | {
"fields": [
{
"declarator": "firstMatcher",
"modifier": "private final",
"original_string": "private final IntentMatcher firstMatcher;",
"type": "IntentMatcher",
"var_name": "firstMatcher"
},
{
"declarator": "secondMatcher",
"modifier": "private final",
"o... | {
"body": "@Override\n public IntentMatch match(String utterance, Context context, Set<String> expectedIntents)\n {\n // see if we can find match in first matcher\n IntentMatch firstMatch = firstMatcher.match(utterance, context, expectedIntents);\n\n if (firstMatch.matched())\n {\n return firstMatc... | {
"created": null,
"fork": null,
"fork_count": 40,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 69207015,
"size": 743,
"stargazer_count": 154,
"stars": null,
"updates": null,
"url": "https://github.com/rabidgremlin/Mutters"
} |
69207015_1 | {
"fields": [],
"file": "mutters-templated-intent/src/test/java/com/rabidgremlin/mutters/generate/TestProduct.java",
"identifier": "TestProduct",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testProduct()\n {\n List<String> list1 = Arrays.asList(\"A\", \"B\");\n List<String> list2 = Arrays.asList(\"1\", \"2\", \"3\");\n List<String> list3 = Arrays.asList(\"X\");\n\n @SuppressWarnings(\"unchecked\")\n List<List<String>> product = Product.generate(list1, list... | {
"fields": [],
"file": "mutters-templated-intent/src/main/java/com/rabidgremlin/mutters/generate/Product.java",
"identifier": "Product",
"interfaces": "",
"methods": [
{
"class_method_signature": "Product.Product()",
"constructor": true,
"full_signature": "private Product()",
"id... | {
"body": "private Product()\n {\n // private constructor for utility class\n }",
"class_method_signature": "Product.Product()",
"constructor": true,
"full_signature": "private Product()",
"identifier": "Product",
"invocations": [],
"modifiers": "private",
"parameters": "()",
"return": "",
"si... | {
"created": null,
"fork": null,
"fork_count": 40,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 69207015,
"size": 743,
"stargazer_count": 154,
"stars": null,
"updates": null,
"url": "https://github.com/rabidgremlin/Mutters"
} |
69207015_14 | {
"fields": [],
"file": "mutters-core/src/test/java/com/rabidgremlin/mutters/core/AbstractSlotTest.java",
"identifier": "AbstractSlotTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetName()\n {\n Slot<String> slot = new TestSlot(\"my-slot\");\n assertThat(slot.getName(), is(\"my-slot\"));\n }",
"class_method_signature": "AbstractSlotTest.testGetName()",
"constructor": false,
"full_signature": "@Test public void testGetName()",
"identifier": "... | {
"fields": [
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final String name;",
"type": "String",
"var_name": "name"
}
],
"file": "mutters-core/src/main/java/com/rabidgremlin/mutters/core/AbstractSlot.java",
"identifier": "AbstractSlot",
... | {
"body": "@Override\n public final String getName()\n {\n return name;\n }",
"class_method_signature": "AbstractSlot.getName()",
"constructor": false,
"full_signature": "@Override public final String getName()",
"identifier": "getName",
"invocations": [],
"modifiers": "@Override public final",
"p... | {
"created": null,
"fork": null,
"fork_count": 40,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 69207015,
"size": 743,
"stargazer_count": 154,
"stars": null,
"updates": null,
"url": "https://github.com/rabidgremlin/Mutters"
} |
69207015_15 | {
"fields": [],
"file": "mutters-core/src/test/java/com/rabidgremlin/mutters/core/AbstractSlotTest.java",
"identifier": "AbstractSlotTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testToString()\n {\n Slot<String> slot = new TestSlot(\"my-slot\");\n assertThat(slot.toString(), is(\"TestSlot [name=my-slot]\"));\n }",
"class_method_signature": "AbstractSlotTest.testToString()",
"constructor": false,
"full_signature": "@Test public void testToString()... | {
"fields": [
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final String name;",
"type": "String",
"var_name": "name"
}
],
"file": "mutters-core/src/main/java/com/rabidgremlin/mutters/core/AbstractSlot.java",
"identifier": "AbstractSlot",
... | {
"body": "@Override\n public String toString()\n {\n return getClass().getSimpleName() + \" [name=\" + name + \"]\";\n }",
"class_method_signature": "AbstractSlot.toString()",
"constructor": false,
"full_signature": "@Override public String toString()",
"identifier": "toString",
"invocations": [
... | {
"created": null,
"fork": null,
"fork_count": 40,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 69207015,
"size": 743,
"stargazer_count": 154,
"stars": null,
"updates": null,
"url": "https://github.com/rabidgremlin/Mutters"
} |
69207015_0 | {
"fields": [],
"file": "mutters-templated-intent/src/test/java/com/rabidgremlin/mutters/generate/TestUtteranceGenerator.java",
"identifier": "TestUtteranceGenerator",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGenerator()\n {\n UtteranceGenerator generator = new UtteranceGenerator();\n\n List<String> utterances = generator.generate(\"~what|what's|what is~ ~the|~ time ~in|at~ {Place}\");\n\n System.out.println(utterances);\n\n assertThat(utterances, is(notNullValue()));\n ... | {
"fields": [
{
"declarator": "matchPattern = Pattern.compile(\"~(.*?)~|(\\\\S+)\")",
"modifier": "private final",
"original_string": "private final Pattern matchPattern = Pattern.compile(\"~(.*?)~|(\\\\S+)\");",
"type": "Pattern",
"var_name": "matchPattern"
}
],
"file": "mut... | {
"body": "public List<String> generate(String template)\n {\n Matcher match = matchPattern.matcher(template);\n\n ArrayList<ArrayList<String>> lists = new ArrayList<>();\n\n while (match.find())\n {\n String group = match.group();\n // System.out.println(group);\n\n if (group.startsWith(\... | {
"created": null,
"fork": null,
"fork_count": 40,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 69207015,
"size": 743,
"stargazer_count": 154,
"stars": null,
"updates": null,
"url": "https://github.com/rabidgremlin/Mutters"
} |
69207015_19 | {
"fields": [],
"file": "mutters-core/src/test/java/com/rabidgremlin/mutters/core/CompoundIntentMatcherTest.java",
"identifier": "CompoundIntentMatcherTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldUseSecondMatcherIfFirstFailsToMatch()\n {\n AlwaysMatcher alwaysMatcher = new AlwaysMatcher();\n NeverMatcher neverMatcher = new NeverMatcher();\n\n CompoundIntentMatcher compoundMatcher = new CompoundIntentMatcher(neverMatcher, alwaysMatcher);\n\n IntentMatch match ... | {
"fields": [
{
"declarator": "firstMatcher",
"modifier": "private final",
"original_string": "private final IntentMatcher firstMatcher;",
"type": "IntentMatcher",
"var_name": "firstMatcher"
},
{
"declarator": "secondMatcher",
"modifier": "private final",
"o... | {
"body": "@Override\n public IntentMatch match(String utterance, Context context, Set<String> expectedIntents)\n {\n // see if we can find match in first matcher\n IntentMatch firstMatch = firstMatcher.match(utterance, context, expectedIntents);\n\n if (firstMatch.matched())\n {\n return firstMatc... | {
"created": null,
"fork": null,
"fork_count": 40,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 69207015,
"size": 743,
"stargazer_count": 154,
"stars": null,
"updates": null,
"url": "https://github.com/rabidgremlin/Mutters"
} |
69207015_23 | {
"fields": [],
"file": "mutters-slots/src/test/java/com/rabidgremlin/mutters/slots/CustomSlotWithDefaultValueTest.java",
"identifier": "CustomSlotWithDefaultValueTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testConstructWithArray()\n {\n String[] options = { \"optionA\", \"optionB\" };\n CustomSlotWithDefaultValue customSlot = new CustomSlotWithDefaultValue(\"custom-slot\", options, \"defaultValue\");\n\n Optional<SlotMatch<String>> match = customSlot.match(\"optiona\", null);\n... | {
"fields": [
{
"declarator": "defaultValue",
"modifier": "private final",
"original_string": "private final String defaultValue;",
"type": "String",
"var_name": "defaultValue"
}
],
"file": "mutters-slots/src/main/java/com/rabidgremlin/mutters/slots/CustomSlotWithDefaultValue... | {
"body": "@Override\n public String getDefaultValue()\n {\n return defaultValue;\n }",
"class_method_signature": "CustomSlotWithDefaultValue.getDefaultValue()",
"constructor": false,
"full_signature": "@Override public String getDefaultValue()",
"identifier": "getDefaultValue",
"invocations": [],
"... | {
"created": null,
"fork": null,
"fork_count": 40,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 69207015,
"size": 743,
"stargazer_count": 154,
"stars": null,
"updates": null,
"url": "https://github.com/rabidgremlin/Mutters"
} |
69207015_35 | {
"fields": [],
"file": "mutters-slots/src/test/java/com/rabidgremlin/mutters/slots/FuzzySlotTest.java",
"identifier": "FuzzySlotTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testToString()\n {\n List<String> options = Arrays.asList(\"optionA\", \"optionB\");\n FuzzySlot fuzzySlot = new FuzzySlot(\"fuzzy-slot\", options);\n\n assertThat(fuzzySlot.toString(), is(\"FuzzySlot [name=fuzzy-slot, options=[optionA, optionB], tolerance=0.95]\"));\n }",
... | {
"fields": [
{
"declarator": "DEFAULT_TOLERANCE = 0.95d",
"modifier": "private static final",
"original_string": "private static final double DEFAULT_TOLERANCE = 0.95d;",
"type": "double",
"var_name": "DEFAULT_TOLERANCE"
},
{
"declarator": "tolerance",
"modifier"... | {
"body": "@Override\n public String toString()\n {\n return \"FuzzySlot [name=\" + getName() + \", options=\" + options + \", tolerance=\" + tolerance + \"]\";\n }",
"class_method_signature": "FuzzySlot.toString()",
"constructor": false,
"full_signature": "@Override public String toString()",
"identifi... | {
"created": null,
"fork": null,
"fork_count": 40,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 69207015,
"size": 743,
"stargazer_count": 154,
"stars": null,
"updates": null,
"url": "https://github.com/rabidgremlin/Mutters"
} |
69207015_20 | {
"fields": [],
"file": "mutters-core/src/test/java/com/rabidgremlin/mutters/core/CompoundIntentMatcherTest.java",
"identifier": "CompoundIntentMatcherTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnNoMatchIfBothMatchersFail()\n {\n NeverMatcher neverMatcher1 = new NeverMatcher();\n NeverMatcher neverMatcher2 = new NeverMatcher();\n\n CompoundIntentMatcher compoundMatcher = new CompoundIntentMatcher(neverMatcher1, neverMatcher2);\n\n IntentMatch match = co... | {
"fields": [
{
"declarator": "firstMatcher",
"modifier": "private final",
"original_string": "private final IntentMatcher firstMatcher;",
"type": "IntentMatcher",
"var_name": "firstMatcher"
},
{
"declarator": "secondMatcher",
"modifier": "private final",
"o... | {
"body": "@Override\n public IntentMatch match(String utterance, Context context, Set<String> expectedIntents)\n {\n // see if we can find match in first matcher\n IntentMatch firstMatch = firstMatcher.match(utterance, context, expectedIntents);\n\n if (firstMatch.matched())\n {\n return firstMatc... | {
"created": null,
"fork": null,
"fork_count": 40,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 69207015,
"size": 743,
"stargazer_count": 154,
"stars": null,
"updates": null,
"url": "https://github.com/rabidgremlin/Mutters"
} |
69207015_16 | {
"fields": [],
"file": "mutters-core/src/test/java/com/rabidgremlin/mutters/core/AbstractSlotTest.java",
"identifier": "AbstractSlotTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testEquals()\n {\n Slot<String> slot = new TestSlot(\"my-slot\");\n Slot<String> slotWithSameName = new TestSlot(\"my-slot\");\n Slot<String> slotWithDifferentName = new TestSlot(\"my-slot-2\");\n Slot<String> slotWithSameNameDifferentClass = new TestSlot2(\"my-slot\");\n ... | {
"fields": [
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final String name;",
"type": "String",
"var_name": "name"
}
],
"file": "mutters-core/src/main/java/com/rabidgremlin/mutters/core/AbstractSlot.java",
"identifier": "AbstractSlot",
... | {
"body": "@Override\n public final boolean equals(Object o)\n {\n // HACK HACK assumes name match means equals. need to do this for SlotMatches\n // list but is dog dog ugly\n if (this == o)\n {\n return true;\n }\n if (!(o instanceof Slot))\n {\n return false;\n }\n Slot<?> th... | {
"created": null,
"fork": null,
"fork_count": 40,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 69207015,
"size": 743,
"stargazer_count": 154,
"stars": null,
"updates": null,
"url": "https://github.com/rabidgremlin/Mutters"
} |
69207015_3 | {
"fields": [],
"file": "mutters-ink-bot/src/test/java/com/rabidgremlin/mutters/bot/ink/functions/TestFunctionHelper.java",
"identifier": "TestFunctionHelper",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testParameterParsingValueWithSpaces() throws Exception\n {\n FunctionDetails details = FunctionHelper\n .parseFunctionString(\"title::Here is the link type::link url::https:\\\\\\\\/\\\\\\\\/en.wikipedia.org/wiki/Chatbot \");\n\n assertThat(details, is(notNullValue()));\n... | {
"fields": [],
"file": "mutters-ink-bot/src/main/java/com/rabidgremlin/mutters/bot/ink/functions/FunctionHelper.java",
"identifier": "FunctionHelper",
"interfaces": "",
"methods": [
{
"class_method_signature": "FunctionHelper.FunctionHelper()",
"constructor": true,
"full_signature": "pr... | {
"body": "public static FunctionDetails parseFunctionString(String paramString) throws IllegalArgumentException\n {\n // trim any whitespace\n String trimmedLine = paramString.trim();\n\n // trimmed line is the data for the functions\n FunctionDetails functionDetails = new FunctionDetails(trimmedLine);\... | {
"created": null,
"fork": null,
"fork_count": 40,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 69207015,
"size": 743,
"stargazer_count": 154,
"stars": null,
"updates": null,
"url": "https://github.com/rabidgremlin/Mutters"
} |
69207015_2 | {
"fields": [],
"file": "mutters-ink-bot/src/test/java/com/rabidgremlin/mutters/bot/ink/functions/TestFunctionHelper.java",
"identifier": "TestFunctionHelper",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testParameterParsing() throws Exception\n {\n FunctionDetails details = FunctionHelper\n .parseFunctionString(\"type::link url::https:\\\\\\\\/\\\\\\\\/en.wikipedia.org/wiki/Chatbot title::Here is the link\");\n\n assertThat(details, is(notNullValue()));\n\n assertThat... | {
"fields": [],
"file": "mutters-ink-bot/src/main/java/com/rabidgremlin/mutters/bot/ink/functions/FunctionHelper.java",
"identifier": "FunctionHelper",
"interfaces": "",
"methods": [
{
"class_method_signature": "FunctionHelper.FunctionHelper()",
"constructor": true,
"full_signature": "pr... | {
"body": "public static FunctionDetails parseFunctionString(String paramString) throws IllegalArgumentException\n {\n // trim any whitespace\n String trimmedLine = paramString.trim();\n\n // trimmed line is the data for the functions\n FunctionDetails functionDetails = new FunctionDetails(trimmedLine);\... | {
"created": null,
"fork": null,
"fork_count": 40,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 69207015,
"size": 743,
"stargazer_count": 154,
"stars": null,
"updates": null,
"url": "https://github.com/rabidgremlin/Mutters"
} |
69207015_17 | {
"fields": [],
"file": "mutters-core/src/test/java/com/rabidgremlin/mutters/core/AbstractSlotTest.java",
"identifier": "AbstractSlotTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testHashCode()\n {\n Slot<String> slot = new TestSlot(\"my-slot\");\n assertEquals(slot.hashCode(), Objects.hash(\"my-slot\"));\n }",
"class_method_signature": "AbstractSlotTest.testHashCode()",
"constructor": false,
"full_signature": "@Test public void testHashCode()",
... | {
"fields": [
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final String name;",
"type": "String",
"var_name": "name"
}
],
"file": "mutters-core/src/main/java/com/rabidgremlin/mutters/core/AbstractSlot.java",
"identifier": "AbstractSlot",
... | {
"body": "@Override\n public final int hashCode()\n {\n // HACK HACK assumes name match means equals. need to do this for SlotMatches\n // list but is dog dog ugly\n return Objects.hash(getName());\n }",
"class_method_signature": "AbstractSlot.hashCode()",
"constructor": false,
"full_signature": "@... | {
"created": null,
"fork": null,
"fork_count": 40,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 69207015,
"size": 743,
"stargazer_count": 154,
"stars": null,
"updates": null,
"url": "https://github.com/rabidgremlin/Mutters"
} |
69207015_21 | {
"fields": [],
"file": "mutters-core/src/test/java/com/rabidgremlin/mutters/core/CompoundIntentMatcherTest.java",
"identifier": "CompoundIntentMatcherTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testConstructWithListOfMatchersRejectsEmptyList()\n {\n try\n {\n // Given\n List<IntentMatcher> intentMatchers = Collections.emptyList();\n\n // When\n CompoundIntentMatcher.compose(intentMatchers);\n\n // Then\n fail();\n }\n catch (IllegalA... | {
"fields": [
{
"declarator": "firstMatcher",
"modifier": "private final",
"original_string": "private final IntentMatcher firstMatcher;",
"type": "IntentMatcher",
"var_name": "firstMatcher"
},
{
"declarator": "secondMatcher",
"modifier": "private final",
"o... | {
"body": "public static IntentMatcher compose(List<IntentMatcher> intentMatchers)\n {\n return compose((a, b) -> new MatcherScores(), intentMatchers);\n }",
"class_method_signature": "CompoundIntentMatcher.compose(List<IntentMatcher> intentMatchers)",
"constructor": false,
"full_signature": "public static... | {
"created": null,
"fork": null,
"fork_count": 40,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 69207015,
"size": 743,
"stargazer_count": 154,
"stars": null,
"updates": null,
"url": "https://github.com/rabidgremlin/Mutters"
} |
69207015_10 | {
"fields": [
{
"declarator": "stringSlot = new Slot<String>()\n {\n @Override\n public Optional<SlotMatch<String>> match(String token, Context context)\n {\n return Optional.of(new SlotMatch<>(this, token, token));\n }\n\n @Override\n public String getName()\n {\n return nul... | {
"body": "@Test\n public void testComposeStaticFactoryRejectsEmptyArray()\n {\n try\n {\n Slot<?>[] slots = {};\n CompoundSlot.compose(\"composed\", slots);\n fail();\n }\n catch (IllegalArgumentException expected)\n {\n assertThat(expected.getMessage(), is(\"No slots provided.\"... | {
"fields": [
{
"declarator": "firstSlot",
"modifier": "private final",
"original_string": "private final Slot<? extends T> firstSlot;",
"type": "Slot<? extends T>",
"var_name": "firstSlot"
},
{
"declarator": "secondSlot",
"modifier": "private final",
"origi... | {
"body": "public static Slot<?> compose(String name, List<Slot<?>> slots)\n {\n return slots.stream().reduce((firstSlot, secondSlot) -> new CompoundSlot<>(name, firstSlot, secondSlot))\n .orElseThrow(() -> new IllegalArgumentException(\"No slots provided.\"));\n }",
"class_method_signature": "CompoundS... | {
"created": null,
"fork": null,
"fork_count": 40,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 69207015,
"size": 743,
"stargazer_count": 154,
"stars": null,
"updates": null,
"url": "https://github.com/rabidgremlin/Mutters"
} |
69207015_5 | {
"fields": [],
"file": "mutters-ink-bot/src/test/java/com/rabidgremlin/mutters/bot/ink/functions/TestFunctionHelper.java",
"identifier": "TestFunctionHelper",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void testBadParams() throws Exception\n {\n FunctionHelper.parseFunctionString(\"junk::ob:::\");\n }",
"class_method_signature": "TestFunctionHelper.testBadParams()",
"constructor": false,
"full_signature": "@Test(expected = IllegalArgum... | {
"fields": [],
"file": "mutters-ink-bot/src/main/java/com/rabidgremlin/mutters/bot/ink/functions/FunctionHelper.java",
"identifier": "FunctionHelper",
"interfaces": "",
"methods": [
{
"class_method_signature": "FunctionHelper.FunctionHelper()",
"constructor": true,
"full_signature": "pr... | {
"body": "public static FunctionDetails parseFunctionString(String paramString) throws IllegalArgumentException\n {\n // trim any whitespace\n String trimmedLine = paramString.trim();\n\n // trimmed line is the data for the functions\n FunctionDetails functionDetails = new FunctionDetails(trimmedLine);\... | {
"created": null,
"fork": null,
"fork_count": 40,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 69207015,
"size": 743,
"stargazer_count": 154,
"stars": null,
"updates": null,
"url": "https://github.com/rabidgremlin/Mutters"
} |
69207015_26 | {
"fields": [],
"file": "mutters-slots/src/test/java/com/rabidgremlin/mutters/slots/CustomSlotTest.java",
"identifier": "CustomSlotTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testConstructWithVarargs()\n {\n CustomSlot customSlot = new CustomSlot(\"custom-slot\", \"optionA\", \"optionB\");\n\n Optional<SlotMatch<String>> match = customSlot.match(\"optiona\", null);\n\n assertTrue(match.isPresent());\n assertThat(match.get().getOriginalValue(), ... | {
"fields": [
{
"declarator": "options = new HashMap<>()",
"modifier": "private final",
"original_string": "private final Map<String, String> options = new HashMap<>();",
"type": "Map<String, String>",
"var_name": "options"
}
],
"file": "mutters-slots/src/main/java/com/rabidg... | {
"body": "@Override\n public Optional<SlotMatch<String>> match(String token, Context context)\n {\n String id = token.toLowerCase();\n return Optional.ofNullable(options.get(id)).map(option -> new SlotMatch<>(this, token, option));\n }",
"class_method_signature": "CustomSlot.match(String token, Context co... | {
"created": null,
"fork": null,
"fork_count": 40,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 69207015,
"size": 743,
"stargazer_count": 154,
"stars": null,
"updates": null,
"url": "https://github.com/rabidgremlin/Mutters"
} |
69207015_9 | {
"fields": [
{
"declarator": "stringSlot = new Slot<String>()\n {\n @Override\n public Optional<SlotMatch<String>> match(String token, Context context)\n {\n return Optional.of(new SlotMatch<>(this, token, token));\n }\n\n @Override\n public String getName()\n {\n return nul... | {
"body": "@Test\n public void testComposeStaticFactoryRejectsEmptyVarargs()\n {\n try\n {\n Slot<?> composed = CompoundSlot.compose(\"composed\");\n fail();\n }\n catch (IllegalArgumentException expected)\n {\n assertThat(expected.getMessage(), is(\"No slots provided.\"));\n }\n }... | {
"fields": [
{
"declarator": "firstSlot",
"modifier": "private final",
"original_string": "private final Slot<? extends T> firstSlot;",
"type": "Slot<? extends T>",
"var_name": "firstSlot"
},
{
"declarator": "secondSlot",
"modifier": "private final",
"origi... | {
"body": "public static Slot<?> compose(String name, List<Slot<?>> slots)\n {\n return slots.stream().reduce((firstSlot, secondSlot) -> new CompoundSlot<>(name, firstSlot, secondSlot))\n .orElseThrow(() -> new IllegalArgumentException(\"No slots provided.\"));\n }",
"class_method_signature": "CompoundS... | {
"created": null,
"fork": null,
"fork_count": 40,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 69207015,
"size": 743,
"stargazer_count": 154,
"stars": null,
"updates": null,
"url": "https://github.com/rabidgremlin/Mutters"
} |
69207015_30 | {
"fields": [],
"file": "mutters-slots/src/test/java/com/rabidgremlin/mutters/slots/CustomSlotTest.java",
"identifier": "CustomSlotTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testToStringConstructedWithMap()\n {\n Map<String, String> map = new HashMap<>();\n map.put(\"keyA\", \"valueA\");\n map.put(\"keyB\", \"valueB\");\n CustomSlot customSlot = new CustomSlot(\"custom-slot\", map);\n\n assertThat(customSlot.toString(), is(\"CustomSlot [nam... | {
"fields": [
{
"declarator": "options = new HashMap<>()",
"modifier": "private final",
"original_string": "private final Map<String, String> options = new HashMap<>();",
"type": "Map<String, String>",
"var_name": "options"
}
],
"file": "mutters-slots/src/main/java/com/rabidg... | {
"body": "@Override\n public String toString()\n {\n return \"CustomSlot [name=\" + getName() + \", options=\" + options + \"]\";\n }",
"class_method_signature": "CustomSlot.toString()",
"constructor": false,
"full_signature": "@Override public String toString()",
"identifier": "toString",
"invocatio... | {
"created": null,
"fork": null,
"fork_count": 40,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 69207015,
"size": 743,
"stargazer_count": 154,
"stars": null,
"updates": null,
"url": "https://github.com/rabidgremlin/Mutters"
} |
69207015_31 | {
"fields": [],
"file": "mutters-slots/src/test/java/com/rabidgremlin/mutters/slots/FuzzySlotTest.java",
"identifier": "FuzzySlotTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testConstructWithArrayDefaultTolerance()\n {\n FuzzySlot fuzzySlot = new FuzzySlot(\"fuzzy-slot\", \"optionA\", \"optionB\");\n\n Optional<SlotMatch<String>> match = fuzzySlot.match(\"optiona\", null);\n\n assertTrue(match.isPresent());\n assertThat(match.get().getOriginal... | {
"fields": [
{
"declarator": "DEFAULT_TOLERANCE = 0.95d",
"modifier": "private static final",
"original_string": "private static final double DEFAULT_TOLERANCE = 0.95d;",
"type": "double",
"var_name": "DEFAULT_TOLERANCE"
},
{
"declarator": "tolerance",
"modifier"... | {
"body": "@Override\n public Optional<SlotMatch<String>> match(String token, Context context)\n {\n String lowerToken = token.toLowerCase();\n double bestMatchScore = 0;\n String bestMatch = null;\n\n for (String option : options)\n {\n double score = StringUtils.getJaroWinklerDistance(lowerTok... | {
"created": null,
"fork": null,
"fork_count": 40,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 69207015,
"size": 743,
"stargazer_count": 154,
"stars": null,
"updates": null,
"url": "https://github.com/rabidgremlin/Mutters"
} |
69207015_8 | {
"fields": [
{
"declarator": "stringSlot = new Slot<String>()\n {\n @Override\n public Optional<SlotMatch<String>> match(String token, Context context)\n {\n return Optional.of(new SlotMatch<>(this, token, token));\n }\n\n @Override\n public String getName()\n {\n return nul... | {
"body": "@Test\n public void mustTrySecondSlotIfFirstFailsToMatch()\n {\n CompoundSlot<Number> compoundSlot = new CompoundSlot<>(\"compound\", doubleSlot, integerSlot);\n Optional<SlotMatch<Number>> match = compoundSlot.match(\"123\", null);\n assertTrue(match.isPresent());\n assertEquals(match.get().... | {
"fields": [
{
"declarator": "firstSlot",
"modifier": "private final",
"original_string": "private final Slot<? extends T> firstSlot;",
"type": "Slot<? extends T>",
"var_name": "firstSlot"
},
{
"declarator": "secondSlot",
"modifier": "private final",
"origi... | {
"body": "@SuppressWarnings(\"unchecked\")\n @Override\n public Optional<SlotMatch<T>> match(String token, Context context)\n {\n Optional<? extends SlotMatch<? extends T>> match = firstSlot.match(token, context);\n if (!match.isPresent())\n {\n match = secondSlot.match(token, context);\n }\n ... | {
"created": null,
"fork": null,
"fork_count": 40,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 69207015,
"size": 743,
"stargazer_count": 154,
"stars": null,
"updates": null,
"url": "https://github.com/rabidgremlin/Mutters"
} |
69207015_27 | {
"fields": [],
"file": "mutters-slots/src/test/java/com/rabidgremlin/mutters/slots/CustomSlotTest.java",
"identifier": "CustomSlotTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testConstructWithList()\n {\n CustomSlot customSlot = new CustomSlot(\"custom-slot\", Arrays.asList(\"optionA\", \"optionB\"));\n\n Optional<SlotMatch<String>> match = customSlot.match(\"optionb\", null);\n\n assertTrue(match.isPresent());\n assertThat(match.get().getOrigi... | {
"fields": [
{
"declarator": "options = new HashMap<>()",
"modifier": "private final",
"original_string": "private final Map<String, String> options = new HashMap<>();",
"type": "Map<String, String>",
"var_name": "options"
}
],
"file": "mutters-slots/src/main/java/com/rabidg... | {
"body": "@Override\n public Optional<SlotMatch<String>> match(String token, Context context)\n {\n String id = token.toLowerCase();\n return Optional.ofNullable(options.get(id)).map(option -> new SlotMatch<>(this, token, option));\n }",
"class_method_signature": "CustomSlot.match(String token, Context co... | {
"created": null,
"fork": null,
"fork_count": 40,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 69207015,
"size": 743,
"stargazer_count": 154,
"stars": null,
"updates": null,
"url": "https://github.com/rabidgremlin/Mutters"
} |
69207015_4 | {
"fields": [],
"file": "mutters-ink-bot/src/test/java/com/rabidgremlin/mutters/bot/ink/functions/TestFunctionHelper.java",
"identifier": "TestFunctionHelper",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testParameterNoParams()\n {\n FunctionDetails details = FunctionHelper.parseFunctionString(\" dd/mm or next friday \");\n\n assertThat(details, is(notNullValue()));\n\n assertThat(details.getFunctionData(), is(\"dd/mm or next friday\"));\n\n assertThat(details.getFunctionP... | {
"fields": [],
"file": "mutters-ink-bot/src/main/java/com/rabidgremlin/mutters/bot/ink/functions/FunctionHelper.java",
"identifier": "FunctionHelper",
"interfaces": "",
"methods": [
{
"class_method_signature": "FunctionHelper.FunctionHelper()",
"constructor": true,
"full_signature": "pr... | {
"body": "public static FunctionDetails parseFunctionString(String paramString) throws IllegalArgumentException\n {\n // trim any whitespace\n String trimmedLine = paramString.trim();\n\n // trimmed line is the data for the functions\n FunctionDetails functionDetails = new FunctionDetails(trimmedLine);\... | {
"created": null,
"fork": null,
"fork_count": 40,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 69207015,
"size": 743,
"stargazer_count": 154,
"stars": null,
"updates": null,
"url": "https://github.com/rabidgremlin/Mutters"
} |
69207015_11 | {
"fields": [
{
"declarator": "stringSlot = new Slot<String>()\n {\n @Override\n public Optional<SlotMatch<String>> match(String token, Context context)\n {\n return Optional.of(new SlotMatch<>(this, token, token));\n }\n\n @Override\n public String getName()\n {\n return nul... | {
"body": "@Test\n public void testComposeStaticFactoryRejectsEmptyList()\n {\n try\n {\n List<Slot<?>> slots = Collections.emptyList();\n CompoundSlot.compose(\"composed\", slots);\n fail();\n }\n catch (IllegalArgumentException expected)\n {\n assertThat(expected.getMessage(), i... | {
"fields": [
{
"declarator": "firstSlot",
"modifier": "private final",
"original_string": "private final Slot<? extends T> firstSlot;",
"type": "Slot<? extends T>",
"var_name": "firstSlot"
},
{
"declarator": "secondSlot",
"modifier": "private final",
"origi... | {
"body": "public static Slot<?> compose(String name, List<Slot<?>> slots)\n {\n return slots.stream().reduce((firstSlot, secondSlot) -> new CompoundSlot<>(name, firstSlot, secondSlot))\n .orElseThrow(() -> new IllegalArgumentException(\"No slots provided.\"));\n }",
"class_method_signature": "CompoundS... | {
"created": null,
"fork": null,
"fork_count": 40,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 69207015,
"size": 743,
"stargazer_count": 154,
"stars": null,
"updates": null,
"url": "https://github.com/rabidgremlin/Mutters"
} |
74192763_0 | {
"fields": [
{
"declarator": "mEventEmitter",
"modifier": "private",
"original_string": "private RCTEventEmitter mEventEmitter;",
"type": "RCTEventEmitter",
"var_name": "mEventEmitter"
},
{
"declarator": "mApplicationContext",
"modifier": "private",
"origin... | {
"body": "@Test\n public void testOnLoadEventEmitted () {\n verify(mEventEmitter, never()).receiveEvent(anyInt(), anyString(), any(WritableMap.class));\n\n WebImageViewTarget target = new WebImageViewTarget(mImageView);\n Bitmap bitmap = Bitmap.createBitmap(64, 64, Bitmap.Config.ARGB_8888);\n... | {
"fields": [],
"file": "android/src/main/java/org/vovkasm/WebImage/RequestListener.java",
"identifier": "RequestListener",
"interfaces": "implements com.bumptech.glide.request.RequestListener",
"methods": [
{
"class_method_signature": "RequestListener.onLoadFailed(@Nullable GlideException e, Object... | {
"body": "@Override\n public boolean onResourceReady(Object resource, Object model, Target target, DataSource dataSource, boolean isFirstResource) {\n WebImageView view = null;\n if (target instanceof WebImageViewTarget) {\n view = ((WebImageViewTarget) target).getView();\n }\n ... | {
"created": null,
"fork": null,
"fork_count": 27,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74192763,
"size": 30077,
"stargazer_count": 139,
"stars": null,
"updates": null,
"url": "https://github.com/vovkasm/react-native-web-image"
} |
74192763_1 | {
"fields": [
{
"declarator": "mEventEmitter",
"modifier": "private",
"original_string": "private RCTEventEmitter mEventEmitter;",
"type": "RCTEventEmitter",
"var_name": "mEventEmitter"
},
{
"declarator": "mApplicationContext",
"modifier": "private",
"origin... | {
"body": "@Test\n public void testOnErrorEventEmitted () {\n verify(mEventEmitter, never()).receiveEvent(anyInt(), anyString(), any(WritableMap.class));\n\n WebImageViewTarget target = new WebImageViewTarget(mImageView);\n\n mViewManager.mRequestListener.onLoadFailed(new GlideException(\"some... | {
"fields": [],
"file": "android/src/main/java/org/vovkasm/WebImage/RequestListener.java",
"identifier": "RequestListener",
"interfaces": "implements com.bumptech.glide.request.RequestListener",
"methods": [
{
"class_method_signature": "RequestListener.onLoadFailed(@Nullable GlideException e, Object... | {
"body": "@Override\n public boolean onLoadFailed(@Nullable GlideException e, Object model, Target target, boolean isFirstResource) {\n WebImageView view = null;\n if (target instanceof WebImageViewTarget) {\n view = ((WebImageViewTarget) target).getView();\n }\n if (view !=... | {
"created": null,
"fork": null,
"fork_count": 27,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74192763,
"size": 30077,
"stargazer_count": 139,
"stars": null,
"updates": null,
"url": "https://github.com/vovkasm/react-native-web-image"
} |
4750298_0 | {
"fields": [],
"file": "plugins/net.refractions.udig.socket/src/net/refractions/udig/socket/DisplayLayerHandlerTest.java",
"identifier": "DisplayLayerHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testCreateShpParams() throws Exception {\n\t\tDisplayLayerHandler handler = new DisplayLayerHandler();\n\t\tString resourceId = \"file://home/user/data/myshp.shp#myshp\";\n\t\tString shpId =\"file://home/user/data/myshp.shp\";\n\t\tStringBuilder builder = new StringBuilder(\"geoResourc... | {
"fields": [
{
"declarator": "HEADER = \"DisplayLayer version:1.0\"",
"modifier": "public static final",
"original_string": "public static final String HEADER = \"DisplayLayer version:1.0\";",
"type": "String",
"var_name": "HEADER"
},
{
"declarator": "RESOURCE_ID = \"g... | {
"body": "Pair<URL, Map<String, Serializable>> createParams(BufferedReader reader)\n\t\t\tthrows Exception {\n\t\tString line = reader.readLine();\n\n\t\tURL resourceId = null;\n\t\tMap<String, Serializable> params = new HashMap<String, Serializable>();\n\n\t\twhile (line != null) {\n\t\t\tline = line.trim();\n\t\t\... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 4750298,
"size": 114889,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/HGitMaster/udig-osgi"
} |
231990_1 | {
"fields": [],
"file": "common/src/test/java/slash/metamusic/util/ContributorHelperTest.java",
"identifier": "ContributorHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testParseTrack() {\n assertEquals(singletonList(\"A\"), parseTrack(\"A\"));\n assertEquals(asList(\"A\", \"B\"), parseTrack(\"A (feat. B)\"));\n assertEquals(asList(\"A\", \"B\"), parseTrack(\"A (Feat. B)\"));\n assertEquals(asList(\"A\", \"B\"), parseTrac... | {
"fields": [],
"file": "common/src/main/java/slash/metamusic/util/ContributorHelper.java",
"identifier": "ContributorHelper",
"interfaces": "",
"methods": [
{
"class_method_signature": "ContributorHelper.createContributorList(String lead, String featuring)",
"constructor": false,
"full_... | {
"body": "public static List<String> parseTrack(String track) {\n Pattern pattern = Pattern.compile(\"(.+)(\\\\((F|f)eat(\\\\. |\\\\.| |uring )(.+))\\\\)\");\n Matcher matcher = pattern.matcher(track);\n boolean matches = matcher.matches();\n if (matches) {\n String title = mat... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 231990,
"size": 18954,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/cpesch/MetaMusic"
} |
231990_0 | {
"fields": [],
"file": "common/src/test/java/slash/metamusic/util/ContributorHelperTest.java",
"identifier": "ContributorHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testParseArtist() {\n assertEquals(singletonList(\"A\"), parseArtist(\"A\"));\n assertEquals(asList(\"A\", \"B\"), parseArtist(\"A and B\"));\n assertEquals(asList(\"A\", \"B\"), parseArtist(\"A feat. B\"));\n assertEquals(asList(\"A\", \"B\"), parseArtist... | {
"fields": [],
"file": "common/src/main/java/slash/metamusic/util/ContributorHelper.java",
"identifier": "ContributorHelper",
"interfaces": "",
"methods": [
{
"class_method_signature": "ContributorHelper.createContributorList(String lead, String featuring)",
"constructor": false,
"full_... | {
"body": "public static List<String> parseArtist(String artist) {\n Pattern pattern = Pattern.compile(\"(.+)(( (F|f)eat(\\\\. |\\\\.| |uring ))(.+))\");\n Matcher matcher = pattern.matcher(artist);\n boolean matches = matcher.matches();\n if (matches) {\n String lead = matcher.... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 231990,
"size": 18954,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/cpesch/MetaMusic"
} |
231990_2 | {
"fields": [],
"file": "common/src/test/java/slash/metamusic/util/ContributorHelperTest.java",
"identifier": "ContributorHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testFormatContributors() {\n assertEquals(\"A\", formatContributors(\"A\", Collections.<String>emptyList()));\n assertEquals(\"A featuring B\", formatContributors(\"A\", singletonList(\"B\")));\n assertEquals(\"A featuring B, C\", formatContributors(\"A\", asList... | {
"fields": [],
"file": "common/src/main/java/slash/metamusic/util/ContributorHelper.java",
"identifier": "ContributorHelper",
"interfaces": "",
"methods": [
{
"class_method_signature": "ContributorHelper.createContributorList(String lead, String featuring)",
"constructor": false,
"full_... | {
"body": "public static String formatContributors(String artist, List<String> contributors) {\n StringBuilder buffer = new StringBuilder();\n buffer.append(artist);\n if (contributors.size() > 0)\n buffer.append(\" featuring \");\n for (int i = 0, c = contributors.size(); i < c... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 231990,
"size": 18954,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/cpesch/MetaMusic"
} |
29349352_1 | {
"fields": [],
"file": "src/main/java/fr/inria/gforge/spoon/analysis/CatchProcessorTest.java",
"identifier": "CatchProcessorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testCatchProcessor() throws Exception {\n\t\tfinal String[] args = {\n\t\t\t\t\"-i\", \"src/test/resources/src/\",\n\t\t\t\t\"-o\", \"target/spooned/\"\n\t\t};\n\n\t\tfinal Launcher launcher = new Launcher();\n\t\tlauncher.setArgs(args);\n\t\tlauncher.run();\n\n\t\tfinal Factory factor... | {
"fields": [
{
"declarator": "emptyCatchs = new ArrayList<>()",
"modifier": "public final",
"original_string": "public final List<CtCatch> emptyCatchs = new ArrayList<>();",
"type": "List<CtCatch>",
"var_name": "emptyCatchs"
}
],
"file": "src/main/java/fr/inria/gforge/spoon/... | {
"body": "@Override\n\tpublic void process(CtCatch element) {\n\t\tgetEnvironment().report(this, Level.WARN, element, \"empty catch clause \" + element.getPosition().toString());\n\t\temptyCatchs.add(element);\n\t}",
"class_method_signature": "CatchProcessor.process(CtCatch element)",
"constructor": false,
"fu... | {
"created": null,
"fork": null,
"fork_count": 29,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29349352,
"size": 5697,
"stargazer_count": 43,
"stars": null,
"updates": null,
"url": "https://github.com/SpoonLabs/spoon-examples"
} |
29349352_0 | {
"fields": [],
"file": "src/main/java/fr/inria/gforge/spoon/analysis/DocProcessorTest.java",
"identifier": "DocProcessorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testDocProcessor() throws Exception {\n\t\tfinal String[] args = {\n\t\t\t\t\"-i\", \"src/test/resources/src/DocTest.java\",\n\t\t\t\t\"-o\", \"target/spooned/\",\n\t\t\t\t\"-c\" // It's mandatory here to enable comments\n\t\t};\n\n\t\tfinal Launcher launcher = new Launcher();\n\t\tlau... | {
"fields": [
{
"declarator": "undocumentedElements = new ArrayList<>()",
"modifier": "public final",
"original_string": "public final List<CtElement> undocumentedElements = new ArrayList<>();",
"type": "List<CtElement>",
"var_name": "undocumentedElements"
}
],
"file": "src/m... | {
"body": "public void process(CtElement element) {\n\t\tif (element instanceof CtType || element instanceof CtField || element instanceof CtExecutable) {\n\t\t\tSet<ModifierKind> modifiers = ((CtModifiable) element).getModifiers();\n\t\t\tif (modifiers.contains(PUBLIC) || modifiers.contains(PROTECTED)) {\n\t\t\t\tSt... | {
"created": null,
"fork": null,
"fork_count": 29,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29349352,
"size": 5697,
"stargazer_count": 43,
"stars": null,
"updates": null,
"url": "https://github.com/SpoonLabs/spoon-examples"
} |
29349352_4 | {
"fields": [],
"file": "src/main/java/fr/inria/gforge/spoon/analysis/ReferenceProcessorTest.java",
"identifier": "ReferenceProcessorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testReferenceProcessor() throws Exception {\n\t\tfinal String[] args = {\n\t\t\t\t\"-i\", \"src/test/resources/src/\",\n\t\t\t\t\"-o\", \"target/spooned/\",\n\t\t};\n\n\t\tfinal Launcher launcher = new Launcher();\n\t\tlauncher.setArgs(args);\n\t\tlauncher.run();\n\n\t\tfinal Factory f... | {
"fields": [
{
"declarator": "ignoredTypes = new ArrayList<>()",
"modifier": "private",
"original_string": "private List<CtTypeReference<?>> ignoredTypes = new ArrayList<>();",
"type": "List<CtTypeReference<?>>",
"var_name": "ignoredTypes"
},
{
"declarator": "circularP... | {
"body": "public void process(CtPackage element) {\n\t\tCtPackageReference pack = element.getReference();\n\t\tSet<CtPackageReference> refs = new HashSet<>();\n\t\tfor (CtType t : element.getTypes()) {\n\t\t\tList<CtTypeReference<?>> listReferences = Query.getReferences(t, new ReferenceTypeFilter<>(CtTypeReference.c... | {
"created": null,
"fork": null,
"fork_count": 29,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29349352,
"size": 5697,
"stargazer_count": 43,
"stars": null,
"updates": null,
"url": "https://github.com/SpoonLabs/spoon-examples"
} |
29349352_3 | {
"fields": [],
"file": "src/main/java/fr/inria/gforge/spoon/analysis/EmptyMethodBodyProcessorTest.java",
"identifier": "EmptyMethodBodyProcessorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testEmptyMethodProcessor() throws Exception {\n\t\tfinal String[] args = {\n\t\t\t\t\"-i\", \"src/test/resources/src/DocTest.java\",\n\t\t\t\t\"-o\", \"target/spooned/\"\n\t\t};\n\n\t\tfinal Launcher launcher = new Launcher();\n\t\tlauncher.setArgs(args);\n\t\tlauncher.run();\n\n\t\tfi... | {
"fields": [
{
"declarator": "emptyMethods = new ArrayList<>()",
"modifier": "public final",
"original_string": "public final List<CtMethod> emptyMethods = new ArrayList<>();",
"type": "List<CtMethod>",
"var_name": "emptyMethods"
}
],
"file": "src/main/java/fr/inria/gforge/s... | {
"body": "public void process(CtMethod<?> element) {\n\t\tif (element.getParent(CtClass.class) != null && !element.getModifiers().contains(ModifierKind.ABSTRACT) && element.getBody().getStatements().isEmpty()) {\n\t\t\temptyMethods.add(element);\n\t\t}\n\t}",
"class_method_signature": "EmptyMethodBodyProcessor.pro... | {
"created": null,
"fork": null,
"fork_count": 29,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29349352,
"size": 5697,
"stargazer_count": 43,
"stars": null,
"updates": null,
"url": "https://github.com/SpoonLabs/spoon-examples"
} |
29349352_2 | {
"fields": [],
"file": "src/main/java/fr/inria/gforge/spoon/analysis/FactoryProcessorTest.java",
"identifier": "FactoryProcessorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testReferenceProcessor() throws Exception {\n\t\tfinal String[] args = {\n\t\t\t\t\"-i\", \"src/test/resources/factory/\",\n\t\t\t\t\"-o\", \"target/spooned/\"\n\t\t};\n\n\t\tfinal Launcher launcher = new Launcher();\n\t\tlauncher.setArgs(args);\n\t\tlauncher.run();\n\n\t\tfinal Factor... | {
"fields": [
{
"declarator": "listWrongUses = new ArrayList<>()",
"modifier": "public",
"original_string": "public List<CtConstructorCall> listWrongUses = new ArrayList<>();",
"type": "List<CtConstructorCall>",
"var_name": "listWrongUses"
},
{
"declarator": "factoryTyp... | {
"body": "public void process(CtConstructorCall<?> newClass) {\n\t\t// skip factory creation\n\t\tif (newClass.getExecutable().getDeclaringType().isSubtypeOf(getFactoryType()))\n\t\t\treturn;\n\t\t// skip creations in factories\n\t\tif (newClass.getParent(CtClass.class).isSubtypeOf(getFactoryType()))\n\t\t\treturn;\... | {
"created": null,
"fork": null,
"fork_count": 29,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29349352,
"size": 5697,
"stargazer_count": 43,
"stars": null,
"updates": null,
"url": "https://github.com/SpoonLabs/spoon-examples"
} |
198220069_12 | {
"fields": [
{
"declarator": "writeRecordNum = 1000000",
"modifier": "final",
"original_string": "final int writeRecordNum = 1000000;",
"type": "int",
"var_name": "writeRecordNum"
}
],
"file": "joyqueue-server/joyqueue-broker-core/src/test/java/org/joyqueue/broker/archive/Co... | {
"body": "@Test\n public void readConsumeLog() throws InterruptedException {\n writeConsumeLog();\n String testPath = getTestPath();\n ConsumeArchiveService.ArchiveMappedFileRepository archiveMappedFileRepository = new ConsumeArchiveService.ArchiveMappedFileRepository(testPath);\n\n fo... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(ConsumeArchiveService.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(ConsumeArchiveService.class);",
"type": "Logger",
"var_name": "logger"
... | {
"body": "private List<ConsumeLog> readConsumeLog(int count) {\n // 每次读取之前清零\n readByteCounter.set(0);\n\n List<ConsumeLog> list = new LinkedList<>();\n for (int i = 0; i < count; i++) {\n byte[] bytes = repository.readOne();\n // 读到结尾会返回byte[0]\n if (byte... | {
"created": "7/22/2019 12:34:59 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 198220069,
"size": null,
"stargazer_count": null,
"stars": 93,
"updates": "2020-01-20T03:17:51+00:00",
"url": "https://github.com/chubaostream/jo... |
198220069_5 | {
"fields": [],
"file": "joyqueue-common/joyqueue-toolkit/src/test/java/org/joyqueue/toolkit/config/ContextTest.java",
"identifier": "ContextTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testBind() throws Exception {\n final Date now = new Date();\n PostmanUpdater postman = new PostmanUpdater() {\n @Override\n protected Context update(final String group) {\n Context context = new Context();\n context.p... | {
"fields": [
{
"declarator": "parameters = new ConcurrentHashMap<String, Object>()",
"modifier": "protected",
"original_string": "protected ConcurrentHashMap<String, Object> parameters = new ConcurrentHashMap<String, Object>();",
"type": "ConcurrentHashMap<String, Object>",
"var_nam... | {
"body": "public Object put(final String key, final Object value) {\n return parameters.put(key, value);\n }",
"class_method_signature": "Context.put(final String key, final Object value)",
"constructor": false,
"full_signature": "public Object put(final String key, final Object value)",
"identifie... | {
"created": "7/22/2019 12:34:59 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 198220069,
"size": null,
"stargazer_count": null,
"stars": 93,
"updates": "2020-01-20T03:17:51+00:00",
"url": "https://github.com/chubaostream/jo... |
198220069_45 | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(PositioningStoreTest.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(PositioningStoreTest.class);",
"type": "Logger",
"var_name": "logger"
... | {
"body": "@Test\n public void readByteBufferPerformanceTest() throws IOException, InterruptedException, TimeoutException {\n // 总共写入消息的的大小\n long maxSize = 1L * 1024 * 1024 * 1024;\n // 每条消息消息体大小\n int logSize = 1024;\n // 每批读消息大小\n int batchSize = 10 * 1024;\n\n P... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(PositioningStore.class)",
"modifier": "private final",
"original_string": "private final Logger logger = LoggerFactory.getLogger(PositioningStore.class);",
"type": "Logger",
"var_name": "logger"
},
{
"decla... | {
"body": "public ByteBuffer readByteBuffer(long position, int length) throws IOException {\n checkReadPosition(position);\n try {\n StoreFile<T> storeFile = storeFileMap.floorEntry(position).getValue();\n int relPosition = (int) (position - storeFile.position());\n Byte... | {
"created": "7/22/2019 12:34:59 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 198220069,
"size": null,
"stargazer_count": null,
"stars": 93,
"updates": "2020-01-20T03:17:51+00:00",
"url": "https://github.com/chubaostream/jo... |
198220069_28 | {
"fields": [],
"file": "joyqueue-server/joyqueue-broker-core/src/test/java/org/joyqueue/broker/consumer/ConcurrentConsumptionTest.java",
"identifier": "ConcurrentConsumptionTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void sortByAckStartIndexTest() {\n List<Position> list = new ArrayList<>();\n Position position = new Position(1, 1, 1, 1);\n Position position1 = new Position(2, 2, 2, 2);\n Position position2 = new Position(3, 3, 3, 3);\n Position position3 = new Posit... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(ConcurrentConsumption.class)",
"modifier": "private final",
"original_string": "private final Logger logger = LoggerFactory.getLogger(ConcurrentConsumption.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "private List<Position> sortByAckStartIndex(List<Position> list) {\n return Lists.newArrayList(list).stream().sorted((thisPosition, thatPosition) -> Long.compare(thisPosition.getAckStartIndex(), thatPosition.getAckStartIndex())).collect(Collectors.toList());\n }",
"class_method_signature": "Conc... | {
"created": "7/22/2019 12:34:59 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 198220069,
"size": null,
"stargazer_count": null,
"stars": 93,
"updates": "2020-01-20T03:17:51+00:00",
"url": "https://github.com/chubaostream/jo... |
198220069_9 | {
"fields": [
{
"declarator": "host=\"127.0.0.1:50091\"",
"modifier": "private static final",
"original_string": "private static final String host=\"127.0.0.1:50091\";",
"type": "String",
"var_name": "host"
},
{
"declarator": "topic=\"test_topic_11\"",
"modifier":... | {
"body": "@Test\n public void partitionGroup() throws Exception{\n TopicAdmin.PartitionGroupArg arg=new TopicAdmin.PartitionGroupArg();\n arg.topic=topic;\n String partitionGroups=client.partitionGroup(arg);\n List<PartitionGroup> partitionGroupList=JSON.parseArray(partitionGroups,Part... | {
"fields": [
{
"declarator": "logger= LoggerFactory.getLogger(AdminClient.class)",
"modifier": "private",
"original_string": "private Logger logger= LoggerFactory.getLogger(AdminClient.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "DELAY_MS=100",
... | {
"body": "@Override\n public String partitionGroup(TopicAdmin.PartitionGroupArg partitionGroupArg) throws Exception {\n partitionGroupArg.host=host;\n\n try {\n String result= topicAdmin.partitionGroups(partitionGroupArg,null);\n hostProvider.onConnected();\n return ... | {
"created": "7/22/2019 12:34:59 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 198220069,
"size": null,
"stargazer_count": null,
"stars": 93,
"updates": "2020-01-20T03:17:51+00:00",
"url": "https://github.com/chubaostream/jo... |
198220069_24 | {
"fields": [
{
"declarator": "localFileStore = new LocalFileStore()",
"modifier": "private",
"original_string": "private LocalFileStore localFileStore = new LocalFileStore();",
"type": "LocalFileStore",
"var_name": "localFileStore"
},
{
"declarator": "base",
"mod... | {
"body": "@Test\n public void forceFlush() {\n put();\n localFileStore.forceFlush();\n }",
"class_method_signature": "LocalFileStoreTest.forceFlush()",
"constructor": false,
"full_signature": "@Test public void forceFlush()",
"identifier": "forceFlush",
"invocations": [
"put",
"... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(LocalFileStore.class)",
"modifier": "private",
"original_string": "private Logger logger = LoggerFactory.getLogger(LocalFileStore.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "fileUpd... | {
"body": "@Override\n public void forceFlush() {\n doFlush();\n }",
"class_method_signature": "LocalFileStore.forceFlush()",
"constructor": false,
"full_signature": "@Override public void forceFlush()",
"identifier": "forceFlush",
"invocations": [
"doFlush"
],
"modifiers": "@Override p... | {
"created": "7/22/2019 12:34:59 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 198220069,
"size": null,
"stargazer_count": null,
"stars": 93,
"updates": "2020-01-20T03:17:51+00:00",
"url": "https://github.com/chubaostream/jo... |
198220069_32 | {
"fields": [
{
"declarator": "nameServiceStub",
"modifier": "private",
"original_string": "private NameServiceStub nameServiceStub;",
"type": "NameServiceStub",
"var_name": "nameServiceStub"
},
{
"declarator": "brokerEventBus",
"modifier": "private",
"origi... | {
"body": "@Test\n public void getPartitionGroupClusterTest() throws Exception {\n TopicConfig topicConfig = nameServiceStub.getTopicConfig(TopicName.parse(\"test1\"));\n GetPartitionGroupClusterRequest getPartitionGroupClusterRequest = new GetPartitionGroupClusterRequest();\n Map<String, List... | {
"fields": [
{
"declarator": "storeService",
"modifier": "private",
"original_string": "private StoreService storeService;",
"type": "StoreService",
"var_name": "storeService"
}
],
"file": "joyqueue-server/joyqueue-broker-core/src/main/java/org/joyqueue/broker/handler/GetPar... | {
"body": "@Override\n public Command handle(Transport transport, Command command) {\n GetPartitionGroupClusterRequest request = (GetPartitionGroupClusterRequest) command.getPayload();\n GetPartitionGroupClusterResponse response = new GetPartitionGroupClusterResponse();\n for (Map.Entry<String... | {
"created": "7/22/2019 12:34:59 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 198220069,
"size": null,
"stargazer_count": null,
"stars": 93,
"updates": "2020-01-20T03:17:51+00:00",
"url": "https://github.com/chubaostream/jo... |
198220069_33 | {
"fields": [
{
"declarator": "message = new BrokerMessage()",
"modifier": "private",
"original_string": "private BrokerMessage message = new BrokerMessage();",
"type": "BrokerMessage",
"var_name": "message"
}
],
"file": "joyqueue-server/joyqueue-broker-core/src/test/java/org... | {
"body": "@Test\n public void readFlag() throws Exception {\n message.setFlag((short) 10);\n message.setClientIp(IpUtil.toByte(new InetSocketAddress(50088)));\n message.setText(\"text\");\n message.setAttribute(\"Test\",\"TestTest\");\n message.setExtension(\"Test\".getBytes());... | {
"fields": [
{
"declarator": "BYTE_SIZE = 1",
"modifier": "private static final",
"original_string": "private static final byte BYTE_SIZE = 1;",
"type": "byte",
"var_name": "BYTE_SIZE"
},
{
"declarator": "SHORT_SIZE = 2",
"modifier": "private static final",
... | {
"body": "public static short readFlag(ByteBuffer byteBuffer) {\n ByteBuffer slice = byteBuffer.slice();\n slice.position(59);\n short flag = slice.getShort();\n\n return flag;\n }",
"class_method_signature": "Serializer.readFlag(ByteBuffer byteBuffer)",
"constructor": false,
"fu... | {
"created": "7/22/2019 12:34:59 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 198220069,
"size": null,
"stargazer_count": null,
"stars": 93,
"updates": "2020-01-20T03:17:51+00:00",
"url": "https://github.com/chubaostream/jo... |
198220069_25 | {
"fields": [
{
"declarator": "localFileStore = new LocalFileStore()",
"modifier": "private",
"original_string": "private LocalFileStore localFileStore = new LocalFileStore();",
"type": "LocalFileStore",
"var_name": "localFileStore"
},
{
"declarator": "base",
"mod... | {
"body": "@Test\n public void recover() throws IOException {\n put();\n localFileStore.forceFlush();\n ConcurrentMap<ConsumePartition, Position> recover = localFileStore.recover();\n Position positionVal = recover.get(consumePartition);\n Assert.assertEquals(position.toString(),... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(LocalFileStore.class)",
"modifier": "private",
"original_string": "private Logger logger = LoggerFactory.getLogger(LocalFileStore.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "fileUpd... | {
"body": "public ConcurrentMap<ConsumePartition, Position> recover() throws IOException {\n ConcurrentMap<ConsumePartition, Position> consumePositionCache = new ConcurrentHashMap<>();\n\n Map<Joint, List<ConsumeBill>> consumeBills;\n try {\n consumeBills = loadFromFile(indexFile, new ... | {
"created": "7/22/2019 12:34:59 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 198220069,
"size": null,
"stargazer_count": null,
"stars": 93,
"updates": "2020-01-20T03:17:51+00:00",
"url": "https://github.com/chubaostream/jo... |
198220069_8 | {
"fields": [
{
"declarator": "host=\"127.0.0.1:50091\"",
"modifier": "private static final",
"original_string": "private static final String host=\"127.0.0.1:50091\";",
"type": "String",
"var_name": "host"
},
{
"declarator": "topic=\"test_topic_11\"",
"modifier":... | {
"body": "@Test\n public void appToken() throws Exception{\n AppAdmin.TokenArg tokenArg=new AppAdmin.TokenArg();\n tokenArg.app=this.app;\n String token=client.token(tokenArg);\n Assert.assertNotNull(token);\n\n }",
"class_method_signature": "AdminClientTest.appToken()",
"constr... | {
"fields": [
{
"declarator": "logger= LoggerFactory.getLogger(AdminClient.class)",
"modifier": "private",
"original_string": "private Logger logger= LoggerFactory.getLogger(AdminClient.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "DELAY_MS=100",
... | {
"body": "@Override\n public String token(AppAdmin.TokenArg tokenArg) throws Exception{\n tokenArg.host=host;\n try {\n String result= appAdmin.token(tokenArg,null);\n hostProvider.onConnected();\n return result;\n }catch (Exception e){\n onExceptio... | {
"created": "7/22/2019 12:34:59 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 198220069,
"size": null,
"stargazer_count": null,
"stars": 93,
"updates": "2020-01-20T03:17:51+00:00",
"url": "https://github.com/chubaostream/jo... |
198220069_48 | {
"fields": [],
"file": "joyqueue-server/joyqueue-retry/joyqueue-retry-api/src/test/java/org/joyqueue/server/retry/util/RetrySerializerUtilTest.java",
"identifier": "RetrySerializerUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void serialize() {\n RetryMessageModel retry = new RetryMessageModel();\n retry.setBusinessId(\"business\");\n retry.setTopic(\"topic\");\n retry.setApp(\"app\");\n retry.setPartition((short) 255);\n retry.setIndex(100L);\n retry.setBrokerM... | {
"fields": [],
"file": "joyqueue-server/joyqueue-retry/joyqueue-retry-api/src/main/java/org/joyqueue/server/retry/util/RetrySerializerUtil.java",
"identifier": "RetrySerializerUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "RetrySerializerUtil.deserialize(ByteBuf buffer)",
... | {
"body": "public static ByteBuffer serialize(RetryMessageModel retryMessageModel) {\n int size = size(retryMessageModel);\n ByteBuffer allocate = ByteBuffer.allocate(size);\n\n String businessId = retryMessageModel.getBusinessId();\n if (StringUtils.isNotEmpty(businessId)) {\n ... | {
"created": "7/22/2019 12:34:59 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 198220069,
"size": null,
"stargazer_count": null,
"stars": 93,
"updates": "2020-01-20T03:17:51+00:00",
"url": "https://github.com/chubaostream/jo... |
198220069_29 | {
"fields": [],
"file": "joyqueue-server/joyqueue-broker-core/src/test/java/org/joyqueue/broker/consumer/ConcurrentConsumptionTest.java",
"identifier": "ConcurrentConsumptionTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void mergeSequenceSegmentTest() {\n List<Position> list = new ArrayList<>();\n Position position = new Position(1, 1, 1, 1);\n// PositionManager.Position position1 = new PositionManager.Position(2, 2, 2, 2);\n Position position2 = new Position(3, 3, 3, 3);\n ... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(ConcurrentConsumption.class)",
"modifier": "private final",
"original_string": "private final Logger logger = LoggerFactory.getLogger(ConcurrentConsumption.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "private List<Position> mergeSequenceSegment(List<Position> sortPositionList) {\n if (sortPositionList.size() <= 1) {\n return sortPositionList;\n }\n List<Position> mergeList = new ArrayList<>();\n\n for (int i = 0; i < sortPositionList.size(); i++) {\n Pos... | {
"created": "7/22/2019 12:34:59 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 198220069,
"size": null,
"stargazer_count": null,
"stars": 93,
"updates": "2020-01-20T03:17:51+00:00",
"url": "https://github.com/chubaostream/jo... |
198220069_4 | {
"fields": [],
"file": "joyqueue-common/joyqueue-toolkit/src/test/java/org/joyqueue/toolkit/security/HexTest.java",
"identifier": "HexTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testEncode() {\n String source = \"12345AB中国6789\";\n String encode = Hex.encode(source.getBytes(Charset.forName(\"utf-8\")));\n String decode = new String(Hex.decode(encode),Charset.forName(\"utf-8\"));\n Assert.assertEquals(source, decode);\n }",
"c... | {
"fields": [
{
"declarator": "HEX[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}",
"modifier": "private static final",
"original_string": "private static final char HEX[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};",
... | {
"body": "public static final String encode(final byte[] data) {\n if (data == null || data.length == 0) {\n return \"\";\n }\n // 把密文转换成十六进制的字符串形式\n char str[] = new char[data.length * 2];\n int k = 0;\n for (byte b : data) {\n str[k++] = HEX[b >>> 4 &... | {
"created": "7/22/2019 12:34:59 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 198220069,
"size": null,
"stargazer_count": null,
"stars": 93,
"updates": "2020-01-20T03:17:51+00:00",
"url": "https://github.com/chubaostream/jo... |
198220069_44 | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(PositioningStoreTest.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(PositioningStoreTest.class);",
"type": "Logger",
"var_name": "logger"
... | {
"body": "@Test\n public void readPerformanceTest() throws IOException, InterruptedException, TimeoutException {\n // 总共写入消息的的大小\n long maxSize = 1L * 1024 * 1024 * 1024;\n // 每条消息消息体大小\n int logSize = 1024;\n PreloadBufferPool bufferPool = PreloadBufferPool.getInstance();\n ... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(PositioningStore.class)",
"modifier": "private final",
"original_string": "private final Logger logger = LoggerFactory.getLogger(PositioningStore.class);",
"type": "Logger",
"var_name": "logger"
},
{
"decla... | {
"body": "public T read(long position) throws IOException {\n checkReadPosition(position);\n try {\n return tryRead(position);\n } catch (Throwable t) {\n logger.warn(\"Exception on read position {} of store {}.\", position, base.getAbsolutePath(), t);\n throw t;... | {
"created": "7/22/2019 12:34:59 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 198220069,
"size": null,
"stargazer_count": null,
"stars": 93,
"updates": "2020-01-20T03:17:51+00:00",
"url": "https://github.com/chubaostream/jo... |
198220069_13 | {
"fields": [],
"file": "joyqueue-server/joyqueue-broker-core/src/test/java/org/joyqueue/broker/archive/ArchiveSerializerTest.java",
"identifier": "ArchiveSerializerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void write() {\n ConsumeLog consumeLog = new ConsumeLog();\n consumeLog.setApp(\"app_test\");\n consumeLog.setBrokerId(1);\n consumeLog.setClientIp(new byte[16]);\n consumeLog.setBytesMessageId(new byte[16]);\n consumeLog.setConsumeTime(SystemCloc... | {
"fields": [
{
"declarator": "byteBufferPool = new ByteBufferPool()",
"modifier": "private static",
"original_string": "private static ByteBufferPool byteBufferPool = new ByteBufferPool();",
"type": "ByteBufferPool",
"var_name": "byteBufferPool"
}
],
"file": "joyqueue-server... | {
"body": "public static ByteBuffer write(ConsumeLog consumeLog) {\n int size = consumeLogSize(consumeLog);\n ByteBuffer buffer = byteBufferPool.acquire(/* 4 byte len */ 4 + size, false); // 4个字节长度\n buffer.putInt(size);\n buffer.put(consumeLog.getBytesMessageId());\n buffer.putInt(... | {
"created": "7/22/2019 12:34:59 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 198220069,
"size": null,
"stargazer_count": null,
"stars": 93,
"updates": "2020-01-20T03:17:51+00:00",
"url": "https://github.com/chubaostream/jo... |
198220069_18 | {
"fields": [
{
"declarator": "partitionLockInstance = new PartitionLockInstance()",
"modifier": "final",
"original_string": "final PartitionLockInstance partitionLockInstance = new PartitionLockInstance();",
"type": "PartitionLockInstance",
"var_name": "partitionLockInstance"
},... | {
"body": "@Test\n public void getLockInstance1() {\n ConsumePartition consumePartition = new ConsumePartition();\n consumePartition.setPartition(partition);\n consumePartition.setTopic(topic);\n consumePartition.setApp(app);\n\n ConsumePartition consumePartition2 = new ConsumePa... | {
"fields": [
{
"declarator": "partitionLockCache = new ConcurrentHashMap<>()",
"modifier": "private",
"original_string": "private ConcurrentMap<ConsumePartition, ConsumePartition> partitionLockCache = new ConcurrentHashMap<>();",
"type": "ConcurrentMap<ConsumePartition, ConsumePartition>"... | {
"body": "public ConsumePartition getLockInstance(String topic, String app, short partition) {\n ConsumePartition consumePartition = new ConsumePartition(topic, app, partition);\n return getLockInstance(consumePartition);\n }",
"class_method_signature": "PartitionLockInstance.getLockInstance(Strin... | {
"created": "7/22/2019 12:34:59 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 198220069,
"size": null,
"stargazer_count": null,
"stars": 93,
"updates": "2020-01-20T03:17:51+00:00",
"url": "https://github.com/chubaostream/jo... |
198220069_22 | {
"fields": [
{
"declarator": "localFileStore = new LocalFileStore()",
"modifier": "private",
"original_string": "private LocalFileStore localFileStore = new LocalFileStore();",
"type": "LocalFileStore",
"var_name": "localFileStore"
},
{
"declarator": "base",
"mod... | {
"body": "@Test\n public void remove() {\n localFileStore.put(consumePartition, position);\n\n Position remove = localFileStore.remove(consumePartition);\n Assert.assertEquals(remove, position);\n\n Position position = localFileStore.get(consumePartition);\n Assert.assertEquals(... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(LocalFileStore.class)",
"modifier": "private",
"original_string": "private Logger logger = LoggerFactory.getLogger(LocalFileStore.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "fileUpd... | {
"body": "@Override\n public Position remove(ConsumePartition key) {\n return consumePositionCache.remove(key);\n }",
"class_method_signature": "LocalFileStore.remove(ConsumePartition key)",
"constructor": false,
"full_signature": "@Override public Position remove(ConsumePartition key)",
"identi... | {
"created": "7/22/2019 12:34:59 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 198220069,
"size": null,
"stargazer_count": null,
"stars": 93,
"updates": "2020-01-20T03:17:51+00:00",
"url": "https://github.com/chubaostream/jo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.