id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
47973088_1004 | {
"fields": [],
"file": "core/serialisation/src/test/java/uk/gov/gchq/gaffer/serialisation/implementation/ordered/OrderedFloatSerialiserTest.java",
"identifier": "OrderedFloatSerialiserTest",
"interfaces": "",
"superclass": "extends ToBytesSerialisationTest<Float>"
} | {
"body": "@Test\n public void cantSerialiseStringClass() {\n assertFalse(serialiser.canHandle(String.class));\n }",
"class_method_signature": "OrderedFloatSerialiserTest.cantSerialiseStringClass()",
"constructor": false,
"full_signature": "@Test public void cantSerialiseStringClass()",
"identifi... | {
"fields": [
{
"declarator": "serialVersionUID = 6829577492677279853L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 6829577492677279853L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "INTEG... | {
"body": "@Override\n public boolean canHandle(final Class clazz) {\n return Float.class.equals(clazz);\n }",
"class_method_signature": "OrderedFloatSerialiser.canHandle(final Class clazz)",
"constructor": false,
"full_signature": "@Override public boolean canHandle(final Class clazz)",
"identif... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_885 | {
"fields": [],
"file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/ElementValidatorTest.java",
"identifier": "ElementValidatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnValidValidationResultWhenSchemaValidateWithValidElement() {\n // Given\n final Schema schema = mock(Schema.class);\n final String group = TestGroups.EDGE;\n final Element elm = mock(Element.class);\n final SchemaElementDefinition element... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(ElementValidator.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(ElementValidator.class);",
"type": "Logger",
"var_name": "LOGGER"
},
... | {
"body": "@Override\n public ValidationResult validateWithValidationResult(final Element element) {\n final ValidationResult validationResult = new ValidationResult();\n if (null == element) {\n validationResult.addError(\"Element was null\");\n } else if (null != schema) {\n ... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_1141 | {
"fields": [
{
"declarator": "graph",
"modifier": "",
"original_string": "Graph graph;",
"type": "Graph",
"var_name": "graph"
},
{
"declarator": "storeProperties = new StoreProperties()",
"modifier": "final",
"original_string": "final StoreProperties storeP... | {
"body": "@Test\n public void shouldValidateInvalidOperationChainAgainstSchema() {\n // When\n final ValidationResult validationResult = SchemaOperationChainUtil.validate(schema, invalidOperationChain);\n\n // Then\n assertFalse(validationResult.isValid());\n assertTrue(validati... | {
"fields": [],
"file": "core/graph/src/main/java/uk/gov/gchq/gaffer/graph/SchemaOperationChainUtil.java",
"identifier": "SchemaOperationChainUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "SchemaOperationChainUtil.SchemaOperationChainUtil()",
"constructor": true,
"ful... | {
"body": "public static ValidationResult validate(final Schema schema, final OperationChain operationChain) {\n updateOperationChainViews(operationChain, schema);\n SchemaOperationChainValidator validator = new SchemaOperationChainValidator(new ViewValidator(), schema);\n\n return validator.vali... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_169 | {
"fields": [
{
"declarator": "SCHEMA = new Schema.Builder()\n .type(\"string\", new TypeDefinition.Builder()\n .clazz(String.class)\n .serialiser(new StringSerialiser())\n .build())\n .type(\"int\", new TypeDefinition.Builder()\... | {
"body": "@Test\n public void shouldAddElements() throws OperationException, StoreException, IOException {\n // Given\n final AddElementsHandler handler = new AddElementsHandler();\n final List<Element> elements = createElements();\n final List<Element> elementsWithNull = new ArrayList... | {
"fields": [],
"file": "store-implementation/hbase-store/src/main/java/uk/gov/gchq/gaffer/hbasestore/operation/handler/AddElementsHandler.java",
"identifier": "AddElementsHandler",
"interfaces": "implements OperationHandler<AddElements>",
"methods": [
{
"class_method_signature": "AddElementsHandler... | {
"body": "@Override\n public Void doOperation(final AddElements operation,\n final Context context, final Store store)\n throws OperationException {\n addElements(operation, (HBaseStore) store);\n return null;\n }",
"class_method_signature": "AddElementsHan... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_493 | {
"fields": [],
"file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/StringUtilTest.java",
"identifier": "StringUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void escapeCommaShouldReplaceCommaWith2Backslashes() {\n assertEquals(\"replaceWith\\\\\\\\comma\", StringUtil.escapeComma(\"replaceWith,comma\"));\n }",
"class_method_signature": "StringUtilTest.escapeCommaShouldReplaceCommaWith2Backslashes()",
"constructor": false,
"full... | {
"fields": [
{
"declarator": "COMMA = ','",
"modifier": "public static final",
"original_string": "public static final char COMMA = ',';",
"type": "char",
"var_name": "COMMA"
},
{
"declarator": "ESCAPE_CHAR = '\\\\'",
"modifier": "private static final",
"or... | {
"body": "public static String escapeComma(final String str) {\n final StringBuilder escapedStr = new StringBuilder(str.length());\n for (int i = 0; i < str.length(); i++) {\n char c = str.charAt(i);\n if (ESCAPE_CHAR == c) {\n escapedStr.append(ESCAPE_CHAR);\n ... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
47973088_539 | {
"fields": [],
"file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/iterable/TransformOneToManyIterableTest.java",
"identifier": "TransformOneToManyIterableTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldCreateIteratorThatReturnsOnlyValidStrings() {\n // Given\n final String nullItem0 = null;\n final String validItem1 = \"item 1\";\n final String invalidItem2 = \"item2a,item2b\";\n final String validItems3A_3B = \"item 3a,item 3b\";\n f... | {
"fields": [
{
"declarator": "input",
"modifier": "private final",
"original_string": "private final Iterable<? extends I> input;",
"type": "Iterable<? extends I>",
"var_name": "input"
},
{
"declarator": "validator",
"modifier": "private final",
"original_s... | {
"body": "@Override\n public CloseableIterator<O> iterator() {\n return new CloseableIterator<O>() {\n private final Iterator<? extends I> inputItr = input.iterator();\n\n private Iterator<O> nextElements;\n private Boolean hasNext;\n\n @Override\n pub... | {
"created": "12/14/2015 12:12:39 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 47973088,
"size": null,
"stargazer_count": null,
"stars": 1568,
"updates": "2020-01-27T21:51:26+00:00",
"url": "https://github.com/gchq/Gaffer"
... |
3570915_5 | {
"fields": [],
"file": "baralga-core/src/test/java/org/remast/text/SmartTimeFormatTest.java",
"identifier": "SmartTimeFormatTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n void parseToHourAndMinutesWithDecimalMinutesShort() throws ParseException {\n int[] hoursAndMinutes = SmartTimeFormat.parseToHourAndMinutes(\",5\");\n assertEquals(hoursAndMinutes[0], 0);\n assertEquals(hoursAndMinutes[1], 30);\n }",
"class_method_signature": "SmartTime... | {
"fields": [],
"file": "baralga-core/src/main/java/org/remast/text/SmartTimeFormat.java",
"identifier": "SmartTimeFormat",
"interfaces": "",
"methods": [
{
"class_method_signature": "SmartTimeFormat.parse(final String source, final ParsePosition pos)",
"constructor": false,
"full_signat... | {
"body": "public static int[] parseToHourAndMinutes(final String timeString) throws ParseException {\n String time = timeString;\n time = Strings.nullToEmpty(time).trim();\n \n if (time.length() == 0) {\n throw new ParseException(\"String is empty\", 1);\n }\n \n ... | {
"created": "2/28/2012 12:43:31 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3570915,
"size": null,
"stargazer_count": null,
"stars": 54,
"updates": "2020-01-07T15:45:38+00:00",
"url": "https://github.com/Baralga/baralga"
... |
3570915_4 | {
"fields": [],
"file": "baralga-core/src/test/java/org/remast/text/SmartTimeFormatTest.java",
"identifier": "SmartTimeFormatTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n void parseToHourAndMinutesWithDecimalMinutes() throws ParseException {\n int[] hoursAndMinutes = SmartTimeFormat.parseToHourAndMinutes(\"9,75\");\n assertEquals(hoursAndMinutes[0], 9);\n assertEquals(hoursAndMinutes[1], 45);\n }",
"class_method_signature": "SmartTimeFor... | {
"fields": [],
"file": "baralga-core/src/main/java/org/remast/text/SmartTimeFormat.java",
"identifier": "SmartTimeFormat",
"interfaces": "",
"methods": [
{
"class_method_signature": "SmartTimeFormat.parse(final String source, final ParsePosition pos)",
"constructor": false,
"full_signat... | {
"body": "public static int[] parseToHourAndMinutes(final String timeString) throws ParseException {\n String time = timeString;\n time = Strings.nullToEmpty(time).trim();\n \n if (time.length() == 0) {\n throw new ParseException(\"String is empty\", 1);\n }\n \n ... | {
"created": "2/28/2012 12:43:31 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3570915,
"size": null,
"stargazer_count": null,
"stars": 54,
"updates": "2020-01-07T15:45:38+00:00",
"url": "https://github.com/Baralga/baralga"
... |
3570915_8 | {
"fields": [],
"file": "baralga-core/src/test/java/org/remast/baralga/model/ProjectActivityTest.java",
"identifier": "ProjectActivityTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSetDay() {\n {\n ProjectActivity act = new ProjectActivity(\n new DateTime(2009, 1, 1, 11, 0, 0 ,0),\n new DateTime(2009, 1, 1, 12, 47, 0, 0), \n null\n );\n DateTime day = act.getDay... | {
"fields": [
{
"declarator": "serialVersionUID = 1L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "id",
"modifier": "private",
"... | {
"body": "public void setDay(final DateTime day) {\n DateTime newStartDay = getStart();\n this.start = newStartDay.withYear(day.getYear()).withMonthOfYear(day.getMonthOfYear())\n .withDayOfMonth(day.getDayOfMonth());\n\n DateTime newEndDay = getEnd();\n newEndDay = newEndDay.wi... | {
"created": "2/28/2012 12:43:31 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3570915,
"size": null,
"stargazer_count": null,
"stars": 54,
"updates": "2020-01-07T15:45:38+00:00",
"url": "https://github.com/Baralga/baralga"
... |
3570915_3 | {
"fields": [],
"file": "baralga-core/src/test/java/org/remast/text/SmartTimeFormatTest.java",
"identifier": "SmartTimeFormatTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n void parseToHourAndMinutesWithHoursOnly() throws ParseException {\n int[] hoursAndMinutes = SmartTimeFormat.parseToHourAndMinutes(\"9\");\n assertEquals(hoursAndMinutes[0], 9);\n assertEquals(hoursAndMinutes[1], 0);\n }",
"class_method_signature": "SmartTimeFormatTest.p... | {
"fields": [],
"file": "baralga-core/src/main/java/org/remast/text/SmartTimeFormat.java",
"identifier": "SmartTimeFormat",
"interfaces": "",
"methods": [
{
"class_method_signature": "SmartTimeFormat.parse(final String source, final ParsePosition pos)",
"constructor": false,
"full_signat... | {
"body": "public static int[] parseToHourAndMinutes(final String timeString) throws ParseException {\n String time = timeString;\n time = Strings.nullToEmpty(time).trim();\n \n if (time.length() == 0) {\n throw new ParseException(\"String is empty\", 1);\n }\n \n ... | {
"created": "2/28/2012 12:43:31 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3570915,
"size": null,
"stargazer_count": null,
"stars": 54,
"updates": "2020-01-07T15:45:38+00:00",
"url": "https://github.com/Baralga/baralga"
... |
3570915_2 | {
"fields": [],
"file": "baralga-core/src/test/java/org/remast/text/SmartTimeFormatTest.java",
"identifier": "SmartTimeFormatTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n void parseToHourAndMinutesNormal() throws ParseException {\n int[] hoursAndMinutes = SmartTimeFormat.parseToHourAndMinutes(\"09:10\");\n assertEquals(hoursAndMinutes[0], 9);\n assertEquals(hoursAndMinutes[1], 10);\n }",
"class_method_signature": "SmartTimeFormatTest.par... | {
"fields": [],
"file": "baralga-core/src/main/java/org/remast/text/SmartTimeFormat.java",
"identifier": "SmartTimeFormat",
"interfaces": "",
"methods": [
{
"class_method_signature": "SmartTimeFormat.parse(final String source, final ParsePosition pos)",
"constructor": false,
"full_signat... | {
"body": "public static int[] parseToHourAndMinutes(final String timeString) throws ParseException {\n String time = timeString;\n time = Strings.nullToEmpty(time).trim();\n \n if (time.length() == 0) {\n throw new ParseException(\"String is empty\", 1);\n }\n \n ... | {
"created": "2/28/2012 12:43:31 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3570915,
"size": null,
"stargazer_count": null,
"stars": 54,
"updates": "2020-01-07T15:45:38+00:00",
"url": "https://github.com/Baralga/baralga"
... |
3570915_1 | {
"fields": [
{
"declarator": "format = new DurationFormat()",
"modifier": "private",
"original_string": "private DurationFormat format = new DurationFormat();",
"type": "DurationFormat",
"var_name": "format"
},
{
"declarator": "initialDurationFormat",
"modifier":... | {
"body": "@Test\n public void formatDurationInHoursAndMinutes() {\n UserSettings.instance().setDurationFormat(UserSettings.DurationFormat.HOURS_AND_MINUTES);\n ProjectActivity act;\n DateTime startTime = new DateTime(DateUtils.getNow());\n\n act = new ProjectActivity(startTime, startTi... | {
"fields": [
{
"declarator": "HOUR_OR_MINUTES_FORMAT = new DecimalFormat(\"#00\")",
"modifier": "public static final",
"original_string": "public static final NumberFormat HOUR_OR_MINUTES_FORMAT = new DecimalFormat(\"#00\");",
"type": "NumberFormat",
"var_name": "HOUR_OR_MINUTES_FOR... | {
"body": "@Override\n public StringBuffer format(double duration, StringBuffer toAppendTo, FieldPosition pos) {\n if (displayAsHoursAndMinutes()) {\n toAppendTo.append(formatAsHoursAndMinutes(duration));\n } else {\n toAppendTo.append(DURATION_FORMAT.format(duration));\n ... | {
"created": "2/28/2012 12:43:31 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3570915,
"size": null,
"stargazer_count": null,
"stars": 54,
"updates": "2020-01-07T15:45:38+00:00",
"url": "https://github.com/Baralga/baralga"
... |
3570915_0 | {
"fields": [],
"file": "baralga-core/src/test/java/org/remast/util/StringUtilsTest.java",
"identifier": "StringUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void stripXmlTags() {\n assertNull(StringUtils.stripXmlTags(null));\n assertNotSame(\"\", org.remast.util.StringUtils.stripXmlTags(null));\n assertEquals(\"\", org.remast.util.StringUtils.stripXmlTags(\"\"));\n assertEquals(\"<\", org.remast.util.StringUtils.stri... | {
"fields": [
{
"declarator": "XML_TAG_PATTERN = \"<[^<>]+>\"",
"modifier": "private static final",
"original_string": "private static final String XML_TAG_PATTERN = \"<[^<>]+>\";",
"type": "String",
"var_name": "XML_TAG_PATTERN"
}
],
"file": "baralga-core/src/main/java/org/r... | {
"body": "public static String stripXmlTags(final String xml) {\n if (org.apache.commons.lang3.StringUtils.isBlank(xml)) {\n return xml;\n }\n \n // 1. Remove xml tags\n String strippedXml = xml.replaceAll(XML_TAG_PATTERN, org.apache.commons.lang3.StringUtils.EMPTY);\n ... | {
"created": "2/28/2012 12:43:31 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3570915,
"size": null,
"stargazer_count": null,
"stars": 54,
"updates": "2020-01-07T15:45:38+00:00",
"url": "https://github.com/Baralga/baralga"
... |
3570915_7 | {
"fields": [],
"file": "baralga-core/src/test/java/org/remast/baralga/model/ProjectActivityTest.java",
"identifier": "ProjectActivityTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testStartNotAfterEnd() {\n try {\n new ProjectActivity(new DateTime(2009, 1, 1, 13, 0, 0 ,0),\n new DateTime(2009, 1, 1, 12, 0, 0, 0), null);\n fail(\"Expected IllegalArgumentException\");\n } catch (IllegalArgumentException e) {... | {
"fields": [
{
"declarator": "serialVersionUID = 1L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "id",
"modifier": "private",
"... | {
"body": "public void setEndTime(final int hours, final int minutes) {\n DateTime endDate = getEnd();\n if (hours == endDate.getHourOfDay() && minutes == endDate.getMinuteOfHour()) {\n return;\n }\n \n if (endDate.getHourOfDay() == 0 && endDate.getMinuteOfHour() == 0) { ... | {
"created": "2/28/2012 12:43:31 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3570915,
"size": null,
"stargazer_count": null,
"stars": 54,
"updates": "2020-01-07T15:45:38+00:00",
"url": "https://github.com/Baralga/baralga"
... |
3570915_6 | {
"fields": [],
"file": "baralga-core/src/test/java/org/remast/baralga/model/ProjectActivityTest.java",
"identifier": "ProjectActivityTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCalculateDuration() {\n ProjectActivity act;\n DateTime startTime = new DateTime(DateUtils.getNow());\n\n act = new ProjectActivity(startTime, startTime.plusMinutes(45), null);\n assertEquals(0.75, act.getDuration(), 0);\n\n act = new ProjectAct... | {
"fields": [
{
"declarator": "serialVersionUID = 1L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "id",
"modifier": "private",
"... | {
"body": "public final double getDuration() {\n final long timeMilliSec = end.getMillis() - start.getMillis();\n final double timeMin = timeMilliSec / 1000.0 / 60.0;\n return timeMin / 60.0;\n }",
"class_method_signature": "ProjectActivity.getDuration()",
"constructor": false,
"full_sig... | {
"created": "2/28/2012 12:43:31 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3570915,
"size": null,
"stargazer_count": null,
"stars": 54,
"updates": "2020-01-07T15:45:38+00:00",
"url": "https://github.com/Baralga/baralga"
... |
1475915_0 | {
"fields": [],
"file": "project/src/test/java/com/tek271/reverseProxy/model/MappingTest.java",
"identifier": "MappingTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testMapProxyToHidden() {\n String proxyUrl= \"http://localhost:8080/rp/maps/home\";\n String actual= ModelFactory.MAPPING1.mapProxyToHidden(proxyUrl);\n String expected= \"http://maps.google.com/home\";\n assertEquals(expected, actual);\n }",
"class_method_signature": "M... | {
"fields": [
{
"declarator": "hiddenDomain",
"modifier": "public final",
"original_string": "public final String hiddenDomain;",
"type": "String",
"var_name": "hiddenDomain"
},
{
"declarator": "proxyDomain",
"modifier": "public final",
"original_string": "p... | {
"body": "public String mapProxyToHidden(String proxyUrl) {\n String path = extractPath(proxyUrl, proxyDomain, proxyResource);\n return extractProtocol(proxyUrl) + SEP + hiddenDomain + path; \n }",
"class_method_signature": "Mapping.mapProxyToHidden(String proxyUrl)",
"constructor": false,
"full_signatu... | {
"created": null,
"fork": null,
"fork_count": 14,
"is_fork": false,
"language": "Java",
"license": "GNU General Public License v3.0",
"repo_id": 1475915,
"size": 166,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ahabra/reverse-proxy"
} |
1475915_1 | {
"fields": [],
"file": "project/src/test/java/com/tek271/reverseProxy/model/MappingTest.java",
"identifier": "MappingTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testMapHiddenToProxy() {\n String hiddenUrl= \"http://maps.google.com/home\";\n String actual= ModelFactory.MAPPING1.mapHiddenToProxy(hiddenUrl);\n String expected= \"http://localhost:8080/rp/maps/home\";\n assertEquals(expected, actual);\n }",
"class_method_signature": ... | {
"fields": [
{
"declarator": "hiddenDomain",
"modifier": "public final",
"original_string": "public final String hiddenDomain;",
"type": "String",
"var_name": "hiddenDomain"
},
{
"declarator": "proxyDomain",
"modifier": "public final",
"original_string": "p... | {
"body": "public String mapHiddenToProxy(String hiddenUrl) {\n String path = extractPath(hiddenUrl, hiddenDomain, \"\");\n return extractProtocol(hiddenUrl) + SEP + proxy + path;\n }",
"class_method_signature": "Mapping.mapHiddenToProxy(String hiddenUrl)",
"constructor": false,
"full_signature": "public... | {
"created": null,
"fork": null,
"fork_count": 14,
"is_fork": false,
"language": "Java",
"license": "GNU General Public License v3.0",
"repo_id": 1475915,
"size": 166,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ahabra/reverse-proxy"
} |
1475915_6 | {
"fields": [
{
"declarator": "ANCHORE_REGEX= \"<[aA]\\\\b(\\\"[^\\\"]*\\\"|'[^']*'|[^'\\\">])*>\"",
"modifier": "private static final",
"original_string": "private static final String ANCHORE_REGEX= \"<[aA]\\\\b(\\\"[^\\\"]*\\\"|'[^']*'|[^'\\\">])*>\";",
"type": "String",
"var_name"... | {
"body": "@Test\n public void testTranslateAnchor() {\n assertEquals(\"\", target.translateTag(\"\"));\n assertEquals(\"<a></a>\", target.translateTag(\"<a></a>\"));\n assertEquals(\"<a/>\", target.translateTag(\"<a/>\"));\n assertEquals(\"<a href></a>\", target.translateTag(\"<a href></a>\"));\n ass... | {
"fields": [
{
"declarator": "urlMapper",
"modifier": "private final",
"original_string": "private final UrlMapper urlMapper;",
"type": "UrlMapper",
"var_name": "urlMapper"
},
{
"declarator": "tagPattern",
"modifier": "private final",
"original_string": "pr... | {
"body": "@VisibleForTesting\n String translateTag(String tag) {\n Tuple3<Integer, Integer, String> value = attributeValue(tag);\n if (value.isNull()) return tag;\n \n String newUrl = urlMapper.mapContentUrl(value.e3);\n return left(tag, value.e1) + dquoteAround(newUrl) + substring(tag, value.e2);\n ... | {
"created": null,
"fork": null,
"fork_count": 14,
"is_fork": false,
"language": "Java",
"license": "GNU General Public License v3.0",
"repo_id": 1475915,
"size": 166,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ahabra/reverse-proxy"
} |
1475915_12 | {
"fields": [],
"file": "project/src/test/java/com/tek271/reverseProxy/utils/RegexToolsTest.java",
"identifier": "RegexToolsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testFindAllWithGroups() {\n String pattern= \"\\\\bhref\\\\b\\\\s*=\\\\s*(\\\\S*?)[\\\\s>]\";\n String text= \"<A href= a.c at >t</a>\";\n List<Tuple3<Integer, Integer, String>> found = RegexTools.findAll(pattern, text, true);\n assertEquals(1, found.size());\n List<Tupl... | {
"fields": [],
"file": "project/src/main/java/com/tek271/reverseProxy/utils/RegexTools.java",
"identifier": "RegexTools",
"interfaces": "",
"methods": [
{
"class_method_signature": "RegexTools.findAll(Pattern pattern, String text, boolean matchGroups)",
"constructor": false,
"full_signa... | {
"body": "public static List<Tuple3<Integer, Integer, String>> findAll(Pattern pattern, String text, boolean matchGroups) {\n if (StringUtils.isEmpty(text)) return Collections.emptyList();\n \n Matcher matcher = pattern.matcher(text);\n List<Tuple3<Integer, Integer, String>> r= Lists.newArrayList();\n ... | {
"created": null,
"fork": null,
"fork_count": 14,
"is_fork": false,
"language": "Java",
"license": "GNU General Public License v3.0",
"repo_id": 1475915,
"size": 166,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ahabra/reverse-proxy"
} |
1475915_7 | {
"fields": [
{
"declarator": "ANCHORE_REGEX= \"<[aA]\\\\b(\\\"[^\\\"]*\\\"|'[^']*'|[^'\\\">])*>\"",
"modifier": "private static final",
"original_string": "private static final String ANCHORE_REGEX= \"<[aA]\\\\b(\\\"[^\\\"]*\\\"|'[^']*'|[^'\\\">])*>\";",
"type": "String",
"var_name"... | {
"body": "@Test public void testAttributeValue() {\n assertEquals(\"abc\", target.attributeValue(\"<A href='abc'>t</a>\").e3);\n assertEquals(\"abc\", target.attributeValue(\"<A href=\\\"abc\\\">t</a>\").e3);\n assertEquals(\"abc\", target.attributeValue(\"<A href= 'abc' >t</a>\").e3);\n assertEquals(\"... | {
"fields": [
{
"declarator": "urlMapper",
"modifier": "private final",
"original_string": "private final UrlMapper urlMapper;",
"type": "UrlMapper",
"var_name": "urlMapper"
},
{
"declarator": "tagPattern",
"modifier": "private final",
"original_string": "pr... | {
"body": "@VisibleForTesting\n Tuple3<Integer, Integer, String> attributeValue(String tag) {\n String normalized= TextTools.removeControlChars(tag);\n List<Tuple3<Integer, Integer, String>> matches = RegexTools.findAll(attributePattern, normalized, true);\n if (matches.isEmpty()) return Tuple3.nil();\n ... | {
"created": null,
"fork": null,
"fork_count": 14,
"is_fork": false,
"language": "Java",
"license": "GNU General Public License v3.0",
"repo_id": 1475915,
"size": 166,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ahabra/reverse-proxy"
} |
1475915_8 | {
"fields": [
{
"declarator": "FILE= \"reverseProxy.test.properties\"",
"modifier": "private static final",
"original_string": "private static final String FILE= \"reverseProxy.test.properties\";",
"type": "String",
"var_name": "FILE"
}
],
"file": "project/src/test/java/com/t... | {
"body": "@Test\n public void testReadMappings() {\n PropertiesFile propertiesFile= new PropertiesFile(FILE, true);\n Mappings mappings = Properties.readMappings(propertiesFile);\n assertEquals(5, mappings.size());\n assertEquals(\"maps.google.com\", mappings.get(0).hiddenDomain);\n }",
"class_method... | {
"fields": [
{
"declarator": "FILE= \"reverseProxy.properties\"",
"modifier": "private static final",
"original_string": "private static final String FILE= \"reverseProxy.properties\";",
"type": "String",
"var_name": "FILE"
},
{
"declarator": "mappings",
"modifie... | {
"body": "@VisibleForTesting\n static Mappings readMappings(PropertiesFile propertiesFile) {\n Mappings mappings= new Mappings();\n PropertiesFile subset = propertiesFile.subset(\"mapping.\");\n \n for(String key: subset.keys()) {\n String value = subset.getString(key);\n mappings.add( new Map... | {
"created": null,
"fork": null,
"fork_count": 14,
"is_fork": false,
"language": "Java",
"license": "GNU General Public License v3.0",
"repo_id": 1475915,
"size": 166,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ahabra/reverse-proxy"
} |
1475915_10 | {
"fields": [
{
"declarator": "FILE= \"reverseProxy.test.properties\"",
"modifier": "private static final",
"original_string": "private static final String FILE= \"reverseProxy.test.properties\";",
"type": "String",
"var_name": "FILE"
}
],
"file": "project/src/test/java/com/t... | {
"body": "@Test\n public void testSubset() {\n PropertiesFile propertiesFile= new PropertiesFile(FILE);\n PropertiesFile subset = propertiesFile.subset(\"mapping\");\n assertEquals(5, subset.getProperties().size());\n }",
"class_method_signature": "PropertiesFileTest.testSubset()",
"constructor": fals... | {
"fields": [
{
"declarator": "COMMENT = \"#\"",
"modifier": "private static final",
"original_string": "private static final String COMMENT = \"#\";",
"type": "String",
"var_name": "COMMENT"
},
{
"declarator": "EQ = \"=\"",
"modifier": "private static final",
... | {
"body": "public PropertiesFile subset(String keyPrefix) {\n PropertiesFile subset= new PropertiesFile();\n subset.props= Maps.newLinkedHashMap();\n subset.allowInLineComments= allowInLineComments;\n for (Map.Entry<String, String> e: props.entrySet()) {\n String k= e.getKey();\n if (startsWith(... | {
"created": null,
"fork": null,
"fork_count": 14,
"is_fork": false,
"language": "Java",
"license": "GNU General Public License v3.0",
"repo_id": 1475915,
"size": 166,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ahabra/reverse-proxy"
} |
1475915_4 | {
"fields": [
{
"declarator": "target= new TextTranslator(ModelFactory.MAPPING1)",
"modifier": "private",
"original_string": "private TextTranslator target= new TextTranslator(ModelFactory.MAPPING1);",
"type": "TextTranslator",
"var_name": "target"
}
],
"file": "project/src/t... | {
"body": "@Test\n public void testTranslate() {\n assertEquals(\"\", target.translate(\"\"));\n assertEquals(\"\", target.translate(null));\n assertEquals(\"hello\", target.translate(\"hello\"));\n assertEquals(\"<a href=\\\"\\\">click</a>\", target.translate(\"<a href=''>click</a>\"));\n assertEqual... | {
"fields": [
{
"declarator": "ANCHOR= pair(\"<[aA]\\\\b(\\\"[^\\\"]*\\\"|'[^']*'|[^'\\\">])*>\", // match <a .*> tags\n \"\\\\bhref\\\\b\\\\s*=\\\\s*(\\\\S*?)[\\\\s>]\")",
"modifier": "private static final",
"original_string": "private static final ... | {
"body": "public String translate(String text) {\n for (TagTranslator translator : tagTranslators) {\n text= translator.translate(text);\n }\n return text;\n }",
"class_method_signature": "TextTranslator.translate(String text)",
"constructor": false,
"full_signature": "public String translate(St... | {
"created": null,
"fork": null,
"fork_count": 14,
"is_fork": false,
"language": "Java",
"license": "GNU General Public License v3.0",
"repo_id": 1475915,
"size": 166,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ahabra/reverse-proxy"
} |
1475915_5 | {
"fields": [
{
"declarator": "target= new UrlMapper(ModelFactory.MAPPING1)",
"modifier": "private",
"original_string": "private UrlMapper target= new UrlMapper(ModelFactory.MAPPING1);",
"type": "UrlMapper",
"var_name": "target"
}
],
"file": "project/src/test/java/com/tek271/... | {
"body": "@Test\n public void testMapContentUrlUrl() {\n assertEquals(\"http://a.b\", target.mapContentUrl(\"http://a.b\"));\n String prefix = ModelFactory.MAPPING1.proxyResource; // /rp/maps\n assertEquals(prefix + \"/home\", target.mapContentUrl(\"/home\"));\n }",
"class_method_signature": ... | {
"fields": [
{
"declarator": "currentMapping",
"modifier": "private",
"original_string": "private Mapping currentMapping;",
"type": "Mapping",
"var_name": "currentMapping"
}
],
"file": "project/src/main/java/com/tek271/reverseProxy/text/UrlMapper.java",
"identifier": "UrlM... | {
"body": "public String mapContentUrl(String url) {\n if (isEmpty(url)) return EMPTY;\n if (startsWith(url, \"/\")) {\n url = currentMapping.proxyResource + url;\n }\n url= mapFullUrlIfCan(url);\n return url;\n }",
"class_method_signature": "UrlMapper.mapContentUrl(String url)",
"constructor... | {
"created": null,
"fork": null,
"fork_count": 14,
"is_fork": false,
"language": "Java",
"license": "GNU General Public License v3.0",
"repo_id": 1475915,
"size": 166,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ahabra/reverse-proxy"
} |
1475915_11 | {
"fields": [],
"file": "project/src/test/java/com/tek271/reverseProxy/utils/RegexToolsTest.java",
"identifier": "RegexToolsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testFindAll() {\n String pattern= \"A+\";\n String text= \"A-AA-AAA-\";\n List<Tuple3<Integer, Integer, String>> found = RegexTools.findAll(pattern, text, true);\n assertEquals(3, found.size());\n List<Tuple3<Integer, Integer, String>> expected= ImmutableList.of(\n ... | {
"fields": [],
"file": "project/src/main/java/com/tek271/reverseProxy/utils/RegexTools.java",
"identifier": "RegexTools",
"interfaces": "",
"methods": [
{
"class_method_signature": "RegexTools.findAll(Pattern pattern, String text, boolean matchGroups)",
"constructor": false,
"full_signa... | {
"body": "public static List<Tuple3<Integer, Integer, String>> findAll(Pattern pattern, String text, boolean matchGroups) {\n if (StringUtils.isEmpty(text)) return Collections.emptyList();\n \n Matcher matcher = pattern.matcher(text);\n List<Tuple3<Integer, Integer, String>> r= Lists.newArrayList();\n ... | {
"created": null,
"fork": null,
"fork_count": 14,
"is_fork": false,
"language": "Java",
"license": "GNU General Public License v3.0",
"repo_id": 1475915,
"size": 166,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ahabra/reverse-proxy"
} |
1475915_9 | {
"fields": [],
"file": "project/src/test/java/com/tek271/reverseProxy/utils/TextToolsTest.java",
"identifier": "TextToolsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test public void testRemoveControlChars() {\n assertEquals(\"\", TextTools.removeControlChars(null));\n assertEquals(\"\", TextTools.removeControlChars(\"\"));\n assertEquals(\" \", TextTools.removeControlChars(\" \"));\n assertEquals(\" \", TextTools.removeControlChars(\" \\t\\n ... | {
"fields": [],
"file": "project/src/main/java/com/tek271/reverseProxy/utils/TextTools.java",
"identifier": "TextTools",
"interfaces": "",
"methods": [
{
"class_method_signature": "TextTools.dquoteAround(String value)",
"constructor": false,
"full_signature": "public static String dquote... | {
"body": "public static String removeControlChars(String text) {\n StringBuilder sb= new StringBuilder();\n for (int i=0, n=StringUtils.length(text) ; i<n; i++) {\n char ch= text.charAt(i);\n if (ch < ' ') ch= ' ';\n sb.append(ch);\n }\n return sb.toString();\n }",
"class_method_signatu... | {
"created": null,
"fork": null,
"fork_count": 14,
"is_fork": false,
"language": "Java",
"license": "GNU General Public License v3.0",
"repo_id": 1475915,
"size": 166,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ahabra/reverse-proxy"
} |
1475915_2 | {
"fields": [],
"file": "project/src/test/java/com/tek271/reverseProxy/model/MappingsTest.java",
"identifier": "MappingsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test public void testfindByProxyUrl() {\n Mappings mappings= ModelFactory.MAPPINGS;\n assertEquals(mappings.get(0), mappings.findByProxyUrl(\"http://localhost:8080/rp/maps/1\"));\n assertEquals(mappings.get(1), mappings.findByProxyUrl(\"http://localhost:8080/rp/fb/2\"));\n }",
"class_method_si... | {
"fields": [
{
"declarator": "serialVersionUID = 1L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "SEP = \"://\"",
"modifier": "privat... | {
"body": "public Mapping findByProxyUrl(String proxyUrl) {\n String noProtocol= substringAfter(proxyUrl, SEP);\n for (Mapping mapping: this) {\n if (startsWithIgnoreCase(noProtocol, mapping.proxy)) return mapping;\n }\n return null;\n }",
"class_method_signature": "Mappings.findByProxyUrl(String ... | {
"created": null,
"fork": null,
"fork_count": 14,
"is_fork": false,
"language": "Java",
"license": "GNU General Public License v3.0",
"repo_id": 1475915,
"size": 166,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ahabra/reverse-proxy"
} |
1475915_3 | {
"fields": [],
"file": "project/src/test/java/com/tek271/reverseProxy/model/MappingsTest.java",
"identifier": "MappingsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test public void testfindByHiddenUrl() {\n Mappings mappings= ModelFactory.MAPPINGS;\n assertEquals(mappings.get(0), mappings.findByHiddenUrl(\"http://maps.google.com/1\"));\n assertEquals(mappings.get(1), mappings.findByHiddenUrl(\"http://www.facebook.com/2\"));\n }",
"class_method_signature"... | {
"fields": [
{
"declarator": "serialVersionUID = 1L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "SEP = \"://\"",
"modifier": "privat... | {
"body": "public Mapping findByHiddenUrl(String hiddenUrl) {\n String noProtocol= substringAfter(hiddenUrl, SEP);\n for (Mapping mapping: this) {\n if (startsWithIgnoreCase(noProtocol, mapping.hiddenDomain)) return mapping;\n }\n return null;\n }",
"class_method_signature": "Mappings.findByHidden... | {
"created": null,
"fork": null,
"fork_count": 14,
"is_fork": false,
"language": "Java",
"license": "GNU General Public License v3.0",
"repo_id": 1475915,
"size": 166,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ahabra/reverse-proxy"
} |
2383782_172 | {
"fields": [
{
"declarator": "passwordMasker",
"modifier": "private",
"original_string": "private PasswordMasker passwordMasker;",
"type": "PasswordMasker",
"var_name": "passwordMasker"
}
],
"file": "sharelib/oozie/src/test/java/org/apache/oozie/action/hadoop/TestPasswordMas... | {
"body": "@Test\n public void testMaskTwoJavaSystemProps() {\n assertEquals(\"-Djava.sysprop.password=***** -Djava.another.password=*****\",\n passwordMasker.maskPasswordsIfNecessary(\"-Djava.sysprop.password=pwd123 -Djava.another.password=pwd456\"));\n }",
"class_method_signature": "Te... | {
"fields": [
{
"declarator": "PASSWORD_MASK = \"*****\"",
"modifier": "private static final",
"original_string": "private static final String PASSWORD_MASK = \"*****\";",
"type": "String",
"var_name": "PASSWORD_MASK"
},
{
"declarator": "PASSWORD_KEY = \"pass\"",
... | {
"body": "public String maskPasswordsIfNecessary(String unmasked) {\n if (containsPasswordFragment(unmasked)) {\n return maskPasswordFragments(unmasked);\n } else {\n return unmasked;\n }\n }",
"class_method_signature": "PasswordMasker.maskPasswordsIfNecessary(String u... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_28 | {
"fields": [
{
"declarator": "expectedException = ExpectedException.none()",
"modifier": "@Rule\n public final",
"original_string": "@Rule\n public final ExpectedException expectedException = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectedExcepti... | {
"body": "@Test\n public void testClearJobXmls() {\n final ActionAttributesBuilder builder = getBuilderInstance();\n\n for (final String jobXml : JOB_XMLS) {\n builder.withJobXml(jobXml);\n }\n\n builder.clearJobXmls();\n\n final ActionAttributes attributes = builder.... | {
"fields": [
{
"declarator": "resourceManager",
"modifier": "private final",
"original_string": "private final ModifyOnce<String> resourceManager;",
"type": "ModifyOnce<String>",
"var_name": "resourceManager"
},
{
"declarator": "nameNode",
"modifier": "private fi... | {
"body": "public void clearJobXmls() {\n jobXmls.clear();\n }",
"class_method_signature": "ActionAttributesBuilder.clearJobXmls()",
"constructor": false,
"full_signature": "public void clearJobXmls()",
"identifier": "clearJobXmls",
"invocations": [
"clear"
],
"modifiers": "public",
"par... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_6 | {
"fields": [],
"file": "tools/src/test/java/org/apache/oozie/tools/TestECPolicyDisabler.java",
"identifier": "TestECPolicyDisabler",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testServerNotSupportsSetErasureCodingPolicyMethod() {\n MockDistributedFileSystem fs = mock(MockDistributedFileSystem.class);\n when(fs.getErasureCodingPolicy(any())).thenReturn(ReplicationPolicy.OTHER);\n Mockito.doThrow(createNoSuchMethodException()).when(fs).s... | {
"fields": [
{
"declarator": "GETREPLICATIONPOLICY_METHOD = \"getReplicationPolicy\"",
"modifier": "private static final",
"original_string": "private static final String GETREPLICATIONPOLICY_METHOD = \"getReplicationPolicy\";",
"type": "String",
"var_name": "GETREPLICATIONPOLICY_ME... | {
"body": "static Result check(FileSystem fs, Path path) {\n if (fs instanceof DistributedFileSystem && supportsErasureCoding()) {\n System.out.println(\"Found Hadoop that supports Erasure Coding. Trying to disable Erasure Coding for path: \"+ path);\n DistributedFileSystem dfs = (Distrib... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_125 | {
"fields": [
{
"declarator": "expectedException = ExpectedException.none()",
"modifier": "@Rule\n public final",
"original_string": "@Rule\n public final ExpectedException expectedException = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectedExcepti... | {
"body": "@Test\n public void testWorkflowWithoutJoin() {\n final Node a = MapReduceActionBuilder.create().withName(\"A\").build();\n\n MapReduceActionBuilder.create().withName(\"B\").withParent(a).build();\n MapReduceActionBuilder.create().withName(\"C\").withParent(a).build();\n\n fi... | {
"fields": [
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final String name;",
"type": "String",
"var_name": "name"
},
{
"declarator": "start = new Start(\"start\")",
"modifier": "private final",
"original_string": "priva... | {
"body": "public Collection<NodeBase> getNodes() {\n return nodesByName.values();\n }",
"class_method_signature": "Graph.getNodes()",
"constructor": false,
"full_signature": "public Collection<NodeBase> getNodes()",
"identifier": "getNodes",
"invocations": [
"values"
],
"modifiers": "publ... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_90 | {
"fields": [
{
"declarator": "NAME = \"map-reduce-name\"",
"modifier": "static final",
"original_string": "static final String NAME = \"map-reduce-name\";",
"type": "String",
"var_name": "NAME"
},
{
"declarator": "expectedException = ExpectedException.none()",
"m... | {
"body": "@Test\n public void testAddingDuplicateParentBothTimesWithConditionThrows() {\n final N parent = getBuilderInstance().build();\n\n final B builder = getBuilderInstance();\n\n builder.withParentWithCondition(parent, \"condition1\");\n\n expectedException.expect(IllegalArgument... | {
"fields": [
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final ModifyOnce<String> name;",
"type": "ModifyOnce<String>",
"var_name": "name"
},
{
"declarator": "credentials",
"modifier": "private final",
"original_string":... | {
"body": "public B withParentWithCondition(final Node parent, final String condition) {\n checkNoDuplicateParent(parent);\n\n parentsWithConditions.add(new Node.NodeWithCondition(parent, Condition.actualCondition(condition)));\n return ensureRuntimeSelfReference();\n }",
"class_method_signa... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_349 | {
"fields": [
{
"declarator": "services",
"modifier": "protected",
"original_string": "protected Services services;",
"type": "Services",
"var_name": "services"
},
{
"declarator": "hcatServer",
"modifier": "private",
"original_string": "private String hcatSe... | {
"body": "@Test\n public void testComputeNextNominalTime() throws Exception {\n // The 10th minute of every hour\n CoordinatorJobBean job = new CoordinatorJobBean();\n CoordinatorActionBean action = new CoordinatorActionBean();\n job.setFrequency(\"10 * * * *\");\n job.setTimeUn... | {
"fields": [
{
"declarator": "CURRENT = 0",
"modifier": "public static final",
"original_string": "public static final int CURRENT = 0;",
"type": "int",
"var_name": "CURRENT"
},
{
"declarator": "LATEST = 1",
"modifier": "public static final",
"original_stri... | {
"body": "public static Date computeNextNominalTime(CoordinatorJobBean coordJob, CoordinatorActionBean coordAction)\n throws ParseException, JDOMException {\n Date nextNominalTime;\n boolean isCronFrequency = false;\n int freq = -1;\n try {\n freq = Integer.parseInt(... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_86 | {
"fields": [
{
"declarator": "NAME = \"map-reduce-name\"",
"modifier": "static final",
"original_string": "static final String NAME = \"map-reduce-name\";",
"type": "String",
"var_name": "NAME"
},
{
"declarator": "expectedException = ExpectedException.none()",
"m... | {
"body": "@Test\n public void testWithoutErrorHandler() {\n final ErrorHandler errorHandler = ErrorHandler.buildAsErrorHandler(\n MapReduceActionBuilder.create().withName(\"error-handler\"));\n\n final B builder = getBuilderInstance();\n builder.withErrorHandler(errorHandler);\... | {
"fields": [
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final ModifyOnce<String> name;",
"type": "ModifyOnce<String>",
"var_name": "name"
},
{
"declarator": "credentials",
"modifier": "private final",
"original_string":... | {
"body": "public B withoutErrorHandler() {\n errorHandler.set(null);\n return ensureRuntimeSelfReference();\n }",
"class_method_signature": "NodeBuilderBaseImpl.withoutErrorHandler()",
"constructor": false,
"full_signature": "public B withoutErrorHandler()",
"identifier": "withoutErrorHandle... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_133 | {
"fields": [
{
"declarator": "expectedException = ExpectedException.none()",
"modifier": "@Rule\n public final",
"original_string": "@Rule\n public final ExpectedException expectedException = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectedExcepti... | {
"body": "@Test\n public void testRedundantEdge() {\n final Node a = MapReduceActionBuilder.create().withName(\"A\").build();\n\n final Node b = MapReduceActionBuilder.create().withName(\"B\").withParent(a).build();\n final Node c = MapReduceActionBuilder.create().withName(\"C\").withParent(a... | {
"fields": [
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final String name;",
"type": "String",
"var_name": "name"
},
{
"declarator": "start = new Start(\"start\")",
"modifier": "private final",
"original_string": "priva... | {
"body": "public Collection<NodeBase> getNodes() {\n return nodesByName.values();\n }",
"class_method_signature": "Graph.getNodes()",
"constructor": false,
"full_signature": "public Collection<NodeBase> getNodes()",
"identifier": "getNodes",
"invocations": [
"values"
],
"modifiers": "publ... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_69 | {
"fields": [
{
"declarator": "NAME = \"map-reduce-name\"",
"modifier": "private static final",
"original_string": "private static final String NAME = \"map-reduce-name\";",
"type": "String",
"var_name": "NAME"
},
{
"declarator": "NAME_NODE = \"${nameNode}\"",
"mo... | {
"body": "@Test\n public void testSameConfigPropertyAddedTwiceThrows() {\n final MapReduceActionBuilder builder = getBuilderInstance();\n builder.withConfigProperty(MAPRED_JOB_QUEUE_NAME, DEFAULT);\n\n expectedException.expect(IllegalStateException.class);\n builder.withConfigProperty(... | {
"fields": [
{
"declarator": "attributesBuilder",
"modifier": "private final",
"original_string": "private final ActionAttributesBuilder attributesBuilder;",
"type": "ActionAttributesBuilder",
"var_name": "attributesBuilder"
}
],
"file": "fluent-job/fluent-job-api/src/main/j... | {
"body": "public MapReduceActionBuilder withConfigProperty(final String key, final String value) {\n attributesBuilder.withConfigProperty(key, value);\n return this;\n }",
"class_method_signature": "MapReduceActionBuilder.withConfigProperty(final String key, final String value)",
"constructor": ... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_164 | {
"fields": [],
"file": "fluent-job/fluent-job-api/src/test/java/org/apache/oozie/fluentjob/api/workflow/TestCredentialBuilder.java",
"identifier": "TestCredentialBuilder",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCreate() {\n final Credential credential = CredentialBuilder.create()\n .withName(\"hive2\")\n .withType(\"hive\")\n .withConfigurationEntry(\"jdbcUrl\", \"jdbc://localhost/hive\")\n .build();\n\n assertEqu... | {
"fields": [
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final ModifyOnce<String> name;",
"type": "ModifyOnce<String>",
"var_name": "name"
},
{
"declarator": "type",
"modifier": "private final",
"original_string": "priva... | {
"body": "public static CredentialBuilder create() {\n final ModifyOnce<String> name = new ModifyOnce<>();\n final ModifyOnce<String> type = new ModifyOnce<>();\n final List<ConfigurationEntry> configurationEntries = new ArrayList<>();\n\n return new CredentialBuilder(name, type, configur... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_308 | {
"fields": [
{
"declarator": "expectedException = ExpectedException.none()",
"modifier": "@Rule\n public final",
"original_string": "@Rule\n public final ExpectedException expectedException = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectedExcepti... | {
"body": "@Test\n public void testNullFilter() throws ServletException {\n Multimap<String, String> filterMap = FilterParser.parseFilter(null);\n assertEquals(\"Filter map size should be zero for null filter\", 0, filterMap.size());\n }",
"class_method_signature": "TestFilterParser.testNullFilt... | {
"fields": [
{
"declarator": "PARAMETER_DELIMITER = \";\"",
"modifier": "private static final",
"original_string": "private static final String PARAMETER_DELIMITER = \";\";",
"type": "String",
"var_name": "PARAMETER_DELIMITER"
},
{
"declarator": "PARAMETER_EQUALS = \"=... | {
"body": "public static ListMultimap<String, String> parseFilter(String filterString) throws ServletException {\n ListMultimap<String, String> filterFieldMap = LinkedListMultimap.create();\n if (filterString != null) {\n StringTokenizer st = new StringTokenizer(filterString, PARAMETER_DELIMI... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_45 | {
"fields": [
{
"declarator": "expectedException = ExpectedException.none()",
"modifier": "@Rule\n public final",
"original_string": "@Rule\n public final ExpectedException expectedException = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectedExcepti... | {
"body": "@Test\n public void testWithMapperCalledTwiceThrows() {\n final String mapperName1 = \"mapper-name-2.sh\";\n final String mapperName2 = \"mapper-name-2.sh\";\n\n final StreamingBuilder builder = new StreamingBuilder();\n builder.withMapper(mapperName1);\n\n expectedExc... | {
"fields": [
{
"declarator": "mapper",
"modifier": "private final",
"original_string": "private final ModifyOnce<String> mapper;",
"type": "ModifyOnce<String>",
"var_name": "mapper"
},
{
"declarator": "reducer",
"modifier": "private final",
"original_string... | {
"body": "public StreamingBuilder withMapper(final String mapper) {\n this.mapper.set(mapper);\n return this;\n }",
"class_method_signature": "StreamingBuilder.withMapper(final String mapper)",
"constructor": false,
"full_signature": "public StreamingBuilder withMapper(final String mapper)",
... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_236 | {
"fields": [],
"file": "core/src/test/java/org/apache/oozie/util/TestDateUtils.java",
"identifier": "TestDateUtils",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIsThreeLetterTZName() {\n Assert.assertTrue(DateUtils.isThreeLetterTZName(\"PST\"));\n Assert.assertTrue(DateUtils.isThreeLetterTZName(\"PDT\"));\n Assert.assertTrue(DateUtils.isThreeLetterTZName(\"BST\"));\n Assert.assertTrue(DateUtils.isThreeLetterTZ... | {
"fields": [
{
"declarator": "LOG = XLog.getLog(DateUtils.class)",
"modifier": "private static final",
"original_string": "private static final XLog LOG = XLog.getLog(DateUtils.class);",
"type": "XLog",
"var_name": "LOG"
},
{
"declarator": "GMT_OFFSET_COLON_PATTERN = P... | {
"body": "@VisibleForTesting\n static boolean isThreeLetterTZName(String tzId) {\n Matcher m = THREE_LETTER_ID_PATTERN.matcher(tzId);\n return m.matches() && !tzId.equalsIgnoreCase(\"UTC\") && !tzId.equalsIgnoreCase(\"GMT\");\n }",
"class_method_signature": "DateUtils.isThreeLetterTZName(String... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_373 | {
"fields": [
{
"declarator": "mockContext",
"modifier": "@Mock private",
"original_string": "@Mock private ActionExecutor.Context mockContext;",
"type": "ActionExecutor.Context",
"var_name": "mockContext"
},
{
"declarator": "mockScript",
"modifier": "@Mock privat... | {
"body": "@Test\n public void multibyteInputsAreAcceptedInScripts() throws Exception {\n final String testInput = \"林檎\";\n doReturn(mockScript).when(mockElement).getChild(anyString(), any());\n doReturn(\"script\").when(mockScript).getTextTrim();\n doReturn(mockActionConfig).when(mock... | {
"fields": [],
"file": "core/src/main/java/org/apache/oozie/action/hadoop/ScriptLanguageActionExecutor.java",
"identifier": "ScriptLanguageActionExecutor",
"interfaces": "",
"methods": [
{
"class_method_signature": "ScriptLanguageActionExecutor.ScriptLanguageActionExecutor(String type)",
"con... | {
"body": "protected void addScriptToCache(Configuration conf, Element actionXml, Path appPath, Context context)\n throws ActionExecutorException {\n Namespace ns = actionXml.getNamespace();\n String script = actionXml.getChild(\"script\", ns).getTextTrim();\n String name = new Path(script... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_12 | {
"fields": [
{
"declarator": "client = new DiagOozieClient(\"testClient\", null)",
"modifier": "final",
"original_string": "final DiagOozieClient client = new DiagOozieClient(\"testClient\", null);",
"type": "DiagOozieClient",
"var_name": "client"
},
{
"declarator": "t... | {
"body": "@Test\n public void testInstrumentionCanBeRetrieved() throws OozieClientException, IOException {\n final String exampleInstrumentation = \"{\\n\" +\n \" \\\"counters\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"group\\\": \\\"db\\\",\\n\" +\n ... | {
"fields": [
{
"declarator": "client",
"modifier": "private final",
"original_string": "private final OozieClient client;",
"type": "OozieClient",
"var_name": "client"
}
],
"file": "tools/src/main/java/org/apache/oozie/tools/diag/MetricsCollector.java",
"identifier": "Metr... | {
"body": "void storeInstrumentationInfo(final File outputDir) {\n try {\n System.out.print(\"Getting Instrumentation...\");\n final OozieClient.Instrumentation instrumentation = client.getInstrumentation();\n if (instrumentation == null) {\n System.out.println(\... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_148 | {
"fields": [
{
"declarator": "expectedException = ExpectedException.none()",
"modifier": "@Rule\n public final",
"original_string": "@Rule\n public final ExpectedException expectedException = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectedExcepti... | {
"body": "@Test\n public void testClose() {\n final Fork instance = getInstance(\"instance\");\n\n final Join join = new Join(\"join\", instance);\n\n assertEquals(join, instance.getClosingJoin());\n assertTrue(instance.isClosed());\n }",
"class_method_signature": "TestFork.testCl... | {
"fields": [
{
"declarator": "parent",
"modifier": "private",
"original_string": "private NodeBase parent;",
"type": "NodeBase",
"var_name": "parent"
},
{
"declarator": "children",
"modifier": "private final",
"original_string": "private final List<NodeBase... | {
"body": "void close(final Join join) {\n closingJoin.set(join);\n }",
"class_method_signature": "Fork.close(final Join join)",
"constructor": false,
"full_signature": " void close(final Join join)",
"identifier": "close",
"invocations": [
"set"
],
"modifiers": "",
"parameters": "(final... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_261 | {
"fields": [],
"file": "core/src/test/java/org/apache/oozie/util/db/TestSLADbOperations.java",
"identifier": "TestSLADbOperations",
"interfaces": "",
"superclass": ""
} | {
"body": "@SuppressWarnings(\"deprecation\")\n @Test\n public void testCreateSlaRegistrationEventMinReqFields() throws Exception {\n Date nomDate = DateUtils.parseDateOozieTZ(\"2014-01-01T01:01Z\");\n String slaXML = \" <sla:info xmlns:sla='uri:oozie:sla:0.2'>\"\n + \" <sla:nominal... | {
"fields": [
{
"declarator": "CLIENT_ID_TAG = \"oozie:sla:client-id\"",
"modifier": "public static final",
"original_string": "public static final String CLIENT_ID_TAG = \"oozie:sla:client-id\";",
"type": "String",
"var_name": "CLIENT_ID_TAG"
}
],
"file": "core/src/main/java... | {
"body": "public static SLAEventBean createSlaRegistrationEvent(Element eSla, Store store, String slaId, SlaAppType appType, String user,\n String groupName) throws Exception {\n if (eSla == null) {\n return null;\n }\n SLAEventBean sla = new SLAEventBean();\n sla.se... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_324 | {
"fields": [
{
"declarator": "DEFAULT_TYPE = \"test\"",
"modifier": "private static final",
"original_string": "private static final String DEFAULT_TYPE = \"test\";",
"type": "String",
"var_name": "DEFAULT_TYPE"
},
{
"declarator": "DEFAULT_MAX_ACTIVE_COMMANDS = 5",
... | {
"body": "@Test\n public void testSubmissionWhenQueueIsFull() {\n asyncExecutor = createExecutor(true, 2, DEFAULT_MAXWAIT, TEST_PRIORITIES, AWAIT_TERMINATION_TIMEOUT_SECONDS);\n callableWrapper = mock(CallableWrapper.class, Mockito.RETURNS_DEEP_STUBS);\n when(callableWrapper.filterDuplicates(... | {
"fields": [
{
"declarator": "MIN_PRIORITY = 0",
"modifier": "public static final",
"original_string": "public static final int MIN_PRIORITY = 0;",
"type": "int",
"var_name": "MIN_PRIORITY"
},
{
"declarator": "ANTI_STARVATION_INTERVAL = 500",
"modifier": "public ... | {
"body": "public synchronized boolean queue(CallableWrapper<?> wrapper, boolean ignoreQueueSize) {\n if (!ignoreQueueSize && activeCommands.get() >= maxActiveCommands) {\n log.warn(\"queue full, ignoring queuing for [{0}]\", wrapper.getElement().getKey());\n return false;\n }\n\n ... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_277 | {
"fields": [
{
"declarator": "expectedException = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException expectedException = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectedException"
},
... | {
"body": "@Test\n public void testUnclosedCurlyBracket() throws ELEvaluationException {\n expectedException.expect(ELEvaluationException.class);\n StringUtils.checkStaticExistence(\"${\", \",\");\n }",
"class_method_signature": "TestStringUtils.testUnclosedCurlyBracket()",
"constructor": fals... | {
"fields": [],
"file": "core/src/main/java/org/apache/oozie/util/StringUtils.java",
"identifier": "StringUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "StringUtils.trim(String str)",
"constructor": false,
"full_signature": "public static String trim(String str)",
... | {
"body": "public static boolean checkStaticExistence(String expr, String sequence) throws ELEvaluationException {\n int curlyBracketDept = 0;\n int functionDepth = 0;\n int index = 0;\n boolean foundSequence = false;\n while (index < expr.length()) {\n String substring =... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_298 | {
"fields": [],
"file": "core/src/test/java/org/apache/oozie/util/TestParamChecker.java",
"identifier": "TestParamChecker",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIsMember() {\n String[] members = {\"LIFO\", \"FIFO\", \"ONLYLAST\"};\n ParamChecker.isMember(\"FIFO\", members, \"test\");\n try {\n ParamChecker.isMember(\"FIF\", members, \"test\");\n fail();\n }\n catch (Exception ex) {... | {
"fields": [
{
"declarator": "MAX_NODE_NAME_LEN = 128",
"modifier": "private static final",
"original_string": "private static final int MAX_NODE_NAME_LEN = 128;",
"type": "int",
"var_name": "MAX_NODE_NAME_LEN"
}
],
"file": "core/src/main/java/org/apache/oozie/util/ParamChec... | {
"body": "public static boolean isMember(String item, String[] members, String name) {\n for (int i = 0; i < members.length; i++) {\n if (members[i].equals(item)) {\n return true;\n }\n }\n // Error case\n StringBuilder buff = new StringBuilder();\n ... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_332 | {
"fields": [
{
"declarator": "DEFAULT_TYPE = \"test\"",
"modifier": "private static final",
"original_string": "private static final String DEFAULT_TYPE = \"test\";",
"type": "String",
"var_name": "DEFAULT_TYPE"
},
{
"declarator": "DEFAULT_MAX_ACTIVE_COMMANDS = 5",
... | {
"body": "@Test\n public void testPriorityHandling() {\n asyncExecutor = createExecutor(DEFAULT_ENABLE_CONCURRENCY_CHECK, 100, DEFAULT_MAXWAIT, 100,\n AWAIT_TERMINATION_TIMEOUT_SECONDS);\n doAnswer(new Answer<Void>() {\n @Override\n public Void answer(InvocationO... | {
"fields": [
{
"declarator": "MIN_PRIORITY = 0",
"modifier": "public static final",
"original_string": "public static final int MIN_PRIORITY = 0;",
"type": "int",
"var_name": "MIN_PRIORITY"
},
{
"declarator": "ANTI_STARVATION_INTERVAL = 500",
"modifier": "public ... | {
"body": "public synchronized boolean queue(CallableWrapper<?> wrapper, boolean ignoreQueueSize) {\n if (!ignoreQueueSize && activeCommands.get() >= maxActiveCommands) {\n log.warn(\"queue full, ignoring queuing for [{0}]\", wrapper.getElement().getKey());\n return false;\n }\n\n ... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_53 | {
"fields": [
{
"declarator": "expectedException = ExpectedException.none()",
"modifier": "@Rule\n public final",
"original_string": "@Rule\n public final ExpectedException expectedException = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectedExcepti... | {
"body": "@Test\n public void testMapCalledTwiceThrows() {\n final String map1 = \"map1\";\n final String map2 = \"map2\";\n\n final PipesBuilder builder = new PipesBuilder();\n builder.withMap(map1);\n\n expectedException.expect(IllegalStateException.class);\n builder.wi... | {
"fields": [
{
"declarator": "map",
"modifier": "private final",
"original_string": "private final ModifyOnce<String> map;",
"type": "ModifyOnce<String>",
"var_name": "map"
},
{
"declarator": "reduce",
"modifier": "private final",
"original_string": "privat... | {
"body": "public PipesBuilder withMap(final String map) {\n this.map.set(map);\n return this;\n }",
"class_method_signature": "PipesBuilder.withMap(final String map)",
"constructor": false,
"full_signature": "public PipesBuilder withMap(final String map)",
"identifier": "withMap",
"invocat... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_109 | {
"fields": [
{
"declarator": "NAME_NODE = \"${nameNode}\"",
"modifier": "private static final",
"original_string": "private static final String NAME_NODE = \"${nameNode}\";",
"type": "String",
"var_name": "NAME_NODE"
},
{
"declarator": "JOB_XMLS = {\"jobXml1.xml\", \"j... | {
"body": "@Test\n public void testClearJobXmls() {\n final FSActionBuilder builder = getBuilderInstance();\n\n for (final String jobXml : JOB_XMLS) {\n builder.withJobXml(jobXml);\n }\n\n builder.clearJobXmls();\n\n final FSAction fsAction = builder.build();\n\n ... | {
"fields": [
{
"declarator": "attributesBuilder",
"modifier": "private final",
"original_string": "private final ActionAttributesBuilder attributesBuilder;",
"type": "ActionAttributesBuilder",
"var_name": "attributesBuilder"
}
],
"file": "fluent-job/fluent-job-api/src/main/j... | {
"body": "public FSActionBuilder clearJobXmls() {\n attributesBuilder.clearJobXmls();\n return this;\n }",
"class_method_signature": "FSActionBuilder.clearJobXmls()",
"constructor": false,
"full_signature": "public FSActionBuilder clearJobXmls()",
"identifier": "clearJobXmls",
"invocations... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_220 | {
"fields": [
{
"declarator": "CREATED_TIME = \"Thu, 01 Jan 2009 00:00:00 GMT\"",
"modifier": "static",
"original_string": "static String CREATED_TIME = \"Thu, 01 Jan 2009 00:00:00 GMT\";",
"type": "String",
"var_name": "CREATED_TIME"
},
{
"declarator": "START_TIME = \"... | {
"body": "@SuppressWarnings(\"unchecked\")\n @Test\n public void testParseWorkflowJobs() {\n JSONArray array = createJsonWorkflowJobList();\n List<WorkflowJob> list = JsonToBean.createWorkflowJobList(array);\n\n assertEquals(2, list.size());\n assertEquals(\"j1\", list.get(0).getId(... | {
"fields": [
{
"declarator": "WF_JOB = new HashMap<String, Property>()",
"modifier": "@VisibleForTesting\n static final",
"original_string": "@VisibleForTesting\n static final Map<String, Property> WF_JOB = new HashMap<String, Property>();",
"type": "Map<String, Property>",
"v... | {
"body": "public static List<WorkflowJob> createWorkflowJobList(JSONArray json) {\n List<WorkflowJob> list = new ArrayList<WorkflowJob>();\n for (Object obj : json) {\n list.add(createWorkflowJob((JSONObject) obj));\n }\n return list;\n }",
"class_method_signature": "JsonT... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_365 | {
"fields": [
{
"declarator": "expectedException = ExpectedException.none()",
"modifier": "@Rule\n public final",
"original_string": "@Rule\n public final ExpectedException expectedException = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectedExcepti... | {
"body": "@Test\n public void whenUOMIsIncorrectException() {\n expectedException.expect(IllegalArgumentException.class);\n\n new BytesAndUOMConverter().toMegabytes(\"123T\");\n }",
"class_method_signature": "TestBytesAndUOMConverter.whenUOMIsIncorrectException()",
"constructor": false,
"fu... | {
"fields": [
{
"declarator": "LOG = XLog.getLog(BytesAndUOMConverter.class)",
"modifier": "private static final",
"original_string": "private static final XLog LOG = XLog.getLog(BytesAndUOMConverter.class);",
"type": "XLog",
"var_name": "LOG"
}
],
"file": "core/src/main/java... | {
"body": "long toMegabytes(final String unitAndUOM) {\n Preconditions.checkArgument(!Strings.isNullOrEmpty(unitAndUOM), \"unitAndUOM should not be empty\");\n Preconditions.checkArgument(unitAndUOM.toUpperCase().endsWith(\"K\")\n || unitAndUOM.toUpperCase().endsWith(\"M\")\n ... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_312 | {
"fields": [
{
"declarator": "expectedException = ExpectedException.none()",
"modifier": "@Rule\n public final",
"original_string": "@Rule\n public final ExpectedException expectedException = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectedExcepti... | {
"body": "@Test\n public void testTooManyEquals() throws ServletException {\n expectedException.expect(ServletException.class);\n FilterParser.parseFilter(\"key=value1=value2\");\n }",
"class_method_signature": "TestFilterParser.testTooManyEquals()",
"constructor": false,
"full_signature": ... | {
"fields": [
{
"declarator": "PARAMETER_DELIMITER = \";\"",
"modifier": "private static final",
"original_string": "private static final String PARAMETER_DELIMITER = \";\";",
"type": "String",
"var_name": "PARAMETER_DELIMITER"
},
{
"declarator": "PARAMETER_EQUALS = \"=... | {
"body": "public static ListMultimap<String, String> parseFilter(String filterString) throws ServletException {\n ListMultimap<String, String> filterFieldMap = LinkedListMultimap.create();\n if (filterString != null) {\n StringTokenizer st = new StringTokenizer(filterString, PARAMETER_DELIMI... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_257 | {
"fields": [
{
"declarator": "predicate =\n new PersistenceExceptionSubclassFilterRetryPredicate()",
"modifier": "private final",
"original_string": "private final PersistenceExceptionSubclassFilterRetryPredicate predicate =\n new PersistenceExceptionSubclassFilterRetryPre... | {
"body": "@Test\n public void testNestedFilteredJPAExceptions() {\n assertFalse(predicate.test(wrapCause(new EntityExistsException())));\n assertFalse(predicate.test(wrapCause(new EntityNotFoundException())));\n assertFalse(predicate.test(wrapCause(new LockTimeoutException())));\n asse... | {
"fields": [
{
"declarator": "LOG = XLog.getLog(PersistenceExceptionSubclassFilterRetryPredicate.class)",
"modifier": "private static final",
"original_string": "private static final XLog LOG = XLog.getLog(PersistenceExceptionSubclassFilterRetryPredicate.class);",
"type": "XLog",
"v... | {
"body": "@Override\n public boolean test(final Throwable throwable) {\n LOG.trace(\"Retry predicate investigation started. [throwable.class={0}]\", throwable.getClass().getName());\n\n boolean applies = true;\n\n if ((throwable.getCause() == null) && BLACKLIST_WITHOUT_CAUSE.contains(throwabl... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_24 | {
"fields": [
{
"declarator": "NAME = \"sqoop-name\"",
"modifier": "private static final",
"original_string": "private static final String NAME = \"sqoop-name\";",
"type": "String",
"var_name": "NAME"
},
{
"declarator": "NAME_NODE = \"${nameNode}\"",
"modifier": "... | {
"body": "@Test\n public void testSameConfigPropertyAddedTwiceThrows() {\n final SqoopActionBuilder builder = getBuilderInstance();\n builder.withConfigProperty(MAPRED_JOB_QUEUE_NAME, DEFAULT);\n\n expectedException.expect(IllegalStateException.class);\n builder.withConfigProperty(MAPR... | {
"fields": [
{
"declarator": "attributesBuilder",
"modifier": "private final",
"original_string": "private final ActionAttributesBuilder attributesBuilder;",
"type": "ActionAttributesBuilder",
"var_name": "attributesBuilder"
},
{
"declarator": "command",
"modifie... | {
"body": "public SqoopActionBuilder withConfigProperty(final String key, final String value) {\n this.attributesBuilder.withConfigProperty(key, value);\n return this;\n }",
"class_method_signature": "SqoopActionBuilder.withConfigProperty(final String key, final String value)",
"constructor": fal... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_191 | {
"fields": [
{
"declarator": "conf",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Configuration conf;",
"type": "Configuration",
"var_name": "conf"
}
],
"file": "sharelib/oozie/src/test/java/org/apache/oozie/action/hadoop/TestLauncherAMUtils.java"... | {
"body": "@Test\n public void testArgsHandlingWhenArgsContainsNullsOnlyAndNullsNotAllowed() {\n setupConf(Arrays.asList(null, null, null));\n setEnableNullArgsAllowed(false);\n\n String args[] = LauncherAMUtils.getMainArguments(conf);\n\n assertTrue(Arrays.equals(new String[] {}, args)... | {
"fields": [
{
"declarator": "CONF_OOZIE_ACTION_MAIN_CLASS = \"oozie.launcher.action.main.class\"",
"modifier": "static final",
"original_string": "static final String CONF_OOZIE_ACTION_MAIN_CLASS = \"oozie.launcher.action.main.class\";",
"type": "String",
"var_name": "CONF_OOZIE_AC... | {
"body": "public static String[] getMainArguments(Configuration conf) {\n String[] args = new String[conf.getInt(CONF_OOZIE_ACTION_MAIN_ARG_COUNT, 0)];\n\n String[] retArray;\n\n if (conf.getBoolean(CONF_OOZIE_NULL_ARGS_ALLOWED, true)) {\n for (int i = 0; i < args.length; i++) {\n ... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_345 | {
"fields": [
{
"declarator": "services",
"modifier": "protected",
"original_string": "protected Services services;",
"type": "Services",
"var_name": "services"
},
{
"declarator": "hcatServer",
"modifier": "private",
"original_string": "private String hcatSe... | {
"body": "@Test\n public void testDryRunPullDeps() {\n\n try {\n CoordinatorJobBean job = addRecordToCoordJobTableForWaiting(\"coord-job-for-matd-hcat.xml\",\n CoordinatorJob.Status.RUNNING, false, true);\n\n Path appPath = new Path(getFsTestCaseDir(), \"coord\");\n... | {
"fields": [
{
"declarator": "CURRENT = 0",
"modifier": "public static final",
"original_string": "public static final int CURRENT = 0;",
"type": "int",
"var_name": "CURRENT"
},
{
"declarator": "LATEST = 1",
"modifier": "public static final",
"original_stri... | {
"body": "static String dryRunCoord(Element eAction, CoordinatorActionBean actionBean) throws Exception {\n String action = XmlUtils.prettyPrint(eAction).toString();\n StringBuilder actionXml = new StringBuilder(action);\n Configuration actionConf = new XConfiguration(new StringReader(actionBean... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_200 | {
"fields": [
{
"declarator": "SPARK_DEFAULTS_PROPERTIES = \"spark-defaults.conf\"",
"modifier": "private static final",
"original_string": "private static final String SPARK_DEFAULTS_PROPERTIES = \"spark-defaults.conf\";",
"type": "String",
"var_name": "SPARK_DEFAULTS_PROPERTIES"
... | {
"body": "@Test\n public void testYarnClientExecutorAndDriverExtraClasspathsArgsParsing() throws Exception {\n final Configuration actionConf = new Configuration();\n actionConf.set(SparkActionExecutor.SPARK_MASTER, \"yarn\");\n actionConf.set(SparkActionExecutor.SPARK_MODE, \"client\");\n ... | {
"fields": [
{
"declarator": "SPARK_DEFAULTS_FILE_PATTERN = Pattern.compile(\"spark-defaults.conf\")",
"modifier": "private static final",
"original_string": "private static final Pattern SPARK_DEFAULTS_FILE_PATTERN = Pattern.compile(\"spark-defaults.conf\");",
"type": "Pattern",
"v... | {
"body": "List<String> extract(final String[] mainArgs) throws OozieActionConfiguratorException, IOException, URISyntaxException {\n final List<String> sparkArgs = new ArrayList<>();\n\n sparkArgs.add(MASTER_OPTION);\n final String master = actionConf.get(SparkActionExecutor.SPARK_MASTER);\n ... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_129 | {
"fields": [
{
"declarator": "expectedException = ExpectedException.none()",
"modifier": "@Rule\n public final",
"original_string": "@Rule\n public final ExpectedException expectedException = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectedExcepti... | {
"body": "@Test\n public void testSplittingJoins() {\n final Node a = MapReduceActionBuilder.create().withName(\"A\").build();\n\n final Node b = MapReduceActionBuilder.create().withName(\"B\").withParent(a).build();\n final Node c = MapReduceActionBuilder.create().withName(\"C\").withParent(... | {
"fields": [
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final String name;",
"type": "String",
"var_name": "name"
},
{
"declarator": "start = new Start(\"start\")",
"modifier": "private final",
"original_string": "priva... | {
"body": "public Collection<NodeBase> getNodes() {\n return nodesByName.values();\n }",
"class_method_signature": "Graph.getNodes()",
"constructor": false,
"full_signature": "public Collection<NodeBase> getNodes()",
"identifier": "getNodes",
"invocations": [
"values"
],
"modifiers": "publ... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_73 | {
"fields": [
{
"declarator": "NAME = \"hive-name\"",
"modifier": "private static final",
"original_string": "private static final String NAME = \"hive-name\";",
"type": "String",
"var_name": "NAME"
},
{
"declarator": "NAME_NODE = \"${nameNode}\"",
"modifier": "pr... | {
"body": "@Test\n public void testClearArgs() {\n final HiveActionBuilder builder = getBuilderInstance();\n\n for (final String file : ARGS) {\n builder.withArg(file);\n }\n\n builder.clearArgs();\n\n final HiveAction action = builder.build();\n\n final List<St... | {
"fields": [
{
"declarator": "delegate",
"modifier": "private final",
"original_string": "private final PigActionBuilder delegate;",
"type": "PigActionBuilder",
"var_name": "delegate"
},
{
"declarator": "query",
"modifier": "protected final",
"original_stri... | {
"body": "public HiveActionBuilder clearArgs() {\n this.delegate.clearArgs();\n return this;\n }",
"class_method_signature": "HiveActionBuilder.clearArgs()",
"constructor": false,
"full_signature": "public HiveActionBuilder clearArgs()",
"identifier": "clearArgs",
"invocations": [
"cle... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_353 | {
"fields": [
{
"declarator": "TZ_DST = TimeZone.getTimeZone(\"America/Los_Angeles\")",
"modifier": "private final static",
"original_string": "private final static TimeZone TZ_DST = TimeZone.getTimeZone(\"America/Los_Angeles\");",
"type": "TimeZone",
"var_name": "TZ_DST"
},
... | {
"body": "@Test\n public void testCalculateGivenStandardTZGivesZeroOffset() throws ParseException {\n final DaylightOffsetCalculator standardStartAndDSTEndCalculator = new DaylightOffsetCalculator(\n DateUtils.parseDateOozieTZ(\"2013-01-18T00:00Z\"),\n DateUtils.parseDateOozie... | {
"fields": [
{
"declarator": "startMatdTime",
"modifier": "private final",
"original_string": "private final Date startMatdTime;",
"type": "Date",
"var_name": "startMatdTime"
},
{
"declarator": "endMatdTime",
"modifier": "private final",
"original_string": ... | {
"body": "Calendar calculate(final TimeZone tz, final Calendar target) {\n final Calendar targetWithDSTOffset = Calendar.getInstance();\n targetWithDSTOffset.setTimeInMillis(target.getTime().getTime() + getDSTOffset(tz, startMatdTime, endMatdTime));\n\n return targetWithDSTOffset;\n }",
"cl... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_216 | {
"fields": [],
"file": "client/src/test/java/org/apache/oozie/client/rest/TestJsonUtils.java",
"identifier": "TestJsonUtils",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testNullDate() {\n assertEquals(null, JsonUtils.formatDateRfc822(null));\n }",
"class_method_signature": "TestJsonUtils.testNullDate()",
"constructor": false,
"full_signature": "@Test public void testNullDate()",
"identifier": "testNullDate",
"invocations": [
... | {
"fields": [
{
"declarator": "GMT_TZ = TimeZone.getTimeZone(\"GMT\")",
"modifier": "private static",
"original_string": "private static TimeZone GMT_TZ = TimeZone.getTimeZone(\"GMT\");",
"type": "TimeZone",
"var_name": "GMT_TZ"
}
],
"file": "client/src/main/java/org/apache/o... | {
"body": "public static String formatDateRfc822(Date date, String timeZoneId) {\n if (date != null) {\n TimeZone tZone = \"GMT\".equals(timeZoneId) ? GMT_TZ : TimeZone.getTimeZone(timeZoneId);\n SimpleDateFormat dateFormater = new SimpleDateFormat(\"EEE, dd MMM yyyy HH:mm:ss zzz\", Local... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_65 | {
"fields": [],
"file": "fluent-job/fluent-job-api/src/test/java/org/apache/oozie/fluentjob/api/action/TestChmodBuilder.java",
"identifier": "TestChmodBuilder",
"interfaces": "",
"superclass": "extends TestChBaseBuilder<Chmod, ChmodBuilder>"
} | {
"body": "@Test\n public void testWithPermissionsCalledTwiceThrows() {\n final String permission1 = \"-rwxrw-rw-\";\n final String permission2 = \"-rwxrw-r-\";\n\n final ChmodBuilder builder = new ChmodBuilder();\n builder.withPermissions(permission1);\n\n expectedException.expe... | {
"fields": [
{
"declarator": "permissions",
"modifier": "private final",
"original_string": "private final ModifyOnce<String> permissions;",
"type": "ModifyOnce<String>",
"var_name": "permissions"
}
],
"file": "fluent-job/fluent-job-api/src/main/java/org/apache/oozie/fluentj... | {
"body": "public ChmodBuilder withPermissions(final String permissions) {\n this.permissions.set(permissions);\n return this;\n }",
"class_method_signature": "ChmodBuilder.withPermissions(final String permissions)",
"constructor": false,
"full_signature": "public ChmodBuilder withPermissions(f... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_304 | {
"fields": [
{
"declarator": "EXTERNAL_ENTITY_XML = \"<!DOCTYPE foo [<!ENTITY xxe SYSTEM \\\"file:///etc/passwd\\\">]>\\n\"\n + \"<foo>&xxe;</foo>\"",
"modifier": "private static",
"original_string": "private static String EXTERNAL_ENTITY_XML = \"<!DOCTYPE foo [<!ENTITY xxe SYSTEM \\... | {
"body": "@Test\n public void testExternalEntity() throws Exception {\n try {\n XmlUtils.parseXml(EXTERNAL_ENTITY_XML);\n fail(\"DOCTYPE should not be allowed\");\n } catch (JDOMParseException e) {\n assertTrue(\"Exception has different message.\", e.getMessage().\n ... | {
"fields": [],
"file": "core/src/main/java/org/apache/oozie/util/XmlUtils.java",
"identifier": "XmlUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "XmlUtils.createSAXBuilder()",
"constructor": false,
"full_signature": "private static SAXBuilder createSAXBuilder()",
... | {
"body": "public static Element parseXml(String xmlStr) throws JDOMException {\n Objects.requireNonNull(xmlStr, \"xmlStr cannot be null\");\n try {\n SAXBuilder saxBuilder = createSAXBuilder();\n Document document = saxBuilder.build(new StringReader(xmlStr));\n return d... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_241 | {
"fields": [],
"file": "core/src/test/java/org/apache/oozie/util/TestELConstantsFunctions.java",
"identifier": "TestELConstantsFunctions",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testTimestamp() throws Exception {\n String s = ELConstantsFunctions.timestamp();\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm'Z'\");\n sdf.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n assertNotNull(sdf.parse(s));\n }",
"class_m... | {
"fields": [
{
"declarator": "KB = 1024",
"modifier": "public static final",
"original_string": "public static final long KB = 1024;",
"type": "long",
"var_name": "KB"
},
{
"declarator": "MB = KB * 1024",
"modifier": "public static final",
"original_string"... | {
"body": "public static String timestamp() {\n return DateUtils.formatDateOozieTZ(new Date());\n }",
"class_method_signature": "ELConstantsFunctions.timestamp()",
"constructor": false,
"full_signature": "public static String timestamp()",
"identifier": "timestamp",
"invocations": [
"formatDat... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_168 | {
"fields": [
{
"declarator": "passwordMasker",
"modifier": "private",
"original_string": "private PasswordMasker passwordMasker;",
"type": "PasswordMasker",
"var_name": "passwordMasker"
}
],
"file": "sharelib/oozie/src/test/java/org/apache/oozie/action/hadoop/TestPasswordMas... | {
"body": "@Test\n public void testWhenOSEnvIsAskedPasswordsAppearMasked() throws Exception {\n Map<String, String> masked = passwordMasker.mask(jsonToMap(\"/instrumentation-os-env.json\"));\n\n assertPasswordValueIsMasked(masked, \"HADOOP_CREDSTORE_PASSWORD\");\n assertPasswordValueIsMasked(m... | {
"fields": [
{
"declarator": "PASSWORD_MASK = \"*****\"",
"modifier": "private static final",
"original_string": "private static final String PASSWORD_MASK = \"*****\";",
"type": "String",
"var_name": "PASSWORD_MASK"
},
{
"declarator": "PASSWORD_KEY = \"pass\"",
... | {
"body": "public Map<String, String> mask(Map<String, String> unmasked) {\n return Maps.transformEntries(unmasked, new Maps.EntryTransformer<String, String, String>() {\n @Override\n public String transformEntry(@Nonnull String key, @Nonnull String value) {\n return mask(k... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_187 | {
"fields": [
{
"declarator": "DEFAULT_CONTAINER_ID = \"container_1479473450392_0001_01_000001\"",
"modifier": "private static final",
"original_string": "private static final String DEFAULT_CONTAINER_ID = \"container_1479473450392_0001_01_000001\";",
"type": "String",
"var_name": "D... | {
"body": "@Test(expected = RuntimeException.class)\n public void testLauncherJobConfCannotBeLoaded() throws Exception {\n given(localFsOperationsMock.readLauncherConf()).willThrow(new RuntimeException());\n LauncherAM.readLauncherConfiguration(localFsOperationsMock);\n }",
"class_method_signatu... | {
"fields": [
{
"declarator": "OOZIE_ACTION_CONF_XML = \"oozie.action.conf.xml\"",
"modifier": "public static final",
"original_string": "public static final String OOZIE_ACTION_CONF_XML = \"oozie.action.conf.xml\";",
"type": "String",
"var_name": "OOZIE_ACTION_CONF_XML"
},
{... | {
"body": "static Configuration readLauncherConfiguration(LocalFsOperations localFsOperations) {\n Configuration launcherConf = null;\n try {\n launcherConf = localFsOperations.readLauncherConf();\n System.out.println(\"Launcher AM configuration loaded\");\n } catch (Excepti... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_32 | {
"fields": [
{
"declarator": "expectedException = ExpectedException.none()",
"modifier": "@Rule\n public final",
"original_string": "@Rule\n public final ExpectedException expectedException = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectedExcepti... | {
"body": "@Test\n public void testWithoutDelete() {\n final ActionAttributesBuilder builder = getBuilderInstance();\n\n for (final Delete delete : DELETES) {\n builder.withDelete(delete);\n }\n\n builder.withoutDelete(DELETES[0]);\n\n final ActionAttributes attributes... | {
"fields": [
{
"declarator": "resourceManager",
"modifier": "private final",
"original_string": "private final ModifyOnce<String> resourceManager;",
"type": "ModifyOnce<String>",
"var_name": "resourceManager"
},
{
"declarator": "nameNode",
"modifier": "private fi... | {
"body": "void withoutDelete(final Delete delete) {\n deletes.remove(delete);\n }",
"class_method_signature": "ActionAttributesBuilder.withoutDelete(final Delete delete)",
"constructor": false,
"full_signature": " void withoutDelete(final Delete delete)",
"identifier": "withoutDelete",
"invocatio... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_390 | {
"fields": [],
"file": "core/src/test/java/org/apache/oozie/coord/input/logic/TestInputLogicParser.java",
"identifier": "TestInputLogicParser",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testWithNameNested() throws JDOMException {\n //@formatter:off\n String xml =\n \"<input-logic>\" +\n \"<and>\" +\n \"<or>\" +\n \"<data-in dataset=\\\"A\\\"/> \" +\n ... | {
"fields": [
{
"declarator": "COORD_INPUT_EVENTS_DATA_IN = \"data-in\"",
"modifier": "public final static",
"original_string": "public final static String COORD_INPUT_EVENTS_DATA_IN = \"data-in\";",
"type": "String",
"var_name": "COORD_INPUT_EVENTS_DATA_IN"
},
{
"decla... | {
"body": "@SuppressWarnings(\"unchecked\")\n public String parseWithName(Element root, String name) {\n if (root == null) {\n return \"\";\n }\n StringBuilder parsedString = new StringBuilder();\n\n List<Element> childrens = root.getChildren();\n for (int i = 0; i < c... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_406 | {
"fields": [
{
"declarator": "mockJspHandler",
"modifier": "@Mock private",
"original_string": "@Mock private JspHandler mockJspHandler;",
"type": "JspHandler",
"var_name": "mockJspHandler"
},
{
"declarator": "mockServices",
"modifier": "@Mock private",
"or... | {
"body": "@Test\n public void testSecureServerSetup() throws Exception {\n doReturn(\"true\").when(mockConfiguration).get(\"oozie.https.enabled\");\n\n ServerConnector mockSecuredServerConnector = new ServerConnector(embeddedOozieServer.server);\n doReturn(mockSecuredServerConnector)\n ... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(EmbeddedOozieServer.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(EmbeddedOozieServer.class);",
"type": "Logger",
"var_name": "LOG"
},
{
... | {
"body": "public void setup() throws URISyntaxException, IOException, ServiceException {\n conf = serviceController.get(ConfigurationService.class).getConf();\n setContextPath(conf);\n httpPort = getConfigPort(ConfigUtils.OOZIE_HTTP_PORT);\n\n HttpConfiguration httpConfiguration = new Htt... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_49 | {
"fields": [
{
"declarator": "expectedException = ExpectedException.none()",
"modifier": "@Rule\n public final",
"original_string": "@Rule\n public final ExpectedException expectedException = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectedExcepti... | {
"body": "@Test\n public void testWithRecordReaderCalledTwiceThrows() {\n final String recordReaderName1 = \"record-reader-name1.sh\";\n final String recordReaderName2 = \"record-reader-name2.sh\";\n\n final StreamingBuilder builder = new StreamingBuilder();\n builder.withRecordReader(... | {
"fields": [
{
"declarator": "mapper",
"modifier": "private final",
"original_string": "private final ModifyOnce<String> mapper;",
"type": "ModifyOnce<String>",
"var_name": "mapper"
},
{
"declarator": "reducer",
"modifier": "private final",
"original_string... | {
"body": "public StreamingBuilder withRecordReader(final String recordReader) {\n this.recordReader.set(recordReader);\n return this;\n }",
"class_method_signature": "StreamingBuilder.withRecordReader(final String recordReader)",
"constructor": false,
"full_signature": "public StreamingBuilder... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_113 | {
"fields": [
{
"declarator": "NAME_NODE = \"${nameNode}\"",
"modifier": "private static final",
"original_string": "private static final String NAME_NODE = \"${nameNode}\";",
"type": "String",
"var_name": "NAME_NODE"
},
{
"declarator": "JOB_XMLS = {\"jobXml1.xml\", \"j... | {
"body": "@Test\n public void testWithoutMkdir() {\n final FSActionBuilder builder = getBuilderInstance();\n\n for (final Mkdir mkdir : MKDIRS) {\n builder.withMkdir(mkdir);\n }\n\n builder.withoutMkdir(MKDIRS[0]);\n\n final FSAction fsAction = builder.build();\n\n ... | {
"fields": [
{
"declarator": "attributesBuilder",
"modifier": "private final",
"original_string": "private final ActionAttributesBuilder attributesBuilder;",
"type": "ActionAttributesBuilder",
"var_name": "attributesBuilder"
}
],
"file": "fluent-job/fluent-job-api/src/main/j... | {
"body": "public FSActionBuilder withoutMkdir(final Mkdir mkdir) {\n attributesBuilder.withoutMkdir(mkdir);\n return this;\n }",
"class_method_signature": "FSActionBuilder.withoutMkdir(final Mkdir mkdir)",
"constructor": false,
"full_signature": "public FSActionBuilder withoutMkdir(final Mkdir... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_282 | {
"fields": [],
"file": "core/src/test/java/org/apache/oozie/util/TestByteArrayUtils.java",
"identifier": "TestByteArrayUtils",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testByteArrayInterningGivesSameInstances() {\n final int byteArrayCount = 1000;\n final int elementCount = 100;\n final byte[][] sameContent = new byte[byteArrayCount][];\n\n for (int i = 0; i < byteArrayCount; i++) {\n final byte[] source = new... | {
"fields": [
{
"declarator": "BYTE_BUFFER_INTERNER = Interners.newWeakInterner()",
"modifier": "private static final",
"original_string": "private static final Interner<ByteBuffer> BYTE_BUFFER_INTERNER = Interners.newWeakInterner();",
"type": "Interner<ByteBuffer>",
"var_name": "BYT... | {
"body": "public static byte[] weakIntern(final byte[] values) {\n if (values == null) {\n return values;\n }\n\n return BYTE_BUFFER_INTERNER.intern(ByteBuffer.wrap(values)).array();\n }",
"class_method_signature": "ByteArrayUtils.weakIntern(final byte[] values)",
"constructor"... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_328 | {
"fields": [
{
"declarator": "DEFAULT_TYPE = \"test\"",
"modifier": "private static final",
"original_string": "private static final String DEFAULT_TYPE = \"test\";",
"type": "String",
"var_name": "DEFAULT_TYPE"
},
{
"declarator": "DEFAULT_MAX_ACTIVE_COMMANDS = 5",
... | {
"body": "@Test\n public void testAntiStarvationWhenDelayIsAboveMaxWait() {\n asyncExecutor = createExecutor(DEFAULT_ENABLE_CONCURRENCY_CHECK, DEFAULT_MAX_ACTIVE_COMMANDS, 500, TEST_PRIORITIES,\n AWAIT_TERMINATION_TIMEOUT_SECONDS);\n when(callableWrapper.getDelay(eq(TimeUnit.MILLISECO... | {
"fields": [
{
"declarator": "MIN_PRIORITY = 0",
"modifier": "public static final",
"original_string": "public static final int MIN_PRIORITY = 0;",
"type": "int",
"var_name": "MIN_PRIORITY"
},
{
"declarator": "ANTI_STARVATION_INTERVAL = 500",
"modifier": "public ... | {
"body": "public void checkMaxConcurrency(String type) {\n Set<CallableWrapper<?>> commandsForType = pendingCommandsPerType.get(type);\n\n if (commandsForType != null) {\n // Only a single thread should be doing stuff here! Reason: concurrent executions might\n // submit an eligib... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_144 | {
"fields": [
{
"declarator": "expectedException = ExpectedException.none()",
"modifier": "@Rule\n public final",
"original_string": "@Rule\n public final ExpectedException expectedException = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectedExcepti... | {
"body": "@Test\n public void testStartAddedAsParentWhenItAlreadyHasAChildThrows() {\n final Start start = getInstance(\"start\");\n final NodeBase child1 = new ExplicitNode(\"child1\", null);\n final NodeBase child2 = new ExplicitNode(\"child2\", null);\n\n child1.addParent(start);\n\... | {
"fields": [
{
"declarator": "child",
"modifier": "private",
"original_string": "private NodeBase child;",
"type": "NodeBase",
"var_name": "child"
}
],
"file": "fluent-job/fluent-job-api/src/main/java/org/apache/oozie/fluentjob/api/dag/Start.java",
"identifier": "Start",
... | {
"body": "@Override\n public void addParent(final NodeBase parent) {\n throw new IllegalStateException(\"Start nodes cannot have parents.\");\n }",
"class_method_signature": "Start.addParent(final NodeBase parent)",
"constructor": false,
"full_signature": "@Override public void addParent(final Nod... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_294 | {
"fields": [],
"file": "core/src/test/java/org/apache/oozie/util/TestParamChecker.java",
"identifier": "TestParamChecker",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCheckGEZero() {\n assertEquals(120, ParamChecker.checkGEZero(120, \"test\"));\n assertEquals(0, ParamChecker.checkGEZero(0, \"test\"));\n try {\n ParamChecker.checkGEZero(-1, \"test\");\n fail();\n }\n catch (Exception ex) ... | {
"fields": [
{
"declarator": "MAX_NODE_NAME_LEN = 128",
"modifier": "private static final",
"original_string": "private static final int MAX_NODE_NAME_LEN = 128;",
"type": "int",
"var_name": "MAX_NODE_NAME_LEN"
}
],
"file": "core/src/main/java/org/apache/oozie/util/ParamChec... | {
"body": "public static int checkGEZero(int value, String name) {\n if (value < 0) {\n throw new IllegalArgumentException(XLog.format(\n \"parameter [{0}] = [{1}] must be greater than or equals zero\", name, value));\n }\n return value;\n }",
"class_method_sign... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_152 | {
"fields": [],
"file": "fluent-job/fluent-job-api/src/test/java/org/apache/oozie/fluentjob/api/dag/TestJoiningNodeBase.java",
"identifier": "TestJoiningNodeBase",
"interfaces": "",
"superclass": "extends TestNodeBase<JoiningNodeBase<B>>"
} | {
"body": "@Test\n public void testGetChildren() {\n final J instance = getJoiningInstance(\"instance\");\n final NodeBase child = new ExplicitNode(\"child\", null);\n\n child.addParent(instance);\n\n assertEquals(Arrays.asList(child), instance.getChildren());\n }",
"class_method_s... | {
"fields": [
{
"declarator": "parents",
"modifier": "private final",
"original_string": "private final List<NodeBase> parents;",
"type": "List<NodeBase>",
"var_name": "parents"
},
{
"declarator": "child",
"modifier": "private",
"original_string": "private N... | {
"body": "@Override\n public List<NodeBase> getChildren() {\n if (child == null) {\n return Arrays.asList();\n }\n\n return Arrays.asList(child);\n }",
"class_method_signature": "JoiningNodeBase.getChildren()",
"constructor": false,
"full_signature": "@Override public List... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_386 | {
"fields": [],
"file": "core/src/test/java/org/apache/oozie/coord/input/logic/TestInputLogicParser.java",
"identifier": "TestInputLogicParser",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testOrWithMin() throws JDOMException {\n //@formatter:off\n String xml = \"<input-logic>\" + \"<or>\" + \"<data-in dataset=\\\"A\\\" min=\\\"3\\\"/> \" + \"<data-in dataset=\\\"B\\\"/>\" + \"</or>\"\n + \"</input-logic>\";\n //@formatter:on\n ... | {
"fields": [
{
"declarator": "COORD_INPUT_EVENTS_DATA_IN = \"data-in\"",
"modifier": "public final static",
"original_string": "public final static String COORD_INPUT_EVENTS_DATA_IN = \"data-in\";",
"type": "String",
"var_name": "COORD_INPUT_EVENTS_DATA_IN"
},
{
"decla... | {
"body": "public String parse(Element root) {\n return parseWithName(root, null);\n\n }",
"class_method_signature": "InputLogicParser.parse(Element root)",
"constructor": false,
"full_signature": "public String parse(Element root)",
"identifier": "parse",
"invocations": [
"parseWithName"
],... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_369 | {
"fields": [
{
"declarator": "expectedException = ExpectedException.none()",
"modifier": "@Rule\n public final",
"original_string": "@Rule\n public final ExpectedException expectedException = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectedExcepti... | {
"body": "@Test\n public void whenUnitIsGivenAndNoUOMIsPresentConvertedCorrectly() {\n assertEquals(\"bytes count should be converted correctly\",\n 1L,\n new BytesAndUOMConverter().toMegabytes(\n Integer.toString(new Double(Math.pow(2, 20)).intValue()))... | {
"fields": [
{
"declarator": "LOG = XLog.getLog(BytesAndUOMConverter.class)",
"modifier": "private static final",
"original_string": "private static final XLog LOG = XLog.getLog(BytesAndUOMConverter.class);",
"type": "XLog",
"var_name": "LOG"
}
],
"file": "core/src/main/java... | {
"body": "long toMegabytes(final String unitAndUOM) {\n Preconditions.checkArgument(!Strings.isNullOrEmpty(unitAndUOM), \"unitAndUOM should not be empty\");\n Preconditions.checkArgument(unitAndUOM.toUpperCase().endsWith(\"K\")\n || unitAndUOM.toUpperCase().endsWith(\"M\")\n ... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_105 | {
"fields": [
{
"declarator": "NAME = \"shell-name\"",
"modifier": "private static final",
"original_string": "private static final String NAME = \"shell-name\";",
"type": "String",
"var_name": "NAME"
},
{
"declarator": "NAME_NODE = \"${nameNode}\"",
"modifier": "... | {
"body": "@Test\n public void testSameConfigPropertyAddedTwiceThrows() {\n final ShellActionBuilder builder = getBuilderInstance();\n builder.withConfigProperty(MAPRED_JOB_QUEUE_NAME, DEFAULT);\n\n expectedException.expect(IllegalStateException.class);\n builder.withConfigProperty(MAPR... | {
"fields": [
{
"declarator": "attributesBuilder",
"modifier": "private final",
"original_string": "private final ActionAttributesBuilder attributesBuilder;",
"type": "ActionAttributesBuilder",
"var_name": "attributesBuilder"
},
{
"declarator": "executable",
"modi... | {
"body": "public ShellActionBuilder withConfigProperty(final String key, final String value) {\n this.attributesBuilder.withConfigProperty(key, value);\n return this;\n }",
"class_method_signature": "ShellActionBuilder.withConfigProperty(final String key, final String value)",
"constructor": fal... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_104 | {
"fields": [],
"file": "fluent-job/fluent-job-api/src/test/java/org/apache/oozie/fluentjob/api/action/TestEmailActionBuilder.java",
"identifier": "TestEmailActionBuilder",
"interfaces": "",
"superclass": "extends TestNodeBuilderBaseImpl<EmailAction, EmailActionBuilder>"
} | {
"body": "@Test\n public void testAttachmentAddedTwiceThrows() {\n final EmailActionBuilder builder = getBuilderInstance();\n builder.withAttachment(\"attachment\");\n\n expectedException.expect(IllegalStateException.class);\n builder.withAttachment(\"any_attachment\");\n }",
"cla... | {
"fields": [
{
"declarator": "to",
"modifier": "private final",
"original_string": "private final ModifyOnce<String> to;",
"type": "ModifyOnce<String>",
"var_name": "to"
},
{
"declarator": "cc",
"modifier": "private final",
"original_string": "private final... | {
"body": "public EmailActionBuilder withAttachment(final String attachment) {\n this.attachment.set(attachment);\n return this;\n }",
"class_method_signature": "EmailActionBuilder.withAttachment(final String attachment)",
"constructor": false,
"full_signature": "public EmailActionBuilder withA... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_387 | {
"fields": [],
"file": "core/src/test/java/org/apache/oozie/coord/input/logic/TestInputLogicParser.java",
"identifier": "TestInputLogicParser",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testOrWithMinAtOr() throws JDOMException {\n //@formatter:off\n String xml =\n \"<input-logic>\" +\n \"<or min=\\\"10\\\">\" +\n \"<data-in dataset=\\\"A\\\"/> \" +\n \"<data-in ... | {
"fields": [
{
"declarator": "COORD_INPUT_EVENTS_DATA_IN = \"data-in\"",
"modifier": "public final static",
"original_string": "public final static String COORD_INPUT_EVENTS_DATA_IN = \"data-in\";",
"type": "String",
"var_name": "COORD_INPUT_EVENTS_DATA_IN"
},
{
"decla... | {
"body": "public String parse(Element root) {\n return parseWithName(root, null);\n\n }",
"class_method_signature": "InputLogicParser.parse(Element root)",
"constructor": false,
"full_signature": "public String parse(Element root)",
"identifier": "parse",
"invocations": [
"parseWithName"
],... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_368 | {
"fields": [
{
"declarator": "expectedException = ExpectedException.none()",
"modifier": "@Rule\n public final",
"original_string": "@Rule\n public final ExpectedException expectedException = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectedExcepti... | {
"body": "@Test\n public void whenNotPositiveUnitIsGivenException() {\n expectedException.expect(IllegalArgumentException.class);\n\n new BytesAndUOMConverter().toMegabytes(\"0K\");\n }",
"class_method_signature": "TestBytesAndUOMConverter.whenNotPositiveUnitIsGivenException()",
"constructor"... | {
"fields": [
{
"declarator": "LOG = XLog.getLog(BytesAndUOMConverter.class)",
"modifier": "private static final",
"original_string": "private static final XLog LOG = XLog.getLog(BytesAndUOMConverter.class);",
"type": "XLog",
"var_name": "LOG"
}
],
"file": "core/src/main/java... | {
"body": "long toMegabytes(final String unitAndUOM) {\n Preconditions.checkArgument(!Strings.isNullOrEmpty(unitAndUOM), \"unitAndUOM should not be empty\");\n Preconditions.checkArgument(unitAndUOM.toUpperCase().endsWith(\"K\")\n || unitAndUOM.toUpperCase().endsWith(\"M\")\n ... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_153 | {
"fields": [
{
"declarator": "expectedException = ExpectedException.none()",
"modifier": "@Rule\n public final",
"original_string": "@Rule\n public final ExpectedException expectedException = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectedExcepti... | {
"body": "@Test\n public void testRealNode() {\n final Node node = MapReduceActionBuilder.create().build();\n final ExplicitNode instance = new ExplicitNode(NAME, node);\n\n assertEquals(node, instance.getRealNode());\n }",
"class_method_signature": "TestExplicitNode.testRealNode()",
"... | {
"fields": [
{
"declarator": "parent",
"modifier": "private",
"original_string": "private NodeBase parent;",
"type": "NodeBase",
"var_name": "parent"
},
{
"declarator": "child",
"modifier": "private",
"original_string": "private NodeBase child;",
"typ... | {
"body": "public Node getRealNode() {\n return realNode;\n }",
"class_method_signature": "ExplicitNode.getRealNode()",
"constructor": false,
"full_signature": "public Node getRealNode()",
"identifier": "getRealNode",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "N... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_295 | {
"fields": [],
"file": "core/src/test/java/org/apache/oozie/util/TestParamChecker.java",
"identifier": "TestParamChecker",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCheckInteger() {\n assertEquals(120, ParamChecker.checkInteger(\"120\", \"test\"));\n assertEquals(-12, ParamChecker.checkInteger(\"-12\", \"test\"));\n try {\n ParamChecker.checkInteger(\"ABCD\", \"test\");\n fail();\n }\n ... | {
"fields": [
{
"declarator": "MAX_NODE_NAME_LEN = 128",
"modifier": "private static final",
"original_string": "private static final int MAX_NODE_NAME_LEN = 128;",
"type": "int",
"var_name": "MAX_NODE_NAME_LEN"
}
],
"file": "core/src/main/java/org/apache/oozie/util/ParamChec... | {
"body": "public static int checkInteger(String val, String name) {\n int ret;\n try {\n ret = Integer.parseInt(val);\n }\n catch (NumberFormatException nex) {\n throw new IllegalArgumentException(XLog.format(\n \"parameter [{0}] = [{1}] must be a... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_145 | {
"fields": [
{
"declarator": "expectedException = ExpectedException.none()",
"modifier": "@Rule\n public final",
"original_string": "@Rule\n public final ExpectedException expectedException = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectedExcepti... | {
"body": "@Test\n public void testGetChildren() {\n final Start start = getInstance(\"start\");\n final NodeBase child = new ExplicitNode(\"child\", null);\n\n child.addParent(start);\n\n assertEquals(Arrays.asList(child), start.getChildren());\n }",
"class_method_signature": "Tes... | {
"fields": [
{
"declarator": "child",
"modifier": "private",
"original_string": "private NodeBase child;",
"type": "NodeBase",
"var_name": "child"
}
],
"file": "fluent-job/fluent-job-api/src/main/java/org/apache/oozie/fluentjob/api/dag/Start.java",
"identifier": "Start",
... | {
"body": "@Override\n public List<NodeBase> getChildren() {\n if (child == null) {\n return Arrays.asList();\n }\n\n return Arrays.asList(child);\n }",
"class_method_signature": "Start.getChildren()",
"constructor": false,
"full_signature": "@Override public List<NodeBase>... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_283 | {
"fields": [],
"file": "core/src/test/java/org/apache/oozie/util/TestPriorityDelayQueue.java",
"identifier": "TestPriorityDelayQueue",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testPoll() throws Exception {\n PriorityDelayQueue<Integer> q = new PriorityDelayQueue<Integer>(3, 500, TimeUnit.MILLISECONDS, -1);\n\n //test immediate offer polling\n\n q.offer(new TestQueueElement<Integer>(1));\n assertEquals((Integer) 1, q.poll().getEl... | {
"fields": [
{
"declarator": "ANTI_STARVATION_INTERVAL = 500",
"modifier": "public static final",
"original_string": "public static final long ANTI_STARVATION_INTERVAL = 500;",
"type": "long",
"var_name": "ANTI_STARVATION_INTERVAL"
},
{
"declarator": "priorities",
... | {
"body": "@Override\n public QueueElement<E> poll() {\n lock.lock();\n try {\n antiStarvation();\n QueueElement<E> e = null;\n int i = priorities;\n for (; e == null && i > 0; i--) {\n e = queues[i - 1].poll();\n }\n if... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_329 | {
"fields": [
{
"declarator": "DEFAULT_TYPE = \"test\"",
"modifier": "private static final",
"original_string": "private static final String DEFAULT_TYPE = \"test\";",
"type": "String",
"var_name": "DEFAULT_TYPE"
},
{
"declarator": "DEFAULT_MAX_ACTIVE_COMMANDS = 5",
... | {
"body": "@Test\n public void testAntiStarvationWhenDelayIsBelowMaxWait() {\n when(callableWrapper.getDelay(eq(TimeUnit.MILLISECONDS))).thenReturn(-200L);\n when(callableWrapper.getPriority()).thenReturn(0);\n pendingCommandsPerType.put(DEFAULT_TYPE, Sets.newHashSet(callableWrapper));\n\n ... | {
"fields": [
{
"declarator": "MIN_PRIORITY = 0",
"modifier": "public static final",
"original_string": "public static final int MIN_PRIORITY = 0;",
"type": "int",
"var_name": "MIN_PRIORITY"
},
{
"declarator": "ANTI_STARVATION_INTERVAL = 500",
"modifier": "public ... | {
"body": "public void checkMaxConcurrency(String type) {\n Set<CallableWrapper<?>> commandsForType = pendingCommandsPerType.get(type);\n\n if (commandsForType != null) {\n // Only a single thread should be doing stuff here! Reason: concurrent executions might\n // submit an eligib... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_407 | {
"fields": [
{
"declarator": "mockJspHandler",
"modifier": "@Mock private",
"original_string": "@Mock private JspHandler mockJspHandler;",
"type": "JspHandler",
"var_name": "mockJspHandler"
},
{
"declarator": "mockServices",
"modifier": "@Mock private",
"or... | {
"body": "@Test(expected=NumberFormatException.class)\n public void numberFormatExceptionThrownWithInvalidHttpPort() throws ServiceException, IOException, URISyntaxException {\n doReturn(\"INVALID_PORT\").when(mockConfiguration).get(\"oozie.http.port\");\n embeddedOozieServer.setup();\n }",
"cl... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(EmbeddedOozieServer.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(EmbeddedOozieServer.class);",
"type": "Logger",
"var_name": "LOG"
},
{
... | {
"body": "public void setup() throws URISyntaxException, IOException, ServiceException {\n conf = serviceController.get(ConfigurationService.class).getConf();\n setContextPath(conf);\n httpPort = getConfigPort(ConfigUtils.OOZIE_HTTP_PORT);\n\n HttpConfiguration httpConfiguration = new Htt... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_48 | {
"fields": [
{
"declarator": "expectedException = ExpectedException.none()",
"modifier": "@Rule\n public final",
"original_string": "@Rule\n public final ExpectedException expectedException = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectedExcepti... | {
"body": "@Test\n public void testWithRecordReader() {\n final String recordReaderName = \"record-reader-name.sh\";\n\n final StreamingBuilder builder = new StreamingBuilder();\n builder.withRecordReader(recordReaderName);\n\n final Streaming streaming = builder.build();\n asser... | {
"fields": [
{
"declarator": "mapper",
"modifier": "private final",
"original_string": "private final ModifyOnce<String> mapper;",
"type": "ModifyOnce<String>",
"var_name": "mapper"
},
{
"declarator": "reducer",
"modifier": "private final",
"original_string... | {
"body": "public StreamingBuilder withRecordReader(final String recordReader) {\n this.recordReader.set(recordReader);\n return this;\n }",
"class_method_signature": "StreamingBuilder.withRecordReader(final String recordReader)",
"constructor": false,
"full_signature": "public StreamingBuilder... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_112 | {
"fields": [
{
"declarator": "NAME_NODE = \"${nameNode}\"",
"modifier": "private static final",
"original_string": "private static final String NAME_NODE = \"${nameNode}\";",
"type": "String",
"var_name": "NAME_NODE"
},
{
"declarator": "JOB_XMLS = {\"jobXml1.xml\", \"j... | {
"body": "@Test\n public void testClearDeletes() {\n final FSActionBuilder builder = getBuilderInstance();\n\n for (final Delete delete : DELETES) {\n builder.withDelete(delete);\n }\n\n builder.clearDeletes();\n\n final FSAction fsAction = builder.build();\n\n ... | {
"fields": [
{
"declarator": "attributesBuilder",
"modifier": "private final",
"original_string": "private final ActionAttributesBuilder attributesBuilder;",
"type": "ActionAttributesBuilder",
"var_name": "attributesBuilder"
}
],
"file": "fluent-job/fluent-job-api/src/main/j... | {
"body": "public FSActionBuilder clearDeletes() {\n attributesBuilder.clearDeletes();\n return this;\n }",
"class_method_signature": "FSActionBuilder.clearDeletes()",
"constructor": false,
"full_signature": "public FSActionBuilder clearDeletes()",
"identifier": "clearDeletes",
"invocations... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_391 | {
"fields": [],
"file": "core/src/test/java/org/apache/oozie/coord/input/logic/TestInputLogicParser.java",
"identifier": "TestInputLogicParser",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDepth2() throws JDOMException {\n //@formatter:off\n String xml =\n \"<input-logic>\" +\n \"<and>\" +\n \"<and>\" +\n \"<or>\" +\n \"<data-in dataset=\\\... | {
"fields": [
{
"declarator": "COORD_INPUT_EVENTS_DATA_IN = \"data-in\"",
"modifier": "public final static",
"original_string": "public final static String COORD_INPUT_EVENTS_DATA_IN = \"data-in\";",
"type": "String",
"var_name": "COORD_INPUT_EVENTS_DATA_IN"
},
{
"decla... | {
"body": "public String parse(Element root) {\n return parseWithName(root, null);\n\n }",
"class_method_signature": "InputLogicParser.parse(Element root)",
"constructor": false,
"full_signature": "public String parse(Element root)",
"identifier": "parse",
"invocations": [
"parseWithName"
],... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_169 | {
"fields": [
{
"declarator": "passwordMasker",
"modifier": "private",
"original_string": "private PasswordMasker passwordMasker;",
"type": "PasswordMasker",
"var_name": "passwordMasker"
}
],
"file": "sharelib/oozie/src/test/java/org/apache/oozie/action/hadoop/TestPasswordMas... | {
"body": "@Test\n public void testMaskNothing() {\n assertEquals(\"abcd\", passwordMasker.maskPasswordsIfNecessary(\"abcd\"));\n assertEquals(\"abcd abcd\", passwordMasker.maskPasswordsIfNecessary(\"abcd abcd\"));\n assertEquals(\"-Djava.net.pasX=pwd1\", passwordMasker.maskPasswordsIfNecessar... | {
"fields": [
{
"declarator": "PASSWORD_MASK = \"*****\"",
"modifier": "private static final",
"original_string": "private static final String PASSWORD_MASK = \"*****\";",
"type": "String",
"var_name": "PASSWORD_MASK"
},
{
"declarator": "PASSWORD_KEY = \"pass\"",
... | {
"body": "public String maskPasswordsIfNecessary(String unmasked) {\n if (containsPasswordFragment(unmasked)) {\n return maskPasswordFragments(unmasked);\n } else {\n return unmasked;\n }\n }",
"class_method_signature": "PasswordMasker.maskPasswordsIfNecessary(String u... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_186 | {
"fields": [],
"file": "sharelib/oozie/src/test/java/org/apache/oozie/action/hadoop/security/TestAllowAllPolicy.java",
"identifier": "TestAllowAllPolicy",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testAllowAllPolicy() throws Exception {\n final AllowAllPolicy policy = new AllowAllPolicy();\n final PermissionCollection collection = policy.getPermissions((CodeSource) null);\n final Enumeration<Permission> elements = collection.elements();\n assertTrue... | {
"fields": [
{
"declarator": "perms",
"modifier": "private",
"original_string": "private PermissionCollection perms;",
"type": "PermissionCollection",
"var_name": "perms"
}
],
"file": "sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/security/AllowAllPolicy.java",... | {
"body": "public AllowAllPolicy() {\n super();\n perms = new AllPermissionCollection();\n perms.add(new AllPermission());\n }",
"class_method_signature": "AllowAllPolicy.AllowAllPolicy()",
"constructor": true,
"full_signature": "public AllowAllPolicy()",
"identifier": "AllowAllPolicy... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_33 | {
"fields": [
{
"declarator": "expectedException = ExpectedException.none()",
"modifier": "@Rule\n public final",
"original_string": "@Rule\n public final ExpectedException expectedException = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectedExcepti... | {
"body": "@Test\n public void testClearDeletes() {\n final ActionAttributesBuilder builder = getBuilderInstance();\n\n for (final Delete delete : DELETES) {\n builder.withDelete(delete);\n }\n\n builder.clearDeletes();\n\n final ActionAttributes attributes = builder.b... | {
"fields": [
{
"declarator": "resourceManager",
"modifier": "private final",
"original_string": "private final ModifyOnce<String> resourceManager;",
"type": "ModifyOnce<String>",
"var_name": "resourceManager"
},
{
"declarator": "nameNode",
"modifier": "private fi... | {
"body": "void clearDeletes() {\n deletes.clear();\n }",
"class_method_signature": "ActionAttributesBuilder.clearDeletes()",
"constructor": false,
"full_signature": " void clearDeletes()",
"identifier": "clearDeletes",
"invocations": [
"clear"
],
"modifiers": "",
"parameters": "()",
"... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_305 | {
"fields": [
{
"declarator": "EXTERNAL_ENTITY_XML = \"<!DOCTYPE foo [<!ENTITY xxe SYSTEM \\\"file:///etc/passwd\\\">]>\\n\"\n + \"<foo>&xxe;</foo>\"",
"modifier": "private static",
"original_string": "private static String EXTERNAL_ENTITY_XML = \"<!DOCTYPE foo [<!ENTITY xxe SYSTEM \\... | {
"body": "@Test\n public void testRemoveComments() throws Exception {\n String xmlStr = \"<test1> <!-- Comment1 -->1234 <test2> ABCD <!-- Comment2 --> </test2> \"\n + \"<!-- Comment3 --> <test3> <!-- Comment4 -->EFGH </test3> <!-- Comment5 --></test1>\";\n String result = XmlUtils.re... | {
"fields": [],
"file": "core/src/main/java/org/apache/oozie/util/XmlUtils.java",
"identifier": "XmlUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "XmlUtils.createSAXBuilder()",
"constructor": false,
"full_signature": "private static SAXBuilder createSAXBuilder()",
... | {
"body": "public static String removeComments(String xmlStr) throws JDOMException {\n if (xmlStr == null) {\n return null;\n }\n try {\n SAXBuilder saxBuilder = createSAXBuilder();\n Document document = saxBuilder.build(new StringReader(xmlStr));\n rem... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_240 | {
"fields": [],
"file": "core/src/test/java/org/apache/oozie/util/TestELConstantsFunctions.java",
"identifier": "TestELConstantsFunctions",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testAppendAll() {\n assertEquals(\"/a/b/ADD,/c/b/ADD,/c/d/ADD\", ELConstantsFunctions.appendAll(\"/a/b/,/c/b/,/c/d/\", \"ADD\", \",\"));\n assertEquals(\"/a/b/ADD\", ELConstantsFunctions.appendAll(\"/a/b/\", \"ADD\", \",\"));\n assertEquals(\" /a/b/ ADD,/c/b/ AD... | {
"fields": [
{
"declarator": "KB = 1024",
"modifier": "public static final",
"original_string": "public static final long KB = 1024;",
"type": "long",
"var_name": "KB"
},
{
"declarator": "MB = KB * 1024",
"modifier": "public static final",
"original_string"... | {
"body": "public static String appendAll(String src, String append, String delimeter) {\n if (src != null && delimeter != null) {\n if (append == null) {\n append = \"\";\n }\n String[] ret = src.split(delimeter);\n StringBuilder result = new StringBu... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_64 | {
"fields": [],
"file": "fluent-job/fluent-job-api/src/test/java/org/apache/oozie/fluentjob/api/action/TestChmodBuilder.java",
"identifier": "TestChmodBuilder",
"interfaces": "",
"superclass": "extends TestChBaseBuilder<Chmod, ChmodBuilder>"
} | {
"body": "@Test\n public void testWithPermissions() {\n final String permission = \"-rwxrw-rw-\";\n\n final ChmodBuilder builder = new ChmodBuilder();\n builder.withPermissions(permission);\n\n final Chmod chmod = builder.build();\n assertEquals(permission, chmod.getPermissions(... | {
"fields": [
{
"declarator": "permissions",
"modifier": "private final",
"original_string": "private final ModifyOnce<String> permissions;",
"type": "ModifyOnce<String>",
"var_name": "permissions"
}
],
"file": "fluent-job/fluent-job-api/src/main/java/org/apache/oozie/fluentj... | {
"body": "public ChmodBuilder withPermissions(final String permissions) {\n this.permissions.set(permissions);\n return this;\n }",
"class_method_signature": "ChmodBuilder.withPermissions(final String permissions)",
"constructor": false,
"full_signature": "public ChmodBuilder withPermissions(f... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
2383782_352 | {
"fields": [
{
"declarator": "TZ_DST = TimeZone.getTimeZone(\"America/Los_Angeles\")",
"modifier": "private final static",
"original_string": "private final static TimeZone TZ_DST = TimeZone.getTimeZone(\"America/Los_Angeles\");",
"type": "TimeZone",
"var_name": "TZ_DST"
},
... | {
"body": "@Test\n public void testCalculateBetweenStandardStartAndDSTEndGivesNegativeOffset() throws ParseException {\n final DaylightOffsetCalculator standardStartAndDSTEndCalculator = new DaylightOffsetCalculator(\n DateUtils.parseDateOozieTZ(\"2013-01-18T00:00Z\"),\n DateUt... | {
"fields": [
{
"declarator": "startMatdTime",
"modifier": "private final",
"original_string": "private final Date startMatdTime;",
"type": "Date",
"var_name": "startMatdTime"
},
{
"declarator": "endMatdTime",
"modifier": "private final",
"original_string": ... | {
"body": "Calendar calculate(final TimeZone tz, final Calendar target) {\n final Calendar targetWithDSTOffset = Calendar.getInstance();\n targetWithDSTOffset.setTimeInMillis(target.getTime().getTime() + getDSTOffset(tz, startMatdTime, endMatdTime));\n\n return targetWithDSTOffset;\n }",
"cl... | {
"created": "9/14/2011 7:00:10 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2383782,
"size": null,
"stargazer_count": null,
"stars": 542,
"updates": "2020-01-18T12:54:24+00:00",
"url": "https://github.com/apache/oozie"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.