id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
23062279_527 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/text/util/ABNFTest.java",
"identifier": "ABNFTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIsSP ()\n {\n assertTrue (ABNF.isSP (0x20));\n assertFalse (ABNF.isSP (0));\n }",
"class_method_signature": "ABNFTest.testIsSP()",
"constructor": false,
"full_signature": "@Test public void testIsSP()",
"identifier": "testIsSP",
"invocations": [
"assertTrue",
... | {
"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 isSP (final int nCP)\n {\n return _isBitSet (nCP, BIT_SP);\n }",
"class_method_signature": "ABNF.isSP(final int nCP)",
"constructor": false,
"full_signature": "public static boolean isSP(final int nCP)",
"identifier": "isSP",
"invocations": [
"_isBitSet"
],
"mod... | {
"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_177 | {
"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 testNull ()\n {\n assertNull (MicroReader.readMicroXML ((InputSource) null));\n assertNull (MicroReader.readMicroXML ((InputStream) null));\n assertNull (MicroReader.readMicroXML ((IReadableResource) null));\n assertNull (MicroReader.readMicroXML ((IHasInputStream) null));... | {
"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_874 | {
"fields": [],
"file": "ph-security/src/test/java/com/helger/security/password/hash/PasswordHashCreatorSHA512Test.java",
"identifier": "PasswordHashCreatorSHA512Test",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testBasic ()\n {\n final String sPlainTextPassword = \"123456\";\n final PasswordHashCreatorSHA512 a = new PasswordHashCreatorSHA512 ();\n final String sPW1 = a.createPasswordHash (null, sPlainTextPassword);\n final String sPW2 = a.createPasswordHash (null, sPlainTextPassw... | {
"fields": [
{
"declarator": "ALGORITHM = \"default\"",
"modifier": "public static final",
"original_string": "public static final String ALGORITHM = \"default\";",
"type": "String",
"var_name": "ALGORITHM"
},
{
"declarator": "USER_PASSWORD_ALGO = EMessageDigestAlgorit... | {
"body": "@Nonnull\n public String createPasswordHash (@Nullable final IPasswordSalt aSalt, @Nonnull final String sPlainTextPassword)\n {\n ValueEnforcer.notNull (sPlainTextPassword, \"PlainTextPassword\");\n\n return MessageDigestValue.create (sPlainTextPassword.getBytes (StandardCharsets.UTF_8), USER_PASSW... | {
"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_618 | {
"fields": [
{
"declarator": "CONVERTIBLE_CLASSES = new Class <?> [] { Boolean.class,\n Byte.class,\n Character.class,\n ... | {
"body": "@Test\n public void testLocale ()\n {\n // Check if conversion works for all locales\n for (final Locale aLocale : LocaleCache.getInstance ().getAllLocales ())\n {\n final String sLocale = TypeConverter.convert (aLocale, String.class);\n assertNotNull (aLocale.toString (), sLocale);\n ... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger (TypeConverter.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger (TypeConverter.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
... | {
"body": "@Nullable\n public static <DSTTYPE> DSTTYPE convert (final boolean aSrcValue, @Nonnull final Class <DSTTYPE> aDstClass)\n {\n return convert (Boolean.valueOf (aSrcValue), aDstClass);\n }",
"class_method_signature": "TypeConverter.convert(final boolean aSrcValue, @Nonnull final Class <DSTTYPE> aDstC... | {
"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_248 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/charset/CharsetHelperTest.java",
"identifier": "CharsetHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetUTF8ByteCount ()\n {\n assertEquals (0, CharsetHelper.getUTF8ByteCount ((String) null));\n assertEquals (0, CharsetHelper.getUTF8ByteCount ((char []) null));\n\n assertEquals (2, CharsetHelper.getUTF8ByteCount (\"\\0\"));\n assertEquals (2, CharsetHelper.getUTF8Byte... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger (CharsetHelper.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger (CharsetHelper.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
... | {
"body": "@Nonnegative\n public static int getUTF8ByteCount (@Nullable final String s)\n {\n return s == null ? 0 : getUTF8ByteCount (s.toCharArray ());\n }",
"class_method_signature": "CharsetHelper.getUTF8ByteCount(@Nullable final String s)",
"constructor": false,
"full_signature": "@Nonnegative 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_51 | {
"fields": [],
"file": "ph-tree/src/test/java/com/helger/tree/sort/TreeSorterTest.java",
"identifier": "TreeSorterTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testTreeNumeric ()\n {\n final DefaultTree <BigDecimal> aTree = new DefaultTree <> ();\n final DefaultTreeItem <BigDecimal> i1 = aTree.getRootItem ().createChildItem (BigDecimal.valueOf (2));\n i1.createChildItem (BigDecimal.valueOf (20));\n i1.createChildItem (BigDecimal.... | {
"fields": [
{
"declarator": "s_aInstance = new TreeSorter ()",
"modifier": "@PresentForCodeCoverage\n private static final",
"original_string": "@PresentForCodeCoverage\n private static final TreeSorter s_aInstance = new TreeSorter ();",
"type": "TreeSorter",
"var_name": "s_aInst... | {
"body": "public static <DATATYPE, ITEMTYPE extends ITreeItem <DATATYPE, ITEMTYPE>> void sort (@Nonnull final IBasicTree <? extends DATATYPE, ITEMTYPE> aTree,\n @Nonnull final Comparator <? super DATATYPE> aValueComparator)\n {\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_474 | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger (CombinationGeneratorFlexibleTest.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger (CombinationGeneratorFlexibleTest.class);",
"type": "Logger",
... | {
"body": "@Test\n @SuppressFBWarnings (\"TQ_NEVER_VALUE_USED_WHERE_ALWAYS_REQUIRED\")\n public void testStringCombination ()\n {\n final ICommonsList <String> aElements = new CommonsArrayList <> (\"A\", \"B\", \"B\");\n\n // Allow empty\n CombinationGeneratorFlexible <String> aGenerator = new Combination... | {
"fields": [
{
"declarator": "m_bAllowEmpty",
"modifier": "private final",
"original_string": "private final boolean m_bAllowEmpty;",
"type": "boolean",
"var_name": "m_bAllowEmpty"
},
{
"declarator": "m_nSlotCount",
"modifier": "private final",
"original_st... | {
"body": "@Nonnull\n @ReturnsMutableCopy\n public ICommonsSet <ICommonsList <DATATYPE>> getCombinations (@Nonnull final ICommonsList <DATATYPE> aElements)\n {\n ValueEnforcer.notNull (aElements, \"Elements\");\n\n final ICommonsSet <ICommonsList <DATATYPE>> aAllResults = new CommonsHashSet <> ();\n itera... | {
"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_862 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/version/VersionRangeTest.java",
"identifier": "VersionRangeTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testEquals ()\n {\n final VersionRange vr1 = VersionRange.parse (\"(1.2,2.0]\");\n assertEquals (vr1, vr1);\n assertNotEquals (vr1, null);\n assertNotEquals (vr1, \"Not a VersionRange\");\n CommonsTestHelper.testDefaultImplementationWithEqualContentObject (vr1, VersionR... | {
"fields": [
{
"declarator": "DEFAULT_VERSION_RANGE_STRING = \"[0)\"",
"modifier": "public static final",
"original_string": "public static final String DEFAULT_VERSION_RANGE_STRING = \"[0)\";",
"type": "String",
"var_name": "DEFAULT_VERSION_RANGE_STRING"
},
{
"declara... | {
"body": "@Override\n public boolean equals (final Object o)\n {\n if (o == this)\n return true;\n if (o == null || !getClass ().equals (o.getClass ()))\n return false;\n\n final VersionRange rhs = (VersionRange) o;\n return m_bIncludeFloor == rhs.m_bIncludeFloor &&\n m_aFloorVersio... | {
"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_161 | {
"fields": [],
"file": "ph-xml/src/test/java/com/helger/xml/microdom/util/MicroHelperTest.java",
"identifier": "MicroHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetPath ()\n {\n final IMicroDocument aDoc = new MicroDocument ();\n assertEquals (\"#document\", MicroHelper.getPath (aDoc, \"/\"));\n final IMicroElement eRoot = aDoc.appendElement (\"root\");\n assertEquals (\"#document/root\", MicroHelper.getPath (eRoot, \"/\"));\n... | {
"fields": [
{
"declarator": "s_aInstance = new MicroHelper ()",
"modifier": "@PresentForCodeCoverage\n private static final",
"original_string": "@PresentForCodeCoverage\n private static final MicroHelper s_aInstance = new MicroHelper ();",
"type": "MicroHelper",
"var_name": "s_a... | {
"body": "@Nonnull\n @SuppressFBWarnings (\"IL_INFINITE_LOOP\")\n public static String getPath (@Nullable final IMicroNode aNode, @Nonnull final String sSep)\n {\n ValueEnforcer.notNull (sSep, \"Separator\");\n\n final StringBuilder aSB = new StringBuilder ();\n IMicroNode aCurrentNode = aNode;\n whil... | {
"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_531 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/text/resolve/DefaultTextResolverTest.java",
"identifier": "DefaultTextResolverTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetTextWithArgs ()\n {\n final Locale aDE = TextHelper.DE;\n final Locale aEN = TextHelper.EN;\n\n // Regular\n assertEquals (\"Text3abcde\", EText.TEXT3.getDisplayTextWithArgs (aDE, \"abc\"));\n assertEquals (\"Text3abcen\", EText.TEXT3.getDisplayTextWithArgs (aEN,... | {
"fields": [
{
"declarator": "s_bDefaultInstantiated = false",
"modifier": "private static",
"original_string": "private static boolean s_bDefaultInstantiated = false;",
"type": "boolean",
"var_name": "s_bDefaultInstantiated"
}
],
"file": "ph-commons/src/main/java/com/helger... | {
"body": "@Nonnull\n public static DefaultTextResolver getInstance ()\n {\n final DefaultTextResolver ret = SingletonHolder.s_aInstance;\n s_bDefaultInstantiated = true;\n return ret;\n }",
"class_method_signature": "DefaultTextResolver.getInstance()",
"constructor": false,
"full_signature": "@Nonn... | {
"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_423 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/callback/exception/LoggingExceptionCallbackTest.java",
"identifier": "LoggingExceptionCallbackTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testAll ()\n {\n new LoggingExceptionCallback ().onException (new MockException ());\n }",
"class_method_signature": "LoggingExceptionCallbackTest.testAll()",
"constructor": false,
"full_signature": "@Test public void testAll()",
"identifier": "testAll",
"invocations": [... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger (LoggingExceptionCallback.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger (LoggingExceptionCallback.class);",
"type": "Logger",
"var_name": "L... | {
"body": "public void onException (@Nullable final Throwable t)\n {\n final String sLogMessage = getLogMessage (t);\n final boolean bLogException = isLogException (t);\n LogHelper.log (LOGGER, m_aErrorLevel, sLogMessage, bLogException ? t : null);\n }",
"class_method_signature": "LoggingExceptionCallbac... | {
"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_589 | {
"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 testParseMultipleQuotes () throws IOException\n {\n final ICommonsList <String> aNextLine = m_aParser.parseLine (\"\\\"\\\"\\\"\\\"\\\"\\\",\\\"test\\\"\\n\"); // \"\"\"\"\"\",\"test\"\n // representing:\n // \"\",\n // test\n assertEquals (\"\\\"\\\"\", aNextLine.get (... | {
"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_566 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/csv/CSVReaderTest.java",
"identifier": "CSVReaderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testReaderCanHandleNullInString () throws IOException\n {\n final StringBuilder aSB = new StringBuilder (CCSV.INITIAL_STRING_SIZE);\n aSB.append (\"a,\\0b,aReader\");\n\n try (final NonBlockingStringReader reader = new NonBlockingStringReader (aSB.toString ());\n fina... | {
"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_136 | {
"fields": [],
"file": "ph-xml/src/test/java/com/helger/xml/XMLFactoryTest.java",
"identifier": "XMLFactoryTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCreateDefaultDocumentBuilderFactory ()\n {\n final DocumentBuilderFactory dbf = XMLFactory.createDefaultDocumentBuilderFactory ();\n assertNotNull (dbf);\n assertTrue (dbf.isCoalescing ());\n assertTrue (dbf.isIgnoringComments ());\n assertTrue (dbf.isNamespaceAware... | {
"fields": [
{
"declarator": "DEFAULT_DOM_NAMESPACE_AWARE = true",
"modifier": "public static final",
"original_string": "public static final boolean DEFAULT_DOM_NAMESPACE_AWARE = true;",
"type": "boolean",
"var_name": "DEFAULT_DOM_NAMESPACE_AWARE"
},
{
"declarator": "... | {
"body": "@Nonnull\n public static DocumentBuilderFactory createDefaultDocumentBuilderFactory ()\n {\n final DocumentBuilderFactory aDocumentBuilderFactory = DocumentBuilderFactory.newInstance ();\n aDocumentBuilderFactory.setNamespaceAware (DEFAULT_DOM_NAMESPACE_AWARE);\n aDocumentBuilderFactory.setValid... | {
"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_835 | {
"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 testGetReverseInlineList ()\n {\n ICommonsList <String> aList = newList (\"1\", \"3\", \"2\");\n\n // Sort inline\n assertSame (aList, getReverseInlineList (aList));\n assertEquals (3, aList.size ());\n assertEquals (\"2\", aList.get (0));\n assertEquals (\"3\", aLis... | {
"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 @ReturnsMutableObject (\"semantics of this method\")\n @CodingStyleguideUnaware\n public static <ELEMENTTYPE, LISTTYPE extends List <ELEMENTTYPE>> LISTTYPE getReverseInlineList (@Nullable final LISTTYPE aList)\n {\n if (aList == null)\n return null;\n\n Collections.reverse (aList... | {
"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_91 | {
"fields": [],
"file": "ph-collection/src/test/java/com/helger/collection/safe/SafeVectorTest.java",
"identifier": "SafeVectorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@SuppressWarnings (\"unused\")\n @Test\n public void testSafeVectorNewInstanceFactory ()\n {\n try\n {\n new SafeVector <String> (null);\n fail ();\n }\n catch (final NullPointerException ex)\n {}\n\n // create with a \"null\"-creating factory\n final SafeVector <String> s... | {
"fields": [
{
"declarator": "m_aFactory",
"modifier": "@MustImplementEqualsAndHashcode\n private final",
"original_string": "@MustImplementEqualsAndHashcode\n private final Supplier <? extends ELEMENTTYPE> m_aFactory;",
"type": "Supplier <? extends ELEMENTTYPE>",
"var_name": "m_a... | {
"body": "@Override\n public synchronized ELEMENTTYPE get (@Nonnegative final int nIndex)\n {\n _ensureSize (nIndex);\n return super.get (nIndex);\n }",
"class_method_signature": "SafeVector.get(@Nonnegative final int nIndex)",
"constructor": false,
"full_signature": "@Override public synchronized ELE... | {
"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_267 | {
"fields": [
{
"declarator": "CHARSET = StandardCharsets.UTF_8",
"modifier": "private static final",
"original_string": "private static final Charset CHARSET = StandardCharsets.UTF_8;",
"type": "Charset",
"var_name": "CHARSET"
}
],
"file": "ph-commons/src/test/java/com/helge... | {
"body": "@Test\n public void testGetDecodedLength ()\n {\n final Base32Codec aBase32 = new Base32Codec ();\n assertEquals (0, aBase32.getMaximumDecodedLength (0));\n for (int i = 1; i <= 8; ++i)\n assertEquals (5, aBase32.getMaximumDecodedLength (i));\n for (int i = 9; i <= 16; ++i)\n assert... | {
"fields": [
{
"declarator": "DECODE_TABLE = { // 00-0f\n -1,\n -1,\n -1,\n -1,\n ... | {
"body": "@Override\n public int getMaximumDecodedLength (final int nLen)\n {\n return MathHelper.getRoundedUp (nLen, 8) * 5 / 8;\n }",
"class_method_signature": "Base32Codec.getMaximumDecodedLength(final int nLen)",
"constructor": false,
"full_signature": "@Override public int getMaximumDecodedLength(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_637 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/id/factory/MemoryStaticLongIDFactoryTest.java",
"identifier": "MemoryStaticLongIDFactoryTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testAll ()\n {\n final MemoryStaticLongIDFactory x = new MemoryStaticLongIDFactory ();\n assertTrue (x.getNewID () >= MemoryStaticLongIDFactory.INITIAL_ID);\n CommonsTestHelper.testDefaultImplementationWithEqualContentObject (x, new MemoryStaticLongIDFactory ());\n }",
"cl... | {
"fields": [
{
"declarator": "INITIAL_ID = 10000L",
"modifier": "public static final",
"original_string": "public static final long INITIAL_ID = 10000L;",
"type": "long",
"var_name": "INITIAL_ID"
},
{
"declarator": "s_aID = new AtomicLong (INITIAL_ID)",
"modifier... | {
"body": "@Nonnegative\n public long getNewID ()\n {\n return getNewStaticID ();\n }",
"class_method_signature": "MemoryStaticLongIDFactory.getNewID()",
"constructor": false,
"full_signature": "@Nonnegative public long getNewID()",
"identifier": "getNewID",
"invocations": [
"getNewStaticID"
],
... | {
"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_322 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/io/stream/BitOutputStreamTest.java",
"identifier": "BitOutputStreamTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testWriteManyBigEndian () throws IOException\n {\n final Random aRandom = new Random ();\n for (int i = 0; i < 200; i += 3)\n {\n final byte [] buf = new byte [i * 100];\n aRandom.nextBytes (buf);\n\n try (final NonBlockingByteArrayOutputStream aBAOS = new NonB... | {
"fields": [
{
"declarator": "m_aLock = new SimpleLock ()",
"modifier": "private final",
"original_string": "private final SimpleLock m_aLock = new SimpleLock ();",
"type": "SimpleLock",
"var_name": "m_aLock"
}
],
"file": "ph-commons/src/main/java/com/helger/commons/io/strea... | {
"body": "@Override\n public void flush () throws IOException\n {\n m_aLock.lockedThrowing (super::flush);\n }",
"class_method_signature": "BitOutputStream.flush()",
"constructor": false,
"full_signature": "@Override public void flush()",
"identifier": "flush",
"invocations": [
"lockedThrowing"
... | {
"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_772 | {
"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 testIsDouble ()\n {\n assertTrue (StringParser.isDouble (\"1\"));\n assertTrue (StringParser.isDouble (\"1.2\"));\n assertTrue (StringParser.isDouble (\"1,2\"));\n assertTrue (StringParser.isDouble (\"0\"));\n assertTrue (StringParser.isDouble (\"0000\"));\n assertTr... | {
"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": "public static boolean isDouble (@Nullable final String sStr)\n {\n return !Double.isNaN (parseDouble (sStr, Double.NaN));\n }",
"class_method_signature": "StringParser.isDouble(@Nullable final String sStr)",
"constructor": false,
"full_signature": "public static boolean isDouble(@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_288 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/ValueEnforcerTest.java",
"identifier": "ValueEnforcerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test (expected = IllegalArgumentException.class)\n public void testNotEmpty5 ()\n {\n ValueEnforcer.notEmpty (new char [0], \"null\");\n }",
"class_method_signature": "ValueEnforcerTest.testNotEmpty5()",
"constructor": false,
"full_signature": "@Test (expected = IllegalArgumentException.class)... | {
"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 extends CharSequence> T notEmpty (final T aValue, final String sName)\n {\n if (isEnabled ())\n return notEmpty (aValue, () -> sName);\n return aValue;\n }",
"class_method_signature": "ValueEnforcer.notEmpty(final T aValue, final String sName)",
"constructor": false,
"fu... | {
"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_660 | {
"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 testGetHexValue ()\n {\n assertEquals (0, StringHelper.getHexValue ('0'));\n assertEquals (9, StringHelper.getHexValue ('9'));\n assertEquals (10, StringHelper.getHexValue ('a'));\n assertEquals (10, StringHelper.getHexValue ('A'));\n assertEquals (15, StringHelper.getH... | {
"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": "@CheckForSigned\n public static int getHexValue (@Nonnegative final char c)\n {\n return Character.digit (c, CGlobal.HEX_RADIX);\n }",
"class_method_signature": "StringHelper.getHexValue(@Nonnegative final char c)",
"constructor": false,
"full_signature": "@CheckForSigned public static int getH... | {
"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_230 | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger (DOMReaderTest.class)",
"modifier": "@SuppressWarnings (\"unused\")\n private static final",
"original_string": "@SuppressWarnings (\"unused\")\n private static final Logger LOGGER = LoggerFactory.getLogger (DOMReaderTest.class);"... | {
"body": "@Test\n public void testReadProcessingInstruction ()\n {\n // Read file with processing instruction\n final Document doc = DOMReader.readXMLDOM (new ClassPathResource (\"xml/xml-processing-instruction.xml\"));\n assertNotNull (doc);\n\n // Write again\n assertNotNull (XMLWriter.getNodeAsSt... | {
"fields": [
{
"declarator": "s_aDomTimerHdl = StatisticsManager.getTimerHandler (DOMReader.class.getName () +\n \"$DOM\")",
"modifier": "private static final",
"original_string": "private s... | {
"body": "@Nullable\n public static Document readXMLDOM (@WillClose @Nonnull final InputSource aIS)\n {\n return readXMLDOM (aIS, new DOMReaderSettings ());\n }",
"class_method_signature": "DOMReader.readXMLDOM(@WillClose @Nonnull final InputSource aIS)",
"constructor": false,
"full_signature": "@Nullabl... | {
"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_29 | {
"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 testIndentedHeaderAndFooter ()\n {\n // related to CLI-207\n final Options options = new Options ();\n final HelpFormatter formatter = new HelpFormatter ();\n final String header = \" Header1\\n Header2\";\n final String footer = \" Footer1\\n Footer2\";\n try (f... | {
"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 printHelp (@Nonnull @Nonempty final String sCmdLineSyntax, @Nonnull final Options aOptions)\n {\n printHelp (getWidth (), sCmdLineSyntax, null, aOptions, null, false);\n }",
"class_method_signature": "HelpFormatter.printHelp(@Nonnull @Nonempty final String sCmdLineSyntax, @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_725 | {
"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 testReplaceMultipleTo () throws IOException\n {\n NonBlockingStringWriter aSW = new NonBlockingStringWriter ();\n StringHelper.replaceMultipleTo (\"a\", new char [] { 'a' }, new char [] [] { \"bb\".toCharArray () }, aSW);\n assertEquals (\"bb\", aSW.getAsString ());\n\n aS... | {
"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 replaceMultipleTo (@Nullable final String sInputString,\n @Nonnull final char [] aSearchChars,\n @Nonnull final char [] [] aReplacementStrings,\n @Nonnull fina... | {
"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_375 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/io/file/FileOperationsTest.java",
"identifier": "FileOperationsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDeleteFile ()\n {\n _expectedError (FileOperations.deleteFile (new File (\"warum sollte es diese Datei geben\")), EFileIOErrorCode.SOURCE_DOES_NOT_EXIST);\n final File f = new File (\"delfile.test\");\n try\n {\n SimpleFileIO.writeFile (f, \"abc\".getBytes (Standa... | {
"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 deleteFile (@Nonnull final File aFile)\n {\n ValueEnforcer.notNull (aFile, \"File\");\n\n if (!FileHelper.existsFile (aFile))\n return EFileIOErrorCode.SOURCE_DOES_NOT_EXIST.getAsIOError (EFileIOOperation.DELETE_FILE, aFile);\n\n // Is the parent directo... | {
"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_119 | {
"fields": [
{
"declarator": "FIELD1 = \"field1\"",
"modifier": "private static final",
"original_string": "private static final String FIELD1 = \"field1\";",
"type": "String",
"var_name": "FIELD1"
},
{
"declarator": "FIELD2 = \"field2\"",
"modifier": "private st... | {
"body": "@SuppressWarnings (\"unused\")\n @Test\n @SuppressFBWarnings (\"NP_NONNULL_PARAM_VIOLATION\")\n public void testIllegal ()\n {\n try\n {\n // null name not allowed\n new Settings ((String) null);\n fail ();\n }\n catch (final NullPointerException ex)\n {}\n\n try\n {... | {
"fields": [
{
"declarator": "m_sName",
"modifier": "private final",
"original_string": "private final String m_sName;",
"type": "String",
"var_name": "m_sName"
}
],
"file": "ph-settings/src/main/java/com/helger/settings/Settings.java",
"identifier": "Settings",
"interfa... | {
"body": "@Nonnull\n @Override\n public EChange putIn (@Nonnull @Nonempty final String sName, @Nullable final Object aNewValue)\n {\n // Additional check, that name may not be empty\n ValueEnforcer.notEmpty (sName, \"Name\");\n\n return super.putIn (sName, aNewValue);\n }",
"class_method_signature": "... | {
"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_549 | {
"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 testParseInt ()\n {\n assertEquals (1000, LocaleParser.parseInt (\"1.000\", L_DE, CGlobal.ILLEGAL_UINT));\n assertEquals (1000, LocaleParser.parseInt (\"1,000\", L_EN, CGlobal.ILLEGAL_UINT));\n assertEquals (CGlobal.ILLEGAL_UINT, LocaleParser.parseInt (\"... und denken\", L_E... | {
"fields": [
{
"declarator": "s_aInstance = new LocaleParser ()",
"modifier": "@PresentForCodeCoverage\n private static final",
"original_string": "@PresentForCodeCoverage\n private static final LocaleParser s_aInstance = new LocaleParser ();",
"type": "LocaleParser",
"var_name": ... | {
"body": "public static int parseInt (@Nullable final String sStr, @Nonnull final Locale aParseLocale, final int nDefault)\n {\n return parseInt (sStr, NumberFormat.getIntegerInstance (aParseLocale), nDefault);\n }",
"class_method_signature": "LocaleParser.parseInt(@Nullable final String sStr, @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_226 | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger (DOMReaderTest.class)",
"modifier": "@SuppressWarnings (\"unused\")\n private static final",
"original_string": "@SuppressWarnings (\"unused\")\n private static final Logger LOGGER = LoggerFactory.getLogger (DOMReaderTest.class);"... | {
"body": "@Test\n public void testReadXMLDOMInputSource ()\n {\n Document doc = DOMReader.readXMLDOM (\"<root/>\");\n assertNotNull (doc);\n doc = DOMReader.readXMLDOM (new NonBlockingStringReader (\"<root/>\"));\n assertNotNull (doc);\n doc = DOMReader.readXMLDOM (new StringSAXInputSource (\"<root/... | {
"fields": [
{
"declarator": "s_aDomTimerHdl = StatisticsManager.getTimerHandler (DOMReader.class.getName () +\n \"$DOM\")",
"modifier": "private static final",
"original_string": "private s... | {
"body": "@Nullable\n public static Document readXMLDOM (@WillClose @Nonnull final InputSource aIS)\n {\n return readXMLDOM (aIS, new DOMReaderSettings ());\n }",
"class_method_signature": "DOMReader.readXMLDOM(@WillClose @Nonnull final InputSource aIS)",
"constructor": false,
"full_signature": "@Nullabl... | {
"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_676 | {
"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 @SuppressFBWarnings (\"TQ_NEVER_VALUE_USED_WHERE_ALWAYS_REQUIRED\")\n public void testImplodeArray ()\n {\n final String [] aArray = new String [] { \"a\", \"b\", \"c\" };\n assertEquals (\"a.b\", StringHelper.getImploded (\".\", aArray, 0, 2));\n assertEquals (\"ab\", StringHelper.getI... | {
"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 getImploded (@Nullable final Iterable <?> aElements)\n {\n return getImplodedMapped (aElements, String::valueOf);\n }",
"class_method_signature": "StringHelper.getImploded(@Nullable final Iterable <?> aElements)",
"constructor": false,
"full_signature": "@Nonnull... | {
"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_363 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/io/file/FileHelperTest.java",
"identifier": "FileHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetOutputStream ()\n {\n try\n {\n FileHelper.getOutputStream ((File) null);\n fail ();\n }\n catch (final NullPointerException ex)\n {}\n try\n {\n FileHelper.getOutputStream ((File) null, EAppend.APPEND);\n fail ();\n }\n catch (fin... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger (FileHelper.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger (FileHelper.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"d... | {
"body": "@Nullable\n public static FileOutputStream getOutputStream (@Nonnull final File aFile)\n {\n return getOutputStream (aFile, EAppend.DEFAULT);\n }",
"class_method_signature": "FileHelper.getOutputStream(@Nonnull final File aFile)",
"constructor": false,
"full_signature": "@Nullable public static... | {
"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_699 | {
"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 testTrimLeadingWhitespaces ()\n {\n assertEquals (\"Hallo Welt\", StringHelper.trimLeadingWhitespaces (\"Hallo Welt\"));\n assertEquals (\"Hallo Welt \", StringHelper.trimLeadingWhitespaces (\" Hallo Welt \"));\n assertEquals (\"Hallo Welt \", StringHelper.trimLeadingWhitesp... | {
"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 trimLeadingWhitespaces (@Nullable final String s)\n {\n final int n = getLeadingWhitespaceCount (s);\n return n == 0 ? s : s.substring (n, s.length ());\n }",
"class_method_signature": "StringHelper.trimLeadingWhitespaces(@Nullable final Stri... | {
"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_733 | {
"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 testGetWithoutTrailingChar ()\n {\n assertEquals (\"abc\", StringHelper.getWithoutTrailingChar (\"abcd\"));\n assertEquals (\"a\", StringHelper.getWithoutTrailingChar (\"ab\"));\n assertEquals (\"\", StringHelper.getWithoutTrailingChar (\"a\"));\n assertEquals (\"\", Strin... | {
"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 getWithoutTrailingChar (@Nullable final String sStr)\n {\n return getWithoutTrailingChars (sStr, 1);\n }",
"class_method_signature": "StringHelper.getWithoutTrailingChar(@Nullable final String sStr)",
"constructor": false,
"full_signature": "@Nonnull public stati... | {
"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_621 | {
"fields": [
{
"declarator": "CONVERTIBLE_CLASSES = new Class <?> [] { Boolean.class,\n Byte.class,\n Character.class,\n ... | {
"body": "@Test\n public void testConvertToObject ()\n {\n final Object aObj = TypeConverter.convert (this, Object.class);\n assertNotNull (aObj);\n assertSame (this, aObj);\n }",
"class_method_signature": "TypeConverterTest.testConvertToObject()",
"constructor": false,
"full_signature": "@Test pub... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger (TypeConverter.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger (TypeConverter.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
... | {
"body": "@Nullable\n public static <DSTTYPE> DSTTYPE convert (final boolean aSrcValue, @Nonnull final Class <DSTTYPE> aDstClass)\n {\n return convert (Boolean.valueOf (aSrcValue), aDstClass);\n }",
"class_method_signature": "TypeConverter.convert(final boolean aSrcValue, @Nonnull final Class <DSTTYPE> aDstC... | {
"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_271 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/codec/ASCII85CodecTest.java",
"identifier": "ASCII85CodecTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDecode ()\n {\n final String sEncoded = \"<~9jqo^BlbD-BleB1DJ+*+F(f,q/0JhKF<GL>Cj@.4Gp$d7F!,L7@<6@)/0JDEF<G%<+EV:2F!,\\n\" +\n \"O<DJ+*.@<*K0@<6L(Df-\\\\0Ec5e;DffZ(EZee.Bl.9pF\\\"AGXBPCsi+DGm>@3BB/F*&OCAfu2/AKY\\n\" +\n \"i(... | {
"fields": [
{
"declarator": "BIT1 = 8",
"modifier": "private static final",
"original_string": "private static final int BIT1 = 8;",
"type": "int",
"var_name": "BIT1"
},
{
"declarator": "BIT2 = 16",
"modifier": "private static final",
"original_string": "p... | {
"body": "public void decode (@Nullable final byte [] aEncodedBuffer,\n @Nonnegative final int nOfs,\n @Nonnegative final int nLen,\n @Nonnull @WillNotClose final OutputStream aOS)\n {\n if (aEncodedBuffer == null)\n return;\n ValueEnforcer.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_87 | {
"fields": [],
"file": "ph-json/src/test/java/com/helger/json/convert/JsonConverterTest.java",
"identifier": "JsonConverterTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSimpleValues ()\n {\n assertTrue (JsonConverter.convertToJson (Boolean.TRUE) instanceof JsonValue);\n assertTrue (JsonConverter.convertToJson (Byte.valueOf ((byte) 0)) instanceof JsonValue);\n assertTrue (JsonConverter.convertToJson (Character.valueOf ('\\0')) instanceof ... | {
"fields": [
{
"declarator": "s_aInstance = new JsonConverter ()",
"modifier": "@PresentForCodeCoverage\n private static final",
"original_string": "@PresentForCodeCoverage\n private static final JsonConverter s_aInstance = new JsonConverter ();",
"type": "JsonConverter",
"var_nam... | {
"body": "@Nonnull\n public static IJson convertToJson (@Nullable final Object aObject)\n {\n if (aObject == null)\n return JsonValue.NULL;\n\n if (aObject instanceof IJson)\n return (IJson) aObject;\n\n if (aObject instanceof IHasJson)\n return ((IHasJson) aObject).getAsJson ();\n\n if ... | {
"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_68 | {
"fields": [],
"file": "ph-graph/src/test/java/com/helger/graph/iterate/GraphIteratorTest.java",
"identifier": "GraphIteratorTest",
"interfaces": "",
"superclass": "extends AbstractGraphTestCase"
} | {
"body": "@Test\n public void testGraphIterator ()\n {\n try\n {\n // null node not allowed\n new GraphIterator (null);\n fail ();\n }\n catch (final NullPointerException ex)\n {}\n\n final IMutableGraph aGraph = _buildGraph ();\n final GraphIterator it = new GraphIterator (aGra... | {
"fields": [
{
"declarator": "m_aHandledObjects = new CommonsHashSet <> ()",
"modifier": "private final",
"original_string": "private final ICommonsSet <String> m_aHandledObjects = new CommonsHashSet <> ();",
"type": "ICommonsSet <String>",
"var_name": "m_aHandledObjects"
},
... | {
"body": "public GraphIterator (@Nonnull final IMutableGraphNode aStartNode)\n {\n ValueEnforcer.notNull (aStartNode, \"startNode\");\n\n // Collect all nodes, depth first\n final ICommonsList <IMutableGraphNode> aList = new CommonsArrayList <> ();\n _traverseDFS (aStartNode, aList);\n m_aIter = aLis... | {
"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_764 | {
"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 testParseFloat ()\n {\n final float fDefault = 3.145667f;\n\n // Object\n CommonsAssert.assertEquals (fDefault, StringParser.parseFloat ((Object) null, fDefault));\n CommonsAssert.assertEquals (1, StringParser.parseFloat (BigDecimal.ONE, fDefault));\n CommonsAssert.asse... | {
"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": "public static float parseFloat (@Nullable final Object aObject, final float fDefault)\n {\n if (aObject == null)\n return fDefault;\n if (aObject instanceof Number)\n return ((Number) aObject).floatValue ();\n return parseFloat (aObject.toString (), fDefault);\n }",
"class_method_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_334 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/io/stream/StreamHelperTest.java",
"identifier": "StreamHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetAllCharacters ()\n {\n final String sInput = \"Hallo\";\n assertEquals (sInput, StreamHelper.getAllCharactersAsString (new NonBlockingStringReader (sInput)));\n assertNull (StreamHelper.getAllCharactersAsString ((Reader) null));\n\n assertArrayEquals (sInput.toCharA... | {
"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": "@Nullable\n public static char [] getAllCharacters (@Nullable @WillClose final Reader aReader)\n {\n if (aReader == null)\n return null;\n\n final NonBlockingStringWriter aWriter = getCopy (aReader);\n if (aWriter == null)\n return null;\n\n return aWriter.getAsCharArray ();\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_158 | {
"fields": [],
"file": "ph-xml/src/test/java/com/helger/xml/microdom/util/MicroVisitorTest.java",
"identifier": "MicroVisitorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testVisitStatic ()\n {\n // Read file with processing instruction\n final IMicroDocument doc = MicroReader.readMicroXML (new ClassPathResource (\"xml/xml-processing-instruction.xml\"));\n assertNotNull (doc);\n\n // Count processing instruction\n final MutableInt aInt =... | {
"fields": [
{
"declarator": "s_aInstance = new MicroVisitor ()",
"modifier": "@PresentForCodeCoverage\n private static final",
"original_string": "@PresentForCodeCoverage\n private static final MicroVisitor s_aInstance = new MicroVisitor ();",
"type": "MicroVisitor",
"var_name": ... | {
"body": "public static void visit (@Nonnull final IMicroNode aNode, @Nonnull final IHierarchyVisitorCallback <? super IMicroNode> aCallback)\n {\n ValueEnforcer.notNull (aNode, \"Node\");\n ChildrenProviderHierarchyVisitor.visitFrom (aNode, aCallback, false);\n }",
"class_method_signature": "MicroVisitor.... | {
"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_508 | {
"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_FR = new Locale (\"fr\")",
"mod... | {
"body": "@Test\n public void testGetUtf8String ()\n {\n assertEquals (\"äöü\", ResourceBundleHelper.getUtf8String (\"properties/test-utf8\", L_DE, \"key1\"));\n assertNull (ResourceBundleHelper.getUtf8String (\"properties/test-utf8-noway\", L_DE, \"key1\"));\n assertEquals (\"äöü\", ResourceBundleHelper.... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger (ResourceBundleHelper.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger (ResourceBundleHelper.class);",
"type": "Logger",
"var_name": "LOGGER"
... | {
"body": "@Nullable\n public static String getUtf8String (@Nonnull final String sBundleName,\n @Nonnull final Locale aContentLocale,\n @Nonnull @PropertyKey final String sKey)\n {\n return getString (getUtf8ResourceBundle (sBundleName, aC... | {
"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_13 | {
"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 testFindWrapPos ()\n {\n String text = \"This is a test.\";\n // text width should be max 8; the wrap position is 7\n assertEquals (\"wrap position\", 7, HelpFormatter.findWrapPos (text, 8, 0));\n\n // starting from 8 must give -1 - the wrap pos is after end\n assertEqu... | {
"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": "@CheckForSigned\n protected static int findWrapPos (final String sText, final int nWidth, final int nStartPos)\n {\n // the line ends before the max wrap pos or a new line char found\n int pos = sText.indexOf ('\\n', nStartPos);\n if (pos != -1 && pos <= nWidth)\n {\n return pos + 1;\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_123 | {
"fields": [],
"file": "ph-xml/src/test/java/com/helger/xml/ChildElementIteratorTest.java",
"identifier": "ChildElementIteratorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetRecursiveChildIter ()\n {\n final Document doc = XMLFactory.newDocument ();\n\n // No children present\n assertFalse (new ChildElementIterator (doc).hasNext ());\n\n // 1 child\n final Element eRoot = (Element) doc.appendChild (doc.createElement (\"root\"));\n ... | {
"fields": [
{
"declarator": "m_aIter",
"modifier": "private final",
"original_string": "private final IIterableIterator <Element> m_aIter;",
"type": "IIterableIterator <Element>",
"var_name": "m_aIter"
}
],
"file": "ph-xml/src/main/java/com/helger/xml/ChildElementIterator.j... | {
"body": "public final boolean hasNext ()\n {\n return m_aIter.hasNext ();\n }",
"class_method_signature": "ChildElementIterator.hasNext()",
"constructor": false,
"full_signature": "public final boolean hasNext()",
"identifier": "hasNext",
"invocations": [
"hasNext"
],
"modifiers": "public 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_573 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/csv/CSVReaderTest.java",
"identifier": "CSVReaderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@SuppressWarnings (\"resource\")\n @Test (expected = UnsupportedOperationException.class)\n public void testQuoteAndEscapeMustBeDifferent ()\n {\n final StringBuilder aSB = new StringBuilder (CCSV.INITIAL_STRING_SIZE);\n\n aSB.append (\"a,b,aReader,ddd\\\\\\\"eee\\nf,g,h,\\\"iii,jjj\\\"\");\n\n ... | {
"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": "@Nonnull\n public CSVReader setEscapeChar (final char cEscapeChar)\n {\n m_aParser.setEscapeChar (cEscapeChar);\n return this;\n }",
"class_method_signature": "CSVReader.setEscapeChar(final char cEscapeChar)",
"constructor": false,
"full_signature": "@Nonnull public CSVReader setEscapeChar(f... | {
"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_820 | {
"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 testNewSortedMap_ArrayArray ()\n {\n try\n {\n // null keys not allowed\n newSortedMap ((String []) null, new String [] { \"a\" });\n fail ();\n }\n catch (final IllegalArgumentException ex)\n {}\n\n try\n {\n // null values not allowed\n ... | {
"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": "@Nonnull\n @ReturnsMutableCopy\n public static <KEYTYPE extends Comparable <? super KEYTYPE>, VALUETYPE> CommonsTreeMap <KEYTYPE, VALUETYPE> newSortedMap ()\n {\n return new CommonsTreeMap <> (Comparator.nullsFirst (Comparator.naturalOrder ()));\n }",
"class_method_signature": "CollectionHelper.ne... | {
"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_436 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/base64/Base64Test.java",
"identifier": "Base64Test",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testEncodeToFile () throws IOException\n {\n final File f2 = new File (\"base64.encoded\");\n try\n {\n assertFalse (FileHelper.existsFile (f2));\n final String sDecoded = \"Hallo Wält\";\n Base64.encodeToFile (sDecoded.getBytes (StandardCharsets.UTF_8), f2.get... | {
"fields": [
{
"declarator": "NO_OPTIONS = 0",
"modifier": "public static final",
"original_string": "public static final int NO_OPTIONS = 0;",
"type": "int",
"var_name": "NO_OPTIONS"
},
{
"declarator": "ENCODE = 1",
"modifier": "public static final",
"orig... | {
"body": "public static void encodeToFile (@Nonnull final byte [] aDataToEncode, final File aFile) throws IOException\n {\n ValueEnforcer.notNull (aDataToEncode, \"DataToEncode\");\n\n try (final Base64OutputStream bos = new Base64OutputStream (FileHelper.getBufferedOutputStream (aFile), ENCODE))\n {\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_318 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/io/stream/NonBlockingStringWriterTest.java",
"identifier": "NonBlockingStringWriterTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n @SuppressWarnings (\"resource\")\n @SuppressFBWarnings (\"OS_OPEN_STREAM\")\n public void testError ()\n {\n try\n {\n new NonBlockingStringWriter (-1);\n fail ();\n }\n catch (final IllegalArgumentException ex)\n {}\n\n final char [] ca = \"abc\".toCharArray ();\n ... | {
"fields": [
{
"declarator": "m_aSB",
"modifier": "private final",
"original_string": "private final StringBuilder m_aSB;",
"type": "StringBuilder",
"var_name": "m_aSB"
}
],
"file": "ph-commons/src/main/java/com/helger/commons/io/stream/NonBlockingStringWriter.java",
"iden... | {
"body": "@Override\n public void write (final int c)\n {\n m_aSB.append ((char) c);\n }",
"class_method_signature": "NonBlockingStringWriter.write(final int c)",
"constructor": false,
"full_signature": "@Override public void write(final int c)",
"identifier": "write",
"invocations": [
"append"
... | {
"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_44 | {
"fields": [],
"file": "ph-cli/src/test/java/com/helger/cli/CmdLineParserTest.java",
"identifier": "CmdLineParserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testParseGroupRequired () throws CmdLineParseException\n {\n final OptionGroup aGroup1 = new OptionGroup ().addOption (Option.builder (\"a\"))\n .addOption (Option.builder (\"b\"))\n .... | {
"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_748 | {
"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 testGetReverse ()\n {\n assertNull (StringHelper.getReverse (null));\n assertEquals (\"\", StringHelper.getReverse (\"\"));\n assertEquals (\"a\", StringHelper.getReverse (\"a\"));\n assertEquals (\"ba\", StringHelper.getReverse (\"ab\"));\n assertEquals (\" ba\", Strin... | {
"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 getReverse (@Nullable final String sStr)\n {\n if (sStr == null)\n return null;\n\n final char [] aChars = sStr.toCharArray ();\n if (aChars.length <= 1)\n return sStr;\n\n final char [] ret = new char [aChars.length];\n int nSrc = aChars.length -... | {
"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_877 | {
"fields": [],
"file": "ph-security/src/test/java/com/helger/security/password/hash/PasswordHashCreatorBCryptTest.java",
"identifier": "PasswordHashCreatorBCryptTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCreateMultipleHashes ()\n {\n final IPasswordSalt aSalt = new PasswordSaltBCrypt ();\n final String sPlainTextPassword = \"123456\";\n final PasswordHashCreatorBCrypt a = new PasswordHashCreatorBCrypt ();\n for (int i = 0; i < 20; ++i)\n a.createPasswordHash (aSal... | {
"fields": [
{
"declarator": "ALGORITHM = \"BCrypt\"",
"modifier": "public static final",
"original_string": "public static final String ALGORITHM = \"BCrypt\";",
"type": "String",
"var_name": "ALGORITHM"
}
],
"file": "ph-security/src/main/java/com/helger/security/password/h... | {
"body": "@Nonnull\n public String createPasswordHash (@Nonnull final IPasswordSalt aSalt, @Nonnull final String sPlainTextPassword)\n {\n ValueEnforcer.notNull (aSalt, \"Salt\");\n ValueEnforcer.isInstanceOf (aSalt, PasswordSaltBCrypt.class, \"Salt\");\n ValueEnforcer.notNull (sPlainTextPassword, \"Plain... | {
"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_524 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/text/util/ABNFTest.java",
"identifier": "ABNFTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIsHTab ()\n {\n assertTrue (ABNF.isHTab (0x09));\n assertFalse (ABNF.isHTab (0));\n }",
"class_method_signature": "ABNFTest.testIsHTab()",
"constructor": false,
"full_signature": "@Test public void testIsHTab()",
"identifier": "testIsHTab",
"invocations": [
"a... | {
"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 isHTab (final int nCP)\n {\n return _isBitSet (nCP, BIT_HTAB);\n }",
"class_method_signature": "ABNF.isHTab(final int nCP)",
"constructor": false,
"full_signature": "public static boolean isHTab(final int nCP)",
"identifier": "isHTab",
"invocations": [
"_isBitSet"
... | {
"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_174 | {
"fields": [
{
"declarator": "m_aRule = new DebugModeTestRule ()",
"modifier": "@Rule\n public final",
"original_string": "@Rule\n public final TestRule m_aRule = new DebugModeTestRule ();",
"type": "TestRule",
"var_name": "m_aRule"
}
],
"file": "ph-xml/src/test/java/com/h... | {
"body": "@Test\n public void testGetClone ()\n {\n final IMicroElement eRoot = new MicroElement (\"root\");\n IMicroElement eClone = eRoot.getClone ();\n assertEquals (eRoot.getTagName (), eClone.getTagName ());\n assertNull (eRoot.getNamespaceURI ());\n assertNull (eClone.getNamespaceURI ());\n ... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger (MicroElement.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger (MicroElement.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
... | {
"body": "@Nonnull\n public IMicroElement getClone ()\n {\n final MicroElement ret = new MicroElement (m_sNamespaceURI, m_sTagName);\n\n // Copy attributes\n if (m_aAttrs != null)\n ret.m_aAttrs = new CommonsLinkedHashMap <> (m_aAttrs);\n\n // Deep clone all child nodes\n forAllChildren (aChild... | {
"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_461 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/math/MathHelperTest.java",
"identifier": "MathHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetMinDouble ()\n {\n CommonsAssert.assertEquals (5, MathHelper.getMinDouble (5));\n CommonsAssert.assertEquals (5, MathHelper.getMinDouble (5, 5, 5, 5));\n CommonsAssert.assertEquals (1, MathHelper.getMinDouble (5, 3, 2, 1));\n CommonsAssert.assertEquals (3, MathHelpe... | {
"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 double getMinDouble (final double dValue, @Nonnull final double... aValues)\n {\n double ret = dValue;\n for (final double d : aValues)\n ret = Math.min (ret, d);\n return ret;\n }",
"class_method_signature": "MathHelper.getMinDouble(final double dValue, @Nonnull final doubl... | {
"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_52 | {
"fields": [],
"file": "ph-tree/src/test/java/com/helger/tree/withid/unique/DefaultTreeItemWithUniqueIDFactoryTest.java",
"identifier": "DefaultTreeItemWithUniqueIDFactoryTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testUniqueness ()\n {\n final DefaultTreeItemWithUniqueIDFactory <String, String> x = new DefaultTreeItemWithUniqueIDFactory <> ();\n\n CommonsTestHelper.testDefaultImplementationWithEqualContentObject (x, new DefaultTreeItemWithUniqueIDFactory <String, String> ());\n x.creat... | {
"fields": [],
"file": "ph-tree/src/main/java/com/helger/tree/withid/unique/DefaultTreeItemWithUniqueIDFactory.java",
"identifier": "DefaultTreeItemWithUniqueIDFactory",
"interfaces": "",
"methods": [
{
"class_method_signature": "DefaultTreeItemWithUniqueIDFactory.internalCreate(@Nonnull final Defa... | {
"body": "@Nonnull\n public DefaultTreeItemWithID <KEYTYPE, DATATYPE> createRoot ()\n {\n return new DefaultTreeItemWithID <> (this);\n }",
"class_method_signature": "DefaultTreeItemWithUniqueIDFactory.createRoot()",
"constructor": false,
"full_signature": "@Nonnull public DefaultTreeItemWithID <KEYTYPE,... | {
"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_162 | {
"fields": [],
"file": "ph-xml/src/test/java/com/helger/xml/microdom/util/MicroHelperTest.java",
"identifier": "MicroHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetDocumentRootElementTagName ()\n {\n assertNull (MicroHelper.getDocumentRootElementTagName (null));\n final IMicroDocument aDoc = new MicroDocument ();\n assertNull (MicroHelper.getDocumentRootElementTagName (aDoc));\n aDoc.appendElement (\"root\");\n assertEquals... | {
"fields": [
{
"declarator": "s_aInstance = new MicroHelper ()",
"modifier": "@PresentForCodeCoverage\n private static final",
"original_string": "@PresentForCodeCoverage\n private static final MicroHelper s_aInstance = new MicroHelper ();",
"type": "MicroHelper",
"var_name": "s_a... | {
"body": "@Nullable\n public static String getDocumentRootElementTagName (@Nullable final IMicroDocument aDoc)\n {\n if (aDoc != null)\n {\n final IMicroElement eRoot = aDoc.getDocumentElement ();\n if (eRoot != null)\n return eRoot.getTagName ();\n }\n return null;\n }",
"class_met... | {
"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_498 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/lang/GenericReflectionTest.java",
"identifier": "GenericReflectionTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testUncheckedCast ()\n {\n final ICommonsList <String> l = new CommonsArrayList <> (\"a\", \"b\");\n final Object o = l;\n final ICommonsList <String> l2 = GenericReflection.uncheckedCast (o);\n assertSame (l, l2);\n }",
"class_method_signature": "GenericReflectionTest.... | {
"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": "@SuppressWarnings (\"unchecked\")\n public static <SRCTYPE, DSTTYPE> DSTTYPE uncheckedCast (@Nullable final SRCTYPE aObject)\n {\n return (DSTTYPE) aObject;\n }",
"class_method_signature": "GenericReflection.uncheckedCast(@Nullable final SRCTYPE aObject)",
"constructor": false,
"full_signature"... | {
"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_532 | {
"fields": [
{
"declarator": "MLH_NULL = (k, l, c, v) -> null",
"modifier": "private static final",
"original_string": "private static final LocaleCache.IMissingLocaleHandler MLH_NULL = (k, l, c, v) -> null;",
"type": "LocaleCache.IMissingLocaleHandler",
"var_name": "MLH_NULL"
}... | {
"body": "@Test\n public void testGetAllLocales ()\n {\n assertNotNull (LocaleCache.getInstance ().getAllLocales ());\n for (final Locale aLocale : LocaleCache.getInstance ().getAllLocales ())\n assertNotNull (aLocale);\n }",
"class_method_signature": "LocaleCacheTest.testGetAllLocales()",
"constru... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger (LocaleCache.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger (LocaleCache.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
... | {
"body": "@Nonnull\n @ReturnsMutableCopy\n public ICommonsList <Locale> getAllLocales ()\n {\n final ICommonsList <Locale> ret = m_aRWLock.readLockedGet (m_aLocales::copyOfValues);\n ret.remove (LocaleHelper.LOCALE_ALL);\n ret.remove (LocaleHelper.LOCALE_INDEPENDENT);\n return ret;\n }",
"class_met... | {
"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_861 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/version/VersionRangeTest.java",
"identifier": "VersionRangeTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCompareTo ()\n {\n assertEquals (0, _compare (\"[1.2,2.0]\", \"[1.2,2.0]\"));\n assertEquals (+1, _compare (\"[1.2,2.0]\", \"[1.2,2.0)\"));\n assertEquals (-1, _compare (\"[1.2,2.0]\", \"(1.2,2.0]\"));\n assertEquals (-1, _compare (\"[1.2,2.0]\", \"(1.2,2.0)\"));\n\n ... | {
"fields": [
{
"declarator": "DEFAULT_VERSION_RANGE_STRING = \"[0)\"",
"modifier": "public static final",
"original_string": "public static final String DEFAULT_VERSION_RANGE_STRING = \"[0)\";",
"type": "String",
"var_name": "DEFAULT_VERSION_RANGE_STRING"
},
{
"declara... | {
"body": "public int compareTo (@Nonnull final VersionRange rhs)\n {\n int i = m_aFloorVersion.compareTo (rhs.m_aFloorVersion);\n if (i == 0)\n {\n if (m_bIncludeFloor && !rhs.m_bIncludeFloor)\n {\n // this < rhs\n i = -1;\n }\n else\n if (!m_bIncludeFloor && rhs.m_... | {
"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_477 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/lang/ClassHelperTest.java",
"identifier": "ClassHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIsPublicClass ()\n {\n // null is not\n assertFalse (ClassHelper.isPublicClass (null));\n\n // annotation is not\n assertFalse (ClassHelper.isPublicClass (Override.class));\n\n // interface is not\n assertFalse (ClassHelper.isPublicClass (IHasName.class));\n\n ... | {
"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 isPublicClass (@Nullable final Class <?> aClass)\n {\n if (aClass == null)\n return false;\n\n // Interfaces or annotations are not allowed\n if (aClass.isInterface () || aClass.isAnnotation ())\n return false;\n\n // Only public classes are allowed\n if (!is... | {
"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_359 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/io/file/FileHelperTest.java",
"identifier": "FileHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIsParentDirectory ()\n {\n // make test create directories in other directory or kick test\n final File aDir1 = new File (\"Directory\");\n final File aDir11 = new File (aDir1, \"Subdirectory\");\n final File aDir2 = new File (\"Another Directory\");\n\n FileOperati... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger (FileHelper.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger (FileHelper.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"d... | {
"body": "@SuppressFBWarnings (\"IL_INFINITE_LOOP\")\n public static boolean isParentDirectory (@Nonnull final File aSearchDirectory, @Nonnull final File aStartDirectory)\n {\n ValueEnforcer.notNull (aSearchDirectory, \"SearchDirectory\");\n ValueEnforcer.notNull (aStartDirectory, \"StartDirectory\");\n\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_709 | {
"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 testTrim ()\n {\n assertEquals (\"Hallo Welt\", StringHelper.trim (\"Hallo Welt\"));\n assertEquals (\"Hallo Welt\", StringHelper.trim (\" Hallo Welt\"));\n assertEquals (\"Hallo Welt\", StringHelper.trim (\"Hallo Welt \"));\n assertEquals (\"Hallo Welt\", StringHelper.tri... | {
"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 trim (@Nullable final String s)\n {\n return hasNoText (s) ? s : s.trim ();\n }",
"class_method_signature": "StringHelper.trim(@Nullable final String s)",
"constructor": false,
"full_signature": "@Nullable @CheckReturnValue public static 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_836 | {
"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 testGetConcatenatedInline ()\n {\n // Array version\n ICommonsList <String> aBaseList = newList (\"1\");\n assertSame (aBaseList, getConcatenatedInline (aBaseList, \"2\", \"3\"));\n assertEquals (3, aBaseList.size ());\n assertEquals (\"1\", aBaseList.get (0));\n ass... | {
"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": "@Nonnull\n @ReturnsMutableObject (\"design\")\n @SafeVarargs\n @CodingStyleguideUnaware\n public static <ELEMENTTYPE, COLLTYPE extends Collection <? super ELEMENTTYPE>> COLLTYPE getConcatenatedInline (@Nonnull final COLLTYPE aCont,\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_565 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/csv/CSVReaderTest.java",
"identifier": "CSVReaderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testParseLine () throws IOException\n {\n try (final CSVReader aReader = _createCSVReader ())\n {\n // test normal case\n ICommonsList <String> nextLine = aReader.readNext ();\n assertEquals (\"a\", nextLine.get (0));\n assertEquals (\"b\", nextLine.get (1));... | {
"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_135 | {
"fields": [],
"file": "ph-xml/src/test/java/com/helger/xml/transform/XMLTransformerFactoryTest.java",
"identifier": "XMLTransformerFactoryTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSpecialChars () throws Exception\n {\n final EXMLVersion eXMLVersion = EXMLVersion.XML_10;\n final EXMLSerializeVersion eXMLSerializeVersion = EXMLSerializeVersion.getFromXMLVersionOrThrow (eXMLVersion);\n final StringBuilder aAttrVal = new StringBuilder ();\n final St... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger (XMLTransformerFactory.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger (XMLTransformerFactory.class);",
"type": "Logger",
"var_name": "LOGGER"... | {
"body": "@Nullable\n public static Transformer newTransformer ()\n {\n return newTransformer (s_aDefaultFactory);\n }",
"class_method_signature": "XMLTransformerFactory.newTransformer()",
"constructor": false,
"full_signature": "@Nullable public static Transformer newTransformer()",
"identifier": "new... | {
"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_420 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/hierarchy/ChildrenProviderHasChildrenWithIDTest.java",
"identifier": "ChildrenProviderHasChildrenWithIDTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testAll ()\n {\n final ChildrenProviderHasChildrenWithID <String, MockHasSortedChildren> cr = new ChildrenProviderHasChildrenWithID <> ();\n assertFalse (cr.hasChildren (null));\n assertEquals (0, cr.getChildCount (null));\n assertNull (cr.getAllChildren (null));\n fina... | {
"fields": [],
"file": "ph-commons/src/main/java/com/helger/commons/hierarchy/ChildrenProviderHasChildrenWithID.java",
"identifier": "ChildrenProviderHasChildrenWithID",
"interfaces": "implements\n IChildrenProviderWithID <KEYTYPE, CHILDTYPE>",
"methods": [
{... | {
"body": "@Nullable\n public CHILDTYPE getChildWithID (@Nullable final CHILDTYPE aCurrent, @Nullable final KEYTYPE aID)\n {\n if (aCurrent != null)\n {\n // Get all children (if any)\n final Collection <? extends CHILDTYPE> aChildren = aCurrent.getAllChildren ();\n if (aChildren != null)\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_457 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/math/MathHelperTest.java",
"identifier": "MathHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetMaxDouble ()\n {\n CommonsAssert.assertEquals (5, MathHelper.getMaxDouble (5));\n CommonsAssert.assertEquals (5, MathHelper.getMaxDouble (5, 5, 5, 5));\n CommonsAssert.assertEquals (5, MathHelper.getMaxDouble (5, 3, 2, 1));\n CommonsAssert.assertEquals (7, MathHelpe... | {
"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 double getMaxDouble (final double dValue, @Nonnull final double... aValues)\n {\n double ret = dValue;\n for (final double d : aValues)\n ret = Math.max (ret, d);\n return ret;\n }",
"class_method_signature": "MathHelper.getMaxDouble(final double dValue, @Nonnull final doubl... | {
"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_142 | {
"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 testGetFirstChildElementOfName ()\n {\n // Empty document has no child element\n assertNull (XMLHelper.getFirstChildElementOfName (XMLFactory.newDocument (), \"root\"));\n\n final Document doc = _getTestDoc ();\n assertNull (XMLHelper.getFirstChildElementOfName (doc, \"any... | {
"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": "@Nullable\n public static Element getFirstChildElementOfName (@Nullable final Node aStartNode, @Nonnull @Nonempty final String sTagName)\n {\n if (aStartNode == null)\n return null;\n return new ChildElementIterator (aStartNode).findFirst (filterElementWithTagName (sTagName));\n }",
"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_512 | {
"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 testGetFormattedText ()\n {\n assertEquals (\"a\", TextHelper.getFormattedText (\"a\", (Object []) null));\n assertEquals (\"a\", TextHelper.getFormattedText (\"a\", new Object [0]));\n assertEquals (\"a{0}\", TextHelper.getFormattedText (\"a{0}\", new Object [0]));\n asse... | {
"fields": [
{
"declarator": "DE = LocaleCache.getInstance ().getLocale (\"de\")",
"modifier": "public static final",
"original_string": "public static final Locale DE = LocaleCache.getInstance ().getLocale (\"de\");",
"type": "Locale",
"var_name": "DE"
},
{
"declarato... | {
"body": "@Nullable\n public static String getFormattedText (@Nullable final String sText, @Nullable final Object... aArgs)\n {\n if (sText == null)\n {\n // Avoid NPE in MessageFormat\n return null;\n }\n\n if (ArrayHelper.isEmpty (aArgs))\n {\n // Return text unchanged\n return... | {
"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_841 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/equals/EqualsHelperTest.java",
"identifier": "EqualsHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testNullSafeEquals () throws MalformedURLException\n {\n _test (\"s1\", \"s2\");\n _test (StringParser.parseBigDecimal (\"12562136756\"), StringParser.parseBigDecimal (\"67673455\"));\n _test (Double.valueOf (3.1234d), Double.valueOf (23.456d));\n _test (Float.valueOf (3.1... | {
"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": "@SuppressFBWarnings ({ \"ES_COMPARING_PARAMETER_STRING_WITH_EQ\" })\n public static boolean equalsIgnoreCase (@Nullable final String sObj1, @Nullable final String sObj2)\n {\n return sObj1 == null ? sObj2 == null : sObj1.equalsIgnoreCase (sObj2);\n }",
"class_method_signature": "EqualsHelper.equals... | {
"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_791 | {
"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 testGetAllExceptLast ()\n {\n // Generic\n {\n final String [] x = new String [] { \"s1\", \"s2\", \"s3\" };\n final String [] y = new String [] { \"s1\", \"s2\" };\n final String [] z = new String [] { \"s1\" };\n assertArrayEquals (y, getAllExceptLast (x));... | {
"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 [] getAllExceptLast (@Nullable final ELEMENTTYPE... aArray)\n {\n return getAllExceptLast (aArray, 1);\n }",
"class_method_signature": "ArrayHelper.getAllExceptLast(@Nullable final ELEMENTTYPE... aArray)",
... | {
"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_284 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/ValueEnforcerTest.java",
"identifier": "ValueEnforcerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test (expected = NullPointerException.class)\n public void testNotEmpty1 ()\n {\n ValueEnforcer.notEmpty ((String) null, \"null\");\n }",
"class_method_signature": "ValueEnforcerTest.testNotEmpty1()",
"constructor": false,
"full_signature": "@Test (expected = NullPointerException.class) public... | {
"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 extends CharSequence> T notEmpty (final T aValue, final String sName)\n {\n if (isEnabled ())\n return notEmpty (aValue, () -> sName);\n return aValue;\n }",
"class_method_signature": "ValueEnforcer.notEmpty(final T aValue, final String sName)",
"constructor": false,
"fu... | {
"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_72 | {
"fields": [],
"file": "ph-json/src/test/java/com/helger/json/JsonValueTest.java",
"identifier": "JsonValueTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCache ()\n {\n for (int i = Byte.MIN_VALUE; i <= Byte.MAX_VALUE; ++i)\n assertNotNull (JsonValue.create ((byte) i));\n for (int i = -200; i < 200; ++i)\n assertNotNull (JsonValue.create (i));\n for (long i = -200; i < 200; ++i)\n assertNotNull (JsonValue.cr... | {
"fields": [
{
"declarator": "NULL = new JsonValue (null)",
"modifier": "public static final",
"original_string": "public static final JsonValue NULL = new JsonValue (null);",
"type": "JsonValue",
"var_name": "NULL"
},
{
"declarator": "TRUE = new JsonValue (Boolean.TRU... | {
"body": "@Nonnull\n public static JsonValue create (final boolean bValue)\n {\n return bValue ? TRUE : FALSE;\n }",
"class_method_signature": "JsonValue.create(final boolean bValue)",
"constructor": false,
"full_signature": "@Nonnull public static JsonValue create(final boolean bValue)",
"identifier":... | {
"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_400 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/io/file/FilenameHelperTest.java",
"identifier": "FilenameHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testEnsurePathEndingWithoutSeparator ()\n {\n assertNull (FilenameHelper.ensurePathEndingWithoutSeparator (null));\n assertEquals (\"\", FilenameHelper.ensurePathEndingWithoutSeparator (\"\"));\n assertEquals (\"abc\", FilenameHelper.ensurePathEndingWithoutSeparator (\"abc\")... | {
"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 @CheckReturnValue\n public static String ensurePathEndingWithoutSeparator (@Nullable final String sPath)\n {\n if (sPath == null)\n return null;\n\n String sRet = sPath;\n while (endsWithPathSeparatorChar (sRet))\n sRet = sRet.substring (0, sRet.length () - 1);\n return... | {
"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_816 | {
"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 testNewMap_Map ()\n {\n final Map <String, Integer> aMap = newMap (\"Hallo\", I5);\n assertNotNull (aMap);\n\n final Map <String, Integer> aMap2 = newMap (aMap);\n assertEquals (1, aMap2.size ());\n assertNotNull (aMap2.get (\"Hallo\"));\n assertEquals (I5, aMap2.get... | {
"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": "@Nonnull\n @ReturnsMutableCopy\n public static <KEYTYPE, VALUETYPE> CommonsHashMap <KEYTYPE, VALUETYPE> newMap (@Nonnegative final int nInitialCapacity)\n {\n return new CommonsHashMap <> (nInitialCapacity);\n }",
"class_method_signature": "CollectionHelper.newMap(@Nonnegative final int nInitialCa... | {
"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_545 | {
"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 testGetValidLanguageCode ()\n {\n assertNull (LocaleHelper.getValidLanguageCode (null));\n assertNull (LocaleHelper.getValidLanguageCode (\"\"));\n assertNull (LocaleHelper.getValidLanguageCode (\"1\"));\n assertNull (LocaleHelper.getValidLanguageCode (\"a\"));\n assert... | {
"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 String getValidLanguageCode (@Nullable final String sCode)\n {\n if (StringHelper.hasText (sCode) && (RegExHelper.stringMatchesPattern (\"[a-zA-Z]{2,8}\", sCode) || isSpecialLocaleCode (sCode)))\n {\n return sCode.toLowerCase (CGlobal.LOCALE_FIXED_NUMBER_FORMAT);\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_115 | {
"fields": [],
"file": "ph-config/src/test/java/com/helger/config/ConfigFactoryTest.java",
"identifier": "ConfigFactoryTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSysPropConfigUrlJson ()\n {\n SystemProperties.setPropertyValue (\"config.url\",\n new ClassPathResource (\"sysprops/url.json\").getAsURL ().toExternalForm ());\n try\n {\n final IConfig aConfig = Config.create (ConfigFactory.cre... | {
"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_7 | {
"fields": [
{
"declarator": "BASE64_ALPHABET = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\" + \"abcdefghijklmnopqrstuvwxyz\" + \"0123456789+/\"",
"modifier": "private static final",
"original_string": "private static final String BASE64_ALPHABET = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\" + \"abcdefghijklmnopqrstuvwxy... | {
"body": "@Test\n public void testGetChar ()\n {\n assertEquals ('A', tested.getChar (0));\n assertEquals ('/', tested.getChar (63));\n assertEquals ('a', tested.getChar (26));\n assertEquals ('0', tested.getChar (52));\n }",
"class_method_signature": "UTF7Base64HelperTest.testGetChar()",
"constru... | {
"fields": [
{
"declarator": "ALPHABET_LENGTH = 64",
"modifier": "private static final",
"original_string": "private static final int ALPHABET_LENGTH = 64;",
"type": "int",
"var_name": "ALPHABET_LENGTH"
},
{
"declarator": "m_aAlphabet",
"modifier": "private final... | {
"body": "public byte getChar (final int sextet)\n {\n return (byte) m_aAlphabet[sextet];\n }",
"class_method_signature": "UTF7Base64Helper.getChar(final int sextet)",
"constructor": false,
"full_signature": "public byte getChar(final int sextet)",
"identifier": "getChar",
"invocations": [],
"modifi... | {
"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_396 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/io/file/FilenameHelperTest.java",
"identifier": "FilenameHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetCleanConcatenatedUrlPath ()\n {\n assertEquals (\"http://server/ctx/imgs/a.gif\", FilenameHelper.getCleanConcatenatedUrlPath (\"http://server/ctx/css/\", \"../imgs/a.gif\"));\n assertEquals (\"http://server/ctx/imgs/a.gif\", FilenameHelper.getCleanConcatenatedUrlPath (\"h... | {
"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": "@Nonnull\n public static String getCleanConcatenatedUrlPath (@Nonnull final String sURL, @Nonnull final String sPath)\n {\n ValueEnforcer.notNull (sURL, \"URL\");\n ValueEnforcer.notNull (sPath, \"Path\");\n\n // If nothing is to be appended, just clean the base URL\n if (StringHelper.hasNoTe... | {
"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_379 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/io/file/FilenameHelperTest.java",
"identifier": "FilenameHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetExtensionString ()\n {\n assertEquals (\"\", FilenameHelper.getExtension ((String) null));\n assertEquals (\"\", FilenameHelper.getExtension ((File) null));\n assertEquals (\"\", FilenameHelper.getExtension (\"\"));\n assertEquals (\"\", FilenameHelper.getExtension ... | {
"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": "@Nonnull\n public static String getExtension (@Nullable final File aFile)\n {\n return aFile == null ? \"\" : getExtension (aFile.getName ());\n }",
"class_method_signature": "FilenameHelper.getExtension(@Nullable final File aFile)",
"constructor": false,
"full_signature": "@Nonnull public stat... | {
"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_683 | {
"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 testExplodeToSet ()\n {\n ICommonsSet <String> ret = StringHelper.getExplodedToSet (\"@\", \"a@b@@c\");\n assertEquals (new CommonsHashSet <> (\"a\", \"b\", \"\", \"c\"), ret);\n ret = StringHelper.getExplodedToSet (\"uu\", \"auubuuuuuuc\");\n assertEquals (new CommonsHash... | {
"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 CommonsHashSet <String> getExplodedToSet (@Nonnull final String sSep, @Nullable final String sElements)\n {\n return getExploded (sSep, sElements, -1, new CommonsHashSet <> ());\n }",
"class_method_signature": "StringHelper.getExplodedToSet(@Nonnull f... | {
"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_25 | {
"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 testPrintRequiredOptionGroupUsage ()\n {\n final OptionGroup group = new OptionGroup ().addOption (Option.builder (\"a\"))\n .addOption (Option.builder (\"b\"))\n .addOption (Option.builde... | {
"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_729 | {
"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 testToString ()\n {\n final Integer I1 = Integer.valueOf (1);\n assertEquals (\"1\", StringHelper.getToString (I1));\n assertEquals (\"any\", StringHelper.getToString (\"any\"));\n assertEquals (\"\", StringHelper.getToString (null));\n\n assertEquals (\"1\", StringHelp... | {
"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 getToString (@Nullable final Object aObject)\n {\n return getToString (aObject, \"\");\n }",
"class_method_signature": "StringHelper.getToString(@Nullable final Object aObject)",
"constructor": false,
"full_signature": "@Nonnull public static String getToString(@... | {
"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_416 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/io/file/FileOperationManagerTest.java",
"identifier": "FileOperationManagerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCopyDirRecursive ()\n {\n final IFileOperationManager aFOM = new FileOperationManager ();\n final File aDir = new File (\"copydir.test\");\n final File aDir2 = new File (\"copydir.copied\");\n try\n {\n assertFalse (FileHelper.existsDir (aDir));\n _expecte... | {
"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 copyDirRecursive (@Nonnull final File aSourceDir, @Nonnull final File aTargetDir)\n {\n m_aLastError = FileOperations.copyDirRecursive (aSourceDir, aTargetDir);\n _handleLastError (m_aLastError);\n return m_aLastError;\n }",
"class_method_signature": "FileOperati... | {
"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_103 | {
"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 testForEach ()\n {\n for (final float ff : FILL_FACTORS)\n _testForEachHelper (ff);\n }",
"class_method_signature": "IntObjectMapTest.testForEach()",
"constructor": false,
"full_signature": "@Test public void testForEach()",
"identifier": "testForEach",
"invocations... | {
"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 = new Object ()",
"modifier": "public static final",
... | {
"body": "public void forEach (@Nonnull final IConsumer <T> aConsumer)\n {\n if (m_bHasFreeKey)\n aConsumer.accept (FREE_KEY, m_aFreeValue);\n final int nLen = m_aKeys.length;\n for (int i = 0; i < nLen; ++i)\n {\n final int nKey = m_aKeys[i];\n if (nKey != FREE_KEY)\n {\n 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_553 | {
"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_Int ()\n {\n assertEquals (\"1.000\", LocaleFormatter.getFormatted (1000, L_DE));\n assertEquals (\"1,000\", LocaleFormatter.getFormatted (1000, L_EN));\n }",
"class_method_signature": "LocaleFormatterTest.testGetFormatted_Int()",
"constructor": false,
"f... | {
"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_800 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/collection/IteratorHelperTest.java",
"identifier": "IteratorHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetEnumeratorFromIterator ()\n {\n final List <String> aList = newList (\"d\", \"c\", \"b\", \"a\");\n Enumeration <String> aEnum = getEnumeration (aList.iterator ());\n assertTrue (aEnum.hasMoreElements ());\n assertEquals (\"d\", aEnum.nextElement ());\n assertTru... | {
"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": "@Nonnull\n public static <ELEMENTTYPE> Enumeration <ELEMENTTYPE> getEnumeration (@Nullable final Iterable <ELEMENTTYPE> aCont)\n {\n return CollectionHelper.isEmpty (aCont) ? new EmptyEnumeration <> () : getEnumeration (aCont.iterator ());\n }",
"class_method_signature": "IteratorHelper.getEnumerat... | {
"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_380 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/io/file/FilenameHelperTest.java",
"identifier": "FilenameHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetExtensionFile ()\n {\n assertEquals (\"\", FilenameHelper.getExtension ((File) null));\n assertEquals (\"\", FilenameHelper.getExtension (new File (\"\")));\n assertEquals (\"\", FilenameHelper.getExtension (new File (\"xyz\")));\n assertEquals (\"sh\", FilenameHelp... | {
"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": "@Nonnull\n public static String getExtension (@Nullable final File aFile)\n {\n return aFile == null ? \"\" : getExtension (aFile.getName ());\n }",
"class_method_signature": "FilenameHelper.getExtension(@Nullable final File aFile)",
"constructor": false,
"full_signature": "@Nonnull public stat... | {
"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_33 | {
"fields": [],
"file": "ph-cli/src/test/java/com/helger/cli/CmdLineParserTest.java",
"identifier": "CmdLineParserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testParse () throws CmdLineParseException\n {\n _parse ((String []) null);\n _parse (new String [0]);\n _parse (\"a\", \"bb\", \"ccc\", \"dddd\");\n _parse (\"-D\", \"a\");\n _parse (\"-D\", \"a\", \"b\");\n _parse (\"-Da\");\n _parse (\"-Da;b\");\n _parse (\"-... | {
"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_695 | {
"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 testGetOccurrenceCountString ()\n {\n assertEquals (0, StringHelper.getOccurrenceCount (\"Test\", null));\n assertEquals (0, StringHelper.getOccurrenceCount (null, \"Test\"));\n assertEquals (1, StringHelper.getOccurrenceCount (\"Test\", \"Test\"));\n assertEquals (1, Stri... | {
"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 getOccurrenceCount (@Nullable final String sText, @Nullable final String sSearch)\n {\n int ret = 0;\n final int nTextLength = getLength (sText);\n final int nSearchLength = getLength (sSearch);\n if (nSearchLength > 0 && nTextLength >= nSearchLength)\n {\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_441 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/base64/Base64Test.java",
"identifier": "Base64Test",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testEncodeByteToByte ()\n {\n final byte [] aSrc = \"Hallo Wält\".getBytes (StandardCharsets.UTF_8);\n final byte [] aDst = Base64.encodeBytesToBytes (aSrc);\n assertEquals (\"Hallo Wält\", Base64.safeDecodeAsString (aDst, StandardCharsets.UTF_8));\n }",
"class_method_sign... | {
"fields": [
{
"declarator": "NO_OPTIONS = 0",
"modifier": "public static final",
"original_string": "public static final int NO_OPTIONS = 0;",
"type": "int",
"var_name": "NO_OPTIONS"
},
{
"declarator": "ENCODE = 1",
"modifier": "public static final",
"orig... | {
"body": "@Nonnull\n @ReturnsMutableCopy\n public static byte [] encodeBytesToBytes (@Nonnull final byte [] source)\n {\n byte [] encoded;\n try\n {\n encoded = encodeBytesToBytes (source, 0, source.length, NO_OPTIONS);\n }\n catch (final IOException ex)\n {\n throw new IllegalStateExc... | {
"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_857 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/version/VersionRangeTest.java",
"identifier": "VersionRangeTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testVersionRange ()\n {\n VersionRange vr = VersionRange.parse (\"[1.2.3, 4.5.6)\");\n assertTrue (vr.isIncludingFloor ());\n assertEquals (\"1.2.3\", vr.getFloorVersion ().getAsString ());\n assertFalse (vr.isIncludingCeil ());\n assertEquals (\"4.5.6\", vr.getCeilVers... | {
"fields": [
{
"declarator": "DEFAULT_VERSION_RANGE_STRING = \"[0)\"",
"modifier": "public static final",
"original_string": "public static final String DEFAULT_VERSION_RANGE_STRING = \"[0)\";",
"type": "String",
"var_name": "DEFAULT_VERSION_RANGE_STRING"
},
{
"declara... | {
"body": "public VersionRange (@Nonnull final Version aFloorVersion, @Nullable final Version aCeilingVersion)\n {\n this (aFloorVersion, true, aCeilingVersion, true);\n }",
"class_method_signature": "VersionRange.VersionRange(@Nonnull final Version aFloorVersion, @Nullable final Version aCeilingVersion)",
"... | {
"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_504 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/lang/ClassPathHelperTest.java",
"identifier": "ClassPathHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetAllClassPathEntries ()\n {\n final List <String> l = ClassPathHelper.getAllClassPathEntries ();\n assertNotNull (l);\n for (final String sItem : l)\n assertNotNull (sItem);\n }",
"class_method_signature": "ClassPathHelperTest.testGetAllClassPathEntries()",
"c... | {
"fields": [
{
"declarator": "s_aInstance = new ClassPathHelper ()",
"modifier": "@PresentForCodeCoverage\n private static final",
"original_string": "@PresentForCodeCoverage\n private static final ClassPathHelper s_aInstance = new ClassPathHelper ();",
"type": "ClassPathHelper",
... | {
"body": "@Nonnull\n @ReturnsMutableCopy\n public static ICommonsList <String> getAllClassPathEntries ()\n {\n final ICommonsList <String> ret = new CommonsArrayList <> ();\n forAllClassPathEntries (ret::add);\n return ret;\n }",
"class_method_signature": "ClassPathHelper.getAllClassPathEntries()",
... | {
"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_154 | {
"fields": [],
"file": "ph-xml/src/test/java/com/helger/xml/microdom/MicroDocumentTest.java",
"identifier": "MicroDocumentTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testToString ()\n {\n final IMicroDocument d = new MicroDocument ();\n CommonsTestHelper.testToStringImplementation (d);\n }",
"class_method_signature": "MicroDocumentTest.testToString()",
"constructor": false,
"full_signature": "@Test public void testToString()",
"iden... | {
"fields": [
{
"declarator": "DEFAULT_STANDALONE = ETriState.UNDEFINED",
"modifier": "public static final",
"original_string": "public static final ETriState DEFAULT_STANDALONE = ETriState.UNDEFINED;",
"type": "ETriState",
"var_name": "DEFAULT_STANDALONE"
},
{
"declara... | {
"body": "@Override\n public String toString ()\n {\n return ToStringGenerator.getDerived (super.toString ()).append (\"Standalone\", m_eStandalone).getToString ();\n }",
"class_method_signature": "MicroDocument.toString()",
"constructor": false,
"full_signature": "@Override public String toString()",
... | {
"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_787 | {
"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 testNewArrayFromCollection ()\n {\n String [] x = newArray (CollectionHelper.newList (\"s1\", \"s2\", \"s3\"), String.class);\n assertNotNull (x);\n assertEquals (3, x.length);\n\n x = newArray (new CommonsArrayList <String> (), String.class);\n assertNotNull (x);\n\n ... | {
"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": "@Nonnull\n @ReturnsMutableCopy\n public static <ELEMENTTYPE> ELEMENTTYPE [] newArray (@Nonnull final Class <? extends ELEMENTTYPE> aClass, @Nonnegative final int nSize)\n {\n ValueEnforcer.notNull (aClass, \"class\");\n if (aClass.isPrimitive ())\n throw new IllegalArgumentException (\"Argume... | {
"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_338 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/io/stream/CountingFileInputStreamTest.java",
"identifier": "CountingFileInputStreamTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testAll () throws IOException\n {\n CountingFileInputStream aCIS = new CountingFileInputStream (\"pom.xml\");\n try\n {\n aCIS.read ();\n assertEquals (1, aCIS.read (new byte [5], 1, 1));\n StreamHelper.copyInputStreamToOutputStream (aCIS, new NonBlockingByteAr... | {
"fields": [
{
"declarator": "s_aReadSizeHdl = StatisticsManager.getSizeHandler (CountingFileInputStream.class.getName () +\n \"$read.bytes\")",
"modifier": "private static final",
"original_s... | {
"body": "@Override\n public int read () throws IOException\n {\n final int ret = super.read ();\n if (ret != -1)\n s_aReadSizeHdl.addSize (1L);\n return ret;\n }",
"class_method_signature": "CountingFileInputStream.read()",
"constructor": false,
"full_signature": "@Override public int read()"... | {
"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_64 | {
"fields": [],
"file": "ph-graph/src/test/java/com/helger/graph/simple/SimpleDirectedGraphTest.java",
"identifier": "SimpleDirectedGraphTest",
"interfaces": "",
"superclass": "extends AbstractGraphTestCase"
} | {
"body": "@Test\n public void testSelfContained ()\n {\n final ISimpleDirectedGraph sg = new SimpleDirectedGraph ();\n assertTrue (sg.isSelfContained ());\n\n // n1 belongs to the graph\n IMutableDirectedGraphNode n1 = sg.createNode (\"any\");\n assertTrue (sg.isSelfContained ());\n\n // n2 does ... | {
"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_768 | {
"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 testIsInt ()\n {\n assertTrue (StringParser.isInt (\"1\"));\n assertFalse (StringParser.isInt (\"1.2\"));\n assertTrue (StringParser.isInt (\"0\"));\n assertTrue (StringParser.isInt (\"0000\"));\n assertTrue (StringParser.isInt (\"-1\"));\n assertTrue (StringParser.i... | {
"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": "public static boolean isInt (@Nullable final String sStr)\n {\n if (sStr != null)\n try\n {\n Integer.parseInt (sStr, DEFAULT_RADIX);\n return true;\n }\n catch (final NumberFormatException ex)\n {\n // fall through\n }\n return false;\n }",
"cla... | {
"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_292 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/ValueEnforcerTest.java",
"identifier": "ValueEnforcerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test (expected = IllegalArgumentException.class)\n public void testNotEmpty9 ()\n {\n ValueEnforcer.notEmpty (new CommonsHashMap <> (), \"null\");\n }",
"class_method_signature": "ValueEnforcerTest.testNotEmpty9()",
"constructor": false,
"full_signature": "@Test (expected = IllegalArgumentExce... | {
"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 extends CharSequence> T notEmpty (final T aValue, final String sName)\n {\n if (isEnabled ())\n return notEmpty (aValue, () -> sName);\n return aValue;\n }",
"class_method_signature": "ValueEnforcer.notEmpty(final T aValue, final String sName)",
"constructor": false,
"fu... | {
"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_590 | {
"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 testParseTrickyString () throws IOException\n {\n final ICommonsList <String> aNextLine = m_aParser.parseLine (\"\\\"a\\nb\\\",b,\\\"\\nd\\\",e\\n\");\n assertEquals (4, aNextLine.size ());\n assertEquals (\"a\\nb\", aNextLine.get (0));\n assertEquals (\"b\", aNextLine.get... | {
"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_343 | {
"fields": [],
"file": "ph-commons/src/test/java/com/helger/commons/io/relative/FileRelativeIOTest.java",
"identifier": "FileRelativeIOTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testBasePath () throws IOException\n {\n final IFileRelativeIO aIO = FileRelativeIO.createForCurrentDir ();\n final String sTestFile = \"testfile\";\n final String sTestContent = \"This is the test file content\";\n final String sTestFile2 = \"testfile2\";\n\n // may no... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger (FileRelativeIO.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger (FileRelativeIO.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
... | {
"body": "@Nonnull\n public static FileRelativeIO createForCurrentDir ()\n {\n return new FileRelativeIO (new File (\".\").getAbsoluteFile ());\n }",
"class_method_signature": "FileRelativeIO.createForCurrentDir()",
"constructor": false,
"full_signature": "@Nonnull public static FileRelativeIO createForC... | {
"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"
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.