id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
23062279_79 | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger (JsonReaderTest.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger (JsonReaderTest.class);",
"type": "Logger",
"var_name": "LOGGER"
}
],
... | {
"body": "@Test\n public void testParseWithComments ()\n {\n for (final String sJson : new String [] { \"true\",\n \" true\",\n \" /* x */ true /* y */ \",\n \"/* a *//* b */fal... | {
"fields": [
{
"declarator": "DEFAULT_CHARSET = StandardCharsets.UTF_8",
"modifier": "public static final",
"original_string": "public static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8;",
"type": "Charset",
"var_name": "DEFAULT_CHARSET"
},
{
"declarator": "... | {
"body": "@Nonnull\n public static Builder builder ()\n {\n return new Builder ();\n }",
"class_method_signature": "JsonReader.builder()",
"constructor": false,
"full_signature": "@Nonnull public static Builder builder()",
"identifier": "builder",
"invocations": [],
"modifiers": "@Nonnull public st... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_775 | {
"fields": [
{
"declarator": "I1 = Integer.valueOf (1)",
"modifier": "private static final",
"original_string": "private static final Integer I1 = Integer.valueOf (1);",
"type": "Integer",
"var_name": "I1"
},
{
"declarator": "I2 = Integer.valueOf (2)",
"modifier"... | {
"body": "@Test\n public void testFirstElement ()\n {\n assertEquals (\"d\", getFirst (\"d\", \"c\", \"b\", \"a\"));\n assertNull (getFirst ((String []) null));\n assertNull (getFirst (new String [0]));\n }",
"class_method_signature": "ArrayHelperTest.testFirstElement()",
"constructor": false,
"ful... | {
"fields": [
{
"declarator": "EMPTY_BOOLEAN_ARRAY = new boolean [0]",
"modifier": "public static final",
"original_string": "public static final boolean [] EMPTY_BOOLEAN_ARRAY = new boolean [0];",
"type": "boolean []",
"var_name": "EMPTY_BOOLEAN_ARRAY"
},
{
"declarator... | {
"body": "public static boolean getFirst (@Nullable final boolean [] aArray, final boolean aDefaultValue)\n {\n return isEmpty (aArray) ? aDefaultValue : aArray[0];\n }",
"class_method_signature": "ArrayHelper.getFirst(@Nullable final boolean [] aArray, final boolean aDefaultValue)",
"constructor": false,
... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_702 | {
"fields": [
{
"declarator": "L_DE = new Locale (\"de\")",
"modifier": "private static final",
"original_string": "private static final Locale L_DE = new Locale (\"de\");",
"type": "Locale",
"var_name": "L_DE"
}
],
"file": "ph-commons/src/test/java/com/helger/commons/string/... | {
"body": "@Test\n public void testTrimEndRepeatedlyString ()\n {\n assertEquals (\"Hallo Welt\", StringHelper.trimEndRepeatedly (\"Hallo Welt\", \"\"));\n assertEquals (\"Hallo Welt\", StringHelper.trimEndRepeatedly (\"Hallo Welt\", \"asd\"));\n assertEquals (\" Hallo We\", StringHelper.trimEndRepeatedly ... | {
"fields": [
{
"declarator": "STRING_NOT_FOUND = -1",
"modifier": "public static final",
"original_string": "public static final int STRING_NOT_FOUND = -1;",
"type": "int",
"var_name": "STRING_NOT_FOUND"
},
{
"declarator": "s_aSizeTableInt = { 9, 99, 999, 9999, 99999, ... | {
"body": "@Nullable\n @CheckReturnValue\n public static String trimEndRepeatedly (@Nullable final String sSrc, @Nullable final String sTail)\n {\n if (hasNoText (sSrc))\n return sSrc;\n\n final int nTailLength = getLength (sTail);\n if (nTailLength == 0)\n return sSrc;\n\n String ret = sSrc;... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_352 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/io/file/PathOperationsTest.java",
"identifier": "PathOperationsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCopyFile ()\n {\n final Path aPath = Paths.get (\"dummy.txt\");\n final Path aPath2 = Paths.get (\"dummy2.txt\");\n try\n {\n assertFalse (Files.isRegularFile (aPath));\n assertFalse (Files.isRegularFile (aPath2));\n\n _expectedError (PathOperations.copy... | {
"fields": [
{
"declarator": "DEFAULT_EXCEPTION_ON_DELETE_ROOT = true",
"modifier": "public static final",
"original_string": "public static final boolean DEFAULT_EXCEPTION_ON_DELETE_ROOT = true;",
"type": "boolean",
"var_name": "DEFAULT_EXCEPTION_ON_DELETE_ROOT"
},
{
... | {
"body": "@Nonnull\n public static FileIOError copyFile (@Nonnull final Path aSourceFile, @Nonnull final Path aTargetFile)\n {\n ValueEnforcer.notNull (aSourceFile, \"SourceFile\");\n ValueEnforcer.notNull (aTargetFile, \"TargetFile\");\n\n final Path aRealSourceFile = _getUnifiedPath (aSourceFile);\n ... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_647 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/mutable/MutableByteTest.java",
"identifier": "MutableByteTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testMutableByte ()\n {\n final MutableByte x = new MutableByte (0);\n assertEquals (0, x.byteValue ());\n assertEquals (Byte.valueOf ((byte) 0), x.getAsByte ());\n assertFalse (x.isNot0 ());\n assertTrue (x.is0 ());\n\n x.inc ();\n assertEquals (1, x.byteValue ())... | {
"fields": [
{
"declarator": "m_nValue",
"modifier": "private",
"original_string": "private byte m_nValue;",
"type": "byte",
"var_name": "m_nValue"
}
],
"file": "ph-commons/src/main/java/com/helger/commons/mutable/MutableByte.java",
"identifier": "MutableByte",
"interfac... | {
"body": "public MutableByte (final int nValue)\n {\n this ((byte) nValue);\n }",
"class_method_signature": "MutableByte.MutableByte(final int nValue)",
"constructor": true,
"full_signature": "public MutableByte(final int nValue)",
"identifier": "MutableByte",
"invocations": [],
"modifiers": "publi... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_217 | {
"fields": [
{
"declarator": "DOCTYPE_XHTML10_QNAME = \"-//W3C//DTD XHTML 1.0 Strict//EN\"",
"modifier": "private static final",
"original_string": "private static final String DOCTYPE_XHTML10_QNAME = \"-//W3C//DTD XHTML 1.0 Strict//EN\";",
"type": "String",
"var_name": "DOCTYPE_XHT... | {
"body": "@Test\n public void testXMLVersionNumber ()\n {\n Document aDoc = XMLFactory.newDocument (EXMLVersion.XML_10);\n aDoc.appendChild (aDoc.createElement (\"any\"));\n String sXML = XMLWriter.getNodeAsString (aDoc);\n assertEquals (\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\... | {
"fields": [
{
"declarator": "DEFAULT_XML_VERSION = EXMLVersion.XML_10",
"modifier": "public static final",
"original_string": "public static final EXMLVersion DEFAULT_XML_VERSION = EXMLVersion.XML_10;",
"type": "EXMLVersion",
"var_name": "DEFAULT_XML_VERSION"
},
{
"de... | {
"body": "@Nullable\n public static String getNodeAsString (@Nonnull final Node aNode, @Nonnull final IXMLWriterSettings aSettings)\n {\n // start serializing\n try (final NonBlockingStringWriter aWriter = new NonBlockingStringWriter (50 * CGlobal.BYTES_PER_KILOBYTE))\n {\n if (writeToWriter (aNode, ... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_581 | {
"fields": [
{
"declarator": "ESCAPE_TEST_STRING = \"\\\\\\\\1\\\\2\\\\\\\"3\\\\\"",
"modifier": "private static final",
"original_string": "private static final String ESCAPE_TEST_STRING = \"\\\\\\\\1\\\\2\\\\\\\"3\\\\\";",
"type": "String",
"var_name": "ESCAPE_TEST_STRING"
},
... | {
"body": "@Test\n public void testParsedLineWithInternalQuota () throws IOException\n {\n final ICommonsList <String> aNextLine = m_aParser.parseLine (\"a,123\\\"4\\\"567,c\");\n assertEquals (3, aNextLine.size ());\n\n assertEquals (\"123\\\"4\\\"567\", aNextLine.get (1));\n\n }",
"class_method_signat... | {
"fields": [
{
"declarator": "m_cSeparatorChar = CCSV.DEFAULT_SEPARATOR",
"modifier": "private",
"original_string": "private char m_cSeparatorChar = CCSV.DEFAULT_SEPARATOR;",
"type": "char",
"var_name": "m_cSeparatorChar"
},
{
"declarator": "m_cQuoteChar = CCSV.DEFAULT... | {
"body": "@Nullable\n public ICommonsList <String> parseLine (@Nullable final String sNextLine) throws IOException\n {\n return _parseLine (sNextLine, false);\n }",
"class_method_signature": "CSVParser.parseLine(@Nullable final String sNextLine)",
"constructor": false,
"full_signature": "@Nullable public... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_305 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/mime/MimeTypeParserTest.java",
"identifier": "MimeTypeParserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testParseInvalidURLEscape ()\n {\n final String [] aInvalid = new String [] { // Invalid URL escaped\n \"text/plain;param=abc%\",\n \"text/plain;param=abc%1\",\n ... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger (MimeTypeParser.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger (MimeTypeParser.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
... | {
"body": "@Nullable\n public static MimeType parseMimeType (@Nullable final String sMimeType)\n {\n return parseMimeType (sMimeType, CMimeType.DEFAULT_QUOTING);\n }",
"class_method_signature": "MimeTypeParser.parseMimeType(@Nullable final String sMimeType)",
"constructor": false,
"full_signature": "@Null... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_59 | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger (DijkstraTest.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger (DijkstraTest.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
... | {
"body": "@Test\n public void testExample1aUndirected ()\n {\n final SimpleGraph g = new SimpleGraph (new SimpleGraphObjectFastFactory ());\n for (int i = 1; i <= 6; ++i)\n g.createNode (Integer.toString (i));\n g.createRelation (\"1\", \"2\").attrs ().putIn (ATTR_WEIGHT, 3);\n g.createRelation (\... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger (Dijkstra.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger (Dijkstra.class);",
"type": "Logger",
"var_name": "LOGGER"
}
],
"file": "ph-... | {
"body": "@Nonnull\n public static <N extends IMutableBaseGraphNode <N, R>, R extends IMutableBaseGraphRelation <N, R>> Dijkstra.Result <N> applyDijkstra (@Nonnull final IMutableBaseGraph <N, R> aGraph,\n ... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_755 | {
"fields": [
{
"declarator": "I_1 = Integer.valueOf (-1)",
"modifier": "private static final",
"original_string": "private static final Integer I_1 = Integer.valueOf (-1);",
"type": "Integer",
"var_name": "I_1"
},
{
"declarator": "I0 = Integer.valueOf (0)",
"modi... | {
"body": "@Test\n public void testParseBoolObjExact ()\n {\n assertSame (Boolean.TRUE, StringParser.parseBoolObjExact (\"true\"));\n assertSame (Boolean.TRUE, StringParser.parseBoolObjExact (\"trUE\"));\n assertSame (Boolean.TRUE, StringParser.parseBoolObjExact (Boolean.TRUE.toString ()));\n assertSame... | {
"fields": [
{
"declarator": "DEFAULT_RADIX = 10",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_RADIX = 10;",
"type": "int",
"var_name": "DEFAULT_RADIX"
},
{
"declarator": "s_aInstance = new StringParser ()",
"modifier": ... | {
"body": "@Nullable\n public static Boolean parseBoolObjExact (@Nullable final String sStr)\n {\n return parseBoolObjExact (sStr, null);\n }",
"class_method_signature": "StringParser.parseBoolObjExact(@Nullable final String sStr)",
"constructor": false,
"full_signature": "@Nullable public static Boolean ... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_240 | {
"fields": [
{
"declarator": "XSD1 = new ClassPathResource (\"xml/schema1.xsd\")",
"modifier": "private static final",
"original_string": "private static final IReadableResource XSD1 = new ClassPathResource (\"xml/schema1.xsd\");",
"type": "IReadableResource",
"var_name": "XSD1"
... | {
"body": "@Test\n public void testValidateReadableResource ()\n {\n // Valid\n IErrorList aErrors = XMLSchemaValidationHelper.validate (XSD1, XML1);\n assertNotNull (aErrors);\n assertEquals (0, aErrors.size ());\n aErrors = XMLSchemaValidationHelper.validate (new IReadableResource [] { XSD2, XSD1 }... | {
"fields": [
{
"declarator": "s_aInstance = new XMLSchemaValidationHelper ()",
"modifier": "@PresentForCodeCoverage\n private static final",
"original_string": "@PresentForCodeCoverage\n private static final XMLSchemaValidationHelper s_aInstance = new XMLSchemaValidationHelper ();",
"ty... | {
"body": "@Nonnull\n public static IErrorList validate (@Nonnull final IReadableResource aSchema, @Nonnull final IReadableResource aXML)\n {\n return validate (new IReadableResource [] { aSchema }, aXML);\n }",
"class_method_signature": "XMLSchemaValidationHelper.validate(@Nonnull final IReadableResource aSc... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_610 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/regex/RegExHelperTest.java",
"identifier": "RegExHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetAllMatchingGroupValues ()\n {\n // Non-matching\n assertNull (RegExHelper.getAllMatchingGroupValues (\"H(.)llo\", \"Servus\"));\n assertNull (RegExHelper.getAllMatchingGroupValues (\"H([al]+)(.)\", \"Hello\"));\n\n // With a single group\n assertArrayEquals (new ... | {
"fields": [
{
"declarator": "s_aInstance = new RegExHelper ()",
"modifier": "@PresentForCodeCoverage\n private static final",
"original_string": "@PresentForCodeCoverage\n private static final RegExHelper s_aInstance = new RegExHelper ();",
"type": "RegExHelper",
"var_name": "s_a... | {
"body": "@Nullable\n public static String [] getAllMatchingGroupValues (@Nonnull @RegEx final String sRegEx, @Nonnull final String sValue)\n {\n final Matcher aMatcher = getMatcher (sRegEx, sValue);\n if (!aMatcher.find ())\n {\n // Values does not match RegEx\n return null;\n }\n\n // gr... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_539 | {
"fields": [
{
"declarator": "L_DE = new Locale (\"de\")",
"modifier": "private static final",
"original_string": "private static final Locale L_DE = new Locale (\"de\");",
"type": "Locale",
"var_name": "L_DE"
},
{
"declarator": "L_EN = new Locale (\"en\")",
"mod... | {
"body": "@Test\n public void testGetAllLocaleDisplayNames ()\n {\n assertNotNull (LocaleHelper.getAllLocaleDisplayNames (LocaleCache.getInstance ().getLocale (\"de\")));\n assertFalse (LocaleHelper.getAllLocaleDisplayNames (LocaleCache.getInstance ().getLocale (\"de\")).isEmpty ());\n }",
"class_method_s... | {
"fields": [
{
"declarator": "LOCALE_SEPARATOR = '_'",
"modifier": "public static final",
"original_string": "public static final char LOCALE_SEPARATOR = '_';",
"type": "char",
"var_name": "LOCALE_SEPARATOR"
},
{
"declarator": "STR_ALL = \"all\"",
"modifier": "pu... | {
"body": "@Nonnull\n @ReturnsMutableCopy\n public static ICommonsMap <Locale, String> getAllLocaleDisplayNames (@Nonnull final Locale aContentLocale)\n {\n ValueEnforcer.notNull (aContentLocale, \"ContentLocale\");\n\n return new CommonsHashMap <> (LocaleCache.getInstance ().getAllLocales (),\n ... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_169 | {
"fields": [],
"file": "ph-xml/src/test/java/com/helger/xml/microdom/util/XMLListHandlerTest.java",
"identifier": "XMLListHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testReadInvalid ()\n {\n final ICommonsList <String> aList = new CommonsArrayList <> ();\n final IReadableResource aRes = new ClassPathResource (\"xml/list.xml\");\n try\n {\n XMLListHandler.readList ((IHasInputStream) null);\n fail ();\n }\n catch (final N... | {
"fields": [
{
"declarator": "ELEMENT_LIST = \"list\"",
"modifier": "public static final",
"original_string": "public static final String ELEMENT_LIST = \"list\";",
"type": "String",
"var_name": "ELEMENT_LIST"
},
{
"declarator": "ELEMENT_ITEM = \"item\"",
"modifi... | {
"body": "@Nullable\n @ReturnsMutableCopy\n public static ICommonsList <String> readList (@Nonnull final IHasInputStream aISP)\n {\n ValueEnforcer.notNull (aISP, \"InputStreamProvider\");\n\n return readList (aISP.getInputStream ());\n }",
"class_method_signature": "XMLListHandler.readList(@Nonnull final... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_493 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/lang/proxy/LoggingInvocationHandlerTest.java",
"identifier": "LoggingInvocationHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n @SuppressFBWarnings (\"RV_RETURN_VALUE_IGNORED\")\n public void testBasic ()\n {\n final ICommonsList <String> aList = LoggingInvocationHandler.proxying (ICommonsList.class, new CommonsArrayList <> ());\n aList.add (\"a\");\n aList.add (\"b\");\n aList.subList (0, 1).isEmpty ();\n ... | {
"fields": [
{
"declarator": "DEFAULT_PROXY_RETURN_VALUES = true",
"modifier": "public static final",
"original_string": "public static final boolean DEFAULT_PROXY_RETURN_VALUES = true;",
"type": "boolean",
"var_name": "DEFAULT_PROXY_RETURN_VALUES"
},
{
"declarator": "... | {
"body": "@Nonnull\n public static <T> T proxying (@Nonnull final Class <? extends T> aInterfaceClass, @Nonnull final T aActualTarget)\n {\n return proxying (aInterfaceClass, aActualTarget, LoggingInvocationHandler::new);\n }",
"class_method_signature": "LoggingInvocationHandler.proxying(@Nonnull final Class... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_885 | {
"fields": [],
"file": "ph-datetime/src/test/java/com/helger/datetime/util/PDTXMLConverterTest.java",
"identifier": "PDTXMLConverterTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCreateNewCalendar ()\n {\n final XMLGregorianCalendar c1 = PDTXMLConverter.createNewCalendar ();\n assertNotNull (c1);\n final XMLGregorianCalendar c2 = PDTXMLConverter.createNewCalendar ();\n assertNotNull (c2);\n assertNotSame (c1, c2);\n assertEquals (c1, c2);... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger (PDTXMLConverter.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger (PDTXMLConverter.class);",
"type": "Logger",
"var_name": "LOGGER"
},
... | {
"body": "@Nonnull\n public static XMLGregorianCalendar createNewCalendar ()\n {\n return s_aDTFactory.newXMLGregorianCalendar ();\n }",
"class_method_signature": "PDTXMLConverter.createNewCalendar()",
"constructor": false,
"full_signature": "@Nonnull public static XMLGregorianCalendar createNewCalendar(... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_186 | {
"fields": [
{
"declarator": "CRLF = ENewLineMode.DEFAULT.getText ()",
"modifier": "private static final",
"original_string": "private static final String CRLF = ENewLineMode.DEFAULT.getText ();",
"type": "String",
"var_name": "CRLF"
},
{
"declarator": "INDENT = XMLWri... | {
"body": "@Test\n public void testReadEntity ()\n {\n // Read file with notation\n final IMicroDocument doc = MicroReader.readMicroXML (new ClassPathResource (\"xml/xml-entity-public.xml\"),\n new SAXReaderSettings ().setEntityResolver (new EmptyEntityR... | {
"fields": [
{
"declarator": "s_aInstance = new MicroReader ()",
"modifier": "@PresentForCodeCoverage\n private static final",
"original_string": "@PresentForCodeCoverage\n private static final MicroReader s_aInstance = new MicroReader ();",
"type": "MicroReader",
"var_name": "s_a... | {
"body": "@Nullable\n public static IMicroDocument readMicroXML (@WillClose @Nullable final InputSource aInputSource)\n {\n return readMicroXML (aInputSource, (ISAXReaderSettings) null);\n }",
"class_method_signature": "MicroReader.readMicroXML(@WillClose @Nullable final InputSource aInputSource)",
"constr... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_743 | {
"fields": [
{
"declarator": "L_DE = new Locale (\"de\")",
"modifier": "private static final",
"original_string": "private static final Locale L_DE = new Locale (\"de\");",
"type": "Locale",
"var_name": "L_DE"
}
],
"file": "ph-commons/src/test/java/com/helger/commons/string/... | {
"body": "@Test\n public void testGetWithoutWhiteSpaces ()\n {\n assertEquals (\"12345\", StringHelper.getWithoutAnySpaces (\" 1 2\\t3\\n4\\r5\"));\n assertEquals (\"12345\", StringHelper.getWithoutAnySpaces (\"12345\"));\n // test unicode space\n assertEquals (\"7650\", StringHelper.getWithoutAnySpac... | {
"fields": [
{
"declarator": "STRING_NOT_FOUND = -1",
"modifier": "public static final",
"original_string": "public static final int STRING_NOT_FOUND = -1;",
"type": "int",
"var_name": "STRING_NOT_FOUND"
},
{
"declarator": "s_aSizeTableInt = { 9, 99, 999, 9999, 99999, ... | {
"body": "@Nonnull\n public static String getWithoutAnySpaces (@Nullable final String sStr)\n {\n if (sStr == null)\n return \"\";\n\n // Trim first\n final char [] aChars = sStr.trim ().toCharArray ();\n final StringBuilder aResult = new StringBuilder (aChars.length);\n for (final char c : aCh... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_313 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/io/misc/SizeHelperTest.java",
"identifier": "SizeHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetAsMatching ()\n {\n // Use fixed locale for constant decimal separator\n final SizeHelper aSH = SizeHelper.getSizeHelperOfLocale (Locale.ENGLISH);\n\n // default\n assertEquals (\"5PB\", aSH.getAsMatching (5 * CGlobal.BYTES_PER_PETABYTE));\n assertEquals (\"5TB\"... | {
"fields": [
{
"declarator": "B_SUFFIX = \"B\"",
"modifier": "public static final",
"original_string": "public static final String B_SUFFIX = \"B\";",
"type": "String",
"var_name": "B_SUFFIX"
},
{
"declarator": "KB_SUFFIX = \"KB\"",
"modifier": "public static fin... | {
"body": "@Nonnull\n public String getAsMatching (@Nonnull final BigInteger aSize)\n {\n _checkConvertibility (aSize);\n return getAsMatching (aSize.longValue ());\n }",
"class_method_signature": "SizeHelper.getAsMatching(@Nonnull final BigInteger aSize)",
"constructor": false,
"full_signature": "@Non... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_606 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/regex/RegExHelperTest.java",
"identifier": "RegExHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetMatcher ()\n {\n final Matcher m = RegExHelper.getMatcher (\"Hallo (\\\\d+)\\\\.(\\\\d+) Welt\", \"This is Hallo 2.3 Welt Text\");\n assertNotNull (m);\n assertEquals (2, m.groupCount ());\n\n // start over and replace all at once\n {\n m.reset ();\n fi... | {
"fields": [
{
"declarator": "s_aInstance = new RegExHelper ()",
"modifier": "@PresentForCodeCoverage\n private static final",
"original_string": "@PresentForCodeCoverage\n private static final RegExHelper s_aInstance = new RegExHelper ();",
"type": "RegExHelper",
"var_name": "s_a... | {
"body": "@Nonnull\n public static Matcher getMatcher (@Nonnull @RegEx final String sRegEx, @Nonnull final String sValue)\n {\n ValueEnforcer.notNull (sValue, \"Value\");\n\n return RegExCache.getPattern (sRegEx).matcher (sValue);\n }",
"class_method_signature": "RegExHelper.getMatcher(@Nonnull @RegEx fin... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_256 | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger (URLHelperTest.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger (URLHelperTest.class);",
"type": "Logger",
"var_name": "LOGGER"
}
],
"f... | {
"body": "@Test\n public void testGetURLData ()\n {\n ISimpleURL aData = URLHelper.getAsURLData (\"http://www.helger.com/folder?x=y&a=b#c\");\n assertNotNull (aData);\n assertEquals (EURLProtocol.HTTP, aData.getProtocol ());\n assertEquals (\"http://www.helger.com/folder\", aData.getPath ());\n asse... | {
"fields": [
{
"declarator": "CHARSET_URL_OBJ = StandardCharsets.UTF_8",
"modifier": "public static final",
"original_string": "public static final Charset CHARSET_URL_OBJ = StandardCharsets.UTF_8;",
"type": "Charset",
"var_name": "CHARSET_URL_OBJ"
},
{
"declarator": "... | {
"body": "@Nonnull\n public static ISimpleURL getAsURLData (@Nonnull final String sHref)\n {\n return getAsURLData (sHref, null);\n }",
"class_method_signature": "URLHelper.getAsURLData(@Nonnull final String sHref)",
"constructor": false,
"full_signature": "@Nonnull public static ISimpleURL getAsURLData(... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_485 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/lang/ClassHelperTest.java",
"identifier": "ClassHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIsIntegerClass ()\n {\n assertTrue (ClassHelper.isIntegerClass (byte.class));\n assertTrue (ClassHelper.isIntegerClass (byte.class));\n assertTrue (ClassHelper.isIntegerClass (int.class));\n assertTrue (ClassHelper.isIntegerClass (Integer.class));\n assertTrue (Clas... | {
"fields": [
{
"declarator": "PRIMITIVE_TO_WRAPPER = new CommonsWeakHashMap <> (8)",
"modifier": "private static final",
"original_string": "private static final ICommonsMap <Class <?>, Class <?>> PRIMITIVE_TO_WRAPPER = new CommonsWeakHashMap <> (8);",
"type": "ICommonsMap <Class <?>, Cla... | {
"body": "public static boolean isIntegerClass (@Nullable final Class <?> aClass)\n {\n if (aClass == null)\n return false;\n return Byte.class.isAssignableFrom (aClass) ||\n byte.class.isAssignableFrom (aClass) ||\n Integer.class.isAssignableFrom (aClass) ||\n int.class.isA... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_190 | {
"fields": [
{
"declarator": "TEST_XML = \"<?xml version=\\\"1.0\\\"?>\" +\n \"<!DOCTYPE verrryoot>\" +\n \"<verrryoot xmlns=\\\"sthgelse\\\">\" +\n \"<!-- arg - a comment -->\" +\n ... | {
"body": "@Test\n public void testGetXMLString ()\n {\n final IMicroDocument aDoc = MicroReader.readMicroXML (TEST_XML);\n _testGetNodeAsXMLString (aDoc);\n _testGetNodeAsXMLString (aDoc.getDocumentElement ());\n _testGetNodeAsXMLString (new MicroElement (\"xyz\"));\n _testGetNodeAsXMLString (new Mi... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger (MicroWriter.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger (MicroWriter.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
... | {
"body": "@Nullable\n public static String getNodeAsString (@Nonnull final IMicroNode aNode, @Nonnull final IXMLWriterSettings aSettings)\n {\n ValueEnforcer.notNull (aNode, \"Node\");\n ValueEnforcer.notNull (aSettings, \"Settings\");\n\n try (final NonBlockingStringWriter aWriter = new NonBlockingString... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_344 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/io/file/SimpleFileIOTest.java",
"identifier": "SimpleFileIOTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testReaFileLines ()\n {\n assertNull (SimpleFileIO.getAllFileLines (null, StandardCharsets.ISO_8859_1));\n assertNull (SimpleFileIO.getAllFileLines (new File (\"ha ha said the clown\"), StandardCharsets.ISO_8859_1));\n final File aFile = ClassPathResource.getAsFile (\"streamu... | {
"fields": [
{
"declarator": "s_aInstance = new SimpleFileIO ()",
"modifier": "@PresentForCodeCoverage\n private static final",
"original_string": "@PresentForCodeCoverage\n private static final SimpleFileIO s_aInstance = new SimpleFileIO ();",
"type": "SimpleFileIO",
"var_name": ... | {
"body": "@Nullable\n public static ICommonsList <String> getAllFileLines (@Nullable final File aFile, @Nonnull final Charset aCharset)\n {\n return aFile == null ? null : StreamHelper.readStreamLines (FileHelper.getInputStream (aFile), aCharset);\n }",
"class_method_signature": "SimpleFileIO.getAllFileLines... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_18 | {
"fields": [
{
"declarator": "EOL = System.getProperty (\"line.separator\")",
"modifier": "private static final",
"original_string": "private static final String EOL = System.getProperty (\"line.separator\");",
"type": "String",
"var_name": "EOL"
}
],
"file": "ph-cli/src/tes... | {
"body": "@Test\n public void testRenderWrappedTextMultiLine ()\n {\n // multi line text\n final int width = 16;\n final int padding = 0;\n final String expected = \"aaaa aaaa aaaa\" + EOL + \"aaaaaa\" + EOL + \"aaaaa\";\n\n final StringBuilder sb = new StringBuilder ();\n new HelpFormatter ().re... | {
"fields": [
{
"declarator": "DEFAULT_WIDTH = 74",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_WIDTH = 74;",
"type": "int",
"var_name": "DEFAULT_WIDTH"
},
{
"declarator": "DEFAULT_LEFT_PAD = 1",
"modifier": "public stati... | {
"body": "protected StringBuilder renderWrappedText (final StringBuilder aSB, final int nWidth, final int nNextLineTabStop, final String sText)\n {\n String text = sText;\n int pos = findWrapPos (text, nWidth, 0);\n if (pos == -1)\n {\n aSB.append (rtrim (text));\n return aSB;\n }\n\n aS... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_714 | {
"fields": [
{
"declarator": "L_DE = new Locale (\"de\")",
"modifier": "private static final",
"original_string": "private static final Locale L_DE = new Locale (\"de\");",
"type": "Locale",
"var_name": "L_DE"
}
],
"file": "ph-commons/src/test/java/com/helger/commons/string/... | {
"body": "@Test\n public void testGetCharacterCountInt ()\n {\n int iVal = 1;\n for (int i = 1; i <= 10; ++i)\n {\n assertEquals (i, StringHelper.getCharacterCount (iVal));\n iVal *= 10;\n }\n iVal = -1;\n for (int i = 1; i <= 10; ++i)\n {\n assertEquals (1 + i, StringHelper.get... | {
"fields": [
{
"declarator": "STRING_NOT_FOUND = -1",
"modifier": "public static final",
"original_string": "public static final int STRING_NOT_FOUND = -1;",
"type": "int",
"var_name": "STRING_NOT_FOUND"
},
{
"declarator": "s_aSizeTableInt = { 9, 99, 999, 9999, 99999, ... | {
"body": "@Nonnegative\n public static int getCharacterCount (final int nValue)\n {\n // index is always one character less than the real size; that's why nPrefix\n // is 1 more!\n final int nPrefix = nValue < 0 ? 2 : 1;\n final int nRealValue = MathHelper.abs (nValue);\n\n for (int nIndex = 0;; nIn... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_201 | {
"fields": [
{
"declarator": "TEST_XML = \"<?xml version=\\\"1.0\\\"?>\" +\n \"<!DOCTYPE verrryoot>\" +\n \"<verrryoot xmlns=\\\"sthgelse\\\">\" +\n \"<!-- arg - a comment -->\" +\n ... | {
"body": "@Test\n public void testAttributesWithNamespaces ()\n {\n final XMLWriterSettings aSettings = new XMLWriterSettings ().setIndent (EXMLSerializeIndent.NONE)\n .setCharset (StandardCharsets.ISO_8859_1);\n final IMicroDocument aDoc = new M... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger (MicroWriter.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger (MicroWriter.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
... | {
"body": "@Nullable\n public static String getNodeAsString (@Nonnull final IMicroNode aNode, @Nonnull final IXMLWriterSettings aSettings)\n {\n ValueEnforcer.notNull (aNode, \"Node\");\n ValueEnforcer.notNull (aSettings, \"Settings\");\n\n try (final NonBlockingStringWriter aWriter = new NonBlockingString... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_651 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/mutable/MutableLongTest.java",
"identifier": "MutableLongTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testMutableLong ()\n {\n final MutableLong x = new MutableLong (0);\n assertEquals (0, x.longValue ());\n assertEquals (Long.valueOf (0), x.getAsLong ());\n assertFalse (x.isNot0 ());\n assertTrue (x.is0 ());\n\n x.inc ();\n assertEquals (1, x.longValue ());\n ... | {
"fields": [
{
"declarator": "m_nValue",
"modifier": "private",
"original_string": "private long m_nValue;",
"type": "long",
"var_name": "m_nValue"
}
],
"file": "ph-commons/src/main/java/com/helger/commons/mutable/MutableLong.java",
"identifier": "MutableLong",
"interfac... | {
"body": "public MutableLong (@Nonnull final Number aValue)\n {\n this (aValue.longValue ());\n }",
"class_method_signature": "MutableLong.MutableLong(@Nonnull final Number aValue)",
"constructor": true,
"full_signature": "public MutableLong(@Nonnull final Number aValue)",
"identifier": "MutableLong",
... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_578 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/csv/CSVReaderTest.java",
"identifier": "CSVReaderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIssue102 () throws IOException\n {\n try (final CSVReader aReader = new CSVReader (new NonBlockingStringReader (\"\\\"\\\",a\\n\\\"\\\",b\\n\")))\n {\n final ICommonsList <String> firstRow = aReader.readNext ();\n assertEquals (2, firstRow.size ());\n assertTr... | {
"fields": [
{
"declarator": "m_aReader",
"modifier": "private final",
"original_string": "private final Reader m_aReader;",
"type": "Reader",
"var_name": "m_aReader"
},
{
"declarator": "m_aLineReader",
"modifier": "private final",
"original_string": "priva... | {
"body": "@Nullable\n public ICommonsList <String> readNext () throws IOException\n {\n ICommonsList <String> ret = null;\n do\n {\n final String sNextLine = _getNextLine ();\n if (!m_bHasNext)\n {\n // should throw if still pending?\n return ret;\n }\n final ICommon... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_128 | {
"fields": [],
"file": "ph-xml/src/test/java/com/helger/xml/transform/ResourceStreamSourceTest.java",
"identifier": "ResourceStreamSourceTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testBasic ()\n {\n final IReadableResource aRes = new ClassPathResource (\"xml/test1.xslt\");\n assertTrue (aRes.exists ());\n final ResourceStreamSource src = new ResourceStreamSource (aRes);\n final InputStream is = src.getInputStream ();\n assertNotNull (is);\n St... | {
"fields": [
{
"declarator": "m_aISP",
"modifier": "private final",
"original_string": "private final IHasInputStream m_aISP;",
"type": "IHasInputStream",
"var_name": "m_aISP"
}
],
"file": "ph-xml/src/main/java/com/helger/xml/transform/ResourceStreamSource.java",
"identifi... | {
"body": "@Override\n public InputStream getInputStream ()\n {\n final InputStream aIS = m_aISP.getInputStream ();\n if (aIS == null)\n throw new IllegalStateException (\"Failed to open input stream for \" + m_aISP);\n return aIS;\n }",
"class_method_signature": "ResourceStreamSource.getInputStrea... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_597 | {
"fields": [
{
"declarator": "ESCAPE_TEST_STRING = \"\\\\\\\\1\\\\2\\\\\\\"3\\\\\"",
"modifier": "private static final",
"original_string": "private static final String ESCAPE_TEST_STRING = \"\\\\\\\\1\\\\2\\\\\\\"3\\\\\";",
"type": "String",
"var_name": "ESCAPE_TEST_STRING"
},
... | {
"body": "@Test (expected = UnsupportedOperationException.class)\n public void testSeparatorAndQuoteCannotBeTheSame ()\n {\n new CSVParser ().setQuoteChar (CCSV.DEFAULT_SEPARATOR);\n }",
"class_method_signature": "CSVParserTest.testSeparatorAndQuoteCannotBeTheSame()",
"constructor": false,
"full_signatur... | {
"fields": [
{
"declarator": "m_cSeparatorChar = CCSV.DEFAULT_SEPARATOR",
"modifier": "private",
"original_string": "private char m_cSeparatorChar = CCSV.DEFAULT_SEPARATOR;",
"type": "char",
"var_name": "m_cSeparatorChar"
},
{
"declarator": "m_cQuoteChar = CCSV.DEFAULT... | {
"body": "@Nonnull\n public CSVParser setQuoteChar (final char cQuoteChar)\n {\n m_cQuoteChar = cQuoteChar;\n if (_anyCharactersAreTheSame ())\n throw new UnsupportedOperationException (\"The separator, quote, and escape characters must be different!\");\n return this;\n }",
"class_method_signatur... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_780 | {
"fields": [
{
"declarator": "I1 = Integer.valueOf (1)",
"modifier": "private static final",
"original_string": "private static final Integer I1 = Integer.valueOf (1);",
"type": "Integer",
"var_name": "I1"
},
{
"declarator": "I2 = Integer.valueOf (2)",
"modifier"... | {
"body": "@Test\n public void testGetAllExcept ()\n {\n {\n final String [] x = new String [] { \"Hallo\", \"Welt\", \"aus\", \"Kopenhagen\", \"Welt\" };\n assertArrayEquals (new String [] { \"Hallo\", \"aus\", \"Kopenhagen\" }, getAllExcept (x, \"Welt\"));\n assertArrayEquals (new String [] { \"... | {
"fields": [
{
"declarator": "EMPTY_BOOLEAN_ARRAY = new boolean [0]",
"modifier": "public static final",
"original_string": "public static final boolean [] EMPTY_BOOLEAN_ARRAY = new boolean [0];",
"type": "boolean []",
"var_name": "EMPTY_BOOLEAN_ARRAY"
},
{
"declarator... | {
"body": "@Nullable\n @ReturnsMutableCopy\n @SafeVarargs\n public static <ELEMENTTYPE> ELEMENTTYPE [] getAllExcept (@Nullable final ELEMENTTYPE [] aArray,\n @Nullable final ELEMENTTYPE... aElementsToRemove)\n {\n if (isEmpty (aArray) || isEmpty (aEleme... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_295 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/statistics/StatisticsHandlerTimerTest.java",
"identifier": "StatisticsHandlerTimerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@SuppressFBWarnings (\"TQ_NEVER_VALUE_USED_WHERE_ALWAYS_REQUIRED\")\n @Test\n public void testAll ()\n {\n final StatisticsHandlerTimer sh = new StatisticsHandlerTimer ();\n assertEquals (0, sh.getInvocationCount ());\n assertEquals (CGlobal.ILLEGAL_UINT, sh.getMin ());\n assertEquals (CGlob... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger (StatisticsHandlerTimer.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger (StatisticsHandlerTimer.class);",
"type": "Logger",
"var_name": "LOGGE... | {
"body": "public void addTime (@Nonnegative final long nMillis)\n {\n if (nMillis < 0)\n if (LOGGER.isWarnEnabled ())\n LOGGER.warn (\"A negative value (\" + nMillis + \") is added to \" + getClass ().getName ());\n addValue (nMillis);\n }",
"class_method_signature": "StatisticsHandlerTimer.add... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_63 | {
"fields": [],
"file": "ph-graph/src/test/java/com/helger/graph/simple/SimpleDirectedGraphTest.java",
"identifier": "SimpleDirectedGraphTest",
"interfaces": "",
"superclass": "extends AbstractGraphTestCase"
} | {
"body": "@Test\n public void testCycles2 ()\n {\n final SimpleDirectedGraph sg = new SimpleDirectedGraph ();\n for (int i = 1; i <= 6; ++i)\n sg.createNode (Integer.toString (i));\n\n // first cycle\n sg.createRelation (\"1\", \"2\");\n assertFalse (sg.containsCycles ());\n sg.createRelatio... | {
"fields": [],
"file": "ph-graph/src/main/java/com/helger/graph/simple/SimpleDirectedGraph.java",
"identifier": "SimpleDirectedGraph",
"interfaces": "implements ISimpleDirectedGraph",
"methods": [
{
"class_method_signature": "SimpleDirectedGraph.SimpleDirectedGraph()",
"constructor": true,
... | {
"body": "@Nonnull\n public IMutableDirectedGraphRelation createRelation (@Nonnull final String sFromNodeID, @Nonnull final String sToNodeID)\n {\n final IMutableDirectedGraphNode aFromNode = getNodeOfID (sFromNodeID);\n if (aFromNode == null)\n throw new IllegalArgumentException (\"Failed to resolve fr... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_446 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/math/RoundHelperTest.java",
"identifier": "RoundHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetRoundedEvenExp ()\n {\n CommonsAssert.assertEquals (9E-1, RoundHelper.getRoundedEvenExp (0.9, 0));\n CommonsAssert.assertEquals (1E0, RoundHelper.getRoundedEvenExp (1.0, 0));\n CommonsAssert.assertEquals (1E0, RoundHelper.getRoundedEvenExp (1.1, 0));\n CommonsAssert... | {
"fields": [
{
"declarator": "s_aInstance = new RoundHelper ()",
"modifier": "@PresentForCodeCoverage\n private static final",
"original_string": "@PresentForCodeCoverage\n private static final RoundHelper s_aInstance = new RoundHelper ();",
"type": "RoundHelper",
"var_name": "s_a... | {
"body": "public static double getRoundedEvenExp (final double dValue, @Nonnegative final int nScale)\n {\n return getRounded (dValue, nScale, RoundingMode.HALF_EVEN, EDecimalType.EXP);\n }",
"class_method_signature": "RoundHelper.getRoundedEvenExp(final double dValue, @Nonnegative final int nScale)",
"cons... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_503 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/lang/GenericReflectionTest.java",
"identifier": "GenericReflectionTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testNewInstance () throws IllegalAccessException, NoSuchMethodException, InvocationTargetException, InstantiationException\n {\n final String s = GenericReflection.newInstance (\"Hallo Welt\");\n assertNotNull (s);\n assertEquals (0, s.length ());\n\n assertNull (GenericRe... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger (GenericReflection.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger (GenericReflection.class);",
"type": "Logger",
"var_name": "LOGGER"
},
... | {
"body": "@Nonnull\n public static <DATATYPE> DATATYPE newInstance (@Nonnull final DATATYPE aObj) throws IllegalAccessException,\n NoSuchMethodException,\n Invo... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_153 | {
"fields": [
{
"declarator": "TEST_NS = \"http://www.helger.com/dev/unittests/commons/\"",
"modifier": "private static final",
"original_string": "private static final String TEST_NS = \"http://www.helger.com/dev/unittests/commons/\";",
"type": "String",
"var_name": "TEST_NS"
}
... | {
"body": "@Test\n public void testGetQName ()\n {\n final Document doc = XMLFactory.newDocument ();\n final Element e1 = (Element) doc.appendChild (doc.createElement (\"any\"));\n final Element e2 = (Element) e1.appendChild (doc.createElementNS (\"myuri\", \"any\"));\n\n QName q = XMLHelper.getQName (e... | {
"fields": [
{
"declarator": "s_aInstance = new XMLHelper ()",
"modifier": "@PresentForCodeCoverage\n private static final",
"original_string": "@PresentForCodeCoverage\n private static final XMLHelper s_aInstance = new XMLHelper ();",
"type": "XMLHelper",
"var_name": "s_aInstance... | {
"body": "@Nonnull\n public static QName getQName (@Nonnull final Element aElement)\n {\n final String sNamespaceURI = aElement.getNamespaceURI ();\n if (sNamespaceURI == null)\n return new QName (aElement.getTagName ());\n return new QName (sNamespaceURI, aElement.getLocalName (), getPrefix (aElemen... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_850 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/equals/EqualsHelperTest.java",
"identifier": "EqualsHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIterable ()\n {\n final Iterable <String> aCont = new MockIterable (\"a\", \"b\", \"c\");\n assertTrue (EqualsHelper.equalsCollection (aCont, aCont));\n assertTrue (EqualsHelper.equalsCollection (aCont, new MockIterable (\"a\", \"b\", \"c\")));\n assertTrue (EqualsHelp... | {
"fields": [
{
"declarator": "s_aInstance = new EqualsHelper ()",
"modifier": "@PresentForCodeCoverage\n private static final",
"original_string": "@PresentForCodeCoverage\n private static final EqualsHelper s_aInstance = new EqualsHelper ();",
"type": "EqualsHelper",
"var_name": ... | {
"body": "public static boolean equalsCollection (@Nullable final Object aObj1, @Nullable final Object aObj2)\n {\n // Same object - check first\n if (identityEqual (aObj1, aObj2))\n return true;\n\n // Is only one value null?\n if (aObj1 == null || aObj2 == null)\n return false;\n\n final ... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_387 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/io/file/FilenameHelperTest.java",
"identifier": "FilenameHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetAsValidASCIIFilename ()\n {\n assertNull (FilenameHelper.getAsSecureValidASCIIFilename (null));\n assertNull (FilenameHelper.getAsSecureValidASCIIFilename (\"\"));\n assertNull (FilenameHelper.getAsSecureValidASCIIFilename (\" \"));\n assertNull (FilenameHelper.getA... | {
"fields": [
{
"declarator": "EXTENSION_SEPARATOR = '.'",
"modifier": "public static final",
"original_string": "public static final char EXTENSION_SEPARATOR = '.';",
"type": "char",
"var_name": "EXTENSION_SEPARATOR"
},
{
"declarator": "ILLEGAL_FILENAME_CHAR_REPLACEMEN... | {
"body": "@Nullable\n @Nonempty\n public static String getAsSecureValidASCIIFilename (@Nullable final String sFilename)\n {\n return getAsSecureValidASCIIFilename (sFilename, ILLEGAL_FILENAME_CHAR_REPLACEMENT);\n }",
"class_method_signature": "FilenameHelper.getAsSecureValidASCIIFilename(@Nullable final Str... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_34 | {
"fields": [],
"file": "ph-cli/src/test/java/com/helger/cli/CmdLineParserTest.java",
"identifier": "CmdLineParserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testValuesBasic () throws CmdLineParseException\n {\n final Options aOptions = new Options ().addOption (Option.builder (\"D\").longOpt (\"def\").args (2).build ());\n final CmdLineParser p = new CmdLineParser (aOptions);\n\n try\n {\n p.parse (new String [] { \"-D\" ... | {
"fields": [
{
"declarator": "PREFIX_SHORT_OPT = \"-\"",
"modifier": "public static final",
"original_string": "public static final String PREFIX_SHORT_OPT = \"-\";",
"type": "String",
"var_name": "PREFIX_SHORT_OPT"
},
{
"declarator": "PREFIX_LONG_OPT = \"--\"",
... | {
"body": "@Nonnull\n public ParsedCmdLine parse (@Nullable final String [] aArgs) throws CmdLineParseException\n {\n return parseStatic (m_aOptions, aArgs);\n }",
"class_method_signature": "CmdLineParser.parse(@Nullable final String [] aArgs)",
"constructor": false,
"full_signature": "@Nonnull public Par... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_738 | {
"fields": [
{
"declarator": "L_DE = new Locale (\"de\")",
"modifier": "private static final",
"original_string": "private static final Locale L_DE = new Locale (\"de\");",
"type": "Locale",
"var_name": "L_DE"
}
],
"file": "ph-commons/src/test/java/com/helger/commons/string/... | {
"body": "@Test\n public void testGetUntilLastIncl ()\n {\n assertEquals (\"a\", StringHelper.getUntilLastIncl (\"abc@def.com\", 'a'));\n assertEquals (\"abc@def.c\", StringHelper.getUntilLastIncl (\"abc@def.com\", 'c'));\n assertEquals (\"abc@\", StringHelper.getUntilLastIncl (\"abc@def.com\", '@'));\n ... | {
"fields": [
{
"declarator": "STRING_NOT_FOUND = -1",
"modifier": "public static final",
"original_string": "public static final int STRING_NOT_FOUND = -1;",
"type": "int",
"var_name": "STRING_NOT_FOUND"
},
{
"declarator": "s_aSizeTableInt = { 9, 99, 999, 9999, 99999, ... | {
"body": "@Nullable\n public static String getUntilLastIncl (@Nullable final String sStr, final char cSearch)\n {\n return _getUntilLast (sStr, cSearch, true);\n }",
"class_method_signature": "StringHelper.getUntilLastIncl(@Nullable final String sStr, final char cSearch)",
"constructor": false,
"full_sig... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_368 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/io/file/FileOperationsTest.java",
"identifier": "FileOperationsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCreateDirRecursive ()\n {\n final File aDir1 = new File (\"TestDir\");\n final File aDir11 = new File (aDir1, \"TestSubDir\");\n assertFalse (FileHelper.existsDir (aDir1));\n assertFalse (FileHelper.existsDir (aDir11));\n _expectedSuccess (FileOperations.createDirRe... | {
"fields": [
{
"declarator": "DEFAULT_EXCEPTION_ON_DELETE_ROOT = true",
"modifier": "public static final",
"original_string": "public static final boolean DEFAULT_EXCEPTION_ON_DELETE_ROOT = true;",
"type": "boolean",
"var_name": "DEFAULT_EXCEPTION_ON_DELETE_ROOT"
},
{
... | {
"body": "@Nonnull\n public static FileIOError createDirRecursive (@Nonnull final File aDir)\n {\n ValueEnforcer.notNull (aDir, \"Directory\");\n\n // Does the directory already exist?\n if (aDir.exists ())\n return EFileIOErrorCode.TARGET_ALREADY_EXISTS.getAsIOError (EFileIOOperation.CREATE_DIR_RECU... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_692 | {
"fields": [
{
"declarator": "L_DE = new Locale (\"de\")",
"modifier": "private static final",
"original_string": "private static final Locale L_DE = new Locale (\"de\");",
"type": "Locale",
"var_name": "L_DE"
}
],
"file": "ph-commons/src/test/java/com/helger/commons/string/... | {
"body": "@Test\n public void testContainsChar ()\n {\n assertTrue (StringHelper.contains (\"Test\", 'T'));\n assertTrue (StringHelper.contains (\"Test\", 'e'));\n assertTrue (StringHelper.contains (\"Test\", 's'));\n assertTrue (StringHelper.contains (\"Test\", 't'));\n assertFalse (StringHelper.co... | {
"fields": [
{
"declarator": "STRING_NOT_FOUND = -1",
"modifier": "public static final",
"original_string": "public static final int STRING_NOT_FOUND = -1;",
"type": "int",
"var_name": "STRING_NOT_FOUND"
},
{
"declarator": "s_aSizeTableInt = { 9, 99, 999, 9999, 99999, ... | {
"body": "public static boolean contains (@Nullable final String sText, @Nullable final String sSearch)\n {\n return getIndexOf (sText, sSearch) != STRING_NOT_FOUND;\n }",
"class_method_signature": "StringHelper.contains(@Nullable final String sText, @Nullable final String sSearch)",
"constructor": false,
... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_411 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/io/file/FileOperationManagerTest.java",
"identifier": "FileOperationManagerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testRenameFile ()\n {\n final IFileOperationManager aFOM = new FileOperationManager ();\n final File aFile = new File (\"renfile.test\");\n final File aFile2 = new File (\"renfile.renamed\");\n try\n {\n assertFalse (FileHelper.existsFile (aFile));\n _expected... | {
"fields": [
{
"declarator": "INSTANCE",
"modifier": "public static final",
"original_string": "public static final IFileOperationManager INSTANCE;",
"type": "IFileOperationManager",
"var_name": "INSTANCE"
},
{
"declarator": "m_aLastError",
"modifier": "private",... | {
"body": "@Nonnull\n public FileIOError renameFile (@Nonnull final File aSourceFile, @Nonnull final File aTargetFile)\n {\n m_aLastError = FileOperations.renameFile (aSourceFile, aTargetFile);\n _handleLastError (m_aLastError);\n return m_aLastError;\n }",
"class_method_signature": "FileOperationManage... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_807 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/collection/iterate/FilterIteratorTest.java",
"identifier": "FilterIteratorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIteration3 ()\n {\n // filtered element in the middle\n final List <String> aList = CollectionHelper.newList (\"s1\", null, \"s2\", null, \"s3\");\n final FilterIterator <String> it = new FilterIterator <> (aList, Objects::nonNull);\n assertNotNull (it);\n\n assertE... | {
"fields": [
{
"declarator": "m_aBaseIter",
"modifier": "private final",
"original_string": "private final Iterator <? extends ELEMENTTYPE> m_aBaseIter;",
"type": "Iterator <? extends ELEMENTTYPE>",
"var_name": "m_aBaseIter"
},
{
"declarator": "m_aFilter",
"modif... | {
"body": "@Nullable\n public ELEMENTTYPE next ()\n {\n if (!hasNext ())\n throw new NoSuchElementException ();\n final ELEMENTTYPE aRet = m_aCurrent;\n _gotoNextCurrent ();\n return aRet;\n }",
"class_method_signature": "FilterIterator.next()",
"constructor": false,
"full_signature": "@Null... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_104 | {
"fields": [
{
"declarator": "FILL_FACTORS = { 0.25f, 0.5f, 0.75f, 0.9f, 0.99f }",
"modifier": "private static final",
"original_string": "private static final float [] FILL_FACTORS = { 0.25f, 0.5f, 0.75f, 0.9f, 0.99f };",
"type": "float []",
"var_name": "FILL_FACTORS"
}
],
... | {
"body": "@Test\n public void testPut ()\n {\n for (final float ff : FILL_FACTORS)\n _testPutHelper (ff);\n }",
"class_method_signature": "IntIntMapTest.testPut()",
"constructor": false,
"full_signature": "@Test public void testPut()",
"identifier": "testPut",
"invocations": [
"_testPutHelpe... | {
"fields": [
{
"declarator": "FREE_KEY = 0",
"modifier": "private static final",
"original_string": "private static final int FREE_KEY = 0;",
"type": "int",
"var_name": "FREE_KEY"
},
{
"declarator": "NO_VALUE = 0",
"modifier": "public static final",
"origin... | {
"body": "public int put (final int key, final int value)\n {\n if (key == FREE_KEY)\n {\n final int ret = m_nFreeValue;\n if (!m_bHasFreeKey)\n {\n ++m_nSize;\n m_bHasFreeKey = true;\n }\n m_nFreeValue = value;\n return ret;\n }\n\n int idx = _getPutIndex (ke... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_554 | {
"fields": [
{
"declarator": "L_DE = new Locale (\"de\")",
"modifier": "private static final",
"original_string": "private static final Locale L_DE = new Locale (\"de\");",
"type": "Locale",
"var_name": "L_DE"
},
{
"declarator": "L_EN = new Locale (\"en\")",
"mod... | {
"body": "@Test\n public void testGetFormatted_Long ()\n {\n assertEquals (\"1.000.000\", LocaleFormatter.getFormatted (1000000L, L_DE));\n assertEquals (\"1,000,000\", LocaleFormatter.getFormatted (1000000L, L_EN));\n }",
"class_method_signature": "LocaleFormatterTest.testGetFormatted_Long()",
"constru... | {
"fields": [
{
"declarator": "s_aInstance = new LocaleFormatter ()",
"modifier": "@PresentForCodeCoverage\n private static final",
"original_string": "@PresentForCodeCoverage\n private static final LocaleFormatter s_aInstance = new LocaleFormatter ();",
"type": "LocaleFormatter",
... | {
"body": "@Nonnull\n public static String getFormatted (final double dValue, @Nonnull final Locale aDisplayLocale)\n {\n ValueEnforcer.notNull (aDisplayLocale, \"DisplayLocale\");\n\n return NumberFormat.getNumberInstance (aDisplayLocale).format (dValue);\n }",
"class_method_signature": "LocaleFormatter.g... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_391 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/io/file/FilenameHelperTest.java",
"identifier": "FilenameHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testContainsPathSeparatorChar ()\n {\n assertTrue (FilenameHelper.containsPathSeparatorChar (\"local/\"));\n assertTrue (FilenameHelper.containsPathSeparatorChar (\"\\\\windows\"));\n assertTrue (FilenameHelper.containsPathSeparatorChar (\"~/desktop.ini\"));\n assertTrue (... | {
"fields": [
{
"declarator": "EXTENSION_SEPARATOR = '.'",
"modifier": "public static final",
"original_string": "public static final char EXTENSION_SEPARATOR = '.';",
"type": "char",
"var_name": "EXTENSION_SEPARATOR"
},
{
"declarator": "ILLEGAL_FILENAME_CHAR_REPLACEMEN... | {
"body": "public static boolean containsPathSeparatorChar (@Nullable final String s)\n {\n // This is a tick faster than iterating the s.toCharArray() chars\n return s != null && (s.indexOf (UNIX_SEPARATOR) >= 0 || s.indexOf (WINDOWS_SEPARATOR) >= 0);\n }",
"class_method_signature": "FilenameHelper.contain... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_0 | {
"fields": [
{
"declarator": "tested = new UTF7CharsetProviderSPI ()",
"modifier": "private final",
"original_string": "private final UTF7CharsetProviderSPI tested = new UTF7CharsetProviderSPI ();",
"type": "UTF7CharsetProviderSPI",
"var_name": "tested"
}
],
"file": "ph-char... | {
"body": "@Test\n public void testModifiedUTF7 ()\n {\n final Charset charset = tested.charsetForName (\"x-modified-UTF-7\");\n assertNotNull (\"charset not found\", charset);\n assertEquals (UTF7CharsetModified.class, charset.getClass ());\n assertEquals (charset, tested.charsetForName (\"x-imap-modif... | {
"fields": [
{
"declarator": "UTF7_NAME = \"UTF-7\"",
"modifier": "private static final",
"original_string": "private static final String UTF7_NAME = \"UTF-7\";",
"type": "String",
"var_name": "UTF7_NAME"
},
{
"declarator": "UTF7_O_NAME = \"X-UTF-7-OPTIONAL\"",
"... | {
"body": "@Override\n @Nullable\n public Charset charsetForName (@Nonnull final String sCharsetName)\n {\n final String sRealCharsetName = sCharsetName.toUpperCase (Locale.US);\n for (final Charset aCharset : m_aCharsets)\n if (aCharset.name ().equals (sRealCharsetName))\n return aCharset;\n ... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_684 | {
"fields": [
{
"declarator": "L_DE = new Locale (\"de\")",
"modifier": "private static final",
"original_string": "private static final Locale L_DE = new Locale (\"de\");",
"type": "Locale",
"var_name": "L_DE"
}
],
"file": "ph-commons/src/test/java/com/helger/commons/string/... | {
"body": "@Test\n public void testExplodeToOrderedSet ()\n {\n ICommonsOrderedSet <String> ret = StringHelper.getExplodedToOrderedSet (\"@\", \"a@b@@c\");\n assertEquals (new CommonsHashSet <> (\"a\", \"b\", \"\", \"c\"), ret);\n ret = StringHelper.getExplodedToOrderedSet (\"uu\", \"auubuuuuuuc\");\n a... | {
"fields": [
{
"declarator": "STRING_NOT_FOUND = -1",
"modifier": "public static final",
"original_string": "public static final int STRING_NOT_FOUND = -1;",
"type": "int",
"var_name": "STRING_NOT_FOUND"
},
{
"declarator": "s_aSizeTableInt = { 9, 99, 999, 9999, 99999, ... | {
"body": "@Nonnull\n @ReturnsMutableCopy\n public static CommonsLinkedHashSet <String> getExplodedToOrderedSet (@Nonnull final String sSep, @Nullable final String sElements)\n {\n return getExploded (sSep, sElements, -1, new CommonsLinkedHashSet <> ());\n }",
"class_method_signature": "StringHelper.getExplo... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_22 | {
"fields": [
{
"declarator": "EOL = System.getProperty (\"line.separator\")",
"modifier": "private static final",
"original_string": "private static final String EOL = System.getProperty (\"line.separator\");",
"type": "String",
"var_name": "EOL"
}
],
"file": "ph-cli/src/tes... | {
"body": "@Test\n public void testAutomaticUsage ()\n {\n final HelpFormatter hf = new HelpFormatter ();\n Options options = null;\n String expected = \"usage: app [-a]\";\n final NonBlockingByteArrayOutputStream out = new NonBlockingByteArrayOutputStream ();\n final PrintWriter pw = new PrintWriter... | {
"fields": [
{
"declarator": "DEFAULT_WIDTH = 74",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_WIDTH = 74;",
"type": "int",
"var_name": "DEFAULT_WIDTH"
},
{
"declarator": "DEFAULT_LEFT_PAD = 1",
"modifier": "public stati... | {
"body": "public void printUsage (@Nonnull final PrintWriter aPW, final int nWidth, final String sAppName, final Options aOptions)\n {\n // initialise the string buffer\n final StringBuilder aSB = new StringBuilder (getSyntaxPrefix ()).append (sAppName).append (' ');\n\n // create a list for processed opti... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_407 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/io/file/FileOperationManagerTest.java",
"identifier": "FileOperationManagerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCreateDirIfNotExisting ()\n {\n final IFileOperationManager aFOM = new FileOperationManager ();\n final File aDir1 = new File (\"TestDir\");\n assertFalse (FileHelper.existsDir (aDir1));\n _expectedSuccess (aFOM.createDirIfNotExisting (aDir1));\n assertEquals (EFile... | {
"fields": [
{
"declarator": "INSTANCE",
"modifier": "public static final",
"original_string": "public static final IFileOperationManager INSTANCE;",
"type": "IFileOperationManager",
"var_name": "INSTANCE"
},
{
"declarator": "m_aLastError",
"modifier": "private",... | {
"body": "@Nonnull\n public FileIOError createDirIfNotExisting (@Nonnull final File aDir)\n {\n m_aLastError = FileOperations.createDirIfNotExisting (aDir);\n _handleLastError (m_aLastError);\n return m_aLastError;\n }",
"class_method_signature": "FileOperationManager.createDirIfNotExisting(@Nonnull fi... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_542 | {
"fields": [
{
"declarator": "L_DE = new Locale (\"de\")",
"modifier": "private static final",
"original_string": "private static final Locale L_DE = new Locale (\"de\");",
"type": "Locale",
"var_name": "L_DE"
},
{
"declarator": "L_EN = new Locale (\"en\")",
"mod... | {
"body": "@Test\n public void testGetLocaleToUseOrFallback ()\n {\n final ICommonsList <Locale> aLocales = new CommonsArrayList <> (L_DE, L_EN, LocaleHelper.LOCALE_ALL);\n try\n {\n LocaleHelper.getLocaleToUseOrFallback (null, aLocales, null);\n fail ();\n }\n catch (final NullPointerExcep... | {
"fields": [
{
"declarator": "LOCALE_SEPARATOR = '_'",
"modifier": "public static final",
"original_string": "public static final char LOCALE_SEPARATOR = '_';",
"type": "char",
"var_name": "LOCALE_SEPARATOR"
},
{
"declarator": "STR_ALL = \"all\"",
"modifier": "pu... | {
"body": "@Nullable\n public static Locale getLocaleToUseOrFallback (@Nonnull final Locale aRequestLocale,\n @Nonnull final Collection <Locale> aAvailableLocales,\n @Nullable final Locale aFallback)\n {\n ValueEnforc... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_112 | {
"fields": [],
"file": "ph-config/src/test/java/com/helger/config/ConfigFactoryTest.java",
"identifier": "ConfigFactoryTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSysPropConfigResourceProperties ()\n {\n SystemProperties.setPropertyValue (\"config.resource\", \"sysprops/resource.properties\");\n try\n {\n final IConfig aConfig = Config.create (ConfigFactory.createDefaultValueProvider ());\n assertEquals (\"from-sysprop-re... | {
"fields": [
{
"declarator": "PRIVATE_APPLICATION_JSON_PRIORITY = EConfigSourceType.RESOURCE.getDefaultPriority () - 5",
"modifier": "public static final",
"original_string": "public static final int PRIVATE_APPLICATION_JSON_PRIORITY = EConfigSourceType.RESOURCE.getDefaultPriority () - 5;",
... | {
"body": "@Nonnull\n public static MultiConfigurationValueProvider createDefaultValueProvider ()\n {\n final MultiConfigurationValueProvider aMCSVP = new MultiConfigurationValueProvider ();\n // Prio 400\n aMCSVP.addConfigurationSource (new ConfigurationSourceSystemProperty ());\n // Prio 300\n aMCS... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_811 | {
"fields": [
{
"declarator": "I1 = Integer.valueOf (1)",
"modifier": "private static final",
"original_string": "private static final Integer I1 = Integer.valueOf (1);",
"type": "Integer",
"var_name": "I1"
},
{
"declarator": "I2 = Integer.valueOf (2)",
"modifier"... | {
"body": "@Test\n public void testGetDifference ()\n {\n final ICommonsList <String> l1 = newList (\"Hello\", \"Welt\", \"from\", \"Vienna\");\n final ICommonsList <String> l2 = newList (\"Welt\", \"from\");\n\n // Result should be \"Hello\" and \"Vienna\"\n final Set <String> ret = getDifference (l1, ... | {
"fields": [
{
"declarator": "s_aInstance = new CollectionHelper ()",
"modifier": "@PresentForCodeCoverage\n private static final",
"original_string": "@PresentForCodeCoverage\n private static final CollectionHelper s_aInstance = new CollectionHelper ();",
"type": "CollectionHelper",
... | {
"body": "@Nullable\n @ReturnsMutableCopy\n public static <ELEMENTTYPE> ICommonsSet <ELEMENTTYPE> getDifference (@Nullable final Collection <? extends ELEMENTTYPE> aCollection1,\n @Nullable final Collection <? extends ELEMENTTYPE> aCollection2)\... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_796 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/collection/IteratorHelperTest.java",
"identifier": "IteratorHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIsEmpty_Iterator ()\n {\n assertTrue (isEmpty ((Iterator <?>) null));\n assertTrue (isEmpty (new CommonsArrayList <> ().iterator ()));\n assertTrue (isEmpty (new EmptyIterator <> ()));\n assertFalse (isEmpty (newList (\"any\").iterator ()));\n assertTrue (isEmpty (n... | {
"fields": [],
"file": "ph-commons/src/main/java/com/helger/commons/collection/IteratorHelper.java",
"identifier": "IteratorHelper",
"interfaces": "",
"methods": [
{
"class_method_signature": "IteratorHelper.IteratorHelper()",
"constructor": true,
"full_signature": "private IteratorHel... | {
"body": "public static boolean isEmpty (@Nullable final Iterator <?> aIter)\n {\n return aIter == null || !aIter.hasNext ();\n }",
"class_method_signature": "IteratorHelper.isEmpty(@Nullable final Iterator <?> aIter)",
"constructor": false,
"full_signature": "public static boolean isEmpty(@Nullable final... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_75 | {
"fields": [],
"file": "ph-json/src/test/java/com/helger/json/JsonArrayTest.java",
"identifier": "JsonArrayTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetSubArray ()\n {\n final JsonArray aArray = new JsonArray ();\n for (int i = 1; i <= 10; ++i)\n aArray.add (i);\n assertEquals (\"[1,2,3,4,5,6,7,8,9,10]\", aArray.getAsJsonString ());\n\n final IJsonArray aSubArray = aArray.getSubArray (1, 5);\n assertEquals ... | {
"fields": [
{
"declarator": "m_aValues",
"modifier": "private",
"original_string": "private ICommonsList <IJson> m_aValues;",
"type": "ICommonsList <IJson>",
"var_name": "m_aValues"
}
],
"file": "ph-json/src/main/java/com/helger/json/JsonArray.java",
"identifier": "JsonAr... | {
"body": "@Nonnull\n @ReturnsMutableCopy\n public JsonArray getSubArray (@Nonnegative final int nStartIndex, @Nonnegative final int nEndIndex)\n {\n ValueEnforcer.isGE0 (nStartIndex, \"StartIndex\");\n ValueEnforcer.isBetweenInclusive (nEndIndex, \"EndIndex\", nStartIndex, m_aValues.size ());\n\n final i... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_779 | {
"fields": [
{
"declarator": "I1 = Integer.valueOf (1)",
"modifier": "private static final",
"original_string": "private static final Integer I1 = Integer.valueOf (1);",
"type": "Integer",
"var_name": "I1"
},
{
"declarator": "I2 = Integer.valueOf (2)",
"modifier"... | {
"body": "@Test\n public void testContains ()\n {\n {\n final String [] x = new String [] { \"Hallo\", \"Welt\", \"aus\", \"Kopenhagen\" };\n assertTrue (contains (x, \"Hallo\"));\n assertTrue (contains (x, \"Kopenhagen\"));\n assertFalse (contains (x, \"hallo\"));\n assertFalse (contai... | {
"fields": [
{
"declarator": "EMPTY_BOOLEAN_ARRAY = new boolean [0]",
"modifier": "public static final",
"original_string": "public static final boolean [] EMPTY_BOOLEAN_ARRAY = new boolean [0];",
"type": "boolean []",
"var_name": "EMPTY_BOOLEAN_ARRAY"
},
{
"declarator... | {
"body": "public static <ELEMENTTYPE> boolean contains (@Nullable final ELEMENTTYPE [] aValues, @Nullable final ELEMENTTYPE aSearchValue)\n {\n return getFirstIndex (aValues, aSearchValue) >= 0;\n }",
"class_method_signature": "ArrayHelper.contains(@Nullable final ELEMENTTYPE [] aValues, @Nullable final ELEME... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_283 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/ValueEnforcerTest.java",
"identifier": "ValueEnforcerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test (expected = NullPointerException.class)\n public void testNotNull ()\n {\n ValueEnforcer.notNull (null, \"null\");\n }",
"class_method_signature": "ValueEnforcerTest.testNotNull()",
"constructor": false,
"full_signature": "@Test (expected = NullPointerException.class) public void testNotN... | {
"fields": [
{
"declarator": "s_aEnabled = new AtomicBoolean (true)",
"modifier": "private static final",
"original_string": "private static final AtomicBoolean s_aEnabled = new AtomicBoolean (true);",
"type": "AtomicBoolean",
"var_name": "s_aEnabled"
},
{
"declarator"... | {
"body": "public static <T> T notNull (final T aValue, final String sName)\n {\n if (isEnabled ())\n if (aValue == null)\n throw new NullPointerException (\"The value of '\" + sName + \"' may not be null!\");\n return aValue;\n }",
"class_method_signature": "ValueEnforcer.notNull(final T aValue... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_329 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/io/stream/StreamHelperTest.java",
"identifier": "StreamHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetAvailable ()\n {\n final byte [] aInput = \"Hallo\".getBytes (StandardCharsets.ISO_8859_1);\n assertEquals (5, StreamHelper.getAvailable (new NonBlockingByteArrayInputStream (aInput)));\n assertEquals (0, StreamHelper.getAvailable ((InputStream) null));\n assertEqua... | {
"fields": [
{
"declarator": "DEFAULT_BUFSIZE = 16 * CGlobal.BYTES_PER_KILOBYTE",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_BUFSIZE = 16 * CGlobal.BYTES_PER_KILOBYTE;",
"type": "int",
"var_name": "DEFAULT_BUFSIZE"
},
{
"decl... | {
"body": "public static int getAvailable (@Nullable final InputStream aIS)\n {\n if (aIS != null)\n try\n {\n return aIS.available ();\n }\n catch (final IOException ex)\n {\n // Fall through\n }\n return 0;\n }",
"class_method_signature": "StreamHelper.getAvaila... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_450 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/math/MathHelperTest.java",
"identifier": "MathHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetRoundedUp ()\n {\n assertEquals (8, MathHelper.getRoundedUp (1, 8));\n assertEquals (8, MathHelper.getRoundedUp (8, 8));\n assertEquals (24, MathHelper.getRoundedUp (17, 8));\n assertEquals (80, MathHelper.getRoundedUp (79, 8));\n assertEquals (0, MathHelper.getR... | {
"fields": [
{
"declarator": "LONG_HIGH_BITS = 0xFFFFFFFF80000000L",
"modifier": "private static final",
"original_string": "private static final long LONG_HIGH_BITS = 0xFFFFFFFF80000000L;",
"type": "long",
"var_name": "LONG_HIGH_BITS"
},
{
"declarator": "s_aInstance =... | {
"body": "public static int getRoundedUp (final int nToRound, @Nonnegative final int nMultiple)\n {\n if (nMultiple == 0)\n return nToRound;\n\n final int nRest = nToRound % nMultiple;\n if (nRest == 0)\n return nToRound;\n if (nToRound < 0)\n return -abs (nToRound - nRest);\n return n... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_846 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/equals/EqualsHelperTest.java",
"identifier": "EqualsHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testArray ()\n {\n final String [] aArray = ArrayHelper.newArray (\"a\", \"b\", \"c\");\n assertTrue (EqualsHelper.equalsCollection (aArray, aArray));\n assertTrue (EqualsHelper.equalsCollection (aArray, ArrayHelper.newArray (\"a\", \"b\", \"c\")));\n assertTrue (EqualsHel... | {
"fields": [
{
"declarator": "s_aInstance = new EqualsHelper ()",
"modifier": "@PresentForCodeCoverage\n private static final",
"original_string": "@PresentForCodeCoverage\n private static final EqualsHelper s_aInstance = new EqualsHelper ();",
"type": "EqualsHelper",
"var_name": ... | {
"body": "public static boolean equalsCollection (@Nullable final Object aObj1, @Nullable final Object aObj2)\n {\n // Same object - check first\n if (identityEqual (aObj1, aObj2))\n return true;\n\n // Is only one value null?\n if (aObj1 == null || aObj2 == null)\n return false;\n\n final ... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_145 | {
"fields": [
{
"declarator": "TEST_NS = \"http://www.helger.com/dev/unittests/commons/\"",
"modifier": "private static final",
"original_string": "private static final String TEST_NS = \"http://www.helger.com/dev/unittests/commons/\";",
"type": "String",
"var_name": "TEST_NS"
}
... | {
"body": "@Test\n public void testGetDirectChildElementCount ()\n {\n final Document doc = XMLFactory.newDocument ();\n final Element eRoot = (Element) doc.appendChild (doc.createElement (\"root\"));\n eRoot.appendChild (doc.createElement (\"child\"));\n eRoot.appendChild (doc.createElement (\"child2\"... | {
"fields": [
{
"declarator": "s_aInstance = new XMLHelper ()",
"modifier": "@PresentForCodeCoverage\n private static final",
"original_string": "@PresentForCodeCoverage\n private static final XMLHelper s_aInstance = new XMLHelper ();",
"type": "XMLHelper",
"var_name": "s_aInstance... | {
"body": "@Nonnegative\n public static int getDirectChildElementCount (@Nullable final Element aParent)\n {\n return aParent == null ? 0 : CollectionHelper.getSize (getChildElementIterator (aParent));\n }",
"class_method_signature": "XMLHelper.getDirectChildElementCount(@Nullable final Element aParent)",
"... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
23062279_515 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/text/util/ABNFTest.java",
"identifier": "ABNFTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIsAlpha ()\n {\n for (int i = 'a'; i <= 'z'; ++i)\n assertTrue (ABNF.isAlpha (i));\n for (int i = 'A'; i <= 'Z'; ++i)\n assertTrue (ABNF.isAlpha (i));\n assertFalse (ABNF.isAlpha (0));\n }",
"class_method_signature": "ABNFTest.testIsAlpha()",
"constructor":... | {
"fields": [
{
"declarator": "CHECK_RANGE_MIN_INCL = 0x00",
"modifier": "public static final",
"original_string": "public static final int CHECK_RANGE_MIN_INCL = 0x00;",
"type": "int",
"var_name": "CHECK_RANGE_MIN_INCL"
},
{
"declarator": "CHECK_RANGE_MAX_INCL = 0x7f",... | {
"body": "public static boolean isAlpha (final int nCP)\n {\n return _isBitSet (nCP, BIT_ALPHA);\n }",
"class_method_signature": "ABNF.isAlpha(final int nCP)",
"constructor": false,
"full_signature": "public static boolean isAlpha(final int nCP)",
"identifier": "isAlpha",
"invocations": [
"_isBitS... | {
"created": "8/18/2014 7:21:36 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 23062279,
"size": null,
"stargazer_count": null,
"stars": 20,
"updates": "2020-01-27T18:40:50+00:00",
"url": "https://github.com/phax/ph-commons"
... |
128027255_0 | {
"fields": [],
"file": "storm-rpc-core/src/test/java/me/stormma/rpc/utils/InetUtilsTest.java",
"identifier": "InetUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetLocalHost() throws UnknownHostException {\n System.out.println(InetUtils.getLocalHost());\n }",
"class_method_signature": "InetUtilsTest.testGetLocalHost()",
"constructor": false,
"full_signature": "@Test public void testGetLocalHost()",
"identifier": "testGe... | {
"fields": [],
"file": "storm-rpc-core/src/main/java/me/stormma/rpc/utils/InetUtils.java",
"identifier": "InetUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "InetUtils.getLocalHost()",
"constructor": false,
"full_signature": "public static String getLocalHost()",
... | {
"body": "public static String getLocalHost() throws UnknownHostException {\n InetAddress inetAddress = InetAddress.getLocalHost();\n System.out.println(inetAddress.getHostAddress());\n return inetAddress.getHostAddress();\n }",
"class_method_signature": "InetUtils.getLocalHost()",
"const... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 128027255,
"size": 152,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/archervanderwaal/storm-rpc"
} |
6179800_5 | {
"fields": [],
"file": "cloudinary-core/src/test/java/com/cloudinary/TransformationTest.java",
"identifier": "TransformationTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDuration() throws Exception {\n Transformation transformation = new Transformation().ifCondition().duration(\"gt\", \"30\").then().width(100).crop(\"scale\");\n assertEquals(\"passing an operator and a value adds a condition\", \"if_du_gt_30,c_scale,w_100\", transfo... | {
"fields": [
{
"declarator": "VAR_NAME_RE = \"^\\\\$[a-zA-Z][a-zA-Z0-9]+$\"",
"modifier": "public static final",
"original_string": "public static final String VAR_NAME_RE = \"^\\\\$[a-zA-Z][a-zA-Z0-9]+$\";",
"type": "String",
"var_name": "VAR_NAME_RE"
},
{
"declarator... | {
"body": "public T duration(String value) {\n return param(\"duration\", value);\n }",
"class_method_signature": "Transformation.duration(String value)",
"constructor": false,
"full_signature": "public T duration(String value)",
"identifier": "duration",
"invocations": [
"param"
],
"modif... | {
"created": null,
"fork": null,
"fork_count": 97,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6179800,
"size": 1744,
"stargazer_count": 127,
"stars": null,
"updates": null,
"url": "https://github.com/cloudinary/cloudinary_java"
} |
6179800_9 | {
"fields": [],
"file": "cloudinary-core/src/test/java/com/cloudinary/api/signing/ApiResponseSignatureVerifierTest.java",
"identifier": "ApiResponseSignatureVerifierTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testVerifySignatureSHA256() {\n ApiResponseSignatureVerifier verifier = new ApiResponseSignatureVerifier(\"X7qLTrsES31MzxxkxPPA-pAGGfU\", SignatureAlgorithm.SHA256);\n\n boolean actual = verifier.verifySignature(\"tests/logo.png\", \"1\", \"cc69ae4ed73303fbf4a55f2ae5fc7... | {
"fields": [
{
"declarator": "secretKey",
"modifier": "private final",
"original_string": "private final String secretKey;",
"type": "String",
"var_name": "secretKey"
},
{
"declarator": "signatureAlgorithm",
"modifier": "private final",
"original_string": "... | {
"body": "public boolean verifySignature(String publicId, String version, String signature) {\n return Util.produceSignature(ObjectUtils.asMap(\n \"public_id\", emptyIfNull(publicId),\n \"version\", emptyIfNull(version)), secretKey, signatureAlgorithm).equals(signature);\n }",... | {
"created": null,
"fork": null,
"fork_count": 97,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6179800,
"size": 1744,
"stargazer_count": 127,
"stars": null,
"updates": null,
"url": "https://github.com/cloudinary/cloudinary_java"
} |
6179800_8 | {
"fields": [],
"file": "cloudinary-core/src/test/java/com/cloudinary/api/signing/ApiResponseSignatureVerifierTest.java",
"identifier": "ApiResponseSignatureVerifierTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testVerifySignatureFail() {\n ApiResponseSignatureVerifier verifier = new ApiResponseSignatureVerifier(\"X7qLTrsES31MzxxkxPPA-pAGGfU\");\n\n boolean actual = verifier.verifySignature(\"tests/logo.png\", \"1\", \"doesNotMatchForSure\");\n\n assertFalse(actual);\n ... | {
"fields": [
{
"declarator": "secretKey",
"modifier": "private final",
"original_string": "private final String secretKey;",
"type": "String",
"var_name": "secretKey"
},
{
"declarator": "signatureAlgorithm",
"modifier": "private final",
"original_string": "... | {
"body": "public boolean verifySignature(String publicId, String version, String signature) {\n return Util.produceSignature(ObjectUtils.asMap(\n \"public_id\", emptyIfNull(publicId),\n \"version\", emptyIfNull(version)), secretKey, signatureAlgorithm).equals(signature);\n }",... | {
"created": null,
"fork": null,
"fork_count": 97,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6179800,
"size": 1744,
"stargazer_count": 127,
"stars": null,
"updates": null,
"url": "https://github.com/cloudinary/cloudinary_java"
} |
6179800_4 | {
"fields": [],
"file": "cloudinary-core/src/test/java/com/cloudinary/TransformationTest.java",
"identifier": "TransformationTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void ifElse() throws Exception {\n String chained = \"[{if: \\\"w_lt_200\\\",crop: \\\"fill\\\",height: 120,width: 80},\\n\" +\n \" {if: \\\"else\\\",crop: \\\"fill\\\",height: 90, width: 100}]\";\n List transformations = ObjectUtils.toList(new JSONAr... | {
"fields": [
{
"declarator": "VAR_NAME_RE = \"^\\\\$[a-zA-Z][a-zA-Z0-9]+$\"",
"modifier": "public static final",
"original_string": "public static final String VAR_NAME_RE = \"^\\\\$[a-zA-Z][a-zA-Z0-9]+$\";",
"type": "String",
"var_name": "VAR_NAME_RE"
},
{
"declarator... | {
"body": "public T ifElse() {\n chain();\n return param(\"if\", \"else\");\n }",
"class_method_signature": "Transformation.ifElse()",
"constructor": false,
"full_signature": "public T ifElse()",
"identifier": "ifElse",
"invocations": [
"chain",
"param"
],
"modifiers": "public",... | {
"created": null,
"fork": null,
"fork_count": 97,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6179800,
"size": 1744,
"stargazer_count": 127,
"stars": null,
"updates": null,
"url": "https://github.com/cloudinary/cloudinary_java"
} |
6179800_10 | {
"fields": [],
"file": "cloudinary-core/src/test/java/com/cloudinary/api/signing/NotificationRequestSignatureVerifierTest.java",
"identifier": "NotificationRequestSignatureVerifierTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testVerifySignature() {\n NotificationRequestSignatureVerifier verifier = new NotificationRequestSignatureVerifier(\"someApiSecret\");\n\n boolean actual = verifier.verifySignature(\n \"{}\",\n \"0\",\n \"f9aa4471d2a88ff24442... | {
"fields": [
{
"declarator": "signedPayloadValidator",
"modifier": "private final",
"original_string": "private final SignedPayloadValidator signedPayloadValidator;",
"type": "SignedPayloadValidator",
"var_name": "signedPayloadValidator"
}
],
"file": "cloudinary-core/src/mai... | {
"body": "public boolean verifySignature(String body, String timestamp, String signature) {\n return signedPayloadValidator.validateSignedPayload(\n emptyIfNull(body) + emptyIfNull(timestamp),\n signature);\n }",
"class_method_signature": "NotificationRequestSignatureVerifie... | {
"created": null,
"fork": null,
"fork_count": 97,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6179800,
"size": 1744,
"stargazer_count": 127,
"stars": null,
"updates": null,
"url": "https://github.com/cloudinary/cloudinary_java"
} |
6179800_3 | {
"fields": [],
"file": "cloudinary-core/src/test/java/com/cloudinary/TransformationTest.java",
"identifier": "TransformationTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void endIf() throws Exception {\n String chained = \"[{if: \\\"w_lt_200\\\"},\\n\" +\n \" {crop: \\\"fill\\\", height: 120, width: 80,effect: \\\"sharpen\\\"},\\n\" +\n \" {effect: \\\"brightness:50\\\"},\\n\" +\n \" ... | {
"fields": [
{
"declarator": "VAR_NAME_RE = \"^\\\\$[a-zA-Z][a-zA-Z0-9]+$\"",
"modifier": "public static final",
"original_string": "public static final String VAR_NAME_RE = \"^\\\\$[a-zA-Z][a-zA-Z0-9]+$\";",
"type": "String",
"var_name": "VAR_NAME_RE"
},
{
"declarator... | {
"body": "public T endIf() {\n chain();\n int transSize = this.transformations.size();\n for (int i = transSize - 1; i >= 0; i--) {\n Map segment = this.transformations.get(i); // [..., {if: \"w_gt_1000\",c: \"fill\", w: 500}, ...]\n Object value = segment.get(\"if\");\n ... | {
"created": null,
"fork": null,
"fork_count": 97,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6179800,
"size": 1744,
"stargazer_count": 127,
"stars": null,
"updates": null,
"url": "https://github.com/cloudinary/cloudinary_java"
} |
6179800_2 | {
"fields": [],
"file": "cloudinary-core/src/test/java/com/cloudinary/TransformationTest.java",
"identifier": "TransformationTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void literalWithSpaces() throws Exception {\n Map map = ObjectUtils.asMap(\"if\", \"width < 200\", \"crop\", \"fill\", \"height\", 120, \"width\", 80);\n List<Map> list = new ArrayList<Map>();\n list.add(map);\n Transformation transformation = new Transformatio... | {
"fields": [
{
"declarator": "VAR_NAME_RE = \"^\\\\$[a-zA-Z][a-zA-Z0-9]+$\"",
"modifier": "public static final",
"original_string": "public static final String VAR_NAME_RE = \"^\\\\$[a-zA-Z][a-zA-Z0-9]+$\";",
"type": "String",
"var_name": "VAR_NAME_RE"
},
{
"declarator... | {
"body": "@Override\n public String toString() {\n return generate();\n }",
"class_method_signature": "Transformation.toString()",
"constructor": false,
"full_signature": "@Override public String toString()",
"identifier": "toString",
"invocations": [
"generate"
],
"modifiers": "@Overr... | {
"created": null,
"fork": null,
"fork_count": 97,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6179800,
"size": 1744,
"stargazer_count": 127,
"stars": null,
"updates": null,
"url": "https://github.com/cloudinary/cloudinary_java"
} |
6179800_11 | {
"fields": [],
"file": "cloudinary-core/src/test/java/com/cloudinary/api/signing/NotificationRequestSignatureVerifierTest.java",
"identifier": "NotificationRequestSignatureVerifierTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testVerifySignatureFailWhenSignatureDoesntMatch() {\n NotificationRequestSignatureVerifier verifier = new NotificationRequestSignatureVerifier(\"someApiSecret\");\n\n boolean actual = verifier.verifySignature(\n \"{}\",\n \"0\",\n ... | {
"fields": [
{
"declarator": "signedPayloadValidator",
"modifier": "private final",
"original_string": "private final SignedPayloadValidator signedPayloadValidator;",
"type": "SignedPayloadValidator",
"var_name": "signedPayloadValidator"
}
],
"file": "cloudinary-core/src/mai... | {
"body": "public boolean verifySignature(String body, String timestamp, String signature) {\n return signedPayloadValidator.validateSignedPayload(\n emptyIfNull(body) + emptyIfNull(timestamp),\n signature);\n }",
"class_method_signature": "NotificationRequestSignatureVerifie... | {
"created": null,
"fork": null,
"fork_count": 97,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6179800,
"size": 1744,
"stargazer_count": 127,
"stars": null,
"updates": null,
"url": "https://github.com/cloudinary/cloudinary_java"
} |
6179800_12 | {
"fields": [],
"file": "cloudinary-core/src/test/java/com/cloudinary/api/signing/NotificationRequestSignatureVerifierTest.java",
"identifier": "NotificationRequestSignatureVerifierTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testVerifySignatureFailWhenTooOld() {\n NotificationRequestSignatureVerifier verifier = new NotificationRequestSignatureVerifier(\"someApiSecret\");\n\n boolean actual = verifier.verifySignature(\n \"{}\",\n \"0\",\n \"f9aa44... | {
"fields": [
{
"declarator": "signedPayloadValidator",
"modifier": "private final",
"original_string": "private final SignedPayloadValidator signedPayloadValidator;",
"type": "SignedPayloadValidator",
"var_name": "signedPayloadValidator"
}
],
"file": "cloudinary-core/src/mai... | {
"body": "public boolean verifySignature(String body, String timestamp, String signature) {\n return signedPayloadValidator.validateSignedPayload(\n emptyIfNull(body) + emptyIfNull(timestamp),\n signature);\n }",
"class_method_signature": "NotificationRequestSignatureVerifie... | {
"created": null,
"fork": null,
"fork_count": 97,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6179800,
"size": 1744,
"stargazer_count": 127,
"stars": null,
"updates": null,
"url": "https://github.com/cloudinary/cloudinary_java"
} |
6179800_1 | {
"fields": [
{
"declarator": "KEY = \"00112233FF99\"",
"modifier": "public static final",
"original_string": "public static final String KEY = \"00112233FF99\";",
"type": "String",
"var_name": "KEY"
},
{
"declarator": "ALT_KEY = \"CCBB2233FF00\"",
"modifier": "pu... | {
"body": "@Test\n public void testConfiguration() {\n cloudinary = new Cloudinary(\"cloudinary://a:b@test123?load_strategies=false&auth_token[key]=aabbcc112233&auth_token[duration]=200\");\n assertEquals(cloudinary.config.authToken, new AuthToken(\"aabbcc112233\").duration(200));\n }",
"class_m... | {
"fields": [
{
"declarator": "NULL_AUTH_TOKEN = new AuthToken().setNull()",
"modifier": "public static final",
"original_string": "public static final AuthToken NULL_AUTH_TOKEN = new AuthToken().setNull();",
"type": "AuthToken",
"var_name": "NULL_AUTH_TOKEN"
},
{
"decl... | {
"body": "public AuthToken duration(long duration) {\n this.duration = duration;\n return this;\n }",
"class_method_signature": "AuthToken.duration(long duration)",
"constructor": false,
"full_signature": "public AuthToken duration(long duration)",
"identifier": "duration",
"invocations": ... | {
"created": null,
"fork": null,
"fork_count": 97,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6179800,
"size": 1744,
"stargazer_count": 127,
"stars": null,
"updates": null,
"url": "https://github.com/cloudinary/cloudinary_java"
} |
6179800_0 | {
"fields": [
{
"declarator": "START = \"2019-02-22 16:20:57 +0200\"",
"modifier": "public static final",
"original_string": "public static final String START = \"2019-02-22 16:20:57 +0200\";",
"type": "String",
"var_name": "START"
},
{
"declarator": "END = \"2019-03-22... | {
"body": "@Test\n public void encodeContext() throws Exception {\n Map context = ObjectUtils.asMap(\"caption\", \"different = caption\", \"alt2\", \"alt|alternative\");\n String result = Util.encodeContext(context);\n assertTrue(\"caption=different \\\\= caption|alt2=alt\\\\|alternative\".equ... | {
"fields": [
{
"declarator": "BOOLEAN_UPLOAD_OPTIONS = new String[]{\"backup\", \"exif\", \"faces\", \"colors\", \"image_metadata\", \"use_filename\", \"unique_filename\",\n \"eager_async\", \"invalidate\", \"discard_original_filename\", \"overwrite\", \"phash\", \"return_delete_token\", \"async... | {
"body": "protected static String encodeContext(Object context) {\n if (context instanceof Map) {\n Map<String, Object> mapArg = (Map<String, Object>) context;\n HashSet out = new HashSet();\n for (Map.Entry<String, Object> entry : mapArg.entrySet()) {\n final S... | {
"created": null,
"fork": null,
"fork_count": 97,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6179800,
"size": 1744,
"stargazer_count": 127,
"stars": null,
"updates": null,
"url": "https://github.com/cloudinary/cloudinary_java"
} |
6179800_13 | {
"fields": [],
"file": "cloudinary-core/src/test/java/com/cloudinary/api/signing/NotificationRequestSignatureVerifierTest.java",
"identifier": "NotificationRequestSignatureVerifierTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testVerifySignaturePassWhenStillValid() {\n NotificationRequestSignatureVerifier verifier = new NotificationRequestSignatureVerifier(\"someApiSecret\");\n\n boolean actual = verifier.verifySignature(\n \"{}\",\n \"0\",\n \"f9... | {
"fields": [
{
"declarator": "signedPayloadValidator",
"modifier": "private final",
"original_string": "private final SignedPayloadValidator signedPayloadValidator;",
"type": "SignedPayloadValidator",
"var_name": "signedPayloadValidator"
}
],
"file": "cloudinary-core/src/mai... | {
"body": "public boolean verifySignature(String body, String timestamp, String signature) {\n return signedPayloadValidator.validateSignedPayload(\n emptyIfNull(body) + emptyIfNull(timestamp),\n signature);\n }",
"class_method_signature": "NotificationRequestSignatureVerifie... | {
"created": null,
"fork": null,
"fork_count": 97,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6179800,
"size": 1744,
"stargazer_count": 127,
"stars": null,
"updates": null,
"url": "https://github.com/cloudinary/cloudinary_java"
} |
6179800_7 | {
"fields": [],
"file": "cloudinary-core/src/test/java/com/cloudinary/api/signing/ApiResponseSignatureVerifierTest.java",
"identifier": "ApiResponseSignatureVerifierTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testVerifySignature() {\n ApiResponseSignatureVerifier verifier = new ApiResponseSignatureVerifier(\"X7qLTrsES31MzxxkxPPA-pAGGfU\");\n\n boolean actual = verifier.verifySignature(\"tests/logo.png\", \"1\", \"08d3107a5b2ad82e7d82c0b972218fbf20b5b1e0\");\n\n assert... | {
"fields": [
{
"declarator": "secretKey",
"modifier": "private final",
"original_string": "private final String secretKey;",
"type": "String",
"var_name": "secretKey"
},
{
"declarator": "signatureAlgorithm",
"modifier": "private final",
"original_string": "... | {
"body": "public boolean verifySignature(String publicId, String version, String signature) {\n return Util.produceSignature(ObjectUtils.asMap(\n \"public_id\", emptyIfNull(publicId),\n \"version\", emptyIfNull(version)), secretKey, signatureAlgorithm).equals(signature);\n }",... | {
"created": null,
"fork": null,
"fork_count": 97,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6179800,
"size": 1744,
"stargazer_count": 127,
"stars": null,
"updates": null,
"url": "https://github.com/cloudinary/cloudinary_java"
} |
6179800_14 | {
"fields": [],
"file": "cloudinary-core/src/test/java/com/cloudinary/api/signing/NotificationRequestSignatureVerifierTest.java",
"identifier": "NotificationRequestSignatureVerifierTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testVerifySignatureFailWhenStillValidButSignatureDoesntMatch() {\n NotificationRequestSignatureVerifier verifier = new NotificationRequestSignatureVerifier(\"someApiSecret\");\n\n boolean actual = verifier.verifySignature(\n \"{}\",\n \"0\"... | {
"fields": [
{
"declarator": "signedPayloadValidator",
"modifier": "private final",
"original_string": "private final SignedPayloadValidator signedPayloadValidator;",
"type": "SignedPayloadValidator",
"var_name": "signedPayloadValidator"
}
],
"file": "cloudinary-core/src/mai... | {
"body": "public boolean verifySignature(String body, String timestamp, String signature) {\n return signedPayloadValidator.validateSignedPayload(\n emptyIfNull(body) + emptyIfNull(timestamp),\n signature);\n }",
"class_method_signature": "NotificationRequestSignatureVerifie... | {
"created": null,
"fork": null,
"fork_count": 97,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6179800,
"size": 1744,
"stargazer_count": 127,
"stars": null,
"updates": null,
"url": "https://github.com/cloudinary/cloudinary_java"
} |
6179800_15 | {
"fields": [],
"file": "cloudinary-core/src/test/java/com/cloudinary/api/signing/NotificationRequestSignatureVerifierTest.java",
"identifier": "NotificationRequestSignatureVerifierTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testVerifySignatureSHA256() {\n NotificationRequestSignatureVerifier verifier = new NotificationRequestSignatureVerifier(\"someApiSecret\", SignatureAlgorithm.SHA256);\n\n boolean actual = verifier.verifySignature(\n \"{}\",\n \"0\",\n ... | {
"fields": [
{
"declarator": "signedPayloadValidator",
"modifier": "private final",
"original_string": "private final SignedPayloadValidator signedPayloadValidator;",
"type": "SignedPayloadValidator",
"var_name": "signedPayloadValidator"
}
],
"file": "cloudinary-core/src/mai... | {
"body": "public boolean verifySignature(String body, String timestamp, String signature) {\n return signedPayloadValidator.validateSignedPayload(\n emptyIfNull(body) + emptyIfNull(timestamp),\n signature);\n }",
"class_method_signature": "NotificationRequestSignatureVerifie... | {
"created": null,
"fork": null,
"fork_count": 97,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6179800,
"size": 1744,
"stargazer_count": 127,
"stars": null,
"updates": null,
"url": "https://github.com/cloudinary/cloudinary_java"
} |
6179800_6 | {
"fields": [],
"file": "cloudinary-core/src/test/java/com/cloudinary/TransformationTest.java",
"identifier": "TransformationTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testVariable(){\n // using strings\n Transformation t = new Transformation();\n t.variable(\"$foo\", 10)\n .chain()\n .ifCondition(faceCount().gt(2))\n .crop(\"scale\")\n .width(new Condition(\"$foo * 20... | {
"fields": [
{
"declarator": "VAR_NAME_RE = \"^\\\\$[a-zA-Z][a-zA-Z0-9]+$\"",
"modifier": "public static final",
"original_string": "public static final String VAR_NAME_RE = \"^\\\\$[a-zA-Z][a-zA-Z0-9]+$\";",
"type": "String",
"var_name": "VAR_NAME_RE"
},
{
"declarator... | {
"body": "public T variable(String name, Object value) {\n return param(name, value);\n }",
"class_method_signature": "Transformation.variable(String name, Object value)",
"constructor": false,
"full_signature": "public T variable(String name, Object value)",
"identifier": "variable",
"invocation... | {
"created": null,
"fork": null,
"fork_count": 97,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6179800,
"size": 1744,
"stargazer_count": 127,
"stars": null,
"updates": null,
"url": "https://github.com/cloudinary/cloudinary_java"
} |
54671444_40 | {
"fields": [],
"file": "core/src/test/java/com/pipeclamp/constraints/bytes/SimplePrefixMatcherTest.java",
"identifier": "SimplePrefixMatcherTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void matchesPredefined() {\n\n\t\tbyte[] data = AbstractConstraintTest.readResource(\"32px.png\");\n\n\t\tassertTrue(SimplePrefixMatcher.PNG.matches(data));\n\t\tassertFalse(SimplePrefixMatcher.GIF.matches(data));\n\t\tassertFalse(SimplePrefixMatcher.PDF.matches(data));\n\t\t\n\t\tdata = Ab... | {
"fields": [
{
"declarator": "offset",
"modifier": "private final",
"original_string": "private final int offset;",
"type": "int",
"var_name": "offset"
},
{
"declarator": "prefixes",
"modifier": "private final",
"original_string": "private final byte[][] pr... | {
"body": "@Override\n\tpublic boolean matches(byte[] data) {\n\n\t\tfor (byte[] prefix : prefixes) {\n\t\t\tif (ByteUtil.matches(data, prefix, offset)) return true;\n\t\t}\n\t\treturn false;\n\t}",
"class_method_signature": "SimplePrefixMatcher.matches(byte[] data)",
"constructor": false,
"full_signature": "@O... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 54671444,
"size": 614,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/Comcast/pipeclamp"
} |
54671444_17 | {
"fields": [
{
"declarator": "Tests = new String[][] {\n\t\t{ \"0\", \"0\", \"0\", \"0\", \"0\" },\n\t\t{ \"5\", \"0\", \"10\" },\n\t\t{ \"0\", \"-3\", \"3\" },\n\t\t{ \"2\", \"1\", \"3\" },\n\t\t}",
"modifier": "private static final",
"original_string": "private static final String[][]... | {
"body": "@Test\n\tpublic void computeInts() {\n\n\t\tfor (String[] test : Tests) {\n\t\t\tInteger expectedResult = Integer.parseInt(test[0]);\n\t\t\tList<Integer> nums = intsOf(test);\n\t\t\t\n\t\t\tCollector<Integer> collector = asFinalCollector(nums);\n\t\t\t\n\t\t\tInteger result = Averager.IntAvg.compute(collec... | {
"fields": [
{
"declarator": "summer",
"modifier": "private final",
"original_string": "private final Summer<I> summer;",
"type": "Summer<I>",
"var_name": "summer"
},
{
"declarator": "multiplier",
"modifier": "private final",
"original_string": "private fin... | {
"body": "@Override\n\tpublic I compute(Collector<I> collector) {\n\n\t\tI sum = summer.compute(collector);\n\n\t\treturn multiplier.divide(sum, collector.collected());\n\t}",
"class_method_signature": "Averager.compute(Collector<I> collector)",
"constructor": false,
"full_signature": "@Override public I compu... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 54671444,
"size": 614,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/Comcast/pipeclamp"
} |
54671444_37 | {
"fields": [],
"file": "core/src/test/java/com/pipeclamp/constraints/bytes/ByteArraySizeConstraintTest.java",
"identifier": "ByteArraySizeConstraintTest",
"interfaces": "",
"superclass": "extends AbstractConstraintTest"
} | {
"body": "@Test\n\tpublic void testBuilder() {\n\n\t\tMap<String,String> paramsByKey = asParams(ByteArraySizeConstraint.MIN_SIZE, 2, ByteArraySizeConstraint.MAX_SIZE, 4);\n\t\tMap<String,String> paramsCopy = new HashMap<>();\n\t\tparamsCopy.putAll(paramsByKey);\n\t\t\n\t\tCollection<Constraint<?>> vcs = ByteArraySiz... | {
"fields": [
{
"declarator": "minSize",
"modifier": "private final",
"original_string": "private final Integer minSize;",
"type": "Integer",
"var_name": "minSize"
},
{
"declarator": "maxSize",
"modifier": "private final",
"original_string": "private final I... | {
"body": "@Override\n\tpublic Map<Parameter<?>, Object> parameters() {\n\n\t\tMap<Parameter<?>, Object> params = new HashMap<>(2);\n\t\tif (minSize != null) params.put(MIN_SIZE, minSize);\n\t\tif (maxSize != null) params.put(MAX_SIZE, maxSize);\n\t\treturn params;\n\t}",
"class_method_signature": "ByteArraySizeCon... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 54671444,
"size": 614,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/Comcast/pipeclamp"
} |
54671444_21 | {
"fields": [],
"file": "core/src/test/java/com/pipeclamp/metrics/MetricDescriptorTest.java",
"identifier": "MetricDescriptorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void hashCodeTest() {\n\t \n\t MetricDescriptor md1 = new MetricDescriptor(\"beatFrequency\", \"Beat frequency\", null, \"Hz\", \"The interference resulting from the union of two signals\");\n\t MetricDescriptor md2 = new MetricDescriptor(\"beatFrequency\", \"Beat frequency\", null, \"Hz... | {
"fields": [
{
"declarator": "label",
"modifier": "public final",
"original_string": "public final String label;",
"type": "String",
"var_name": "label"
},
{
"declarator": "function",
"modifier": "public final",
"original_string": "public final Function<? e... | {
"body": "@Override\n\tpublic int hashCode() {\n\t\treturn super.hashCode() + Objects.hash(label, function, unitLabel);\n\t}",
"class_method_signature": "MetricDescriptor.hashCode()",
"constructor": false,
"full_signature": "@Override public int hashCode()",
"identifier": "hashCode",
"invocations": [
"... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 54671444,
"size": 614,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/Comcast/pipeclamp"
} |
54671444_6 | {
"fields": [],
"file": "core/src/test/java/com/pipeclamp/avro/AvroUtilTest.java",
"identifier": "AvroUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void parseSchemaTest() {\n \n\t byte[] schemaBytes = AbstractConstraintTest.readResource(\"recursive_example.avsc\");\n\t Schema sc = AvroUtil.parseSchema(new String(schemaBytes));\n\t \n\t assertNotNull(sc);\n\n }",
"class_method_signature": "AvroUtilTest.parseSchemaTest()",
"co... | {
"fields": [],
"file": "core/src/main/java/com/pipeclamp/avro/AvroUtil.java",
"identifier": "AvroUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "AvroUtil.AvroUtil()",
"constructor": true,
"full_signature": "private AvroUtil()",
"identifier": "AvroUtil",
"... | {
"body": "public static Schema parseSchema(String schemaString) {\n\t\ttry {\n\t\t\tSchema.Parser parser1 = new Schema.Parser();\n\t\t\treturn parser1.parse(schemaString);\n\t\t} catch (SchemaParseException e) {\n\t\t\treturn null;\n\t\t}\n\t}",
"class_method_signature": "AvroUtil.parseSchema(String schemaString)"... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 54671444,
"size": 614,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/Comcast/pipeclamp"
} |
54671444_20 | {
"fields": [],
"file": "core/src/test/java/com/pipeclamp/metrics/MetricDescriptorTest.java",
"identifier": "MetricDescriptorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void equals() {\n\t MetricDescriptor md1 = new MetricDescriptor(\"beatFrequency\", \"Beat frequency\", null, \"Hz\", \"The interference resulting from the union of two signals\");\n\t MetricDescriptor md2 = new MetricDescriptor(\"beatFrequency\", \"Beat frequency\", null, \"Hz\", \"The in... | {
"fields": [
{
"declarator": "label",
"modifier": "public final",
"original_string": "public final String label;",
"type": "String",
"var_name": "label"
},
{
"declarator": "function",
"modifier": "public final",
"original_string": "public final Function<? e... | {
"body": "@Override\n\tpublic boolean equals(Object other) {\n\n\t\tif (!super.equals(other)) return false;\n\n\t\tif (!(other instanceof MetricDescriptor)) return false;\n\n\t\tMetricDescriptor md = MetricDescriptor.class.cast(other);\n\n\t\treturn\n\t\t\t\tObjects.deepEquals(label, md.label) &&\n\t\t\t\tObjects.de... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 54671444,
"size": 614,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/Comcast/pipeclamp"
} |
54671444_7 | {
"fields": [],
"file": "core/src/test/java/com/pipeclamp/avro/AvroConstraintUtilTest.java",
"identifier": "AvroConstraintUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void constraintsIn() {\n\n\t\tbyte[] schemaBytes = AbstractConstraintTest.readResource(\"person.avsc\");\n\t\tSchema sc = AvroUtil.parseSchema(new String(schemaBytes));\n\n\t\tMap<Path<GenericRecord, ?>, Collection<Constraint<?>>> constraints = AvroConstraintUtil.constraintsIn(sc, true, Avr... | {
"fields": [
{
"declarator": "TypeKey = \"_type\"",
"modifier": "public static final",
"original_string": "public static final String TypeKey = \"_type\";",
"type": "String",
"var_name": "TypeKey"
},
{
"declarator": "AllowNullKey = \"allowNull\"",
"modifier": "pu... | {
"body": "public static Map<Path<GenericRecord,?>, Collection<Constraint<?>>> constraintsIn(Schema schema, boolean flagUnknowns, ConstraintFactory<Schema.Type> factory) {\n\n\t\treturn constraintParamsIn(schema, factory);\n\t}",
"class_method_signature": "AvroConstraintUtil.constraintsIn(Schema schema, boolean fla... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 54671444,
"size": 614,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/Comcast/pipeclamp"
} |
54671444_36 | {
"fields": [],
"file": "core/src/test/java/com/pipeclamp/constraints/bytes/BytePrefixConstraintTest.java",
"identifier": "BytePrefixConstraintTest",
"interfaces": "",
"superclass": "extends AbstractConstraintTest"
} | {
"body": "@Test\n\tpublic void typedErrorFor() {\n\n\t\tMap<String,String> paramsByKey = asParams(BytePrefixConstraint.MATCHERS, \"GIF\");\n\n\t\tCollection<Constraint<?>> vcs = BytePrefixConstraint.Builder.constraintsFrom(Schema.Type.BYTES, false, paramsByKey);\n\n\t\tValueConstraint<?> vc = (ValueConstraint<?>)vcs... | {
"fields": [
{
"declarator": "matchers",
"modifier": "private final",
"original_string": "private final SignatureMatcher[] matchers;",
"type": "SignatureMatcher[]",
"var_name": "matchers"
},
{
"declarator": "TypeTag = \"prefixes\"",
"modifier": "private static fi... | {
"body": "@Override\n\tpublic Violation typedErrorFor(byte[] values) {\n\n\t\tfor (SignatureMatcher matcher : matchers) {\n\t\t\tif (matcher.matches(values)) return null;\n\t\t}\n\n\t\treturn new Violation(this, \"Unable to match existing prefixes\");\n\t}",
"class_method_signature": "BytePrefixConstraint.typedErr... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 54671444,
"size": 614,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/Comcast/pipeclamp"
} |
54671444_16 | {
"fields": [
{
"declarator": "Tests = new String[][] {\n\t\t{ \"0\", \"0\", \"0\", \"0\", \"0\" },\n\t\t{ \"2\", \"2\", \"4\", \"4\", \"4\", \"5\", \"5\", \"7\", \"9\" },\n\t\t}",
"modifier": "private static final",
"original_string": "private static final String[][] Tests = new String[][... | {
"body": "@Test\n\tpublic void computeLongs() {\n\n\t\tfor (String[] test : Tests) {\n\t\t\tLong expectedResult = Long.parseLong(test[0]);\n\t\t\tList<Long> nums = longsOf(test);\n\n\t\t\tCollector<Long> collector = asFinalCollector(nums);\n\n\t\t\tLong result = StdDeviation.LongDev.compute(collector);\n\t\t\tAssert... | {
"fields": [
{
"declarator": "summer",
"modifier": "private final",
"original_string": "private final Summer<I> summer;",
"type": "Summer<I>",
"var_name": "summer"
},
{
"declarator": "multiplier",
"modifier": "private final",
"original_string": "private fin... | {
"body": "@Override\n\tpublic I compute(Collector<I> collector) {\n\n\t\tI avg = averager.compute(collector);\n\n\t\tList<I> deviations = new ArrayList<I>(collector.collected());\n\t\tfor (I value : collector.all()) {\n\t\t\tdeviations.add( summer.subtract(avg, value));\n\t\t}\n\t\tList<I> squares = new ArrayList<I>... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 54671444,
"size": 614,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/Comcast/pipeclamp"
} |
54671444_41 | {
"fields": [],
"file": "core/src/test/java/com/pipeclamp/constraints/string/RegexDescriptorTest.java",
"identifier": "RegexDescriptorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void matches() {\n \n\t for (RegexDescriptor rd : RegexDescriptor.ALL.values()) {\n\t\t assertTrue(rd.matches(rd.example));\n\t }\n }",
"class_method_signature": "RegexDescriptorTest.matches()",
"constructor": false,
"full_signature": "@Test public void matches()",
"identifier... | {
"fields": [
{
"declarator": "regex",
"modifier": "public final",
"original_string": "public final String regex;",
"type": "String",
"var_name": "regex"
},
{
"declarator": "pattern",
"modifier": "private final",
"original_string": "private final Pattern pat... | {
"body": "public boolean matches(String text) {\n\t\treturn pattern.matcher(text).matches();\n\t}",
"class_method_signature": "RegexDescriptor.matches(String text)",
"constructor": false,
"full_signature": "public boolean matches(String text)",
"identifier": "matches",
"invocations": [
"matches",
"... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 54671444,
"size": 614,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/Comcast/pipeclamp"
} |
54671444_31 | {
"fields": [],
"file": "core/src/test/java/com/pipeclamp/constraints/BasicConstraintFactoryTest.java",
"identifier": "BasicConstraintFactoryTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void showOn() {\n \n\t try {\n\t\t AvroConfiguration.ConstraintFactory.showOn(System.out);\n\t\t \t} catch (Exception ex) {\n\t\t \t\tfail(ex.getMessage());\n\t\t \t}\n }",
"class_method_signature": "BasicConstraintFactoryTest.showOn()",
"constructor": false,
"full_signature":... | {
"fields": [
{
"declarator": "typesByStringType",
"modifier": "private final",
"original_string": "private final Map<String, T> typesByStringType;",
"type": "Map<String, T>",
"var_name": "typesByStringType"
},
{
"declarator": "buildersByType = new HashMap<>()",
"... | {
"body": "@Override\n\tpublic void showOn(PrintStream out) {\n\n\t\tfinal int paramIdWidth = 12;\n\n\t\tfor (Entry<T, Map<String, ConstraintBuilder<?>>> entry : buildersByType.entrySet()) {\n\t\t\tout.println();\n\t\t\tout.println(entry.getKey());\n\t\t\tfor (ConstraintBuilder<?> builder : entry.getValue().values())... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 54671444,
"size": 614,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/Comcast/pipeclamp"
} |
54671444_27 | {
"fields": [],
"file": "core/src/test/java/com/pipeclamp/params/ByteArrayParameterTest.java",
"identifier": "ByteArrayParameterTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void asByteArray() {\n \tByteArrayParameter bap = new ByteArrayParameter(\"a\", \"aye\", \" \");\n \t\n \tbyte[][] values = bap.valueIn(\"1\", null);\n \tassertNull(values);\n \t\n \tvalues = bap.valueIn(\"1 4\", null);\n \tassertNull(values);\n \t\n \tvalues = ba... | {
"fields": [
{
"declarator": "regexSplitter",
"modifier": "private final",
"original_string": "private final String regexSplitter;",
"type": "String",
"var_name": "regexSplitter"
}
],
"file": "core/src/main/java/com/pipeclamp/params/ByteArrayParameter.java",
"identifier": ... | {
"body": "@Override\n\tpublic byte[][] valueIn(String text, Type type) {\n\n\t\tif (text == null) return null;\n\n\t\tString[] values = text.split(regexSplitter);\n\t\tif (values.length == 0) return null;\n\n\t\tbyte[][] arrays = new byte[values.length][];\n\n\t\tfor (int i=0; i<values.length; i++) {\n\t\t\tarrays[i... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 54671444,
"size": 614,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/Comcast/pipeclamp"
} |
54671444_0 | {
"fields": [],
"file": "core/src/test/java/com/pipeclamp/avro/AvroUtilTest.java",
"identifier": "AvroUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void allowsNull() {\n\t \n\tassertFalse( AvroUtil.allowsNull(Person.SCHEMA$) );\n\t\n\tField field = Person.SCHEMA$.getField(\"birthdate\");\n\tassertTrue( AvroUtil.allowsNull( field.schema() ));\n\t\n\tfield = Person.SCHEMA$.getField(\"lastname\");\n\tassertFalse( AvroUtil.allowsNull( fi... | {
"fields": [],
"file": "core/src/main/java/com/pipeclamp/avro/AvroUtil.java",
"identifier": "AvroUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "AvroUtil.AvroUtil()",
"constructor": true,
"full_signature": "private AvroUtil()",
"identifier": "AvroUtil",
"... | {
"body": "public static boolean allowsNull(Schema schema) {\n\n\t\tif (schema.getType() == Type.UNION) {\n\t\t\tfor (Schema sch : schema.getTypes()) {\n\t\t\t\tif (sch.getType() == Type.NULL) return true;\n\t\t\t}\n\t\t};\n\t\treturn false;\n\t}",
"class_method_signature": "AvroUtil.allowsNull(Schema schema)",
"... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 54671444,
"size": 614,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/Comcast/pipeclamp"
} |
54671444_50 | {
"fields": [],
"file": "core/src/test/java/com/pipeclamp/constraints/multivalue/ComparativeConstraintTest.java",
"identifier": "ComparativeConstraintTest",
"interfaces": "",
"superclass": "extends AbstractConstraintTest"
} | {
"body": "@Test\n\tpublic void testEvaluate() {\n\t\t\n\t\tConstraintBuilder<?> builder = ComparativeConstraint.builderFor(\" \", SimpleAvroPath.Builder);\n\t\n\t\tMap<String,String> paramsByKey = asParams(\n\t\t\t\tComparativeConstraint.Path1, \"birthdate\", \n\t\t\t\tComparativeConstraint.Path2, \"deathdate\",\n\t... | {
"fields": [
{
"declarator": "op1Path",
"modifier": "private final",
"original_string": "private final Path<T,?> op1Path;",
"type": "Path<T,?>",
"var_name": "op1Path"
},
{
"declarator": "op2Path",
"modifier": "private final",
"original_string": "private fin... | {
"body": "@Override\n\tpublic Violation evaluate(Map<Path<T,?>, Object> values) {\n\n\t\tComparable a = (Comparable)values.get(op1Path);\n\t\tComparable b = (Comparable)values.get(op2Path);\n\n\t\tif (a== null || b == null) return null;\t// unable to compare\n\n\t\tif (comparison.comp.check(a, b)) return null;\n\n\t... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 54671444,
"size": 614,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/Comcast/pipeclamp"
} |
54671444_46 | {
"fields": [],
"file": "core/src/test/java/com/pipeclamp/constraints/timestamp/TimestampRangeConstraintTest.java",
"identifier": "TimestampRangeConstraintTest",
"interfaces": "",
"superclass": "extends AbstractConstraintTest"
} | {
"body": "@Test\n\tpublic void typedErrorFor() {\n\n\t\tMap<String,String> paramsByKey = asParams(\n\t\t\t\tTimestampRangeConstraint.MIN_TIMESTAMP, \"2016-02-01 00:00:00\",\n\t\t\t\tTimestampRangeConstraint.MAX_TIMESTAMP, \"2016-03-01 00:00:00\");\n\n\t\tCollection<Constraint<?>> vcs = TimestampRangeConstraint.Build... | {
"fields": [
{
"declarator": "minTimestamp",
"modifier": "private final",
"original_string": "private final Long minTimestamp;",
"type": "Long",
"var_name": "minTimestamp"
},
{
"declarator": "maxTimestamp",
"modifier": "private final",
"original_string": "p... | {
"body": "@Override\n\tpublic Violation typedErrorFor(Long value) {\n\n\t\tif (minTimestamp != null && minTimestamp > value) {\n\t\t\treturn new Violation(this, MIN_TIMESTAMP.asString(value) + \" is too early, earliest is \" + MIN_TIMESTAMP.asString(minTimestamp));\n\t\t}\n\t\tif (maxTimestamp != null && maxTimestam... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 54671444,
"size": 614,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/Comcast/pipeclamp"
} |
54671444_11 | {
"fields": [
{
"declarator": "mf = MetricFactory.Instance",
"modifier": "private static final",
"original_string": "private static final MetricFactory mf = MetricFactory.Instance;",
"type": "MetricFactory",
"var_name": "mf"
}
],
"file": "core/src/test/java/com/pipeclamp/metr... | {
"body": "@Test\n public void availableFunctionsFor() {\n\t \n\t MetricFactory mf = MetricFactory.Instance;\n\t \n\t List<String> expectedNumericFns = Arrays.asList(Summer.Id, Histogram.Id, Averager.Id, MinMax.Id, StdDeviation.Id);\n\n\t Set<String> functions = mf.availableFunctionsFor(Integer.class);\n\t ass... | {
"fields": [
{
"declarator": "buildersByFunction = new HashMap<>()",
"modifier": "private final",
"original_string": "private final Map<String, Map<Class<?>, Function<?,?>>> buildersByFunction = new HashMap<>();",
"type": "Map<String, Map<Class<?>, Function<?,?>>>",
"var_name": "bui... | {
"body": "public Set<String> availableFunctionsFor(Class<?> javaType) {\n\n\t\tSet<String> functions = new HashSet<>(buildersByFunction.size());\n\t\tfor (Entry<String, Map<Class<?>, Function<?,?>>> entry : buildersByFunction.entrySet()) {\n\t\t\tif (entry.getValue().containsKey(javaType)) functions.add(entry.getKey... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 54671444,
"size": 614,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/Comcast/pipeclamp"
} |
54671444_10 | {
"fields": [],
"file": "core/src/test/java/com/pipeclamp/avro/AvroMetricUtilTest.java",
"identifier": "AvroMetricUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void allMetricsIn() {\n\t \n\t Map<Path<GenericRecord, ?>, Map<String, MetricDescriptor>> metrics = AvroMetricUtil.metricsIn(Person.SCHEMA$);\n\t \n\t assertEquals(metrics.size(), 1);\n }",
"class_method_signature": "AvroMetricUtilTest.allMetricsIn()",
"constructor": false,
"full_... | {
"fields": [
{
"declarator": "MetricsKey = \"metrics\"",
"modifier": "private static final",
"original_string": "private static final String MetricsKey = \"metrics\";",
"type": "String",
"var_name": "MetricsKey"
},
{
"declarator": "MetricFunctionKey = \"function\"",
... | {
"body": "private static Map<String, MetricDescriptor> allMetricsIn(JsonNode cstNode, Schema schema) {\n\n\t\tif (Type.UNION == schema.getType() && schema.getTypes().size() > 2) throw new RuntimeException(\"Cannot currently handle more than two major datatypes in a UNION\");\n\n\t\tMap<String, MetricDescriptor> metr... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 54671444,
"size": 614,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/Comcast/pipeclamp"
} |
54671444_47 | {
"fields": [],
"file": "core/src/test/java/com/pipeclamp/constraints/timestamp/TimestampEraConstraintTest.java",
"identifier": "TimestampEraConstraintTest",
"interfaces": "",
"superclass": "extends AbstractConstraintTest"
} | {
"body": "@Test\n public void typedErrorFor() {\n \n\t Map<String,String> paramsByKey = asParams(TimestampEraConstraint.Era, TimestampRestriction.Historical);\n\n\t Collection<Constraint<?>> vcs = TimestampEraConstraint.Builder.constraintsFrom(Schema.Type.LONG, false, paramsByKey);\n\n\t ValueConstraint<?> vc... | {
"fields": [
{
"declarator": "restriction",
"modifier": "private final",
"original_string": "private final TimestampRestriction restriction;",
"type": "TimestampRestriction",
"var_name": "restriction"
},
{
"declarator": "TypeTag = \"timestampEra\"",
"modifier": "... | {
"body": "@Override\n\tpublic Violation typedErrorFor(Long value) {\n\n\t\tswitch (restriction) {\n\t\t\tcase Future \t: return checkFuture(value);\n\t\t\tcase Historical : return checkHistorical(value);\n\t\t\t}\n\t\treturn null;\n\t}",
"class_method_signature": "TimestampEraConstraint.typedErrorFor(Long value)",... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 54671444,
"size": 614,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/Comcast/pipeclamp"
} |
54671444_26 | {
"fields": [],
"file": "core/src/test/java/com/pipeclamp/params/IntegerRangeParameterTest.java",
"identifier": "IntegerRangeParameterTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void valueInTest() {\n \n\t IntegerRangeParameter ipr = new IntegerRangeParameter(\"a\", \"Aye\", \" \");\n\t Integer[] range = ipr.valueIn(\"5 19\", null);\n\t \n\t assertNotNull(range);\n\t assertEquals(2, range.length);\n\t assertEquals(5, range[0].intValue());\n\t assertEquals... | {
"fields": [
{
"declarator": "regexSplitter",
"modifier": "private final",
"original_string": "private final String regexSplitter;",
"type": "String",
"var_name": "regexSplitter"
}
],
"file": "core/src/main/java/com/pipeclamp/params/IntegerRangeParameter.java",
"identifier... | {
"body": "@Override\n\tpublic Integer[] valueIn(String text, Type type) {\n\n\t\tif (text == null || text.length() == 0) return null;\n\n\t\tString[] parts = text.split(regexSplitter);\n\t\tif (parts.length != 2) return null;\n\n\t\treturn new Integer[] {\n\t\t\t\tInteger.parseInt(parts[0]),\n\t\t\t\tInteger.parseIn... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 54671444,
"size": 614,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/Comcast/pipeclamp"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.