id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
16970593_69 | {
"fields": [
{
"declarator": "validator",
"modifier": "private",
"original_string": "private EntityParentsReferToExistingEntitiesValidator validator;",
"type": "EntityParentsReferToExistingEntitiesValidator",
"var_name": "validator"
},
{
"declarator": "context",
... | {
"body": "@Test\n public void testUnknownParent() {\n MetricEntityTypeDescriptor entity2 = mockEntity(\"foobar_entity_two\");\n doReturn(ImmutableList.of(\"FOOBAR\", \"non_existing_parent\")).when(entity)\n .getParentMetricEntityTypeNames();\n addEntity(entity);\n addEntity(entity2);\n context... | {
"fields": [
{
"declarator": "builtInRoleTypes",
"modifier": "private final",
"original_string": "private final ImmutableSet<String> builtInRoleTypes;",
"type": "ImmutableSet<String>",
"var_name": "builtInRoleTypes"
},
{
"declarator": "builtInEntityTypes",
"modif... | {
"body": "@Override\n public <T> List<ConstraintViolation<T>> validate(\n MonitoringValidationContext context,\n MetricEntityTypeDescriptor entity,\n DescriptorPathImpl path) {\n Preconditions.checkNotNull(context);\n Preconditions.checkNotNull(entity);\n Preconditions.checkNotNull(path);\n ... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_100 | {
"fields": [
{
"declarator": "visitor = new DescriptorVisitorImpl()",
"modifier": "private",
"original_string": "private DescriptorVisitorImpl visitor = new DescriptorVisitorImpl();",
"type": "DescriptorVisitorImpl",
"var_name": "visitor"
}
],
"file": "cm-schema/src/test/jav... | {
"body": "@Test\n public void testVisitNamed() {\n\n NamedSubDescriptor sub = new NamedSubDescriptor(\"foo\");\n\n final Set<String> beforePaths = Sets.newHashSet();\n\n visitor.visit(sub, new AbstractNodeProcessor<Object>() {\n @Override\n public void beforeNode(Object obj, DescriptorPath path) ... | {
"fields": [],
"file": "cm-schema/src/main/java/com/cloudera/csd/validation/references/components/DescriptorVisitorImpl.java",
"identifier": "DescriptorVisitorImpl",
"interfaces": "implements DescriptorVisitor",
"methods": [
{
"class_method_signature": "DescriptorVisitorImpl.visit(Object rootObject... | {
"body": "@Override\n public <T> T visit(Object rootObject, NodeProcessor<T> processor) {\n DescriptorPathImpl root = new DescriptorPathImpl();\n visit(rootObject, root, processor);\n return processor.getResult();\n }",
"class_method_signature": "DescriptorVisitorImpl.visit(Object rootObject, NodeProces... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_35 | {
"fields": [
{
"declarator": "validator",
"modifier": "private",
"original_string": "private ParentsAreReachableUsingAttributesValidator validator;",
"type": "ParentsAreReachableUsingAttributesValidator",
"var_name": "validator"
},
{
"declarator": "context",
"mod... | {
"body": "@Test\n public void testEntitiesNoParents() {\n MetricEntityTypeDescriptor entity2 = mockEntity(\"foobar_entity_two\");\n addEntity(entity);\n addEntity(entity2);\n assertTrue(validator.validate(context, entity, root).isEmpty());\n }",
"class_method_signature": "ParentsAreReachableUsingAttr... | {
"fields": [],
"file": "cm-schema/src/main/java/com/cloudera/csd/validation/monitoring/constraints/ParentsAreReachableUsingAttributesValidator.java",
"identifier": "ParentsAreReachableUsingAttributesValidator",
"interfaces": "",
"methods": [
{
"class_method_signature": "ParentsAreReachableUsingAttr... | {
"body": "@Override\n public <T> List<ConstraintViolation<T>> validate(\n MonitoringValidationContext context,\n MetricEntityTypeDescriptor entity,\n DescriptorPathImpl path) {\n Preconditions.checkNotNull(context);\n Preconditions.checkNotNull(entity);\n Preconditions.checkNotNull(path);\n ... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_62 | {
"fields": [
{
"declarator": "validator",
"modifier": "private",
"original_string": "private NameForCrossEntityAggregatesIsUniqueValidator validator;",
"type": "NameForCrossEntityAggregatesIsUniqueValidator",
"var_name": "validator"
},
{
"declarator": "context",
... | {
"body": "@Test\n public void testOnlyServiceHasNameForAggregates() {\n setServiceNameForCrossEntityAggregates(\"aggregate_for_service\");\n assertTrue(validator.validate(context, serviceDescriptor, root).isEmpty());\n }",
"class_method_signature": "NameForCrossEntityAggregatesIsUniqueValidatorTest.testOnl... | {
"fields": [],
"file": "cm-schema/src/main/java/com/cloudera/csd/validation/monitoring/constraints/NameForCrossEntityAggregatesIsUniqueValidator.java",
"identifier": "NameForCrossEntityAggregatesIsUniqueValidator",
"interfaces": "",
"methods": [
{
"class_method_signature": "NameForCrossEntityAggreg... | {
"body": "@Override\n public <T> List<ConstraintViolation<T>> validate(\n MonitoringValidationContext context,\n ServiceMonitoringDefinitionsDescriptor serviceDescriptor,\n DescriptorPathImpl path) {\n Preconditions.checkNotNull(context);\n Preconditions.checkNotNull(serviceDescriptor);\n Pr... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_74 | {
"fields": [
{
"declarator": "validator",
"modifier": "private",
"original_string": "private CounterMetricNameValidator validator;",
"type": "CounterMetricNameValidator",
"var_name": "validator"
},
{
"declarator": "context",
"modifier": "private",
"original... | {
"body": "@Test\n public void testGoodCounter() {\n setName(\"bytes_read\");\n assertTrue(validator.validate(context, metric, root).isEmpty());\n }",
"class_method_signature": "CounterMetricNameValidatorTest.testGoodCounter()",
"constructor": false,
"full_signature": "@Test public void testGoodCounter(... | {
"fields": [],
"file": "cm-schema/src/main/java/com/cloudera/csd/validation/monitoring/constraints/CounterMetricNameValidator.java",
"identifier": "CounterMetricNameValidator",
"interfaces": "",
"methods": [
{
"class_method_signature": "CounterMetricNameValidator.getDescription()",
"construct... | {
"body": "@Override\n public <T> List<ConstraintViolation<T>> validate(\n MonitoringValidationContext context,\n MetricDescriptor metricDescriptor,\n DescriptorPathImpl path) {\n Preconditions.checkNotNull(context);\n Preconditions.checkNotNull(metricDescriptor);\n if (!metricDescriptor.isCo... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_23 | {
"fields": [
{
"declarator": "validator",
"modifier": "@Qualifier(\"serviceDescriptorValidatorWithDependencyCheck\")\n @Autowired\n private",
"original_string": "@Qualifier(\"serviceDescriptorValidatorWithDependencyCheck\")\n @Autowired\n private ServiceDescriptorValidatorImpl validator;",
... | {
"body": "@Test\n public void testTopologyRangeCheck() {\n Set<String> errors = validate(\"service_topologyRangeCheck.sdl\");\n assertEquals(\"service.roles[0].topology must satisfy \" +\n \"\\\"minInstances == null or maxInstances == null or minInstances <= maxInstances\\\"\",\n Iterables.getOn... | {
"fields": [
{
"declarator": "validator",
"modifier": "private final",
"original_string": "private final Validator validator;",
"type": "Validator",
"var_name": "validator"
},
{
"declarator": "refValidator",
"modifier": "private final",
"original_string": "... | {
"body": "@Override\n public Set<String> validate(ServiceDescriptor descriptor) {\n Set<ConstraintViolation<ServiceDescriptor>> constraintViolations;\n constraintViolations = getViolations(descriptor);\n\n ImmutableSet.Builder<String> violations = ImmutableSet.builder();\n for (ConstraintViolation<Servi... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_58 | {
"fields": [
{
"declarator": "validator",
"modifier": "private",
"original_string": "private WeightingMetricValidator validator;",
"type": "WeightingMetricValidator",
"var_name": "validator"
},
{
"declarator": "context",
"modifier": "private",
"original_str... | {
"body": "@Test\n public void testWeightingMetricInDefinedMetrics() {\n setName(\"bytes_read\");\n setServiceMetrics(ImmutableList.of(newWeightingMetric(\"foobar\")));\n context = new MonitoringValidationContext(serviceDescriptor);\n setWeightingMetric(\"foobar\");\n assertTrue(validator.validate(con... | {
"fields": [],
"file": "cm-schema/src/main/java/com/cloudera/csd/validation/monitoring/constraints/WeightingMetricValidator.java",
"identifier": "WeightingMetricValidator",
"interfaces": "",
"methods": [
{
"class_method_signature": "WeightingMetricValidator.getDescription()",
"constructor": f... | {
"body": "@Override\n public <T> List<ConstraintViolation<T>> validate(\n MonitoringValidationContext context,\n MetricDescriptor metricDescriptor,\n DescriptorPathImpl path) {\n Preconditions.checkNotNull(context);\n Preconditions.checkNotNull(metricDescriptor);\n Preconditions.checkNotNull... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_131 | {
"fields": [
{
"declarator": "COUNTER = true",
"modifier": "private static final",
"original_string": "private static final boolean COUNTER = true;",
"type": "boolean",
"var_name": "COUNTER"
},
{
"declarator": "adapter",
"modifier": "private",
"original_str... | {
"body": "@Test\n public void testNameForCounterMetricOverride() throws Exception {\n String source = this.getClass().getResource(\n \"/com/cloudera/csd/tools/codahale/name_for_counter_metrics_overrides.json\")\n .getPath();\n adapter.init(source, CodahaleMetricAdapter.DEFAULT_CONVENTIONS);\n ... | {
"fields": [
{
"declarator": "LOG =\n LoggerFactory.getLogger(CodahaleMetricAdapter.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG =\n LoggerFactory.getLogger(CodahaleMetricAdapter.class);",
"type": "Logger",
"var_name": "L... | {
"body": "@Override\n public void init(String fixtureFile,\n @Nullable String conventionsFile) throws Exception {\n Preconditions.checkNotNull(fixtureFile);\n\n FileInputStream in = null;\n try {\n in = FileUtils.openInputStream(new File(fixtureFile));\n fixture = JsonUtil.value... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_7 | {
"fields": [
{
"declarator": "validator",
"modifier": "@Autowired\n private",
"original_string": "@Autowired\n private ServiceMonitoringDefinitionsDescriptorValidatorImpl validator;",
"type": "ServiceMonitoringDefinitionsDescriptorValidatorImpl",
"var_name": "validator"
}
],... | {
"body": "@Test\n public void testMetricsWithBadPrefixesMDL() throws Exception {\n Set<ConstraintViolation<ServiceMonitoringDefinitionsDescriptor>>\n validations =\n validator.getViolations(SdlTestUtils.getValidatorMdl(\n \"monitoring/service_with_bad_prefixes.mdl\"));\n assertEquals(2,... | {
"fields": [
{
"declarator": "NAME_FOR_CROSS_ENTITY_AGGREGATE_METRICS =\n \"nameForCrossEntityAggregateMetrics\"",
"modifier": "private static final",
"original_string": "private static final String NAME_FOR_CROSS_ENTITY_AGGREGATE_METRICS =\n \"nameForCrossEntityAggregateMetrics\";",
... | {
"body": "@Override\n public Set<ConstraintViolation<ServiceMonitoringDefinitionsDescriptor>>\n getViolations(ServiceMonitoringDefinitionsDescriptor descriptor) {\n Set<ConstraintViolation<ServiceMonitoringDefinitionsDescriptor>> violations =\n validator.validate(descriptor);\n if (!violations.isE... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_127 | {
"fields": [
{
"declarator": "COUNTER = true",
"modifier": "private static final",
"original_string": "private static final boolean COUNTER = true;",
"type": "boolean",
"var_name": "COUNTER"
},
{
"declarator": "adapter",
"modifier": "private",
"original_str... | {
"body": "@Test\n public void testCounterAsGaguesMetrics() throws Exception {\n String source = this.getClass().getResource(\n \"/com/cloudera/csd/tools/codahale/valid_with_gauge_counters.json\").getPath();\n adapter.init(source, CodahaleMetricAdapter.DEFAULT_CONVENTIONS);\n assertEquals(2, adapter.... | {
"fields": [
{
"declarator": "LOG =\n LoggerFactory.getLogger(CodahaleMetricAdapter.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG =\n LoggerFactory.getLogger(CodahaleMetricAdapter.class);",
"type": "Logger",
"var_name": "L... | {
"body": "@Override\n public void init(String fixtureFile,\n @Nullable String conventionsFile) throws Exception {\n Preconditions.checkNotNull(fixtureFile);\n\n FileInputStream in = null;\n try {\n in = FileUtils.openInputStream(new File(fixtureFile));\n fixture = JsonUtil.value... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_19 | {
"fields": [
{
"declarator": "validator",
"modifier": "@Qualifier(\"serviceDescriptorValidatorWithDependencyCheck\")\n @Autowired\n private",
"original_string": "@Qualifier(\"serviceDescriptorValidatorWithDependencyCheck\")\n @Autowired\n private ServiceDescriptorValidatorImpl validator;",
... | {
"body": "@Test\n public void testNonUniqueRoleGlobally() {\n Set<String> errors = validate(\"service_nonUniqueRoleGlobal.sdl\");\n assertEquals(\"service.roles[0].name conflicts with a built-in role type\", Iterables.getOnlyElement(errors));\n }",
"class_method_signature": "ServiceDescriptorValidatorImplT... | {
"fields": [
{
"declarator": "validator",
"modifier": "private final",
"original_string": "private final Validator validator;",
"type": "Validator",
"var_name": "validator"
},
{
"declarator": "refValidator",
"modifier": "private final",
"original_string": "... | {
"body": "@Override\n public Set<String> validate(ServiceDescriptor descriptor) {\n Set<ConstraintViolation<ServiceDescriptor>> constraintViolations;\n constraintViolations = getViolations(descriptor);\n\n ImmutableSet.Builder<String> violations = ImmutableSet.builder();\n for (ConstraintViolation<Servi... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_39 | {
"fields": [
{
"declarator": "validator",
"modifier": "private",
"original_string": "private ParentsAreReachableUsingAttributesValidator validator;",
"type": "ParentsAreReachableUsingAttributesValidator",
"var_name": "validator"
},
{
"declarator": "context",
"mod... | {
"body": "@Test\n public void testMissingOneAttribute() {\n MetricEntityTypeDescriptor entity2 = mockEntity(\"foobar_entity_two\");\n doReturn(ImmutableList.of(\"foobar_entity_two\")).when(entity)\n .getParentMetricEntityTypeNames();\n doReturn(ImmutableList.of(\"attr1\", \"attr2\")).when(entity2)\n... | {
"fields": [],
"file": "cm-schema/src/main/java/com/cloudera/csd/validation/monitoring/constraints/ParentsAreReachableUsingAttributesValidator.java",
"identifier": "ParentsAreReachableUsingAttributesValidator",
"interfaces": "",
"methods": [
{
"class_method_signature": "ParentsAreReachableUsingAttr... | {
"body": "@Override\n public <T> List<ConstraintViolation<T>> validate(\n MonitoringValidationContext context,\n MetricEntityTypeDescriptor entity,\n DescriptorPathImpl path) {\n Preconditions.checkNotNull(context);\n Preconditions.checkNotNull(entity);\n Preconditions.checkNotNull(path);\n ... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_107 | {
"fields": [
{
"declarator": "parser = new JsonMdlParser(new JsonSdlObjectMapper())",
"modifier": "private",
"original_string": "private JsonMdlParser parser = new JsonMdlParser(new JsonSdlObjectMapper());",
"type": "JsonMdlParser",
"var_name": "parser"
}
],
"file": "cm-sche... | {
"body": "@Test\n public void testParseFullFile() throws Exception {\n ServiceMonitoringDefinitionsDescriptor descriptor =\n parser.parse(getMdl(\"service_full.mdl\"));\n assertNotNull(descriptor);\n assertEquals(descriptor.getName(), \"ECHO\");\n assertEquals(2, descriptor.getMetricEntityAttribu... | {
"fields": [
{
"declarator": "OBJECT_WRITER",
"modifier": "static final",
"original_string": "static final ObjectWriter OBJECT_WRITER;",
"type": "ObjectWriter",
"var_name": "OBJECT_WRITER"
},
{
"declarator": "PRETTY_OBJECT_WRITER",
"modifier": "static final",
... | {
"body": "@Override\n public ServiceMonitoringDefinitionsDescriptor parse(byte[] data)\n throws IOException {\n Preconditions.checkNotNull(data);\n return mapper.readValue(data, ServiceMonitoringDefinitionsDescriptor.class);\n }",
"class_method_signature": "JsonMdlParser.parse(byte[] data)",
"constr... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_81 | {
"fields": [
{
"declarator": "validator",
"modifier": "private",
"original_string": "private AttributesReferToExistingAttributesValidator validator;",
"type": "AttributesReferToExistingAttributesValidator",
"var_name": "validator"
},
{
"declarator": "context",
"m... | {
"body": "@Test\n public void testImmutableDefinedAttributes() {\n doReturn(ImmutableList.of(\"attr1\", \"attr2\", \"builtIn1\", \"builtIn2\"))\n .when(entity).getImmutableAttributeNames();\n addEntity(entity);\n assertTrue(validator.validate(context, entity, root).isEmpty());\n }",
"class_method... | {
"fields": [
{
"declarator": "builtInAttributes",
"modifier": "private final",
"original_string": "private final ImmutableSet<String> builtInAttributes;",
"type": "ImmutableSet<String>",
"var_name": "builtInAttributes"
}
],
"file": "cm-schema/src/main/java/com/cloudera/csd/v... | {
"body": "@Override\n public <T> List<ConstraintViolation<T>> validate(\n MonitoringValidationContext context,\n MetricEntityTypeDescriptor entity,\n DescriptorPathImpl path) {\n Preconditions.checkNotNull(context);\n Preconditions.checkNotNull(entity);\n Preconditions.checkNotNull(path);\n\... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_150 | {
"fields": [
{
"declarator": "app",
"modifier": "private",
"original_string": "private Main app;",
"type": "Main",
"var_name": "app"
},
{
"declarator": "appName = \"myapp\"",
"modifier": "private",
"original_string": "private String appName = \"myapp\";",
... | {
"body": "@Test\n public void testGoodPermissions() throws Exception {\n String[] args = {\"-r\", goodPermissions};\n app.run(args);\n assertEquals(\"\", err.toString());\n assertTrue(out.toString().contains(goodPermissions));\n }",
"class_method_signature": "MainTest.testGoodPermissions()",
"const... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(Main.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(Main.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "outStream"... | {
"body": "public int run(String[] args) throws IOException {\n Writer writer = new OutputStreamWriter(outStream, Constants.CHARSET_UTF_8);\n AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();\n try {\n BeanDefinition cmdOptsbeanDefinition = BeanDefinitionBuilder\n ... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_97 | {
"fields": [
{
"declarator": "parentAgetInt = method(ParentA.class, \"getInt\")",
"modifier": "private",
"original_string": "private Method parentAgetInt = method(ParentA.class, \"getInt\");",
"type": "Method",
"var_name": "parentAgetInt"
},
{
"declarator": "parentAget... | {
"body": "@Test(expected = IllegalStateException.class)\n public void testPropertyNameOfGetterBadName() {\n ReflectionHelper.propertyNameOfGetter(childABar);\n }",
"class_method_signature": "ReflectionHelperTest.testPropertyNameOfGetterBadName()",
"constructor": false,
"full_signature": "@Test(expected = ... | {
"fields": [
{
"declarator": "GETTER_PREFIXES = ImmutableSet.of(\"get\", \"is\")",
"modifier": "private static final",
"original_string": "private static final Set<String> GETTER_PREFIXES = ImmutableSet.of(\"get\", \"is\");",
"type": "Set<String>",
"var_name": "GETTER_PREFIXES"
... | {
"body": "public static String propertyNameOfGetter(Method method) {\n Preconditions.checkNotNull(method);\n String name = method.getName();\n for (String prefix : GETTER_PREFIXES) {\n if (name.startsWith(prefix)) {\n return Introspector.decapitalize(name.substring(prefix.length()));\n }\n ... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_78 | {
"fields": [
{
"declarator": "validator",
"modifier": "private",
"original_string": "private CounterMetricNameValidator validator;",
"type": "CounterMetricNameValidator",
"var_name": "validator"
},
{
"declarator": "context",
"modifier": "private",
"original... | {
"body": "@Test\n public void testCounterMetricVisibleNameCollidesWithExistingMetric() {\n setName(\"bytes_read\");\n setIsCounter(true);\n setServiceMetrics(ImmutableList.of(newMetricWithName(\"bytes_read_rate\")));\n context = new MonitoringValidationContext(serviceDescriptor);\n assertFalse(valida... | {
"fields": [],
"file": "cm-schema/src/main/java/com/cloudera/csd/validation/monitoring/constraints/CounterMetricNameValidator.java",
"identifier": "CounterMetricNameValidator",
"interfaces": "",
"methods": [
{
"class_method_signature": "CounterMetricNameValidator.getDescription()",
"construct... | {
"body": "@Override\n public <T> List<ConstraintViolation<T>> validate(\n MonitoringValidationContext context,\n MetricDescriptor metricDescriptor,\n DescriptorPathImpl path) {\n Preconditions.checkNotNull(context);\n Preconditions.checkNotNull(metricDescriptor);\n if (!metricDescriptor.isCo... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_146 | {
"fields": [
{
"declarator": "app",
"modifier": "private",
"original_string": "private Main app;",
"type": "Main",
"var_name": "app"
},
{
"declarator": "appName = \"myapp\"",
"modifier": "private",
"original_string": "private String appName = \"myapp\";",
... | {
"body": "@Test\n public void testBadParcel() throws Exception {\n String[] args = {\"-p\", badParcel};\n app.run(args);\n assertEquals(\"\", err.toString());\n assertTrue(out.toString().contains(\"==>\"));\n }",
"class_method_signature": "MainTest.testBadParcel()",
"constructor": false,
"full_si... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(Main.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(Main.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "outStream"... | {
"body": "public int run(String[] args) throws IOException {\n Writer writer = new OutputStreamWriter(outStream, Constants.CHARSET_UTF_8);\n AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();\n try {\n BeanDefinition cmdOptsbeanDefinition = BeanDefinitionBuilder\n ... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_111 | {
"fields": [
{
"declarator": "mapper = new JsonSdlObjectMapper()",
"modifier": "private",
"original_string": "private JsonSdlObjectMapper mapper = new JsonSdlObjectMapper();",
"type": "JsonSdlObjectMapper",
"var_name": "mapper"
},
{
"declarator": "parser = new JsonSdlP... | {
"body": "@Test\n public void testCompatibilty() throws Exception {\n ServiceDescriptor descriptor = parser.parse(getSdl(\"service_full.sdl\"));\n assertNotNull(descriptor);\n\n CompatibilityDescriptor desc = descriptor.getCompatibility();\n assertNotNull(desc);\n VersionRange cdhRange = desc.getCdhV... | {
"fields": [
{
"declarator": "mapper",
"modifier": "private final",
"original_string": "private final JsonSdlObjectMapper mapper;",
"type": "JsonSdlObjectMapper",
"var_name": "mapper"
}
],
"file": "cm-schema/src/main/java/com/cloudera/csd/components/JsonSdlParser.java",
"i... | {
"body": "@Override\n public ServiceDescriptor parse(byte[] data) throws IOException {\n Preconditions.checkNotNull(data);\n return mapper.readValue(data, ServiceDescriptor.class);\n }",
"class_method_signature": "JsonSdlParser.parse(byte[] data)",
"constructor": false,
"full_signature": "@Override pub... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_54 | {
"fields": [
{
"declarator": "SERVICE_NODE = true",
"modifier": "private static final",
"original_string": "private static final Boolean SERVICE_NODE = true;",
"type": "Boolean",
"var_name": "SERVICE_NODE"
},
{
"declarator": "validator",
"modifier": "private",
... | {
"body": "@Test\n public void testGoodName() {\n assertTrue(validator.validate(\n context, SERVICE_NAME.toLowerCase() + \"_\", root).isEmpty());\n }",
"class_method_signature": "NameForCrossEntityAggregatesPrefixedWithServiceNameValidatorTest.testGoodName()",
"constructor": false,
"full_signature":... | {
"fields": [
{
"declarator": "builtInNamesForCrossEntityAggregateMetrics",
"modifier": "private final",
"original_string": "private final ImmutableSet<String> builtInNamesForCrossEntityAggregateMetrics;",
"type": "ImmutableSet<String>",
"var_name": "builtInNamesForCrossEntityAggrega... | {
"body": "@Override\n public <T> List<ConstraintViolation<T>> validate(\n MonitoringValidationContext context,\n String nameForCrossEntityAggregateMetrics,\n DescriptorPathImpl path) {\n Preconditions.checkNotNull(context);\n if (null == nameForCrossEntityAggregateMetrics) {\n // This is v... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_15 | {
"fields": [
{
"declarator": "validator",
"modifier": "@Qualifier(\"serviceDescriptorValidatorWithDependencyCheck\")\n @Autowired\n private",
"original_string": "@Qualifier(\"serviceDescriptorValidatorWithDependencyCheck\")\n @Autowired\n private ServiceDescriptorValidatorImpl validator;",
... | {
"body": "@Test\n public void testBadParcelUrl() {\n Set<String> errors = validate(\"service_badparcelurl.sdl\");\n assertEquals(\"service.parcel.repoUrl must be a valid url\", Iterables.getOnlyElement(errors));\n }",
"class_method_signature": "ServiceDescriptorValidatorImplTest.testBadParcelUrl()",
"con... | {
"fields": [
{
"declarator": "validator",
"modifier": "private final",
"original_string": "private final Validator validator;",
"type": "Validator",
"var_name": "validator"
},
{
"declarator": "refValidator",
"modifier": "private final",
"original_string": "... | {
"body": "@Override\n public Set<String> validate(ServiceDescriptor descriptor) {\n Set<ConstraintViolation<ServiceDescriptor>> constraintViolations;\n constraintViolations = getViolations(descriptor);\n\n ImmutableSet.Builder<String> violations = ImmutableSet.builder();\n for (ConstraintViolation<Servi... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_42 | {
"fields": [
{
"declarator": "validator",
"modifier": "private",
"original_string": "private AttributeNamePrefixedWithServiceNameValidator validator;",
"type": "AttributeNamePrefixedWithServiceNameValidator",
"var_name": "validator"
},
{
"declarator": "context",
... | {
"body": "@Test\n public void testEmptyName() {\n MetricEntityAttributeDescriptor attribute = mockAttribute(\"\");\n List<ConstraintViolation<Object>> validations =\n validator.validate(context, attribute, root);\n assertFalse(validations.isEmpty());\n ConstraintViolation<Object> validation = Ite... | {
"fields": [
{
"declarator": "builtInAttributes",
"modifier": "private final",
"original_string": "private final ImmutableSet<String> builtInAttributes;",
"type": "ImmutableSet<String>",
"var_name": "builtInAttributes"
}
],
"file": "cm-schema/src/main/java/com/cloudera/csd/v... | {
"body": "@Override\n public <T> List<ConstraintViolation<T>> validate(\n MonitoringValidationContext context,\n MetricEntityAttributeDescriptor attribute,\n DescriptorPathImpl path) {\n Preconditions.checkNotNull(context);\n Preconditions.checkNotNull(attribute);\n Preconditions.checkNotNul... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_43 | {
"fields": [
{
"declarator": "validator",
"modifier": "private",
"original_string": "private AttributeNamePrefixedWithServiceNameValidator validator;",
"type": "AttributeNamePrefixedWithServiceNameValidator",
"var_name": "validator"
},
{
"declarator": "context",
... | {
"body": "@Test\n public void testInvaidServiceNameNotSmallCapsPrefixed() {\n MetricEntityAttributeDescriptor attribute = mockAttribute(\"FOOBARAttribute\");\n List<ConstraintViolation<Object>> validations =\n validator.validate(context, attribute, root);\n assertFalse(validations.isEmpty());\n C... | {
"fields": [
{
"declarator": "builtInAttributes",
"modifier": "private final",
"original_string": "private final ImmutableSet<String> builtInAttributes;",
"type": "ImmutableSet<String>",
"var_name": "builtInAttributes"
}
],
"file": "cm-schema/src/main/java/com/cloudera/csd/v... | {
"body": "@Override\n public <T> List<ConstraintViolation<T>> validate(\n MonitoringValidationContext context,\n MetricEntityAttributeDescriptor attribute,\n DescriptorPathImpl path) {\n Preconditions.checkNotNull(context);\n Preconditions.checkNotNull(attribute);\n Preconditions.checkNotNul... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_14 | {
"fields": [
{
"declarator": "validator",
"modifier": "@Qualifier(\"serviceDescriptorValidatorWithDependencyCheck\")\n @Autowired\n private",
"original_string": "@Qualifier(\"serviceDescriptorValidatorWithDependencyCheck\")\n @Autowired\n private ServiceDescriptorValidatorImpl validator;",
... | {
"body": "@Test\n public void testMultipleNonUniqueKeys() {\n Set<String> errors = validate(\"service_nonuniqueMultiple.sdl\");\n assertEquals(2, errors.size());\n assertTrue(errors.contains(\"service.parameters[].name must be unique in list\"));\n assertTrue(errors.contains(\"service.parameters[].confi... | {
"fields": [
{
"declarator": "validator",
"modifier": "private final",
"original_string": "private final Validator validator;",
"type": "Validator",
"var_name": "validator"
},
{
"declarator": "refValidator",
"modifier": "private final",
"original_string": "... | {
"body": "@Override\n public Set<String> validate(ServiceDescriptor descriptor) {\n Set<ConstraintViolation<ServiceDescriptor>> constraintViolations;\n constraintViolations = getViolations(descriptor);\n\n ImmutableSet.Builder<String> violations = ImmutableSet.builder();\n for (ConstraintViolation<Servi... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_55 | {
"fields": [
{
"declarator": "SERVICE_NODE = true",
"modifier": "private static final",
"original_string": "private static final Boolean SERVICE_NODE = true;",
"type": "Boolean",
"var_name": "SERVICE_NODE"
},
{
"declarator": "validator",
"modifier": "private",
... | {
"body": "@Test\n public void testGoodLongName() {\n assertTrue(validator.validate(\n context, SERVICE_NAME.toLowerCase() + \"_foo_bar\", root).isEmpty());\n }",
"class_method_signature": "NameForCrossEntityAggregatesPrefixedWithServiceNameValidatorTest.testGoodLongName()",
"constructor": false,
"f... | {
"fields": [
{
"declarator": "builtInNamesForCrossEntityAggregateMetrics",
"modifier": "private final",
"original_string": "private final ImmutableSet<String> builtInNamesForCrossEntityAggregateMetrics;",
"type": "ImmutableSet<String>",
"var_name": "builtInNamesForCrossEntityAggrega... | {
"body": "@Override\n public <T> List<ConstraintViolation<T>> validate(\n MonitoringValidationContext context,\n String nameForCrossEntityAggregateMetrics,\n DescriptorPathImpl path) {\n Preconditions.checkNotNull(context);\n if (null == nameForCrossEntityAggregateMetrics) {\n // This is v... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_110 | {
"fields": [
{
"declarator": "mapper = new JsonSdlObjectMapper()",
"modifier": "private",
"original_string": "private JsonSdlObjectMapper mapper = new JsonSdlObjectMapper();",
"type": "JsonSdlObjectMapper",
"var_name": "mapper"
},
{
"declarator": "parser = new JsonSdlP... | {
"body": "@Test\n public void testParseFullFile() throws Exception {\n ServiceDescriptor descriptor = parser.parse(getSdl(\"service_full.sdl\"));\n assertNotNull(descriptor);\n assertEquals(descriptor.getName(), \"ECHO\");\n assertEquals(Integer.valueOf(1), descriptor.getMaxInstances());\n\n assertNo... | {
"fields": [
{
"declarator": "mapper",
"modifier": "private final",
"original_string": "private final JsonSdlObjectMapper mapper;",
"type": "JsonSdlObjectMapper",
"var_name": "mapper"
}
],
"file": "cm-schema/src/main/java/com/cloudera/csd/components/JsonSdlParser.java",
"i... | {
"body": "@Override\n public ServiceDescriptor parse(byte[] data) throws IOException {\n Preconditions.checkNotNull(data);\n return mapper.readValue(data, ServiceDescriptor.class);\n }",
"class_method_signature": "JsonSdlParser.parse(byte[] data)",
"constructor": false,
"full_signature": "@Override pub... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_147 | {
"fields": [
{
"declarator": "app",
"modifier": "private",
"original_string": "private Main app;",
"type": "Main",
"var_name": "app"
},
{
"declarator": "appName = \"myapp\"",
"modifier": "private",
"original_string": "private String appName = \"myapp\";",
... | {
"body": "@Test\n public void testBadParseParcel() throws Exception {\n String[] args = {\"-p\", badParseParcel};\n app.run(args);\n assertEquals(\"\", err.toString());\n assertTrue(out.toString().contains(\"==>\"));\n }",
"class_method_signature": "MainTest.testBadParseParcel()",
"constructor": fa... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(Main.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(Main.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "outStream"... | {
"body": "public int run(String[] args) throws IOException {\n Writer writer = new OutputStreamWriter(outStream, Constants.CHARSET_UTF_8);\n AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();\n try {\n BeanDefinition cmdOptsbeanDefinition = BeanDefinitionBuilder\n ... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_96 | {
"fields": [
{
"declarator": "parentAgetInt = method(ParentA.class, \"getInt\")",
"modifier": "private",
"original_string": "private Method parentAgetInt = method(ParentA.class, \"getInt\");",
"type": "Method",
"var_name": "parentAgetInt"
},
{
"declarator": "parentAget... | {
"body": "@Test\n public void testPropetyNameOfGetter() {\n assertEquals(\"var\", ReflectionHelper.propertyNameOfGetter(childAgetVar));\n assertEquals(\"var2\", ReflectionHelper.propertyNameOfGetter(childAisVar2));\n }",
"class_method_signature": "ReflectionHelperTest.testPropetyNameOfGetter()",
"constru... | {
"fields": [
{
"declarator": "GETTER_PREFIXES = ImmutableSet.of(\"get\", \"is\")",
"modifier": "private static final",
"original_string": "private static final Set<String> GETTER_PREFIXES = ImmutableSet.of(\"get\", \"is\");",
"type": "Set<String>",
"var_name": "GETTER_PREFIXES"
... | {
"body": "public static String propertyNameOfGetter(Method method) {\n Preconditions.checkNotNull(method);\n String name = method.getName();\n for (String prefix : GETTER_PREFIXES) {\n if (name.startsWith(prefix)) {\n return Introspector.decapitalize(name.substring(prefix.length()));\n }\n ... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_79 | {
"fields": [
{
"declarator": "validator",
"modifier": "private",
"original_string": "private AttributesReferToExistingAttributesValidator validator;",
"type": "AttributesReferToExistingAttributesValidator",
"var_name": "validator"
},
{
"declarator": "context",
"m... | {
"body": "@Test\n public void testNoAttributes() {\n assertTrue(validator.validate(context, entity, root).isEmpty());\n }",
"class_method_signature": "AttributesReferToExistingAttributesValidatorTest.testNoAttributes()",
"constructor": false,
"full_signature": "@Test public void testNoAttributes()",
"id... | {
"fields": [
{
"declarator": "builtInAttributes",
"modifier": "private final",
"original_string": "private final ImmutableSet<String> builtInAttributes;",
"type": "ImmutableSet<String>",
"var_name": "builtInAttributes"
}
],
"file": "cm-schema/src/main/java/com/cloudera/csd/v... | {
"body": "@Override\n public <T> List<ConstraintViolation<T>> validate(\n MonitoringValidationContext context,\n MetricEntityTypeDescriptor entity,\n DescriptorPathImpl path) {\n Preconditions.checkNotNull(context);\n Preconditions.checkNotNull(entity);\n Preconditions.checkNotNull(path);\n\... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_151 | {
"fields": [
{
"declarator": "app",
"modifier": "private",
"original_string": "private Main app;",
"type": "Main",
"var_name": "app"
},
{
"declarator": "appName = \"myapp\"",
"modifier": "private",
"original_string": "private String appName = \"myapp\";",
... | {
"body": "@Test\n public void testBadPermissions() throws Exception {\n String[] args = {\"-r\", badPermissions};\n app.run(args);\n assertEquals(\"\", err.toString());\n assertTrue(out.toString().contains(\"==>\"));\n }",
"class_method_signature": "MainTest.testBadPermissions()",
"constructor": fa... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(Main.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(Main.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "outStream"... | {
"body": "public int run(String[] args) throws IOException {\n Writer writer = new OutputStreamWriter(outStream, Constants.CHARSET_UTF_8);\n AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();\n try {\n BeanDefinition cmdOptsbeanDefinition = BeanDefinitionBuilder\n ... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_80 | {
"fields": [
{
"declarator": "validator",
"modifier": "private",
"original_string": "private AttributesReferToExistingAttributesValidator validator;",
"type": "AttributesReferToExistingAttributesValidator",
"var_name": "validator"
},
{
"declarator": "context",
"m... | {
"body": "@Test\n public void testImmutableBuiltInAttributes() {\n doReturn(ImmutableList.of(\"builtIn1\", \"builtIn2\")).when(entity)\n .getImmutableAttributeNames();\n addEntity(entity);\n assertTrue(validator.validate(context, entity, root).isEmpty());\n }",
"class_method_signature": "Attribut... | {
"fields": [
{
"declarator": "builtInAttributes",
"modifier": "private final",
"original_string": "private final ImmutableSet<String> builtInAttributes;",
"type": "ImmutableSet<String>",
"var_name": "builtInAttributes"
}
],
"file": "cm-schema/src/main/java/com/cloudera/csd/v... | {
"body": "@Override\n public <T> List<ConstraintViolation<T>> validate(\n MonitoringValidationContext context,\n MetricEntityTypeDescriptor entity,\n DescriptorPathImpl path) {\n Preconditions.checkNotNull(context);\n Preconditions.checkNotNull(entity);\n Preconditions.checkNotNull(path);\n\... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_106 | {
"fields": [
{
"declarator": "context",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private ConstraintValidatorContext context;",
"type": "ConstraintValidatorContext",
"var_name": "context"
},
{
"declarator": "validator",
"modifier": "@Spy\n @In... | {
"body": "@Test\n public void testPropertyValue() {\n TestBean bean = new TestBean(\"a\", \"b\");\n Object value = validator.propertyValue(bean, \"field1\");\n assertEquals(\"a\", value);\n }",
"class_method_signature": "UniqueFieldValidatorImplTest.testPropertyValue()",
"constructor": false,
"full_... | {
"fields": [
{
"declarator": "uniqueField",
"modifier": "private",
"original_string": "private UniqueField uniqueField;",
"type": "UniqueField",
"var_name": "uniqueField"
},
{
"declarator": "skipNulls",
"modifier": "private",
"original_string": "private boo... | {
"body": "@VisibleForTesting\n Object propertyValue(Object obj, String property) {\n try {\n PropertyDescriptor desc = PropertyUtils.getPropertyDescriptor(obj, property);\n return desc.getReadMethod().invoke(obj, new Object[]{});\n } catch( Exception e) {\n throw new ValidationException(e);\n ... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_38 | {
"fields": [
{
"declarator": "validator",
"modifier": "private",
"original_string": "private ParentsAreReachableUsingAttributesValidator validator;",
"type": "ParentsAreReachableUsingAttributesValidator",
"var_name": "validator"
},
{
"declarator": "context",
"mod... | {
"body": "@Test\n public void testGoodParents() {\n MetricEntityTypeDescriptor entity2 = mockEntity(\"foobar_entity_two\");\n doReturn(ImmutableList.of(\"foobar_entity_two\")).when(entity)\n .getParentMetricEntityTypeNames();\n doReturn(ImmutableList.of(\"attr1\", \"attr2\")).when(entity2)\n ... | {
"fields": [],
"file": "cm-schema/src/main/java/com/cloudera/csd/validation/monitoring/constraints/ParentsAreReachableUsingAttributesValidator.java",
"identifier": "ParentsAreReachableUsingAttributesValidator",
"interfaces": "",
"methods": [
{
"class_method_signature": "ParentsAreReachableUsingAttr... | {
"body": "@Override\n public <T> List<ConstraintViolation<T>> validate(\n MonitoringValidationContext context,\n MetricEntityTypeDescriptor entity,\n DescriptorPathImpl path) {\n Preconditions.checkNotNull(context);\n Preconditions.checkNotNull(entity);\n Preconditions.checkNotNull(path);\n ... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_18 | {
"fields": [
{
"declarator": "validator",
"modifier": "@Qualifier(\"serviceDescriptorValidatorWithDependencyCheck\")\n @Autowired\n private",
"original_string": "@Qualifier(\"serviceDescriptorValidatorWithDependencyCheck\")\n @Autowired\n private ServiceDescriptorValidatorImpl validator;",
... | {
"body": "@Test\n public void testBadServiceDependency() {\n Set<String> errors = validate(\"service_badDependencyType.sdl\");\n assertEquals(\"foo must be a valid service type\", Iterables.getOnlyElement(errors));\n }",
"class_method_signature": "ServiceDescriptorValidatorImplTest.testBadServiceDependency... | {
"fields": [
{
"declarator": "validator",
"modifier": "private final",
"original_string": "private final Validator validator;",
"type": "Validator",
"var_name": "validator"
},
{
"declarator": "refValidator",
"modifier": "private final",
"original_string": "... | {
"body": "@Override\n public Set<String> validate(ServiceDescriptor descriptor) {\n Set<ConstraintViolation<ServiceDescriptor>> constraintViolations;\n constraintViolations = getViolations(descriptor);\n\n ImmutableSet.Builder<String> violations = ImmutableSet.builder();\n for (ConstraintViolation<Servi... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_6 | {
"fields": [
{
"declarator": "locale = Locale.getDefault()",
"modifier": "private",
"original_string": "private Locale locale = Locale.getDefault();",
"type": "Locale",
"var_name": "locale"
},
{
"declarator": "delegate",
"modifier": "@Mock\n private",
"ori... | {
"body": "@Test\n public void testTranslateStripNoBrackets() {\n String key = \"javax.validation.constraint.myconstraint.message\";\n String output = interpolator.translate(key);\n assertEquals(\"javax.validation.constraint.myconstraint.message\",\n output);\n }",
"class_method_signature": "M... | {
"fields": [
{
"declarator": "source",
"modifier": "private final",
"original_string": "private final MessageSource source;",
"type": "MessageSource",
"var_name": "source"
}
],
"file": "cm-schema/src/main/java/com/cloudera/validation/MessageSourceInterpolator.java",
"ident... | {
"body": "@VisibleForTesting\n String translate(String templateKey) {\n // remove wrapping {..} brackets\n if (templateKey.startsWith(\"{\") && templateKey.endsWith(\"}\")) {\n templateKey = templateKey.substring(1, templateKey.length() - 1);\n }\n\n try {\n Object[] args = {};\n return s... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_126 | {
"fields": [
{
"declarator": "COUNTER = true",
"modifier": "private static final",
"original_string": "private static final boolean COUNTER = true;",
"type": "boolean",
"var_name": "COUNTER"
},
{
"declarator": "adapter",
"modifier": "private",
"original_str... | {
"body": "@Test\n public void testCounterMetrics() throws Exception {\n String source = this.getClass().getResource(\n \"/com/cloudera/csd/tools/codahale/valid.json\").getPath();\n adapter.init(source, CodahaleMetricAdapter.DEFAULT_CONVENTIONS);\n assertEquals(2, adapter.getRoleNames().size());\n ... | {
"fields": [
{
"declarator": "LOG =\n LoggerFactory.getLogger(CodahaleMetricAdapter.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG =\n LoggerFactory.getLogger(CodahaleMetricAdapter.class);",
"type": "Logger",
"var_name": "L... | {
"body": "@Override\n public void init(String fixtureFile,\n @Nullable String conventionsFile) throws Exception {\n Preconditions.checkNotNull(fixtureFile);\n\n FileInputStream in = null;\n try {\n in = FileUtils.openInputStream(new File(fixtureFile));\n fixture = JsonUtil.value... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_130 | {
"fields": [
{
"declarator": "COUNTER = true",
"modifier": "private static final",
"original_string": "private static final boolean COUNTER = true;",
"type": "boolean",
"var_name": "COUNTER"
},
{
"declarator": "adapter",
"modifier": "private",
"original_str... | {
"body": "@Test\n public void testMeterMetrics() throws Exception {\n String source = this.getClass().getResource(\n \"/com/cloudera/csd/tools/codahale/meters.json\").getPath();\n adapter.init(source, CodahaleMetricAdapter.DEFAULT_CONVENTIONS);\n List<MetricDescriptor> metrics = adapter.getServiceMe... | {
"fields": [
{
"declarator": "LOG =\n LoggerFactory.getLogger(CodahaleMetricAdapter.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG =\n LoggerFactory.getLogger(CodahaleMetricAdapter.class);",
"type": "Logger",
"var_name": "L... | {
"body": "@Override\n public void init(String fixtureFile,\n @Nullable String conventionsFile) throws Exception {\n Preconditions.checkNotNull(fixtureFile);\n\n FileInputStream in = null;\n try {\n in = FileUtils.openInputStream(new File(fixtureFile));\n fixture = JsonUtil.value... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_59 | {
"fields": [
{
"declarator": "validator",
"modifier": "private",
"original_string": "private WeightingMetricValidator validator;",
"type": "WeightingMetricValidator",
"var_name": "validator"
},
{
"declarator": "context",
"modifier": "private",
"original_str... | {
"body": "@Test\n public void testNoWeightingMetricInDefinedMetrics() {\n setName(\"bytes_read\");\n setServiceMetrics(ImmutableList.of(newWeightingMetric(\"foobar_2\")));\n context = new MonitoringValidationContext(serviceDescriptor);\n setWeightingMetric(\"foobar\");\n assertFalse(validator.validat... | {
"fields": [],
"file": "cm-schema/src/main/java/com/cloudera/csd/validation/monitoring/constraints/WeightingMetricValidator.java",
"identifier": "WeightingMetricValidator",
"interfaces": "",
"methods": [
{
"class_method_signature": "WeightingMetricValidator.getDescription()",
"constructor": f... | {
"body": "@Override\n public <T> List<ConstraintViolation<T>> validate(\n MonitoringValidationContext context,\n MetricDescriptor metricDescriptor,\n DescriptorPathImpl path) {\n Preconditions.checkNotNull(context);\n Preconditions.checkNotNull(metricDescriptor);\n Preconditions.checkNotNull... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_22 | {
"fields": [
{
"declarator": "validator",
"modifier": "@Qualifier(\"serviceDescriptorValidatorWithDependencyCheck\")\n @Autowired\n private",
"original_string": "@Qualifier(\"serviceDescriptorValidatorWithDependencyCheck\")\n @Autowired\n private ServiceDescriptorValidatorImpl validator;",
... | {
"body": "@Test\n public void testBadAutoConfigShares() {\n Set<String> errors = validate(\"service_badAutoConfigShares.sdl\");\n assertEquals(\"service.roles[0].parameters must add up to 100 autoconfig shares\",\n Iterables.getOnlyElement(errors));\n }",
"class_method_signature": "ServiceDescriptor... | {
"fields": [
{
"declarator": "validator",
"modifier": "private final",
"original_string": "private final Validator validator;",
"type": "Validator",
"var_name": "validator"
},
{
"declarator": "refValidator",
"modifier": "private final",
"original_string": "... | {
"body": "@Override\n public Set<String> validate(ServiceDescriptor descriptor) {\n Set<ConstraintViolation<ServiceDescriptor>> constraintViolations;\n constraintViolations = getViolations(descriptor);\n\n ImmutableSet.Builder<String> violations = ImmutableSet.builder();\n for (ConstraintViolation<Servi... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_75 | {
"fields": [
{
"declarator": "validator",
"modifier": "private",
"original_string": "private CounterMetricNameValidator validator;",
"type": "CounterMetricNameValidator",
"var_name": "validator"
},
{
"declarator": "context",
"modifier": "private",
"original... | {
"body": "@Test\n public void testCounterWithRateSuffix() {\n setName(\"bytes_read\" + MonitoringConventions.RATE_SUFFIX);\n setIsCounter(true);\n List<ConstraintViolation<Object>> validations =\n validator.validate(context, metric, root);\n assertFalse(validations.isEmpty());\n ConstraintViol... | {
"fields": [],
"file": "cm-schema/src/main/java/com/cloudera/csd/validation/monitoring/constraints/CounterMetricNameValidator.java",
"identifier": "CounterMetricNameValidator",
"interfaces": "",
"methods": [
{
"class_method_signature": "CounterMetricNameValidator.getDescription()",
"construct... | {
"body": "@Override\n public <T> List<ConstraintViolation<T>> validate(\n MonitoringValidationContext context,\n MetricDescriptor metricDescriptor,\n DescriptorPathImpl path) {\n Preconditions.checkNotNull(context);\n Preconditions.checkNotNull(metricDescriptor);\n if (!metricDescriptor.isCo... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_63 | {
"fields": [
{
"declarator": "validator",
"modifier": "private",
"original_string": "private NameForCrossEntityAggregatesIsUniqueValidator validator;",
"type": "NameForCrossEntityAggregatesIsUniqueValidator",
"var_name": "validator"
},
{
"declarator": "context",
... | {
"body": "@Test\n public void testUniqueAggregateNames() {\n setServiceNameForCrossEntityAggregates(\"aggregate_for_service\");\n addNameForCrossEntityAggregatesForRole(\"role1\", \"aggregate_for_role1\");\n addNameForCrossEntityAggregatesForRole(\"role2\", \"aggregate_for_role2\");\n addNameForCrossEnt... | {
"fields": [],
"file": "cm-schema/src/main/java/com/cloudera/csd/validation/monitoring/constraints/NameForCrossEntityAggregatesIsUniqueValidator.java",
"identifier": "NameForCrossEntityAggregatesIsUniqueValidator",
"interfaces": "",
"methods": [
{
"class_method_signature": "NameForCrossEntityAggreg... | {
"body": "@Override\n public <T> List<ConstraintViolation<T>> validate(\n MonitoringValidationContext context,\n ServiceMonitoringDefinitionsDescriptor serviceDescriptor,\n DescriptorPathImpl path) {\n Preconditions.checkNotNull(context);\n Preconditions.checkNotNull(serviceDescriptor);\n Pr... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
16970593_34 | {
"fields": [
{
"declarator": "validator",
"modifier": "private",
"original_string": "private ParentsAreReachableUsingAttributesValidator validator;",
"type": "ParentsAreReachableUsingAttributesValidator",
"var_name": "validator"
},
{
"declarator": "context",
"mod... | {
"body": "@Test\n public void testNoEntities() {\n assertTrue(validator.validate(context, entity, root).isEmpty());\n }",
"class_method_signature": "ParentsAreReachableUsingAttributesValidatorTest.testNoEntities()",
"constructor": false,
"full_signature": "@Test public void testNoEntities()",
"identifie... | {
"fields": [],
"file": "cm-schema/src/main/java/com/cloudera/csd/validation/monitoring/constraints/ParentsAreReachableUsingAttributesValidator.java",
"identifier": "ParentsAreReachableUsingAttributesValidator",
"interfaces": "",
"methods": [
{
"class_method_signature": "ParentsAreReachableUsingAttr... | {
"body": "@Override\n public <T> List<ConstraintViolation<T>> validate(\n MonitoringValidationContext context,\n MetricEntityTypeDescriptor entity,\n DescriptorPathImpl path) {\n Preconditions.checkNotNull(context);\n Preconditions.checkNotNull(entity);\n Preconditions.checkNotNull(path);\n ... | {
"created": null,
"fork": null,
"fork_count": 78,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 16970593,
"size": 855,
"stargazer_count": 132,
"stars": null,
"updates": null,
"url": "https://github.com/cloudera/cm_ext"
} |
19454960_0 | {
"fields": [
{
"declarator": "EXAMPLE_INPUT_STRING = \"a long string with content\"",
"modifier": "private static final",
"original_string": "private static final String EXAMPLE_INPUT_STRING = \"a long string with content\";",
"type": "String",
"var_name": "EXAMPLE_INPUT_STRING"
... | {
"body": "@Test\n public void shouldReadRemainder() throws IOException {\n reader = newReaderInstance(EXAMPLE_INPUT_STRING, DEFAULT_BUFFER_SIZE);\n\n char[] buffer = new char[5];\n reader.read(buffer);\n\n assertThat(SpinIoUtil.getStringFromReader(reader)).isEqualTo(EXAMPLE_INPUT_STRING.substring(5));\n... | {
"fields": [
{
"declarator": "LOG = SpinLogger.CORE_LOGGER",
"modifier": "private static final",
"original_string": "private static final SpinCoreLogger LOG = SpinLogger.CORE_LOGGER;",
"type": "SpinCoreLogger",
"var_name": "LOG"
},
{
"declarator": "wrappedReader",
... | {
"body": "public int read(char[] cbuf, int off, int len) throws IOException {\n int charactersRead = wrappedReader.read(cbuf, off, len);\n\n if (charactersRead > 0) {\n if (rewindable && pos + charactersRead > buffer.length) {\n rewindable = false;\n }\n\n if (pos < buffer.length) {\n ... | {
"created": "5/5/2014 12:28:54 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 19454960,
"size": null,
"stargazer_count": null,
"stars": 15,
"updates": "2020-01-23T10:56:51+00:00",
"url": "https://github.com/camunda/camunda-s... |
163387337_72 | {
"fields": [
{
"declarator": "testValue = (null != null ? \"hello\" : \"hello\")",
"modifier": "public static final",
"original_string": "public static final String testValue = (null != null ? \"hello\" : \"hello\");",
"type": "String",
"var_name": "testValue"
}
],
"file": "... | {
"body": "@Test\n public void testGetClassByName() throws ClassNotFoundException {\n Assertions.assertEquals(String.class,\n ReflectionUtil.getClassByName(\"java.lang.String\"));\n }",
"class_method_signature": "ReflectionUtilTest.testGetClassByName()",
"constructor": false,
"full_s... | {
"fields": [
{
"declarator": "MAX_NEST_DEPTH = 20",
"modifier": "public static final",
"original_string": "public static final int MAX_NEST_DEPTH = 20;",
"type": "int",
"var_name": "MAX_NEST_DEPTH"
}
],
"file": "common/src/main/java/io/seata/common/util/ReflectionUtil.java",... | {
"body": "public static Class<?> getClassByName(String className) throws ClassNotFoundException {\n return Class.forName(className, true, Thread.currentThread().getContextClassLoader());\n }",
"class_method_signature": "ReflectionUtil.getClassByName(String className)",
"constructor": false,
"full_sig... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_132 | {
"fields": [],
"file": "common/src/test/java/io/seata/common/XIDTest.java",
"identifier": "XIDTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGenerateXID() {\n long tranId = new Random().nextLong();\n XID.setPort(8080);\n XID.setIpAddress(\"127.0.0.1\");\n assertThat(XID.generateXID(tranId)).isEqualTo(XID.getIpAddress() + \":\" + XID.getPort() + \":\" + tranId);\n }",
"class_method_sign... | {
"fields": [
{
"declarator": "port",
"modifier": "private static",
"original_string": "private static int port;",
"type": "int",
"var_name": "port"
},
{
"declarator": "ipAddress",
"modifier": "private static",
"original_string": "private static String ipAdd... | {
"body": "public static String generateXID(long tranId) {\n return ipAddress + \":\" + port + \":\" + tranId;\n }",
"class_method_signature": "XID.generateXID(long tranId)",
"constructor": false,
"full_signature": "public static String generateXID(long tranId)",
"identifier": "generateXID",
"invo... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_25 | {
"fields": [],
"file": "serializer/seata-serializer-protobuf/src/test/java/io/seata/serializer/protobuf/convertor/BranchRegisterRequestConvertorTest.java",
"identifier": "BranchRegisterRequestConvertorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void convert2Proto() {\n\n BranchRegisterRequest branchRegisterRequest = new BranchRegisterRequest();\n branchRegisterRequest.setApplicationData(\"data\");\n branchRegisterRequest.setBranchType(BranchType.AT);\n branchRegisterRequest.setLockKey(\"localKey\");\n... | {
"fields": [],
"file": "serializer/seata-serializer-protobuf/src/main/java/io/seata/serializer/protobuf/convertor/BranchRegisterRequestConvertor.java",
"identifier": "BranchRegisterRequestConvertor",
"interfaces": "implements PbConvertor<BranchRegisterRequest, BranchRegisterRequestProto>",
"methods": [
{... | {
"body": "@Override\n public BranchRegisterRequestProto convert2Proto(BranchRegisterRequest branchRegisterRequest) {\n final short typeCode = branchRegisterRequest.getTypeCode();\n\n final AbstractMessageProto abstractMessage = AbstractMessageProto.newBuilder().setMessageType(\n MessageTy... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_165 | {
"fields": [
{
"declarator": "parameterParser = null",
"modifier": "private static",
"original_string": "private static ParameterParser parameterParser = null;",
"type": "ParameterParser",
"var_name": "parameterParser"
}
],
"file": "server/src/test/java/io/seata/server/Param... | {
"body": "@Test\n public void testGetSeataEnv() {\n Assertions.assertEquals(\"test\", parameterParser.getSeataEnv());\n }",
"class_method_signature": "ParameterParserTest.testGetSeataEnv()",
"constructor": false,
"full_signature": "@Test public void testGetSeataEnv()",
"identifier": "testGetSeat... | {
"fields": [
{
"declarator": "PROGRAM_NAME\n = \"sh seata-server.sh(for linux and mac) or cmd seata-server.bat(for windows)\"",
"modifier": "private static final",
"original_string": "private static final String PROGRAM_NAME\n = \"sh seata-server.sh(for linux and mac) or cmd seata... | {
"body": "public String getSeataEnv() {\n return seataEnv;\n }",
"class_method_signature": "ParameterParser.getSeataEnv()",
"constructor": false,
"full_signature": "public String getSeataEnv()",
"identifier": "getSeataEnv",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"retu... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_33 | {
"fields": [],
"file": "serializer/seata-serializer-protobuf/src/test/java/io/seata/serializer/protobuf/convertor/MergeResultMessageConvertorTest.java",
"identifier": "MergeResultMessageConvertorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void convert2Proto() {\n\n MergeResultMessage mergeResultMessage = new MergeResultMessage();\n AbstractResultMessage[] msgs = new AbstractResultMessage[1];\n final GlobalCommitResponse globalCommitResponse = new GlobalCommitResponse();\n globalCommitResponse.se... | {
"fields": [],
"file": "serializer/seata-serializer-protobuf/src/main/java/io/seata/serializer/protobuf/convertor/MergeResultMessageConvertor.java",
"identifier": "MergeResultMessageConvertor",
"interfaces": "implements PbConvertor<MergeResultMessage, MergedResultMessageProto>",
"methods": [
{
"cla... | {
"body": "@Override\n public MergedResultMessageProto convert2Proto(MergeResultMessage mergeResultMessage) {\n final short typeCode = mergeResultMessage.getTypeCode();\n\n final AbstractMessageProto abstractMessage = AbstractMessageProto.newBuilder().setMessageType(\n MessageTypeProto.for... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_173 | {
"fields": [],
"file": "rm-datasource/src/test/java/io/seata/rm/datasource/ColumnUtilsTest.java",
"identifier": "ColumnUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void test_delEscape_byDbType() throws Exception {\n\n List<String> cols3 = new ArrayList<>();\n cols3.add(\"\\\"id\\\"\");\n cols3 = ColumnUtils.delEscape(cols3, JdbcConstants.ORACLE);\n Assertions.assertEquals(\"id\", cols3.get(0));\n\n List<String> col... | {
"fields": [
{
"declarator": "DOT = \".\"",
"modifier": "private static final",
"original_string": "private static final String DOT = \".\";",
"type": "String",
"var_name": "DOT"
}
],
"file": "rm-datasource/src/main/java/io/seata/rm/datasource/ColumnUtils.java",
"identifie... | {
"body": "public static List<String> delEscape(List<String> cols, String dbType) {\n // sql standard\n // https://db.apache.org/derby/docs/10.1/ref/crefsqlj1003454.html\n // https://docs.oracle.com/javadb/10.8.3.0/ref/crefsqlj1003454.html\n // https://www.informit.com/articles/article.asp... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_64 | {
"fields": [
{
"declarator": "message = new Message()",
"modifier": "private",
"original_string": "private Message message = new Message();",
"type": "Message",
"var_name": "message"
}
],
"file": "common/src/test/java/io/seata/common/exception/FrameworkExceptionTest.java",
... | {
"body": "@Test\n public void testGetErrcode() {\n Throwable throwable = Assertions.assertThrows(FrameworkException.class, () -> {\n message.print4();\n });\n assertThat(throwable).hasMessage(FrameworkErrorCode.UnknownAppError.getErrMessage());\n assertThat(((FrameworkExcept... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(FrameworkException.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(FrameworkException.class);",
"type": "Logger",
"var_name": "LOGGER"
},
... | {
"body": "public FrameworkErrorCode getErrcode() {\n return errcode;\n }",
"class_method_signature": "FrameworkException.getErrcode()",
"constructor": false,
"full_signature": "public FrameworkErrorCode getErrcode()",
"identifier": "getErrcode",
"invocations": [],
"modifiers": "public",
"para... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_124 | {
"fields": [
{
"declarator": "THREAD_TOTAL_SIZE = 3",
"modifier": "private static final",
"original_string": "private static final int THREAD_TOTAL_SIZE = 3;",
"type": "int",
"var_name": "THREAD_TOTAL_SIZE"
},
{
"declarator": "DEFAULT_THREAD_PREFIX_COUNTER = 1",
... | {
"body": "@Test\n public void testNewThread() {\n NamedThreadFactory namedThreadFactory = new NamedThreadFactory(\"testNameThread\", 5);\n\n Thread testNameThread = namedThreadFactory\n .newThread(() -> {\n try {\n Thread.sleep(1000);\n } c... | {
"fields": [
{
"declarator": "PREFIX_COUNTER = new ConcurrentHashMap<>()",
"modifier": "private final static",
"original_string": "private final static Map<String, AtomicInteger> PREFIX_COUNTER = new ConcurrentHashMap<>();",
"type": "Map<String, AtomicInteger>",
"var_name": "PREFIX_... | {
"body": "@Override\n public Thread newThread(Runnable r) {\n String name = prefix + \"_\" + counter.incrementAndGet();\n if (totalSize > 1) {\n name += \"_\" + totalSize;\n }\n Thread thread = new FastThreadLocalThread(r, name);\n\n thread.setDaemon(makeDaemons);\n ... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_108 | {
"fields": [],
"file": "common/src/test/java/io/seata/common/util/CollectionUtilsTest.java",
"identifier": "CollectionUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIsEmptyWithArrays() {\n String[] emptyArray = {};\n String[] filledArray = {\"Foo\", \"Bar\"};\n\n Assertions.assertTrue(CollectionUtils.isEmpty(emptyArray));\n Assertions.assertFalse(CollectionUtils.isEmpty(filledArray));\n }",
"class_method_sign... | {
"fields": [
{
"declarator": "KV_SPLIT = \"=\"",
"modifier": "private static final",
"original_string": "private static final String KV_SPLIT = \"=\";",
"type": "String",
"var_name": "KV_SPLIT"
},
{
"declarator": "PAIR_SPLIT = \"&\"",
"modifier": "private static ... | {
"body": "public static boolean isEmpty(Collection<?> col) {\n return !isNotEmpty(col);\n }",
"class_method_signature": "CollectionUtils.isEmpty(Collection<?> col)",
"constructor": false,
"full_signature": "public static boolean isEmpty(Collection<?> col)",
"identifier": "isEmpty",
"invocations":... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_48 | {
"fields": [],
"file": "tm/src/test/java/io/seata/tm/api/transaction/TransactionHookManagerTest.java",
"identifier": "TransactionHookManagerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testClear() {\n assertThat(TransactionHookManager.getHooks()).isEmpty();\n TransactionHookManager.registerHook(new TransactionHookAdapter());\n assertThat(TransactionHookManager.getHooks()).isNotEmpty();\n TransactionHookManager.clear();\n assertTha... | {
"fields": [
{
"declarator": "LOCAL_HOOKS = new ThreadLocal<>()",
"modifier": "private static final",
"original_string": "private static final ThreadLocal<List<TransactionHook>> LOCAL_HOOKS = new ThreadLocal<>();",
"type": "ThreadLocal<List<TransactionHook>>",
"var_name": "LOCAL_HOO... | {
"body": "public static void clear() {\n LOCAL_HOOKS.remove();\n }",
"class_method_signature": "TransactionHookManager.clear()",
"constructor": false,
"full_signature": "public static void clear()",
"identifier": "clear",
"invocations": [
"remove"
],
"modifiers": "public static",
"param... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_5 | {
"fields": [
{
"declarator": "server = null",
"modifier": "protected static",
"original_string": "protected static TestingServer server = null;",
"type": "TestingServer",
"var_name": "server"
},
{
"declarator": "service = (ZookeeperRegisterServiceImpl) new ZookeeperReg... | {
"body": "@Test\n public void getInstance() {\n ZookeeperRegisterServiceImpl service1 = ZookeeperRegisterServiceImpl.getInstance();\n Assertions.assertEquals(service1, service);\n }",
"class_method_signature": "ZookeeperRegisterServiceImplTest.getInstance()",
"constructor": false,
"full_sig... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(ZookeeperRegisterServiceImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(ZookeeperRegisterServiceImpl.class);",
"type": "Logger",
"var_nam... | {
"body": "static ZookeeperRegisterServiceImpl getInstance() {\n if (instance == null) {\n synchronized (ZookeeperRegisterServiceImpl.class) {\n if (instance == null) {\n instance = new ZookeeperRegisterServiceImpl();\n }\n }\n }\n ... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_221 | {
"fields": [
{
"declarator": "executor",
"modifier": "private static",
"original_string": "private static MySQLUndoDeleteExecutor executor;",
"type": "MySQLUndoDeleteExecutor",
"var_name": "executor"
}
],
"file": "rm-datasource/src/test/java/io/seata/rm/datasource/undo/mysql... | {
"body": "@Test\n public void getUndoRows() {\n Assertions.assertEquals(executor.getUndoRows(), executor.getSqlUndoLog().getBeforeImage());\n }",
"class_method_signature": "MySQLUndoDeleteExecutorTest.getUndoRows()",
"constructor": false,
"full_signature": "@Test public void getUndoRows()",
"ide... | {
"fields": [
{
"declarator": "INSERT_SQL_TEMPLATE = \"INSERT INTO %s (%s) VALUES (%s)\"",
"modifier": "private static final",
"original_string": "private static final String INSERT_SQL_TEMPLATE = \"INSERT INTO %s (%s) VALUES (%s)\";",
"type": "String",
"var_name": "INSERT_SQL_TEMPLA... | {
"body": "@Override\n protected TableRecords getUndoRows() {\n return sqlUndoLog.getBeforeImage();\n }",
"class_method_signature": "MySQLUndoDeleteExecutor.getUndoRows()",
"constructor": false,
"full_signature": "@Override protected TableRecords getUndoRows()",
"identifier": "getUndoRows",
"in... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_149 | {
"fields": [],
"file": "core/src/test/java/io/seata/core/protocol/MergedWarpMessageTest.java",
"identifier": "MergedWarpMessageTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void getTypeCode() {\n MergedWarpMessage mergedWarpMessage = new MergedWarpMessage();\n assertThat(mergedWarpMessage.getTypeCode()).isEqualTo(MessageType.TYPE_SEATA_MERGE);\n }",
"class_method_signature": "MergedWarpMessageTest.getTypeCode()",
"constructor": false,
... | {
"fields": [
{
"declarator": "msgs = new ArrayList<>()",
"modifier": "public",
"original_string": "public List<AbstractMessage> msgs = new ArrayList<>();",
"type": "List<AbstractMessage>",
"var_name": "msgs"
},
{
"declarator": "msgIds = new ArrayList<>()",
"modif... | {
"body": "@Override\n public short getTypeCode() {\n return MessageType.TYPE_SEATA_MERGE;\n }",
"class_method_signature": "MergedWarpMessage.getTypeCode()",
"constructor": false,
"full_signature": "@Override public short getTypeCode()",
"identifier": "getTypeCode",
"invocations": [],
"modifi... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_217 | {
"fields": [
{
"declarator": "executor",
"modifier": "private static",
"original_string": "private static MySQLUndoInsertExecutor executor;",
"type": "MySQLUndoInsertExecutor",
"var_name": "executor"
}
],
"file": "rm-datasource/src/test/java/io/seata/rm/datasource/undo/mysql... | {
"body": "@Test\n public void buildUndoSQL() {\n String sql = executor.buildUndoSQL().toLowerCase();\n Assertions.assertNotNull(sql);\n Assertions.assertTrue(sql.contains(\"delete\"));\n Assertions.assertTrue(sql.contains(\"id\"));\n }",
"class_method_signature": "MySQLUndoInsertE... | {
"fields": [
{
"declarator": "DELETE_SQL_TEMPLATE = \"DELETE FROM %s WHERE %s \"",
"modifier": "private static final",
"original_string": "private static final String DELETE_SQL_TEMPLATE = \"DELETE FROM %s WHERE %s \";",
"type": "String",
"var_name": "DELETE_SQL_TEMPLATE"
}
],... | {
"body": "@Override\n protected String buildUndoSQL() {\n TableRecords afterImage = sqlUndoLog.getAfterImage();\n List<Row> afterImageRows = afterImage.getRows();\n if (CollectionUtils.isEmpty(afterImageRows)) {\n throw new ShouldNeverHappenException(\"Invalid UNDO LOG\");\n ... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_91 | {
"fields": [],
"file": "common/src/test/java/io/seata/common/util/BlobUtilsTest.java",
"identifier": "BlobUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testString2blob() throws SQLException {\n assertNull(BlobUtils.string2blob(null));\n assertThat(BlobUtils.string2blob(\"123abc\")).isEqualTo(\n new SerialBlob(\"123abc\".getBytes(Constants.DEFAULT_CHARSET)));\n }",
"class_method_signature": "BlobUtilsTes... | {
"fields": [],
"file": "common/src/main/java/io/seata/common/util/BlobUtils.java",
"identifier": "BlobUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "BlobUtils.BlobUtils()",
"constructor": true,
"full_signature": "private BlobUtils()",
"identifier": "BlobUtils... | {
"body": "public static Blob string2blob(String str) {\n if (str == null) {\n return null;\n }\n\n try {\n return new SerialBlob(str.getBytes(Constants.DEFAULT_CHARSET));\n } catch (Exception e) {\n throw new ShouldNeverHappenException(e);\n }\n ... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_29 | {
"fields": [],
"file": "serializer/seata-serializer-protobuf/src/test/java/io/seata/serializer/protobuf/convertor/GlobalStatusResponseConvertorTest.java",
"identifier": "GlobalStatusResponseConvertorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void convert2Proto() {\n\n GlobalStatusResponse globalStatusResponse = new GlobalStatusResponse();\n globalStatusResponse.setGlobalStatus(GlobalStatus.AsyncCommitting);\n globalStatusResponse.setMsg(\"msg\");\n globalStatusResponse.setResultCode(ResultCode.Fail... | {
"fields": [],
"file": "serializer/seata-serializer-protobuf/src/main/java/io/seata/serializer/protobuf/convertor/GlobalStatusResponseConvertor.java",
"identifier": "GlobalStatusResponseConvertor",
"interfaces": "implements PbConvertor<GlobalStatusResponse, GlobalStatusResponseProto>",
"methods": [
{
... | {
"body": "@Override\n public GlobalStatusResponseProto convert2Proto(GlobalStatusResponse globalStatusResponse) {\n final short typeCode = globalStatusResponse.getTypeCode();\n\n final AbstractMessageProto abstractMessage = AbstractMessageProto.newBuilder().setMessageType(\n MessageTypePr... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_186 | {
"fields": [
{
"declarator": "updateExecutor",
"modifier": "private static",
"original_string": "private static UpdateExecutor updateExecutor;",
"type": "UpdateExecutor",
"var_name": "updateExecutor"
},
{
"declarator": "statementProxy",
"modifier": "private stati... | {
"body": "@Test\n public void testBeforeImage() throws SQLException {\n Assertions.assertNotNull(updateExecutor.beforeImage());\n\n String sql = \"update table_update_executor_test set name = 'WILL' where id = 1\";\n List<SQLStatement> asts = SQLUtils.parseStatements(sql, JdbcConstants.MYSQL)... | {
"fields": [
{
"declarator": "CONFIG = ConfigurationFactory.getInstance()",
"modifier": "private static final",
"original_string": "private static final Configuration CONFIG = ConfigurationFactory.getInstance();",
"type": "Configuration",
"var_name": "CONFIG"
},
{
"dec... | {
"body": "@Override\n protected TableRecords beforeImage() throws SQLException {\n ArrayList<List<Object>> paramAppenderList = new ArrayList<>();\n TableMeta tmeta = getTableMeta();\n String selectSQL = buildBeforeImageSQL(tmeta, paramAppenderList);\n return buildTableRecords(tmeta, se... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_169 | {
"fields": [
{
"declarator": "returnValueColumnLabels = Lists.newArrayList(\"id\", \"name\")",
"modifier": "private static",
"original_string": "private static List<String> returnValueColumnLabels = Lists.newArrayList(\"id\", \"name\");",
"type": "List<String>",
"var_name": "returnV... | {
"body": "@Test\n public void testExecuteQuery() throws SQLException {\n Assertions.assertNotNull(preparedStatementProxy.executeQuery());\n }",
"class_method_signature": "PreparedStatementProxyTest.testExecuteQuery()",
"constructor": false,
"full_signature": "@Test public void testExecuteQuery()",... | {
"fields": [],
"file": "rm-datasource/src/main/java/io/seata/rm/datasource/PreparedStatementProxy.java",
"identifier": "PreparedStatementProxy",
"interfaces": "implements PreparedStatement, ParametersHolder",
"methods": [
{
"class_method_signature": "PreparedStatementProxy.getParameters()",
"... | {
"body": "@Override\n public ResultSet executeQuery() throws SQLException {\n return ExecuteTemplate.execute(this, (statement, args) -> statement.executeQuery());\n }",
"class_method_signature": "PreparedStatementProxy.executeQuery()",
"constructor": false,
"full_signature": "@Override public Resu... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_190 | {
"fields": [],
"file": "rm-datasource/src/test/java/io/seata/rm/datasource/sql/SQLVisitorFactoryTest.java",
"identifier": "SQLVisitorFactoryTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSqlRecognizerLoading() {\n List<SQLRecognizer> recognizers = SQLVisitorFactory.get(\"update t1 set name = 'test' where id = '1'\", JdbcConstants.MYSQL);\n Assertions.assertNotNull(recognizers);\n Assertions.assertEquals(recognizers.size(), 1);\n SQLRec... | {
"fields": [
{
"declarator": "SQL_RECOGNIZER_FACTORY",
"modifier": "private final static",
"original_string": "private final static SQLRecognizerFactory SQL_RECOGNIZER_FACTORY;",
"type": "SQLRecognizerFactory",
"var_name": "SQL_RECOGNIZER_FACTORY"
}
],
"file": "rm-datasource... | {
"body": "public static List<SQLRecognizer> get(String sql, String dbType) {\n return SQL_RECOGNIZER_FACTORY.create(sql, dbType);\n }",
"class_method_signature": "SQLVisitorFactory.get(String sql, String dbType)",
"constructor": false,
"full_signature": "public static List<SQLRecognizer> get(String s... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_201 | {
"fields": [],
"file": "rm-datasource/src/test/java/io/seata/rm/datasource/sql/struct/IndexMetaTest.java",
"identifier": "IndexMetaTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIndexMeta() {\n IndexMeta indexMeta = new IndexMeta();\n indexMeta.setValues(Lists.newArrayList());\n Assertions.assertNotNull(indexMeta.toString());\n Assertions.assertEquals(indexMeta, indexMeta);\n Assertions.assertEquals(indexMeta.hashCode()... | {
"fields": [
{
"declarator": "values = new ArrayList<ColumnMeta>()",
"modifier": "private",
"original_string": "private List<ColumnMeta> values = new ArrayList<ColumnMeta>();",
"type": "List<ColumnMeta>",
"var_name": "values"
},
{
"declarator": "nonUnique",
"modi... | {
"body": "public IndexMeta() {\n }",
"class_method_signature": "IndexMeta.IndexMeta()",
"constructor": true,
"full_signature": "public IndexMeta()",
"identifier": "IndexMeta",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " IndexMeta()",
"testcase": ... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_68 | {
"fields": [],
"file": "common/src/test/java/io/seata/common/util/StringUtilsTest.java",
"identifier": "StringUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n void inputStream2Bytes() {\n assertNull(StringUtils.inputStream2Bytes(null));\n String data = \"abc\\n\"\n + \":\\\"klsdf\\n\"\n + \"2ks,x:\\\".,-3sd˚ø≤ø¬≥\";\n byte[] bs = data.getBytes(Constants.DEFAULT_CHARSET);\n ByteArrayInputStream ... | {
"fields": [
{
"declarator": "EMPTY = \"\"",
"modifier": "public static final",
"original_string": "public static final String EMPTY = \"\";",
"type": "String",
"var_name": "EMPTY"
}
],
"file": "common/src/main/java/io/seata/common/util/StringUtils.java",
"identifier": "St... | {
"body": "public static byte[] inputStream2Bytes(InputStream is) {\n if (is == null) {\n return null;\n }\n try {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n int i;\n while ((i = is.read()) != -1) {\n baos.write(i);\n ... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_128 | {
"fields": [],
"file": "common/src/test/java/io/seata/common/thread/PositiveAtomicCounterTest.java",
"identifier": "PositiveAtomicCounterTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetAndIncrement() {\n PositiveAtomicCounter counter = new PositiveAtomicCounter();\n assertThat(counter.getAndIncrement()).isEqualTo(0);\n }",
"class_method_signature": "PositiveAtomicCounterTest.testGetAndIncrement()",
"constructor": false,
"full_signature... | {
"fields": [
{
"declarator": "MASK = 0x7FFFFFFF",
"modifier": "private static final",
"original_string": "private static final int MASK = 0x7FFFFFFF;",
"type": "int",
"var_name": "MASK"
},
{
"declarator": "atom",
"modifier": "private final",
"original_strin... | {
"body": "public final int getAndIncrement() {\n return atom.getAndIncrement() & MASK;\n }",
"class_method_signature": "PositiveAtomicCounter.getAndIncrement()",
"constructor": false,
"full_signature": "public final int getAndIncrement()",
"identifier": "getAndIncrement",
"invocations": [
"ge... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_87 | {
"fields": [
{
"declarator": "ipv4 = new InetSocketAddress(Inet4Address.getLocalHost().getHostName(), 3902)",
"modifier": "private",
"original_string": "private InetSocketAddress ipv4 = new InetSocketAddress(Inet4Address.getLocalHost().getHostName(), 3902);",
"type": "InetSocketAddress",
... | {
"body": "@Test\n public void testToLong1() {\n String[] split = \"127.0.0.1\".split(\"\\\\.\");\n long r = 0;\n r = r | (Long.parseLong(split[0]) << 40);\n r = r | (Long.parseLong(split[1]) << 32);\n r = r | (Long.parseLong(split[2]) << 24);\n r = r | (Long.parseLong(spl... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(NetUtil.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(NetUtil.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarato... | {
"body": "public static long toLong(String address) {\n InetSocketAddress ad = toInetSocketAddress(address);\n String[] ip = ad.getAddress().getHostAddress().split(\"\\\\.\");\n long r = 0;\n r = r | (Long.parseLong(ip[0]) << 40);\n r = r | (Long.parseLong(ip[1]) << 32);\n r... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_153 | {
"fields": [
{
"declarator": "DEFAULT_XID = \"default_xid\"",
"modifier": "private final",
"original_string": "private final String DEFAULT_XID = \"default_xid\";",
"type": "String",
"var_name": "DEFAULT_XID"
},
{
"declarator": "DEFAULT_BRANCH_TYPE = BranchType.AT",
... | {
"body": "@Test\n public void testGetXID() {\n RootContext.bind(DEFAULT_XID);\n assertThat(RootContext.getXID()).isEqualTo(DEFAULT_XID);\n assertThat(RootContext.unbind()).isEqualTo(DEFAULT_XID);\n assertThat(RootContext.getXID()).isNull();\n }",
"class_method_signature": "RootCon... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(RootContext.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(RootContext.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"d... | {
"body": "public static String getXID() {\n String xid = (String) CONTEXT_HOLDER.get(KEY_XID);\n if (StringUtils.isNotBlank(xid)) {\n return xid;\n }\n return null;\n }",
"class_method_signature": "RootContext.getXID()",
"constructor": false,
"full_signature": "public ... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_13 | {
"fields": [],
"file": "compressor/seata-compressor-7z/src/test/java/io/seata/compressor/sevenz/SevenZUtilTest.java",
"identifier": "SevenZUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void test_compress() {\n Assertions.assertThrows(NullPointerException.class, () -> {\n SevenZUtil.compress(null);\n });\n }",
"class_method_signature": "SevenZUtilTest.test_compress()",
"constructor": false,
"full_signature": "@Test public void test_compr... | {
"fields": [
{
"declarator": "BUFFER_SIZE = 8192",
"modifier": "private static final",
"original_string": "private static final int BUFFER_SIZE = 8192;",
"type": "int",
"var_name": "BUFFER_SIZE"
}
],
"file": "compressor/seata-compressor-7z/src/main/java/io/seata/compressor/s... | {
"body": "public static byte[] compress(byte[] bytes) {\n if (bytes == null) {\n throw new NullPointerException(\"bytes is null\");\n }\n SeekableInMemoryByteChannel channel = new SeekableInMemoryByteChannel();\n try (SevenZOutputFile z7z = new SevenZOutputFile(channel)) {\n ... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_9 | {
"fields": [],
"file": "compressor/seata-compressor-gzip/src/test/java/io/seata/compressor/gzip/GzipUtilTest.java",
"identifier": "GzipUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void test_compress() {\n Assertions.assertThrows(NullPointerException.class, () -> {\n GzipUtil.compress(null);\n });\n\n byte[] compress = GzipUtil.compress(\"aa\".getBytes());\n int head = ((int) compress[0] & 0xff) | ((compress[1] << 8) & 0xff00);... | {
"fields": [
{
"declarator": "BUFFER_SIZE = 8192",
"modifier": "private static final",
"original_string": "private static final int BUFFER_SIZE = 8192;",
"type": "int",
"var_name": "BUFFER_SIZE"
}
],
"file": "compressor/seata-compressor-gzip/src/main/java/io/seata/compressor... | {
"body": "public static byte[] compress(byte[] bytes) {\n if (bytes == null) {\n throw new NullPointerException(\"bytes is null\");\n }\n ByteArrayOutputStream out = new ByteArrayOutputStream();\n try (GZIPOutputStream gzip = new GZIPOutputStream(out)) {\n gzip.write... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_104 | {
"fields": [],
"file": "common/src/test/java/io/seata/common/util/CollectionUtilsTest.java",
"identifier": "CollectionUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void isSizeEquals() {\n List<String> list0 = new ArrayList<>();\n List<String> list1 = new ArrayList<>();\n Assertions.assertTrue(CollectionUtils.isSizeEquals(null, null));\n Assertions.assertFalse(CollectionUtils.isSizeEquals(null, list0));\n Assertions... | {
"fields": [
{
"declarator": "KV_SPLIT = \"=\"",
"modifier": "private static final",
"original_string": "private static final String KV_SPLIT = \"=\";",
"type": "String",
"var_name": "KV_SPLIT"
},
{
"declarator": "PAIR_SPLIT = \"&\"",
"modifier": "private static ... | {
"body": "public static boolean isSizeEquals(Collection<?> col0, Collection<?> col1) {\n if (col0 == null) {\n return col1 == null;\n } else {\n if (col1 == null) {\n return false;\n } else {\n return col0.size() == col1.size();\n ... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_44 | {
"fields": [
{
"declarator": "DEFAULT_XID = \"1234567890\"",
"modifier": "private static final",
"original_string": "private static final String DEFAULT_XID = \"1234567890\";",
"type": "String",
"var_name": "DEFAULT_XID"
}
],
"file": "tm/src/test/java/io/seata/tm/api/Default... | {
"body": "@Test\n public void rollBackNoXIDExceptionTest() throws TransactionException {\n RootContext.unbind();\n GlobalTransaction tx = GlobalTransactionContext.getCurrentOrCreate();\n tx.begin();\n Assertions.assertThrows(TransactionException.class, tx::rollback);\n }",
"class_... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(DefaultGlobalTransaction.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(DefaultGlobalTransaction.class);",
"type": "Logger",
"var_name": "LOG... | {
"body": "@Override\n public void begin() throws TransactionException {\n begin(DEFAULT_GLOBAL_TX_TIMEOUT);\n }",
"class_method_signature": "DefaultGlobalTransaction.begin()",
"constructor": false,
"full_signature": "@Override public void begin()",
"identifier": "begin",
"invocations": [
"... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_112 | {
"fields": [],
"file": "common/src/test/java/io/seata/common/util/DurationUtilTest.java",
"identifier": "DurationUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testParseThrowException() {\n Assertions.assertThrows(UnsupportedOperationException.class,\n () -> DurationUtil.parse(\"a\"));\n\n Assertions.assertThrows(UnsupportedOperationException.class,\n () -> DurationUtil.parse(\"as\"));\n\n }",
... | {
"fields": [
{
"declarator": "DEFAULT_DURATION = Duration.ofMillis(-1)",
"modifier": "public static final",
"original_string": "public static final Duration DEFAULT_DURATION = Duration.ofMillis(-1);",
"type": "Duration",
"var_name": "DEFAULT_DURATION"
},
{
"declarator"... | {
"body": "public static Duration parse(String str) {\n if (StringUtils.isBlank(str)) {\n return DEFAULT_DURATION;\n }\n\n if (str.contains(MILLIS_SECOND_UNIT)) {\n Long value = doParse(MILLIS_SECOND_UNIT, str);\n return value == null ? null : Duration.ofMillis(va... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_52 | {
"fields": [],
"file": "tm/src/test/java/io/seata/tm/api/transaction/RollbackRuleTest.java",
"identifier": "RollbackRuleTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void RollbackRule() {\n RollbackRule rr = new RollbackRule(Exception.class);\n assertThat(rr.getDepth(new Exception())).isEqualTo(0);\n }",
"class_method_signature": "RollbackRuleTest.RollbackRule()",
"constructor": false,
"full_signature": "@Test public void Rollba... | {
"fields": [
{
"declarator": "exceptionName",
"modifier": "private final",
"original_string": "private final String exceptionName;",
"type": "String",
"var_name": "exceptionName"
}
],
"file": "tm/src/main/java/io/seata/tm/api/transaction/RollbackRule.java",
"identifier": "... | {
"body": "public RollbackRule(String exceptionName) {\n if (StringUtils.isNullOrEmpty(exceptionName)) {\n throw new IllegalArgumentException(\"'exceptionName' cannot be null or empty\");\n }\n this.exceptionName = exceptionName;\n }",
"class_method_signature": "RollbackRule.Rollb... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_145 | {
"fields": [
{
"declarator": "nettyPoolKey",
"modifier": "private",
"original_string": "private NettyPoolKey nettyPoolKey;",
"type": "NettyPoolKey",
"var_name": "nettyPoolKey"
},
{
"declarator": "RM_ROLE = NettyPoolKey.TransactionRole.RMROLE",
"modifier": "privat... | {
"body": "@Test\n public void testToString() {\n String expectStr = \"transactionRole:RMROLE,address:127.0.0.1:8091,msg:< \" + MSG1.toString() + \" >\";\n Assertions.assertEquals(nettyPoolKey.toString(), expectStr);\n }",
"class_method_signature": "NettyPoolKeyTest.testToString()",
"construct... | {
"fields": [
{
"declarator": "transactionRole",
"modifier": "private",
"original_string": "private TransactionRole transactionRole;",
"type": "TransactionRole",
"var_name": "transactionRole"
},
{
"declarator": "address",
"modifier": "private",
"original_str... | {
"body": "@Override\n public String toString() {\n StringBuilder sb = new StringBuilder();\n sb.append(\"transactionRole:\");\n sb.append(transactionRole.name());\n sb.append(\",\");\n sb.append(\"address:\");\n sb.append(address);\n sb.append(\",\");\n sb.a... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_144 | {
"fields": [
{
"declarator": "nettyPoolKey",
"modifier": "private",
"original_string": "private NettyPoolKey nettyPoolKey;",
"type": "NettyPoolKey",
"var_name": "nettyPoolKey"
},
{
"declarator": "RM_ROLE = NettyPoolKey.TransactionRole.RMROLE",
"modifier": "privat... | {
"body": "@Test\n public void setMessage() {\n nettyPoolKey.setMessage(MSG2);\n Assertions.assertEquals(nettyPoolKey.getMessage(), MSG2);\n }",
"class_method_signature": "NettyPoolKeyTest.setMessage()",
"constructor": false,
"full_signature": "@Test public void setMessage()",
"identifier"... | {
"fields": [
{
"declarator": "transactionRole",
"modifier": "private",
"original_string": "private TransactionRole transactionRole;",
"type": "TransactionRole",
"var_name": "transactionRole"
},
{
"declarator": "address",
"modifier": "private",
"original_str... | {
"body": "public void setMessage(AbstractMessage message) {\n this.message = message;\n }",
"class_method_signature": "NettyPoolKey.setMessage(AbstractMessage message)",
"constructor": false,
"full_signature": "public void setMessage(AbstractMessage message)",
"identifier": "setMessage",
"invocat... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_113 | {
"fields": [],
"file": "common/src/test/java/io/seata/common/loader/EnhancedServiceLoaderTest.java",
"identifier": "EnhancedServiceLoaderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testLoadByClassAndClassLoader() {\n Hello load = EnhancedServiceLoader.load(Hello.class, Hello.class.getClassLoader());\n Assertions.assertEquals(load.say(), \"Olá.\");\n }",
"class_method_signature": "EnhancedServiceLoaderTest.testLoadByClassAndClassLoader()",
"... | {
"fields": [],
"file": "common/src/main/java/io/seata/common/loader/EnhancedServiceLoader.java",
"identifier": "EnhancedServiceLoader",
"interfaces": "",
"methods": [
{
"class_method_signature": "EnhancedServiceLoader.load(Class<S> service, ClassLoader loader)",
"constructor": false,
"f... | {
"body": "public static <S> S load(Class<S> service, ClassLoader loader) throws EnhancedServiceNotFoundException {\n return InnerEnhancedServiceLoader.getServiceLoader(service).load(loader);\n }",
"class_method_signature": "EnhancedServiceLoader.load(Class<S> service, ClassLoader loader)",
"constructor... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_53 | {
"fields": [],
"file": "tm/src/test/java/io/seata/tm/api/transaction/RollbackRuleTest.java",
"identifier": "RollbackRuleTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void notFound() {\n RollbackRule rr = new RollbackRule(java.io.IOException.class.getName());\n assertThat(rr.getDepth(new MyRuntimeException(\"\"))).isEqualTo(-1);\n }",
"class_method_signature": "RollbackRuleTest.notFound()",
"constructor": false,
"full_signature":... | {
"fields": [
{
"declarator": "exceptionName",
"modifier": "private final",
"original_string": "private final String exceptionName;",
"type": "String",
"var_name": "exceptionName"
}
],
"file": "tm/src/main/java/io/seata/tm/api/transaction/RollbackRule.java",
"identifier": "... | {
"body": "public int getDepth(Throwable ex) {\n return getDepth(ex.getClass(), 0);\n }",
"class_method_signature": "RollbackRule.getDepth(Throwable ex)",
"constructor": false,
"full_signature": "public int getDepth(Throwable ex)",
"identifier": "getDepth",
"invocations": [
"getDepth",
"ge... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_105 | {
"fields": [],
"file": "common/src/test/java/io/seata/common/util/CollectionUtilsTest.java",
"identifier": "CollectionUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void encodeMap() {\n Map<String, String> map = null;\n Assertions.assertNull(CollectionUtils.encodeMap(map));\n\n map = new LinkedHashMap<>();\n Assertions.assertEquals(\"\", CollectionUtils.encodeMap(map));\n map.put(\"x\", \"1\");\n Assertions.a... | {
"fields": [
{
"declarator": "KV_SPLIT = \"=\"",
"modifier": "private static final",
"original_string": "private static final String KV_SPLIT = \"=\";",
"type": "String",
"var_name": "KV_SPLIT"
},
{
"declarator": "PAIR_SPLIT = \"&\"",
"modifier": "private static ... | {
"body": "public static String encodeMap(Map<String, String> map) {\n if (map == null) {\n return null;\n }\n if (map.isEmpty()) {\n return StringUtils.EMPTY;\n }\n StringBuilder sb = new StringBuilder();\n for (Map.Entry<String, String> entry : map.ent... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_45 | {
"fields": [],
"file": "tm/src/test/java/io/seata/tm/api/transaction/NoRollbackRuleTest.java",
"identifier": "NoRollbackRuleTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void equalsTest(){\n RollbackRule rollbackRuleByClass = new NoRollbackRule(Exception.class);\n RollbackRule otherRollbackRuleByClass = new NoRollbackRule(Exception.class);\n Assertions.assertEquals(rollbackRuleByClass, otherRollbackRuleByClass);\n RollbackRule ... | {
"fields": [
{
"declarator": "DEFAULT_NO_ROLLBACK_RULE = new NoRollbackRule(Throwable.class)",
"modifier": "public static final",
"original_string": "public static final NoRollbackRule DEFAULT_NO_ROLLBACK_RULE = new NoRollbackRule(Throwable.class);",
"type": "NoRollbackRule",
"var_n... | {
"body": "@Override\n public boolean equals(Object other) {\n return super.equals(other);\n }",
"class_method_signature": "NoRollbackRule.equals(Object other)",
"constructor": false,
"full_signature": "@Override public boolean equals(Object other)",
"identifier": "equals",
"invocations": [
... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_8 | {
"fields": [],
"file": "compressor/seata-compressor-bzip2/src/test/java/io/seata/compressor/bzip2/BZip2UtilTest.java",
"identifier": "BZip2UtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void test_decompress() {\n Assertions.assertThrows(NullPointerException.class, () -> {\n BZip2Util.decompress(null);\n });\n }",
"class_method_signature": "BZip2UtilTest.test_decompress()",
"constructor": false,
"full_signature": "@Test public void test_d... | {
"fields": [
{
"declarator": "BUFFER_SIZE = 8192",
"modifier": "private static final",
"original_string": "private static final int BUFFER_SIZE = 8192;",
"type": "int",
"var_name": "BUFFER_SIZE"
}
],
"file": "compressor/seata-compressor-bzip2/src/main/java/io/seata/compresso... | {
"body": "public static byte[] decompress(byte[] bytes) {\n if (bytes == null) {\n throw new NullPointerException(\"bytes is null\");\n }\n ByteArrayOutputStream out = new ByteArrayOutputStream();\n ByteArrayInputStream bis = new ByteArrayInputStream(bytes);\n try (CBZip... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_152 | {
"fields": [
{
"declarator": "BODY_FIELD = \"test_body\"",
"modifier": "private static final",
"original_string": "private static final String BODY_FIELD = \"test_body\";",
"type": "String",
"var_name": "BODY_FIELD"
},
{
"declarator": "ID_FIELD = 100",
"modifier"... | {
"body": "@Test\n public void testIsTimeOut() throws Exception {\n MessageFuture messageFuture = new MessageFuture();\n messageFuture.setTimeout(TIME_OUT_FIELD);\n assertThat(messageFuture.isTimeout()).isFalse();\n Thread.sleep(TIME_OUT_FIELD + 1);\n assertThat(messageFuture.isT... | {
"fields": [
{
"declarator": "requestMessage",
"modifier": "private",
"original_string": "private RpcMessage requestMessage;",
"type": "RpcMessage",
"var_name": "requestMessage"
},
{
"declarator": "timeout",
"modifier": "private",
"original_string": "privat... | {
"body": "public boolean isTimeout() {\n return System.currentTimeMillis() - start > timeout;\n }",
"class_method_signature": "MessageFuture.isTimeout()",
"constructor": false,
"full_signature": "public boolean isTimeout()",
"identifier": "isTimeout",
"invocations": [
"currentTimeMillis"
],... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_12 | {
"fields": [],
"file": "compressor/seata-compressor-lz4/src/test/java/io/seata/compressor/lz4/Lz4UtilTest.java",
"identifier": "Lz4UtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDecompress() {\n Assertions.assertThrows(NullPointerException.class, () -> {\n Lz4Util.decompress(null);\n });\n }",
"class_method_signature": "Lz4UtilTest.testDecompress()",
"constructor": false,
"full_signature": "@Test public void testDecompre... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(Lz4Util.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(Lz4Util.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarato... | {
"body": "public static byte[] decompress(byte[] bytes) {\n if (bytes == null) {\n throw new NullPointerException(\"bytes is null\");\n }\n\n ByteArrayOutputStream outputStream = new ByteArrayOutputStream(ARRAY_SIZE);\n\n LZ4FastDecompressor decompressor = LZ4Factory.fastestIns... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_69 | {
"fields": [],
"file": "common/src/test/java/io/seata/common/util/StringUtilsTest.java",
"identifier": "StringUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n void testEquals() {\n Assertions.assertTrue(StringUtils.equals(\"1\", \"1\"));\n Assertions.assertFalse(StringUtils.equals(\"1\", \"2\"));\n Assertions.assertFalse(StringUtils.equals(null, \"1\"));\n Assertions.assertFalse(StringUtils.equals(\"1\", null));\n As... | {
"fields": [
{
"declarator": "EMPTY = \"\"",
"modifier": "public static final",
"original_string": "public static final String EMPTY = \"\";",
"type": "String",
"var_name": "EMPTY"
}
],
"file": "common/src/main/java/io/seata/common/util/StringUtils.java",
"identifier": "St... | {
"body": "public static boolean equals(String a, String b) {\n if (a == null) {\n return b == null;\n }\n return a.equals(b);\n }",
"class_method_signature": "StringUtils.equals(String a, String b)",
"constructor": false,
"full_signature": "public static boolean equals(String... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_129 | {
"fields": [],
"file": "common/src/test/java/io/seata/common/thread/PositiveAtomicCounterTest.java",
"identifier": "PositiveAtomicCounterTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGet() {\n PositiveAtomicCounter counter = new PositiveAtomicCounter();\n assertThat(counter.get()).isEqualTo(0);\n }",
"class_method_signature": "PositiveAtomicCounterTest.testGet()",
"constructor": false,
"full_signature": "@Test public void testGet()",
... | {
"fields": [
{
"declarator": "MASK = 0x7FFFFFFF",
"modifier": "private static final",
"original_string": "private static final int MASK = 0x7FFFFFFF;",
"type": "int",
"var_name": "MASK"
},
{
"declarator": "atom",
"modifier": "private final",
"original_strin... | {
"body": "public int get() {\n return atom.get() & MASK;\n }",
"class_method_signature": "PositiveAtomicCounter.get()",
"constructor": false,
"full_signature": "public int get()",
"identifier": "get",
"invocations": [
"get"
],
"modifiers": "public",
"parameters": "()",
"return": "int"... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_86 | {
"fields": [
{
"declarator": "ipv4 = new InetSocketAddress(Inet4Address.getLocalHost().getHostName(), 3902)",
"modifier": "private",
"original_string": "private InetSocketAddress ipv4 = new InetSocketAddress(Inet4Address.getLocalHost().getHostName(), 3902);",
"type": "InetSocketAddress",
... | {
"body": "@Test\n public void testToLong() {\n try {\n NetUtil.toLong(\"kdskdsfk\");\n } catch (Exception e) {\n assertThat(e).isInstanceOf(NullPointerException.class);\n }\n }",
"class_method_signature": "NetUtilTest.testToLong()",
"constructor": false,
"full_s... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(NetUtil.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(NetUtil.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarato... | {
"body": "public static long toLong(String address) {\n InetSocketAddress ad = toInetSocketAddress(address);\n String[] ip = ad.getAddress().getHostAddress().split(\"\\\\.\");\n long r = 0;\n r = r | (Long.parseLong(ip[0]) << 40);\n r = r | (Long.parseLong(ip[1]) << 32);\n r... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_200 | {
"fields": [
{
"declarator": "NOT_EXIST_SQL_TYPE = \"not_exist_sql_type\"",
"modifier": "private static final",
"original_string": "private static final String NOT_EXIST_SQL_TYPE = \"not_exist_sql_type\";",
"type": "String",
"var_name": "NOT_EXIST_SQL_TYPE"
}
],
"file": "rm-... | {
"body": "@Test\n public void getTableMetaCache() {\n Assertions.assertTrue(TableMetaCacheFactory.getTableMetaCache(JdbcConstants.MYSQL) instanceof MysqlTableMetaCache);\n Assertions.assertTrue(TableMetaCacheFactory.getTableMetaCache(JdbcConstants.ORACLE) instanceof OracleTableMetaCache);\n A... | {
"fields": [
{
"declarator": "TABLE_META_CACHE_MAP = new ConcurrentHashMap<>()",
"modifier": "private static final",
"original_string": "private static final Map<String, TableMetaCache> TABLE_META_CACHE_MAP = new ConcurrentHashMap<>();",
"type": "Map<String, TableMetaCache>",
"var_n... | {
"body": "public static TableMetaCache getTableMetaCache(String dbType) {\n if (TABLE_META_CACHE_MAP.get(dbType) != null) {\n return TABLE_META_CACHE_MAP.get(dbType);\n }\n TableMetaCache tableMetaCache = EnhancedServiceLoader.load(TableMetaCache.class, dbType);\n TABLE_META_CA... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_191 | {
"fields": [
{
"declarator": "COLUMN_ID=\"id\"",
"modifier": "private final",
"original_string": "private final String COLUMN_ID=\"id\";",
"type": "String",
"var_name": "COLUMN_ID"
},
{
"declarator": "COLUMN_USERCODE=\"userCode\"",
"modifier": "private final",
... | {
"body": "@Test\n public void testGetColumnMeta() {\n TableMeta tableMeta = new TableMeta();\n tableMeta.getAllColumns().put(\"id\", new ColumnMeta());\n tableMeta.getAllColumns().put(\"name\", new ColumnMeta());\n Assertions.assertNull(tableMeta.getColumnMeta(\"`id`\"));\n Asse... | {
"fields": [
{
"declarator": "tableName",
"modifier": "private",
"original_string": "private String tableName;",
"type": "String",
"var_name": "tableName"
},
{
"declarator": "allColumns = new LinkedHashMap<String, ColumnMeta>()",
"modifier": "private",
"ori... | {
"body": "public ColumnMeta getColumnMeta(String colName) {\n return allColumns.get(colName);\n }",
"class_method_signature": "TableMeta.getColumnMeta(String colName)",
"constructor": false,
"full_signature": "public ColumnMeta getColumnMeta(String colName)",
"identifier": "getColumnMeta",
"invoc... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_28 | {
"fields": [],
"file": "serializer/seata-serializer-protobuf/src/test/java/io/seata/serializer/protobuf/convertor/RegisterTMResponseConvertorTest.java",
"identifier": "RegisterTMResponseConvertorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void convert2Proto() {\n\n RegisterTMResponse registerRMResponse = new RegisterTMResponse();\n registerRMResponse.setResultCode(ResultCode.Failed);\n registerRMResponse.setMsg(\"msg\");\n registerRMResponse.setIdentified(true);\n registerRMResponse.setVe... | {
"fields": [],
"file": "serializer/seata-serializer-protobuf/src/main/java/io/seata/serializer/protobuf/convertor/RegisterTMResponseConvertor.java",
"identifier": "RegisterTMResponseConvertor",
"interfaces": "implements PbConvertor<RegisterTMResponse, RegisterTMResponseProto>",
"methods": [
{
"clas... | {
"body": "@Override\n public RegisterTMResponseProto convert2Proto(RegisterTMResponse registerTMResponse) {\n final short typeCode = registerTMResponse.getTypeCode();\n\n final AbstractMessageProto abstractMessage = AbstractMessageProto.newBuilder().setMessageType(\n MessageTypeProto.forN... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_187 | {
"fields": [
{
"declarator": "updateExecutor",
"modifier": "private static",
"original_string": "private static UpdateExecutor updateExecutor;",
"type": "UpdateExecutor",
"var_name": "updateExecutor"
},
{
"declarator": "statementProxy",
"modifier": "private stati... | {
"body": "@Test\n public void testAfterImage() throws SQLException {\n TableRecords beforeImage = updateExecutor.beforeImage();\n TableRecords afterImage = updateExecutor.afterImage(beforeImage);\n Assertions.assertNotNull(afterImage);\n\n afterImage = updateExecutor.afterImage(new Tab... | {
"fields": [
{
"declarator": "CONFIG = ConfigurationFactory.getInstance()",
"modifier": "private static final",
"original_string": "private static final Configuration CONFIG = ConfigurationFactory.getInstance();",
"type": "Configuration",
"var_name": "CONFIG"
},
{
"dec... | {
"body": "@Override\n protected TableRecords afterImage(TableRecords beforeImage) throws SQLException {\n TableMeta tmeta = getTableMeta();\n if (beforeImage == null || beforeImage.size() == 0) {\n return TableRecords.empty(getTableMeta());\n }\n String selectSQL = buildAfte... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_168 | {
"fields": [
{
"declarator": "returnValueColumnLabels = Lists.newArrayList(\"id\", \"name\")",
"modifier": "private static",
"original_string": "private static List<String> returnValueColumnLabels = Lists.newArrayList(\"id\", \"name\");",
"type": "List<String>",
"var_name": "returnV... | {
"body": "@Test\n public void testExecuteUpdate() throws SQLException {\n Assertions.assertNotNull(preparedStatementProxy.executeUpdate());\n }",
"class_method_signature": "PreparedStatementProxyTest.testExecuteUpdate()",
"constructor": false,
"full_signature": "@Test public void testExecuteUpdate... | {
"fields": [],
"file": "rm-datasource/src/main/java/io/seata/rm/datasource/PreparedStatementProxy.java",
"identifier": "PreparedStatementProxy",
"interfaces": "implements PreparedStatement, ParametersHolder",
"methods": [
{
"class_method_signature": "PreparedStatementProxy.getParameters()",
"... | {
"body": "@Override\n public int executeUpdate() throws SQLException {\n return ExecuteTemplate.execute(this, (statement, args) -> statement.executeUpdate());\n }",
"class_method_signature": "PreparedStatementProxy.executeUpdate()",
"constructor": false,
"full_signature": "@Override public int exe... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_90 | {
"fields": [
{
"declarator": "ipv4 = new InetSocketAddress(Inet4Address.getLocalHost().getHostName(), 3902)",
"modifier": "private",
"original_string": "private InetSocketAddress ipv4 = new InetSocketAddress(Inet4Address.getLocalHost().getHostName(), 3902);",
"type": "InetSocketAddress",
... | {
"body": "@Test\n public void testGetLocalAddress() {\n assertThat(NetUtil.getLocalAddress()).isNotNull();\n }",
"class_method_signature": "NetUtilTest.testGetLocalAddress()",
"constructor": false,
"full_signature": "@Test public void testGetLocalAddress()",
"identifier": "testGetLocalAddress",
... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(NetUtil.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(NetUtil.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarato... | {
"body": "public static InetAddress getLocalAddress() {\n if (LOCAL_ADDRESS != null) {\n return LOCAL_ADDRESS;\n }\n InetAddress localAddress = getLocalAddress0();\n LOCAL_ADDRESS = localAddress;\n return localAddress;\n }",
"class_method_signature": "NetUtil.getLoc... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_216 | {
"fields": [
{
"declarator": "returnValueColumnLabels = Lists.newArrayList(\"log_status\")",
"modifier": "",
"original_string": "List<String> returnValueColumnLabels = Lists.newArrayList(\"log_status\");",
"type": "List<String>",
"var_name": "returnValueColumnLabels"
},
{
... | {
"body": "@Test\n public void testInsertUndoLog() throws SQLException {\n Assertions.assertDoesNotThrow(() -> undoLogManager.insertUndoLogWithGlobalFinished(\"xid\", 1L, new JacksonUndoLogParser(),\n dataSource.getConnection()));\n\n Assertions.assertDoesNotThrow(() -> undoLogManager.inse... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(MySQLUndoLogManager.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(MySQLUndoLogManager.class);",
"type": "Logger",
"var_name": "LOGGER"
}... | {
"body": "private void insertUndoLog(String xid, long branchId, String rollbackCtx,\n byte[] undoLogContent, State state, Connection conn) throws SQLException {\n try (PreparedStatement pst = conn.prepareStatement(INSERT_UNDO_LOG_SQL)) {\n pst.setLong(1, branchId);\n ... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_148 | {
"fields": [],
"file": "core/src/test/java/io/seata/core/protocol/MergeResultMessageTest.java",
"identifier": "MergeResultMessageTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void getTypeCode() {\n MergeResultMessage mergeResultMessage = new MergeResultMessage();\n assertThat(MessageType.TYPE_SEATA_MERGE_RESULT).isEqualTo(mergeResultMessage.getTypeCode());\n }",
"class_method_signature": "MergeResultMessageTest.getTypeCode()",
"constructor... | {
"fields": [
{
"declarator": "msgs",
"modifier": "public",
"original_string": "public AbstractResultMessage[] msgs;",
"type": "AbstractResultMessage[]",
"var_name": "msgs"
}
],
"file": "core/src/main/java/io/seata/core/protocol/MergeResultMessage.java",
"identifier": "Merg... | {
"body": "@Override\n public short getTypeCode() {\n return MessageType.TYPE_SEATA_MERGE_RESULT;\n }",
"class_method_signature": "MergeResultMessage.getTypeCode()",
"constructor": false,
"full_signature": "@Override public short getTypeCode()",
"identifier": "getTypeCode",
"invocations": [],
... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_4 | {
"fields": [],
"file": "discovery/seata-discovery-zk/src/test/java/io/seata/discovery/registry/zk/ZookeeperRegistryProviderTest.java",
"identifier": "ZookeeperRegistryProviderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void provide() {\n ZookeeperRegistryProvider provider = new ZookeeperRegistryProvider();\n Assertions.assertTrue(provider.provide() instanceof ZookeeperRegisterServiceImpl);\n }",
"class_method_signature": "ZookeeperRegistryProviderTest.provide()",
"constructor": fals... | {
"fields": [],
"file": "discovery/seata-discovery-zk/src/main/java/io/seata/discovery/registry/zk/ZookeeperRegistryProvider.java",
"identifier": "ZookeeperRegistryProvider",
"interfaces": "implements RegistryProvider",
"methods": [
{
"class_method_signature": "ZookeeperRegistryProvider.provide()",
... | {
"body": "@Override\n public RegistryService provide() {\n return ZookeeperRegisterServiceImpl.getInstance();\n }",
"class_method_signature": "ZookeeperRegistryProvider.provide()",
"constructor": false,
"full_signature": "@Override public RegistryService provide()",
"identifier": "provide",
"i... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_220 | {
"fields": [
{
"declarator": "executor",
"modifier": "private static",
"original_string": "private static MySQLUndoDeleteExecutor executor;",
"type": "MySQLUndoDeleteExecutor",
"var_name": "executor"
}
],
"file": "rm-datasource/src/test/java/io/seata/rm/datasource/undo/mysql... | {
"body": "@Test\n public void buildUndoSQL() {\n String sql = executor.buildUndoSQL().toLowerCase();\n Assertions.assertNotNull(sql);\n Assertions.assertTrue(sql.contains(\"insert\"));\n Assertions.assertTrue(sql.contains(\"id\"));\n }",
"class_method_signature": "MySQLUndoDeleteE... | {
"fields": [
{
"declarator": "INSERT_SQL_TEMPLATE = \"INSERT INTO %s (%s) VALUES (%s)\"",
"modifier": "private static final",
"original_string": "private static final String INSERT_SQL_TEMPLATE = \"INSERT INTO %s (%s) VALUES (%s)\";",
"type": "String",
"var_name": "INSERT_SQL_TEMPLA... | {
"body": "@Override\n protected String buildUndoSQL() {\n TableRecords beforeImage = sqlUndoLog.getBeforeImage();\n List<Row> beforeImageRows = beforeImage.getRows();\n if (CollectionUtils.isEmpty(beforeImageRows)) {\n throw new ShouldNeverHappenException(\"Invalid UNDO LOG\");\n ... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_109 | {
"fields": [],
"file": "common/src/test/java/io/seata/common/util/CollectionUtilsTest.java",
"identifier": "CollectionUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIsEmptyWithCollection() {\n List<String> emptyCollection = new ArrayList<>();\n List<String> filledCollection = new ArrayList<>();\n\n filledCollection.add(\"Foo\");\n filledCollection.add(\"Bar\");\n\n Assertions.assertTrue(CollectionUtils.isEm... | {
"fields": [
{
"declarator": "KV_SPLIT = \"=\"",
"modifier": "private static final",
"original_string": "private static final String KV_SPLIT = \"=\";",
"type": "String",
"var_name": "KV_SPLIT"
},
{
"declarator": "PAIR_SPLIT = \"&\"",
"modifier": "private static ... | {
"body": "public static boolean isEmpty(Collection<?> col) {\n return !isNotEmpty(col);\n }",
"class_method_signature": "CollectionUtils.isEmpty(Collection<?> col)",
"constructor": false,
"full_signature": "public static boolean isEmpty(Collection<?> col)",
"identifier": "isEmpty",
"invocations":... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_49 | {
"fields": [],
"file": "tm/src/test/java/io/seata/tm/api/transaction/TransactionHookManagerTest.java",
"identifier": "TransactionHookManagerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testNPE() {\n Assertions.assertThrows(NullPointerException.class, () -> TransactionHookManager.registerHook(null));\n }",
"class_method_signature": "TransactionHookManagerTest.testNPE()",
"constructor": false,
"full_signature": "@Test public void testNPE()",
"identi... | {
"fields": [
{
"declarator": "LOCAL_HOOKS = new ThreadLocal<>()",
"modifier": "private static final",
"original_string": "private static final ThreadLocal<List<TransactionHook>> LOCAL_HOOKS = new ThreadLocal<>();",
"type": "ThreadLocal<List<TransactionHook>>",
"var_name": "LOCAL_HOO... | {
"body": "public static void registerHook(TransactionHook transactionHook) {\n if (transactionHook == null) {\n throw new NullPointerException(\"transactionHook must not be null\");\n }\n List<TransactionHook> transactionHooks = LOCAL_HOOKS.get();\n if (transactionHooks == null... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_65 | {
"fields": [
{
"declarator": "message = new Message()",
"modifier": "private",
"original_string": "private Message message = new Message();",
"type": "Message",
"var_name": "message"
}
],
"file": "common/src/test/java/io/seata/common/exception/FrameworkExceptionTest.java",
... | {
"body": "@Test\n public void testNestedException() {\n Throwable throwable = Assertions.assertThrows(FrameworkException.class, () -> {\n message.print();\n });\n assertThat(throwable).hasMessage(\"\");\n }",
"class_method_signature": "FrameworkExceptionTest.testNestedExceptio... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(FrameworkException.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(FrameworkException.class);",
"type": "Logger",
"var_name": "LOGGER"
},
... | {
"body": "public static FrameworkException nestedException(Throwable e) {\n return nestedException(\"\", e);\n }",
"class_method_signature": "FrameworkException.nestedException(Throwable e)",
"constructor": false,
"full_signature": "public static FrameworkException nestedException(Throwable e)",
"i... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_125 | {
"fields": [
{
"declarator": "THREAD_TOTAL_SIZE = 3",
"modifier": "private static final",
"original_string": "private static final int THREAD_TOTAL_SIZE = 3;",
"type": "int",
"var_name": "THREAD_TOTAL_SIZE"
},
{
"declarator": "DEFAULT_THREAD_PREFIX_COUNTER = 1",
... | {
"body": "@Test\n public void testConstructorWithPrefixAndDaemons() {\n NamedThreadFactory factory = new NamedThreadFactory(\"prefix\", true);\n Thread thread = factory.newThread(() -> {});\n\n assertThat(thread.getName()).startsWith(\"prefix\");\n assertThat(thread.isDaemon()).isTrue(... | {
"fields": [
{
"declarator": "PREFIX_COUNTER = new ConcurrentHashMap<>()",
"modifier": "private final static",
"original_string": "private final static Map<String, AtomicInteger> PREFIX_COUNTER = new ConcurrentHashMap<>();",
"type": "Map<String, AtomicInteger>",
"var_name": "PREFIX_... | {
"body": "@Override\n public Thread newThread(Runnable r) {\n String name = prefix + \"_\" + counter.incrementAndGet();\n if (totalSize > 1) {\n name += \"_\" + totalSize;\n }\n Thread thread = new FastThreadLocalThread(r, name);\n\n thread.setDaemon(makeDaemons);\n ... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
163387337_32 | {
"fields": [],
"file": "serializer/seata-serializer-protobuf/src/test/java/io/seata/serializer/protobuf/convertor/GlobalCommitRequestConvertorTest.java",
"identifier": "GlobalCommitRequestConvertorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void convert2Proto() {\n\n GlobalCommitRequest globalCommitRequest = new GlobalCommitRequest();\n globalCommitRequest.setExtraData(\"extraData\");\n globalCommitRequest.setXid(\"xid\");\n\n GlobalCommitRequestConvertor convertor = new GlobalCommitRequestConvert... | {
"fields": [],
"file": "serializer/seata-serializer-protobuf/src/main/java/io/seata/serializer/protobuf/convertor/GlobalCommitRequestConvertor.java",
"identifier": "GlobalCommitRequestConvertor",
"interfaces": "implements PbConvertor<GlobalCommitRequest, GlobalCommitRequestProto>",
"methods": [
{
"... | {
"body": "@Override\n public GlobalCommitRequestProto convert2Proto(GlobalCommitRequest globalCommitRequest) {\n final short typeCode = globalCommitRequest.getTypeCode();\n\n final AbstractMessageProto abstractMessage = AbstractMessageProto.newBuilder().setMessageType(\n MessageTypeProto.... | {
"created": "12/28/2018 8:37:22 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 163387337,
"size": null,
"stargazer_count": null,
"stars": 14069,
"updates": "2020-01-27T16:13:33+00:00",
"url": "https://github.com/seata/seata"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.