id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
23062279_843
{ "fields": [], "file": "ph-commons/src/test/java/com/helger/commons/equals/EqualsHelperTest.java", "identifier": "EqualsHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testList ()\n {\n final ICommonsList <String> aCont = new CommonsArrayList <> (\"a\", \"b\", \"c\");\n assertTrue (EqualsHelper.equalsCollection (aCont, aCont));\n assertTrue (EqualsHelper.equalsCollection (aCont, CollectionHelper.makeUnmodifiable (aCont)));\n assertTrue (...
{ "fields": [ { "declarator": "s_aInstance = new EqualsHelper ()", "modifier": "@PresentForCodeCoverage\n private static final", "original_string": "@PresentForCodeCoverage\n private static final EqualsHelper s_aInstance = new EqualsHelper ();", "type": "EqualsHelper", "var_name": ...
{ "body": "public static boolean equalsCollection (@Nullable final Object aObj1, @Nullable final Object aObj2)\n {\n // Same object - check first\n if (identityEqual (aObj1, aObj2))\n return true;\n\n // Is only one value null?\n if (aObj1 == null || aObj2 == null)\n return false;\n\n final ...
{ "created": "8/18/2014 7:21:36 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 23062279, "size": null, "stargazer_count": null, "stars": 20, "updates": "2020-01-27T18:40:50+00:00", "url": "https://github.com/phax/ph-commons" ...
23062279_140
{ "fields": [], "file": "ph-xml/src/test/java/com/helger/xml/XMLFactoryTest.java", "identifier": "XMLFactoryTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testNewDocument ()\n {\n Document doc = XMLFactory.newDocument ();\n assertNotNull (doc);\n assertNull (doc.getDoctype ());\n assertNull (doc.getDocumentElement ());\n assertEquals (EXMLVersion.XML_10.getVersion (), doc.getXmlVersion ());\n\n doc = XMLFactory.newDocu...
{ "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 Document newDocument ()\n {\n return newDocument (getDocumentBuilder (), (EXMLVersion) null);\n }", "class_method_signature": "XMLFactory.newDocument()", "constructor": false, "full_signature": "@Nonnull public static Document newDocument()", "identifier": "newDocumen...
{ "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_510
{ "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 testAll ()\n {\n final IHasDisplayText t = new MockHasDisplayText (L_DE, \"Hallo {0}\");\n final HasDisplayTextWithArgs x = new HasDisplayTextWithArgs (t, \"Welt\");\n assertEquals (\"Hallo Welt\", x.getDisplayText (L_DE));\n assertNull (x.getDisplayText (L_FR));\n Comm...
{ "fields": [ { "declarator": "m_aParentText", "modifier": "private final", "original_string": "private final IHasDisplayText m_aParentText;", "type": "IHasDisplayText", "var_name": "m_aParentText" }, { "declarator": "m_aArgs", "modifier": "private final", "...
{ "body": "@Nullable\n public String getDisplayText (@Nonnull final Locale aContentLocale)\n {\n final String sText = m_aParentText.getDisplayText (aContentLocale);\n return TextHelper.getFormattedText (sText, m_aArgs);\n }", "class_method_signature": "HasDisplayTextWithArgs.getDisplayText(@Nonnull final L...
{ "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_455
{ "fields": [], "file": "ph-commons/src/test/java/com/helger/commons/math/MathHelperTest.java", "identifier": "MathHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetMaxLong ()\n {\n assertEquals (5, MathHelper.getMaxLong (5));\n assertEquals (5, MathHelper.getMaxLong (5, 5, 5, 5));\n assertEquals (5, MathHelper.getMaxLong (5, 3, 2, 1));\n assertEquals (7, MathHelper.getMaxLong (5, 3, 7, 4));\n }", "class_method_signature": "...
{ "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 long getMaxLong (final long nValue, @Nonnull final long... aValues)\n {\n long ret = nValue;\n for (final long n : aValues)\n ret = Math.max (ret, n);\n return ret;\n }", "class_method_signature": "MathHelper.getMaxLong(final long nValue, @Nonnull final long... aValues)", ...
{ "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_842
{ "fields": [], "file": "ph-commons/src/test/java/com/helger/commons/equals/EqualsHelperTest.java", "identifier": "EqualsHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testBasic ()\n {\n // Same objects - are tested first\n assertTrue (EqualsHelper.equalsCollection (null, null));\n assertTrue (EqualsHelper.equalsCollection (\"abc\", \"abc\"));\n\n // One argument is null\n assertFalse (EqualsHelper.equalsCollection (\"abc\", null));\n...
{ "fields": [ { "declarator": "s_aInstance = new EqualsHelper ()", "modifier": "@PresentForCodeCoverage\n private static final", "original_string": "@PresentForCodeCoverage\n private static final EqualsHelper s_aInstance = new EqualsHelper ();", "type": "EqualsHelper", "var_name": ...
{ "body": "public static boolean equalsCollection (@Nullable final Object aObj1, @Nullable final Object aObj2)\n {\n // Same object - check first\n if (identityEqual (aObj1, aObj2))\n return true;\n\n // Is only one value null?\n if (aObj1 == null || aObj2 == null)\n return false;\n\n final ...
{ "created": "8/18/2014 7:21:36 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 23062279, "size": null, "stargazer_count": null, "stars": 20, "updates": "2020-01-27T18:40:50+00:00", "url": "https://github.com/phax/ph-commons" ...
23062279_141
{ "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 testGetFirstChildElement ()\n {\n // Empty document has no child element\n assertNull (XMLHelper.getFirstChildElement (XMLFactory.newDocument ()));\n assertFalse (XMLHelper.hasChildElementNodes (XMLFactory.newDocument ()));\n\n Document doc = _getTestDoc ();\n assertTru...
{ "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 getFirstChildElement (@Nullable final Node aStartNode)\n {\n if (aStartNode == null)\n return null;\n return NodeListIterator.createChildNodeIterator (aStartNode).findFirstMapped (filterNodeIsElement (), x -> (Element) x);\n }", "class_method_signature": "X...
{ "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_511
{ "fields": [], "file": "ph-commons/src/test/java/com/helger/commons/text/util/PunycodeTest.java", "identifier": "PunycodeTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testPunycode ()\n {\n for (final ETest e : ETest.values ())\n {\n final String sEncoded = Punycode.getEncoded (e.m_sDecoded);\n final String sDecoded = Punycode.getDecoded (sEncoded);\n assertEquals (e.m_sName, e.m_sEncoded, sEncoded);\n assertEquals (e.m_sNa...
{ "fields": [ { "declarator": "BASE = 0x24", "modifier": "private static final", "original_string": "private static final int BASE = 0x24;", "type": "int", "var_name": "BASE" }, { "declarator": "TMIN = 0x01", "modifier": "private static final", "original_str...
{ "body": "private Punycode ()\n {}", "class_method_signature": "Punycode.Punycode()", "constructor": true, "full_signature": "private Punycode()", "identifier": "Punycode", "invocations": [], "modifiers": "private", "parameters": "()", "return": "", "signature": " Punycode()", "testcase": false...
{ "created": "8/18/2014 7:21:36 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 23062279, "size": null, "stargazer_count": null, "stars": 20, "updates": "2020-01-27T18:40:50+00:00", "url": "https://github.com/phax/ph-commons" ...
23062279_454
{ "fields": [], "file": "ph-commons/src/test/java/com/helger/commons/math/MathHelperTest.java", "identifier": "MathHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetMaxInt ()\n {\n assertEquals (5, MathHelper.getMaxInt (5));\n assertEquals (5, MathHelper.getMaxInt (5, 5, 5, 5));\n assertEquals (5, MathHelper.getMaxInt (5, 3, 2, 1));\n assertEquals (7, MathHelper.getMaxInt (5, 3, 7, 4));\n }", "class_method_signature": "MathH...
{ "fields": [ { "declarator": "LONG_HIGH_BITS = 0xFFFFFFFF80000000L", "modifier": "private static final", "original_string": "private static final long LONG_HIGH_BITS = 0xFFFFFFFF80000000L;", "type": "long", "var_name": "LONG_HIGH_BITS" }, { "declarator": "s_aInstance =...
{ "body": "public static int getMaxInt (final int nValue, @Nonnull final int... aValues)\n {\n int ret = nValue;\n for (final int n : aValues)\n ret = Math.max (ret, n);\n return ret;\n }", "class_method_signature": "MathHelper.getMaxInt(final int nValue, @Nonnull final int... aValues)", "construc...
{ "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_287
{ "fields": [], "file": "ph-commons/src/test/java/com/helger/commons/ValueEnforcerTest.java", "identifier": "ValueEnforcerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test (expected = IllegalArgumentException.class)\n public void testNotEmpty4 ()\n {\n ValueEnforcer.notEmpty (new String [0], \"null\");\n }", "class_method_signature": "ValueEnforcerTest.testNotEmpty4()", "constructor": false, "full_signature": "@Test (expected = IllegalArgumentException.clas...
{ "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_71
{ "fields": [], "file": "ph-graph/src/test/java/com/helger/graph/impl/GraphRelationTest.java", "identifier": "GraphRelationTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGet ()\n {\n final GraphNode nf = new GraphNode ();\n final GraphNode nt = new GraphNode ();\n final GraphRelation gr = new GraphRelation (nf, nt);\n assertEquals (2, gr.getAllConnectedNodes ().size ());\n assertTrue (gr.getAllConnectedNodes ().contains (nf));\n ...
{ "fields": [ { "declarator": "m_aNode1", "modifier": "private final", "original_string": "private final IMutableGraphNode m_aNode1;", "type": "IMutableGraphNode", "var_name": "m_aNode1" }, { "declarator": "m_aNode2", "modifier": "private final", "original_s...
{ "body": "@Nonnull\n @ReturnsMutableCopy\n public ICommonsOrderedSet <IMutableGraphNode> getAllConnectedNodes ()\n {\n return new CommonsLinkedHashSet <> (m_aNode1, m_aNode2);\n }", "class_method_signature": "GraphRelation.getAllConnectedNodes()", "constructor": false, "full_signature": "@Nonnull @Retur...
{ "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_638
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger (CryptoPolicyTest.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger (CryptoPolicyTest.class);", "type": "Logger", "var_name": "LOGGER" } ]...
{ "body": "@Test\n public void testIf ()\n {\n if (CryptoPolicy.isUnlimitedStrengthCryptoAvailable ())\n {\n LOGGER.info (\"Unlimited strength crypto IS available.\");\n assertTrue (CryptoPolicy.isUnlimitedStrengthCryptoAvailable ());\n }\n else\n {\n LOGGER.warn (\"Unlimited strength ...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger (CryptoPolicy.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger (CryptoPolicy.class);", "type": "Logger", "var_name": "LOGGER" }, { ...
{ "body": "public static boolean isUnlimitedStrengthCryptoAvailable ()\n {\n if (!s_aChecked.getAndSet (true))\n {\n // Double initialisation in case of parallel access is just a minor\n // performance penalty\n s_bUnlimitedStrength = _isUnlimitedStrengthAvailable ();\n }\n return s_bUnlim...
{ "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_268
{ "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 testDecode ()\n {\n final Base32Codec aBase32 = new Base32Codec ();\n assertNull (aBase32.getDecodedAsString ((byte []) null, CHARSET));\n assertEquals (\"\", aBase32.getDecodedAsString (new byte [0], CHARSET));\n assertArrayEquals (new byte [] { 0 }, aBase32.getDecoded (\...
{ "fields": [ { "declarator": "DECODE_TABLE = { // 00-0f\n -1,\n -1,\n -1,\n -1,\n ...
{ "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 || nLen == 0)\n return;\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_792
{ "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 testNewArrayFromCollectionWithMapper ()\n {\n final Function <String, Integer> aMapper = StringParser::parseIntObj;\n\n Integer [] x = newArrayMapped (CollectionHelper.newList (\"1\", \"2\", \"3\"), aMapper, Integer.class);\n assertNotNull (x);\n assertEquals (3, x.length)...
{ "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 <SRCTYPE, DSTTYPE> DSTTYPE [] newArrayMapped (@Nonnull final Collection <? extends SRCTYPE> aCollection,\n @Nonnull final Function <? super SRCTYPE, ? extends DSTTYPE> aMapper,\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_546
{ "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 testGetValidCountryCode ()\n {\n assertNull (LocaleHelper.getValidCountryCode (null));\n assertNull (LocaleHelper.getValidCountryCode (\"\"));\n assertNull (LocaleHelper.getValidCountryCode (\"1\"));\n assertNull (LocaleHelper.getValidCountryCode (\"12\"));\n assertNull...
{ "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 getValidCountryCode (@Nullable final String sCode)\n {\n // Allow for 2 or 3 letter codes (\"AT\" and \"AUT\")\n if (StringHelper.hasText (sCode))\n {\n // Allow for 2 letter codes (\"AT\")\n if (RegExHelper.stringMatchesPattern (\"[a-zA-Z]{2}|[0-9]{3}\...
{ "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_116
{ "fields": [], "file": "ph-config/src/test/java/com/helger/config/ConfigFactoryTest.java", "identifier": "ConfigFactoryTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSysPropConfigUrlProperties ()\n {\n SystemProperties.setPropertyValue (\"config.url\",\n new ClassPathResource (\"sysprops/url.properties\").getAsURL ().toExternalForm ());\n try\n {\n final IConfig aConfig = Config.create (Confi...
{ "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_815
{ "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_KeyValue ()\n {\n final Map <String, Integer> aMap = newMap (\"Hallo\", I5);\n assertNotNull (aMap);\n assertEquals (1, aMap.size ());\n assertNotNull (aMap.get (\"Hallo\"));\n assertEquals (I5, aMap.get (\"Hallo\"));\n }", "class_method_signature": "Colle...
{ "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_403
{ "fields": [], "file": "ph-commons/src/test/java/com/helger/commons/io/file/FilenameHelperTest.java", "identifier": "FilenameHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetSecureFilename ()\n {\n assertNull (FilenameHelper.getSecureFilename (null));\n assertEquals (\"\", FilenameHelper.getSecureFilename (\"\"));\n assertEquals (\"abc.txt\", FilenameHelper.getSecureFilename (\"abc.txt\"));\n assertEquals (\"abc.txt\", FilenameHelper.ge...
{ "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 public static String getSecureFilename (@Nullable final String sFilename)\n {\n if (sFilename == null)\n return null;\n final int nIdx0 = sFilename.indexOf ('\\0');\n return nIdx0 == -1 ? sFilename : sFilename.substring (0, nIdx0);\n }", "class_method_signature": "FilenameHel...
{ "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_680
{ "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 testGetExplodedToList ()\n {\n ICommonsList <String> ret = StringHelper.getExploded (\"@\", \"a@b@@c\");\n assertEquals (new CommonsArrayList <> (\"a\", \"b\", \"\", \"c\"), ret);\n ret = StringHelper.getExploded (\"uu\", \"auubuuuuuuc\");\n assertEquals (new CommonsArrayL...
{ "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 @ReturnsMutableObject (\"The passed parameter\")\n @CodingStyleguideUnaware\n public static <COLLTYPE extends Collection <String>> COLLTYPE getExploded (final char cSep,\n @Nullable final String sElements,\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_26
{ "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 testPrintOptionWithEmptyArgNameUsage ()\n {\n final Option option = Option.builder (\"f\").required (true).build ();\n\n final Options options = new Options ();\n options.addOption (option);\n\n try (final NonBlockingStringWriter out = new NonBlockingStringWriter ())\n ...
{ "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_395
{ "fields": [], "file": "ph-commons/src/test/java/com/helger/commons/io/file/FilenameHelperTest.java", "identifier": "FilenameHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testIsSystemInternalDirectory_File ()\n {\n assertFalse (FilenameHelper.isSystemInternalDirectory ((File) null));\n assertFalse (FilenameHelper.isSystemInternalDirectory (new File (\"pom.xml\")));\n assertFalse (FilenameHelper.isSystemInternalDirectory (new File (\"target\"))...
{ "fields": [ { "declarator": "EXTENSION_SEPARATOR = '.'", "modifier": "public static final", "original_string": "public static final char EXTENSION_SEPARATOR = '.';", "type": "char", "var_name": "EXTENSION_SEPARATOR" }, { "declarator": "ILLEGAL_FILENAME_CHAR_REPLACEMEN...
{ "body": "public static boolean isSystemInternalDirectory (@Nullable final File aFile)\n {\n return aFile != null && isSystemInternalDirectory (aFile.getName ());\n }", "class_method_signature": "FilenameHelper.isSystemInternalDirectory(@Nullable final File aFile)", "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_4
{ "fields": [ { "declarator": "tested = new UTF7CharsetProviderSPI ()", "modifier": "private final", "original_string": "private final UTF7CharsetProviderSPI tested = new UTF7CharsetProviderSPI ();", "type": "UTF7CharsetProviderSPI", "var_name": "tested" } ], "file": "ph-char...
{ "body": "@Test\n public void testTurkish ()\n {\n Locale.setDefault (new Locale (\"tr\", \"TR\"));\n assertEquals (tested.charsetForName (\"UTF-7\"), tested.charsetForName (\"unicode-1-1-utf-7\"));\n }", "class_method_signature": "UTF7CharsetProviderSPITest.testTurkish()", "constructor": false, "full...
{ "fields": [ { "declarator": "UTF7_NAME = \"UTF-7\"", "modifier": "private static final", "original_string": "private static final String UTF7_NAME = \"UTF-7\";", "type": "String", "var_name": "UTF7_NAME" }, { "declarator": "UTF7_O_NAME = \"X-UTF-7-OPTIONAL\"", "...
{ "body": "@Override\n @Nullable\n public Charset charsetForName (@Nonnull final String sCharsetName)\n {\n final String sRealCharsetName = sCharsetName.toUpperCase (Locale.US);\n for (final Charset aCharset : m_aCharsets)\n if (aCharset.name ().equals (sRealCharsetName))\n return aCharset;\n ...
{ "created": "8/18/2014 7:21:36 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 23062279, "size": null, "stargazer_count": null, "stars": 20, "updates": "2020-01-27T18:40:50+00:00", "url": "https://github.com/phax/ph-commons" ...
23062279_803
{ "fields": [], "file": "ph-commons/src/test/java/com/helger/commons/collection/IteratorHelperTest.java", "identifier": "IteratorHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetIterator_Iterator ()\n {\n assertNotNull (getIterator ((Iterator <?>) null));\n assertFalse (getIterator ((Iterator <?>) null).hasNext ());\n assertTrue (getIterator (newList (\"abc\").iterator ()).hasNext ());\n }", "class_method_signature": "IteratorHelperTest.tes...
{ "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> IIterableIterator <ELEMENTTYPE> getIterator (@Nullable final Enumeration <? extends ELEMENTTYPE> aEnum)\n {\n return new IterableIteratorFromEnumeration <> (aEnum);\n }", "class_method_signature": "IteratorHelper.getIterator(@Nullable final Enumeration <? exte...
{ "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_100
{ "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 testEquals ()\n {\n final Map <String, Integer> aMap = new SingleElementMap <> ();\n final Map <String, Integer> aMap2 = new SingleElementMap <> ();\n assertEquals (aMap, aMap);\n assertEquals (aMap, aMap2);\n assertEquals (aMap2, aMap);\n assertNotEquals (aMap, null...
{ "fields": [ { "declarator": "m_bHasElement = false", "modifier": "private", "original_string": "private boolean m_bHasElement = false;", "type": "boolean", "var_name": "m_bHasElement" }, { "declarator": "m_aKey", "modifier": "private", "original_string": "...
{ "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 final SingleElementMap <?, ?> rhs = (SingleElementMap <?, ?>) o;\n return m_bHasElement == rhs.m_bHasElement && EqualsHelp...
{ "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_550
{ "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 testParseLong ()\n {\n assertEquals (1000000L, LocaleParser.parseLong (\"1.000.000\", L_DE, CGlobal.ILLEGAL_UINT));\n assertEquals (1000000L, LocaleParser.parseLong (\"1,000,000\", L_EN, CGlobal.ILLEGAL_UINT));\n assertEquals (CGlobal.ILLEGAL_UINT, LocaleParser.parseLong (\"....
{ "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 long parseLong (@Nullable final String sStr, @Nonnull final Locale aParseLocale, final long nDefault)\n {\n return parseLong (sStr, NumberFormat.getIntegerInstance (aParseLocale), nDefault);\n }", "class_method_signature": "LocaleParser.parseLong(@Nullable final String sStr, @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_415
{ "fields": [], "file": "ph-commons/src/test/java/com/helger/commons/io/file/FileOperationManagerTest.java", "identifier": "FileOperationManagerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testDeleteDirIfExisting ()\n {\n final IFileOperationManager aFOM = new FileOperationManager ();\n final File aDir = new File (\"deldir.test\");\n try\n {\n assertFalse (FileHelper.existsDir (aDir));\n _expectedSuccess (aFOM.deleteDirIfExisting (aDir));\n as...
{ "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 deleteDirIfExisting (@Nonnull final File aDir)\n {\n m_aLastError = FileOperations.deleteDirIfExisting (aDir);\n _handleLastError (m_aLastError);\n return m_aLastError;\n }", "class_method_signature": "FileOperationManager.deleteDirIfExisting(@Nonnull final File ...
{ "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_30
{ "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 testOptionWithoutShortFormat ()\n {\n // related to Bugzilla #19383 (CLI-67)\n final Options options = new Options ();\n options.addOption (Option.builder (\"a\").longOpt (\"aaa\").desc (\"aaaaaaa\"));\n options.addOption (Option.builder (null).longOpt (\"bbb\").desc (\"bb...
{ "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_696
{ "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 testGetOccurrenceCountChar ()\n {\n assertEquals (0, StringHelper.getOccurrenceCount (null, 'x'));\n assertEquals (0, StringHelper.getOccurrenceCount (\"e\", 'f'));\n assertEquals (0, StringHelper.getOccurrenceCount (\"e\", '\\u0000'));\n assertEquals (0, StringHelper.getO...
{ "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_679
{ "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 testGetImplodedNonEmptyArray ()\n {\n final String [] aArray = new String [] { null, \"a\", \"\", \"b\", null, \"c\", \"\" };\n assertEquals (\"a.b\", StringHelper.getImplodedNonEmpty (\".\", aArray, 0, 4));\...
{ "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 getImplodedNonEmpty (@Nullable final Iterable <String> aElements)\n {\n return getImplodedMappedNonEmpty (aElements, Function.identity ());\n }", "class_method_signature": "StringHelper.getImplodedNonEmpty(@Nullable final Iterable <String> aElements)", "constructor...
{ "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_383
{ "fields": [], "file": "ph-commons/src/test/java/com/helger/commons/io/file/FilenameHelperTest.java", "identifier": "FilenameHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetPath ()\n {\n assertNull (FilenameHelper.getPath (null));\n assertEquals (\"\", FilenameHelper.getPath (\"\"));\n assertEquals (\"\", FilenameHelper.getPath (\"xyz\"));\n assertEquals (\"\", FilenameHelper.getPath (\"xyz.sh\"));\n assertEquals (\"\", 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": "@Nullable\n public static String getPath (@Nullable final String sAbsoluteFilename)\n {\n /**\n * Note: do not use <code>new File (sFilename).getPath ()</code> since this\n * only invokes the underlying FileSystem implementation which handles path\n * handling only correctly on the native ...
{ "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_229
{ "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 testReadWithSchema ()\n {\n final Schema aSchema = XMLSchemaCache.getInstance ().getSchema (new ClassPathResource (\"xml/schema1.xsd\"));\n assertNotNull (aSchema);\n\n // read valid\n final String sValid = \"<?xml version='1.0'?><root xmlns='http://www.example.org/schema1...
{ "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_507
{ "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 testGetString ()\n {\n assertEquals (\"äöü\", ResourceBundleHelper.getString (\"properties/test-iso8859\", L_DE, \"key1\"));\n assertNull (ResourceBundleHelper.getString (\"properties/test-iso8859-noway\", L_DE, \"key1\"));\n assertEquals (\"äöü\", ResourceBundleHelper.getStr...
{ "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 getString (@Nullable final ResourceBundle aResourceBundle, @Nonnull @PropertyKey final String sKey)\n {\n if (aResourceBundle != null)\n try\n {\n return aResourceBundle.getString (sKey);\n }\n catch (final MissingResourceException ex)\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_157
{ "fields": [], "file": "ph-xml/src/test/java/com/helger/xml/microdom/util/XMLMapHandlerTest.java", "identifier": "XMLMapHandlerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testWriteInvalid ()\n {\n final ICommonsMap <String, String> aMap = new CommonsHashMap <> ();\n\n try\n {\n XMLMapHandler.writeMap (aMap, (IHasOutputStream) null);\n fail ();\n }\n catch (final NullPointerException ex)\n {}\n try\n {\n XMLMapHand...
{ "fields": [ { "declarator": "ELEMENT_MAPPING = \"mapping\"", "modifier": "public static final", "original_string": "public static final String ELEMENT_MAPPING = \"mapping\";", "type": "String", "var_name": "ELEMENT_MAPPING" }, { "declarator": "ELEMENT_MAP = \"map\"", ...
{ "body": "@Nonnull\n public static ESuccess writeMap (@Nonnull final Map <String, String> aMap, @Nonnull final IHasOutputStream aOSP)\n {\n ValueEnforcer.notNull (aOSP, \"OutputStreamProvider\");\n\n return writeMap (aMap, aOSP.getOutputStream (EAppend.DEFAULT));\n }", "class_method_signature": "XMLMapHan...
{ "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_854
{ "fields": [], "file": "ph-commons/src/test/java/com/helger/commons/wrapper/WrapperTest.java", "identifier": "WrapperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testWrapper ()\n {\n // Default ctor\n final Wrapper <String> w = new Wrapper <> ();\n assertNull (w.get ());\n w.set (\"Hi\");\n assertNotNull (w.get ());\n assertEquals (\"Hi\", w.get ());\n assertNotNull (w.toString ());\n\n // ctor with value\n final Wra...
{ "fields": [ { "declarator": "m_aObj", "modifier": "private", "original_string": "private DATATYPE m_aObj;", "type": "DATATYPE", "var_name": "m_aObj" } ], "file": "ph-commons/src/main/java/com/helger/commons/wrapper/Wrapper.java", "identifier": "Wrapper", "interfaces": "...
{ "body": "public Wrapper ()\n {}", "class_method_signature": "Wrapper.Wrapper()", "constructor": true, "full_signature": "public Wrapper()", "identifier": "Wrapper", "invocations": [], "modifiers": "public", "parameters": "()", "return": "", "signature": " Wrapper()", "testcase": false }
{ "created": "8/18/2014 7:21:36 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 23062279, "size": null, "stargazer_count": null, "stars": 20, "updates": "2020-01-27T18:40:50+00:00", "url": "https://github.com/phax/ph-commons" ...
23062279_442
{ "fields": [], "file": "ph-commons/src/test/java/com/helger/commons/base64/Base64Test.java", "identifier": "Base64Test", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSafeDecode ()\n {\n assertEquals (0, Base64.safeDecode (new byte [0]).length);\n assertNull (Base64.safeDecode (new byte [1]));\n assertNull (Base64.safeDecode (new byte [2]));\n assertNull (Base64.safeDecode (new byte [3]));\n assertEquals (3, Base64.safeDecode (ne...
{ "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": "@Nullable\n @ReturnsMutableCopy\n public static byte [] safeDecode (@Nullable final String sEncoded)\n {\n return safeDecode (sEncoded, DONT_GUNZIP);\n }", "class_method_signature": "Base64.safeDecode(@Nullable final String sEncoded)", "constructor": false, "full_signature": "@Nullable @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_67
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger (SimpleGraphTest.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger (SimpleGraphTest.class);", "type": "Logger", "var_name": "LOGGER" } ], ...
{ "body": "@Test\n public void testSelfContained ()\n {\n final ISimpleGraph sg = new SimpleGraph ();\n assertTrue (sg.isSelfContained ());\n\n // n1 belongs to the graph\n IMutableGraphNode n1 = sg.createNode (\"any\");\n assertTrue (sg.isSelfContained ());\n\n // n2 does not belong to the graph\...
{ "fields": [], "file": "ph-graph/src/main/java/com/helger/graph/simple/SimpleGraph.java", "identifier": "SimpleGraph", "interfaces": "implements ISimpleGraph", "methods": [ { "class_method_signature": "SimpleGraph.SimpleGraph()", "constructor": true, "full_signature": "public SimpleGra...
{ "body": "@Nonnull\n public IMutableGraphRelation createRelation (@Nonnull final String sFromNodeID, @Nonnull final String sToNodeID)\n {\n final IMutableGraphNode aFromNode = getNodeOfID (sFromNodeID);\n if (aFromNode == null)\n throw new IllegalArgumentException (\"Failed to resolve from node ID '\" +...
{ "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_291
{ "fields": [], "file": "ph-commons/src/test/java/com/helger/commons/ValueEnforcerTest.java", "identifier": "ValueEnforcerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test (expected = IllegalArgumentException.class)\n public void testNotEmpty8 ()\n {\n ValueEnforcer.notEmpty (new CommonsVector <> (), \"null\");\n }", "class_method_signature": "ValueEnforcerTest.testNotEmpty8()", "constructor": false, "full_signature": "@Test (expected = IllegalArgumentExcep...
{ "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_88
{ "fields": [], "file": "ph-json/src/test/java/com/helger/json/convert/JsonConverterTest.java", "identifier": "JsonConverterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testArray ()\n {\n assertTrue (JsonConverter.convertToJson (new boolean [] { true, false, true }) instanceof JsonArray);\n assertTrue (JsonConverter.convertToJson (new byte [] { 0, 1, 2 }) instanceof JsonArray);\n assertTrue (JsonConverter.convertToJson (new char [] { 'a', 'b...
{ "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_784
{ "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 testAsObjectArray ()\n {\n assertNull (getAsObjectArray (null));\n assertNull (getAsObjectArray (new CommonsArrayList <String> ()));\n assertArrayEquals (new Object [] { \"Hallo\" }, getAsObjectArray (CollectionHelper.newList (\"Hallo\")));\n assertArrayEquals (new Object ...
{ "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 public static Object [] getAsObjectArray (@Nullable final Collection <?> aCollection)\n {\n if (CollectionHelper.isEmpty (aCollection))\n return null;\n\n final Object [] ret = new Object [aCollection.size ()];\n return aCollection.toArray (ret);\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_439
{ "fields": [], "file": "ph-commons/src/test/java/com/helger/commons/base64/Base64Test.java", "identifier": "Base64Test", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testEncodeByteBuffer ()\n {\n final ByteBuffer aSrc = ByteBuffer.wrap (\"Hallo Wält\".getBytes (StandardCharsets.UTF_8));\n final ByteBuffer aDst = ByteBuffer.allocate (aSrc.capacity () * 2);\n Base64.encode (aSrc, aDst);\n assertEquals (\"Hallo Wält\", Base64.safeDecodeAs...
{ "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 encode (@Nonnull final ByteBuffer raw, @Nonnull final ByteBuffer encoded)\n {\n final byte [] raw3 = new byte [3];\n final byte [] enc4 = new byte [4];\n\n while (raw.hasRemaining ())\n {\n final int rem = Math.min (3, raw.remaining ());\n raw.get (raw3, 0, rem);\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_593
{ "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 testReturnNullWhenNullPassedIn () throws IOException\n {\n final ICommonsList <String> aNextLine = m_aParser.parseLine (null);\n assertNull (aNextLine);\n }", "class_method_signature": "CSVParserTest.testReturnNullWhenNullPassedIn()", "constructor": false, "full_signature...
{ "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_205
{ "fields": [ { "declarator": "ELEMENT_NAME = \"element\"", "modifier": "private static final", "original_string": "private static final String ELEMENT_NAME = \"element\";", "type": "String", "var_name": "ELEMENT_NAME" } ], "file": "ph-xml/src/test/java/com/helger/xml/microdo...
{ "body": "@Test\n public void testConvertToNative ()\n {\n // null object allowed\n assertNull (MicroTypeConverter.convertToNative (null, String.class));\n\n try\n {\n // null class not allowed\n MicroTypeConverter.convertToNative (new MicroElement (\"any\"), null);\n fail ();\n }\n ...
{ "fields": [ { "declarator": "s_aInstance = new MicroTypeConverter ()", "modifier": "@PresentForCodeCoverage\n private static final", "original_string": "@PresentForCodeCoverage\n private static final MicroTypeConverter s_aInstance = new MicroTypeConverter ();", "type": "MicroTypeConver...
{ "body": "@Nullable\n public static <DSTTYPE> DSTTYPE convertToNative (@Nullable final IMicroElement aElement, @Nonnull final Class <DSTTYPE> aDstClass)\n {\n return convertToNative (aElement, aDstClass, null);\n }", "class_method_signature": "MicroTypeConverter.convertToNative(@Nullable final IMicroElement ...
{ "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_655
{ "fields": [], "file": "ph-commons/src/test/java/com/helger/commons/string/util/LevenshteinDistanceTest.java", "identifier": "LevenshteinDistanceTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetDistanceCharArray ()\n {\n assertEquals (0, LevenshteinDistance.getDistance (\"abc\".toCharArray (), \"abc\".toCharArray ()));\n assertEquals (0, LevenshteinDistance.getDistance (new char [0], new char [0]));\n assertEquals (0, LevenshteinDistance.getDistance ((char []...
{ "fields": [ { "declarator": "s_aInstance = new LevenshteinDistance ()", "modifier": "@PresentForCodeCoverage\n private static final", "original_string": "@PresentForCodeCoverage\n private static final LevenshteinDistance s_aInstance = new LevenshteinDistance ();", "type": "LevenshteinD...
{ "body": "public static int getDistance (@Nullable final char [] aStr1, @Nullable final char [] aStr2)\n {\n final int nLen1 = aStr1 == null ? 0 : aStr1.length;\n final int nLen2 = aStr2 == null ? 0 : aStr2.length;\n\n if (nLen1 == 0)\n return nLen2;\n if (nLen2 == 0)\n return nLen1;\n\n re...
{ "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_340
{ "fields": [], "file": "ph-commons/src/test/java/com/helger/commons/io/stream/BitInputStreamTest.java", "identifier": "BitInputStreamTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testReadBitBigEndian () throws IOException\n {\n final NonBlockingByteArrayInputStream aBAIS = new NonBlockingByteArrayInputStream (new byte [] { (byte) 0x80 });\n try (final BitInputStream aBIS = new BitInputStream (aBAIS, ByteOrder.BIG_ENDIAN))\n {\n for (int i = 0; i ...
{ "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 int readBit () throws IOException\n {\n // Cannot used \"locked\" because there is not IThrowingIntSupplier interface\n m_aLock.lock ();\n try\n {\n return super.readBit ();\n }\n finally\n {\n m_aLock.unlock ();\n }\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_710
{ "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 testGetFirstChar ()\n {\n assertEquals ('a', StringHelper.getFirstChar (\"abc\"));\n assertEquals ('a', StringHelper.getFirstChar (\"a\"));\n assertEquals (CGlobal.ILLEGAL_CHAR, StringHelper.getFirstChar (\"\"));\n assertEquals (CGlobal.ILLEGAL_CHAR, StringHelper.getFirstC...
{ "fields": [ { "declarator": "STRING_NOT_FOUND = -1", "modifier": "public static final", "original_string": "public static final int STRING_NOT_FOUND = -1;", "type": "int", "var_name": "STRING_NOT_FOUND" }, { "declarator": "s_aSizeTableInt = { 9, 99, 999, 9999, 99999, ...
{ "body": "public static char getFirstChar (@Nullable final CharSequence aCS)\n {\n return hasText (aCS) ? aCS.charAt (0) : CGlobal.ILLEGAL_CHAR;\n }", "class_method_signature": "StringHelper.getFirstChar(@Nullable final CharSequence aCS)", "constructor": false, "full_signature": "public static char getFir...
{ "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_194
{ "fields": [ { "declarator": "TEST_XML = \"<?xml version=\\\"1.0\\\"?>\" +\n \"<!DOCTYPE verrryoot>\" +\n \"<verrryoot xmlns=\\\"sthgelse\\\">\" +\n \"<!-- arg - a comment -->\" +\n ...
{ "body": "@Test\n public void testWriteCDATAAsText ()\n {\n final XMLWriterSettings aSettings = new XMLWriterSettings ().setIndent (EXMLSerializeIndent.NONE).setWriteCDATAAsText (true);\n\n // Simple CDATA\n IMicroElement e = new MicroElement (\"a\");\n e.appendCDATA (\"foobar\");\n assertEquals (\"...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger (MicroWriter.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger (MicroWriter.class);", "type": "Logger", "var_name": "LOGGER" }, { ...
{ "body": "@Nullable\n public static String getNodeAsString (@Nonnull final IMicroNode aNode, @Nonnull final IXMLWriterSettings aSettings)\n {\n ValueEnforcer.notNull (aNode, \"Node\");\n ValueEnforcer.notNull (aSettings, \"Settings\");\n\n try (final NonBlockingStringWriter aWriter = new NonBlockingString...
{ "created": "8/18/2014 7:21:36 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 23062279, "size": null, "stargazer_count": null, "stars": 20, "updates": "2020-01-27T18:40:50+00:00", "url": "https://github.com/phax/ph-commons" ...
23062279_878
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger (BCryptTest.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger (BCryptTest.class);", "type": "Logger", "var_name": "LOGGER" }, { "d...
{ "body": "@Test\n public void testHashpw ()\n {\n LOGGER.info (\"BCrypt.hashpw(): \");\n for (final String [] test_vector : test_vectors)\n {\n final String plain = test_vector[0];\n final String salt = test_vector[1];\n final String expected = test_vector[2];\n final String hashed = B...
{ "fields": [ { "declarator": "GENSALT_DEFAULT_LOG2_ROUNDS = 10", "modifier": "public static final", "original_string": "public static final int GENSALT_DEFAULT_LOG2_ROUNDS = 10;", "type": "int", "var_name": "GENSALT_DEFAULT_LOG2_ROUNDS" }, { "declarator": "BCRYPT_SALT_...
{ "body": "@Nonnull\n public static String hashpw (@Nonnull final String sPassword, @Nonnull final String sSalt)\n {\n if (sSalt.charAt (0) != '$' || sSalt.charAt (1) != '2')\n throw new IllegalArgumentException (\"Invalid salt version\");\n\n char minor = (char) 0;\n int off;\n if (sSalt.charAt (2...
{ "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_481
{ "fields": [], "file": "ph-commons/src/test/java/com/helger/commons/lang/ClassHelperTest.java", "identifier": "ClassHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testIsStringClass ()\n {\n assertTrue (ClassHelper.isStringClass (String.class));\n assertTrue (ClassHelper.isStringClass (StringBuilder.class));\n assertFalse (ClassHelper.isStringClass (null));\n assertFalse (ClassHelper.isStringClass (Integer.class));\n assertFalse (...
{ "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 isStringClass (@Nullable final Class <?> aClass)\n {\n if (aClass == null)\n return false;\n // Base class of String, StringBuffer and StringBuilder\n return CharSequence.class.isAssignableFrom (aClass);\n }", "class_method_signature": "ClassHelper.isStringClass(@Nul...
{ "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_602
{ "fields": [], "file": "ph-commons/src/test/java/com/helger/commons/regex/RegExHelperTest.java", "identifier": "RegExHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n @SuppressFBWarnings (value = \"NP_NONNULL_PARAM_VIOLATION\")\n public void testSplitWithLimit ()\n {\n String [] x = RegExHelper.getSplitToArray (\"abc\", \"b\", 2);\n assertNotNull (x);\n assertEquals (2, x.length);\n assertEquals (\"a\", x[0]);\n assertEquals (\"c\", x[1]);\n\n ...
{ "fields": [ { "declarator": "s_aInstance = new RegExHelper ()", "modifier": "@PresentForCodeCoverage\n private static final", "original_string": "@PresentForCodeCoverage\n private static final RegExHelper s_aInstance = new RegExHelper ();", "type": "RegExHelper", "var_name": "s_a...
{ "body": "@Nonnull\n public static String [] getSplitToArray (@Nullable final CharSequence sText, @Nonnull @RegEx final String sRegEx)\n {\n if (sText == null)\n return ArrayHelper.EMPTY_STRING_ARRAY;\n return RegExCache.getPattern (sRegEx).split (sText);\n }", "class_method_signature": "RegExHelper....
{ "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_252
{ "fields": [], "file": "ph-commons/src/test/java/com/helger/commons/url/SimpleURLTest.java", "identifier": "SimpleURLTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testDataUrls ()\n {\n final String sURL = \"data:image/gif;base64,R0lGODlhEAAOALMAAOazToeHh0tLS/7LZv/0jvb29t/f3//Ub//ge8WSLf/rhf/3kdbW1mxsbP//mf///yH5BAAAAAAALAAAAAAQAA4AAARe8L1Ekyky67QZ1hLnjM5UUde0ECwLJoExKcppV0aCcGCmTIHEIUEqjgaORCMxIC6e0CcguWw6aFjsVMkkIr7g77ZKPJjPZqIyd7sJAgVGoEGv...
{ "fields": [ { "declarator": "m_sPath", "modifier": "private", "original_string": "private String m_sPath;", "type": "String", "var_name": "m_sPath" }, { "declarator": "m_aParams = new URLParameterList ()", "modifier": "private final", "original_string": "p...
{ "body": "@Nonnull\n @ReturnsMutableObject\n public final URLParameterList params ()\n {\n return m_aParams;\n }", "class_method_signature": "SimpleURL.params()", "constructor": false, "full_signature": "@Nonnull @ReturnsMutableObject public final URLParameterList params()", "identifier": "params", ...
{ "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_747
{ "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 testGetLastTokenString ()\n {\n assertEquals (\"abc\", StringHelper.getLastToken (\"abc\", \" \"));\n assertEquals (\"bc\", StringHelper.getLastToken (\"abc\", \"a\"));\n assertEquals (\"c\", StringHelper.getLastToken (\"abc\", \"b\"));\n assertEquals (\"a\", StringHelper....
{ "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 getLastToken (@Nullable final String sStr, final char cSearch)\n {\n final int nIndex = getLastIndexOf (sStr, cSearch);\n return nIndex == StringHelper.STRING_NOT_FOUND ? sStr : sStr.substring (nIndex + 1);\n }", "class_method_signature": "StringHelper.getLastTok...
{ "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_317
{ "fields": [], "file": "ph-commons/src/test/java/com/helger/commons/io/resource/URLResourceTest.java", "identifier": "URLResourceTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testCtor () throws MalformedURLException\n {\n assertNotNull (new URLResource (\"http://www.helger.com\"));\n assertNotNull (new URLResource (\"http://www.helger.com/\"));\n assertNotNull (new URLResource (\"http://www.helger.com#anchor\"));\n assertNotNull (new URLResourc...
{ "fields": [ { "declarator": "DEFAULT_CONNECT_TIMEOUT = -1", "modifier": "public static final", "original_string": "public static final int DEFAULT_CONNECT_TIMEOUT = -1;", "type": "int", "var_name": "DEFAULT_CONNECT_TIMEOUT" }, { "declarator": "DEFAULT_READ_TIMEOUT = -...
{ "body": "public boolean exists ()\n {\n // 1. as file\n if (URLHelper.PROTOCOL_FILE.equals (m_aURL.getProtocol ()))\n return getAsFile ().exists ();\n\n // Not a file URL\n InputStream aIS = null;\n try\n {\n // 2. as stream\n aIS = getInputStream ();\n return aIS != 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_881
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger (BCryptTest.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger (BCryptTest.class);", "type": "Logger", "var_name": "LOGGER" }, { "d...
{ "body": "@Test\n public void testCheckpw_failure ()\n {\n LOGGER.info (\"BCrypt.checkpw w/ bad passwords: \");\n for (int i = 0; i < test_vectors.length; i++)\n {\n final int broken_index = (i + 4) % test_vectors.length;\n final String plain = test_vectors[i][0];\n final String expected = ...
{ "fields": [ { "declarator": "GENSALT_DEFAULT_LOG2_ROUNDS = 10", "modifier": "public static final", "original_string": "public static final int GENSALT_DEFAULT_LOG2_ROUNDS = 10;", "type": "int", "var_name": "GENSALT_DEFAULT_LOG2_ROUNDS" }, { "declarator": "BCRYPT_SALT_...
{ "body": "public static boolean checkpw (@Nonnull final String sPlaintext, @Nonnull final String sHashed)\n {\n final String sNewHashed = hashpw (sPlaintext, sHashed);\n final byte [] aHashedBytes = sHashed.getBytes (StandardCharsets.UTF_8);\n final byte [] aTryBytes = sNewHashed.getBytes (StandardCharsets...
{ "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_478
{ "fields": [], "file": "ph-commons/src/test/java/com/helger/commons/lang/ClassHelperTest.java", "identifier": "ClassHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testIsInstancableClass ()\n {\n // null is not\n assertFalse (ClassHelper.isInstancableClass (null));\n\n // annotation is not\n assertFalse (ClassHelper.isInstancableClass (Override.class));\n\n // interface is not\n assertFalse (ClassHelper.isInstancableClass (IHas...
{ "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 isInstancableClass (@Nullable final Class <?> aClass)\n {\n if (!isPublicClass (aClass))\n return false;\n\n // Check if a default constructor is present\n try\n {\n aClass.getConstructor ((Class <?> []) null);\n }\n catch (final NoSuchMethodException ex)\...
{ "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_182
{ "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 testNamespaces3a ()\n {\n final XMLWriterSettings xs = new XMLWriterSettings ();\n xs.setIndent (EXMLSerializeIndent.NONE);\n xs.setUseDoubleQuotesForAttributes (false);\n xs.setNamespaceContext (new MapBasedNamespaceContext ().addMapping (\"a1\", \"uri1\").addMapping (\"a...
{ "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_497
{ "fields": [], "file": "ph-commons/src/test/java/com/helger/commons/lang/ClassHierarchyCacheTest.java", "identifier": "ClassHierarchyCacheTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetClassHierarchy ()\n {\n // Very basic class\n Collection <Class <?>> aHierarchy = ClassHierarchyCache.getClassHierarchy (Object.class);\n assertEquals (1, aHierarchy.size ());\n assertTrue (aHierarchy.contains (Object.class));\n\n // More sophisticated static cla...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger (ClassHierarchyCache.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger (ClassHierarchyCache.class);", "type": "Logger", "var_name": "LOGGER" ...
{ "body": "@Nonnull\n @ReturnsMutableCopy\n public static ICommonsSet <Class <?>> getClassHierarchy (@Nonnull final Class <?> aClass)\n {\n return _getClassList (aClass).getAsSet ();\n }", "class_method_signature": "ClassHierarchyCache.getClassHierarchy(@Nonnull final Class <?> aClass)", "constructor": fal...
{ "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_244
{ "fields": [], "file": "ph-xml/src/test/java/com/helger/xml/sax/StringSAXInputSourceTest.java", "identifier": "StringSAXInputSourceTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testBasic ()\n {\n final StringSAXInputSource sis = new StringSAXInputSource (\"bla foo 90\");\n assertEquals (\"bla foo 90\", StreamHelper.getAllCharactersAsString (sis.getCharacterStream ()));\n CommonsTestHelper.testToStringImplementation (sis);\n }", "class_method_sign...
{ "fields": [ { "declarator": "m_sText", "modifier": "private final", "original_string": "private final String m_sText;", "type": "String", "var_name": "m_sText" } ], "file": "ph-xml/src/main/java/com/helger/xml/sax/StringSAXInputSource.java", "identifier": "StringSAXInputS...
{ "body": "@Override\n public Reader getCharacterStream ()\n {\n return new NonBlockingStringReader (m_sText);\n }", "class_method_signature": "StringSAXInputSource.getCharacterStream()", "constructor": false, "full_signature": "@Override public Reader getCharacterStream()", "identifier": "getCharacterS...
{ "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_614
{ "fields": [ { "declarator": "CONVERTIBLE_CLASSES = new Class <?> [] { Boolean.class,\n Byte.class,\n Character.class,\n ...
{ "body": "@Test\n public void testConvertAllToAll () throws Exception\n {\n // Try convert all types into each other\n for (final Class <?> aSrcClass : CONVERTIBLE_CLASSES)\n {\n final Object aSrcValue = _instantiate (aSrcClass);\n\n // Convert into all other types\n for (final Class <?> aD...
{ "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_301
{ "fields": [], "file": "ph-commons/src/test/java/com/helger/commons/mime/MimeTypeParserTest.java", "identifier": "MimeTypeParserTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testParseValid ()\n {\n final String [] aValid = new String [] { \"text/x\",\n \"text/x;\",\n \"text/x; \",\n \"text/x;param1=\",\n ...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger (MimeTypeParser.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger (MimeTypeParser.class);", "type": "Logger", "var_name": "LOGGER" }, { ...
{ "body": "@Nullable\n public static MimeType parseMimeType (@Nullable final String sMimeType)\n {\n return parseMimeType (sMimeType, CMimeType.DEFAULT_QUOTING);\n }", "class_method_signature": "MimeTypeParser.parseMimeType(@Nullable final String sMimeType)", "constructor": false, "full_signature": "@Null...
{ "created": "8/18/2014 7:21:36 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 23062279, "size": null, "stargazer_count": null, "stars": 20, "updates": "2020-01-27T18:40:50+00:00", "url": "https://github.com/phax/ph-commons" ...
23062279_751
{ "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 testAppendQuotedSB ()\n {\n final Function <String, String> quote = x -> {\n final StringBuilder aSB = new StringBuilder ();\n StringHelper.appendQuoted (aSB, x);\n return aSB.toString ();\n };\n assertEquals (\"null\", quote.apply (null));\n assertEquals (\...
{ "fields": [ { "declarator": "STRING_NOT_FOUND = -1", "modifier": "public static final", "original_string": "public static final int STRING_NOT_FOUND = -1;", "type": "int", "var_name": "STRING_NOT_FOUND" }, { "declarator": "s_aSizeTableInt = { 9, 99, 999, 9999, 99999, ...
{ "body": "public static void appendQuoted (@Nonnull final StringBuilder aTarget, @Nullable final String sSource)\n {\n if (sSource == null)\n aTarget.append (\"null\");\n else\n aTarget.append ('\\'').append (sSource).append ('\\'');\n }", "class_method_signature": "StringHelper.appendQuoted(@Non...
{ "created": "8/18/2014 7:21:36 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 23062279, "size": null, "stargazer_count": null, "stars": 20, "updates": "2020-01-27T18:40:50+00:00", "url": "https://github.com/phax/ph-commons" ...
23062279_585
{ "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 testParseMultiLinedQuotedwithCarriageReturns () throws IOException\n {\n final ICommonsList <String> aNextLine = m_aParser.parseLine (\"a,\\\"PO Box 123,\\r\\nKippax,ACT. 2615.\\r\\nAustralia\\\",d.\\n\");\n assertEquals (3, aNextLine.size ());\n assertEquals (\"a\", aNextLin...
{ "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_839
{ "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 @SuppressFBWarnings (\"TQ_NEVER_VALUE_USED_WHERE_ALWAYS_REQUIRED\")\n public void testGetSubList ()\n {\n assertNotNull (getSubList (null, 0, 5));\n\n try\n {\n // start index may not be < 0\n getSubList (new CommonsArrayList <String> (), -1, 2);\n fail ();\n }\n ca...
{ "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 <ELEMENTTYPE> CommonsArrayList <ELEMENTTYPE> getSubList (@Nullable final List <ELEMENTTYPE> aCont,\n @Nonnegative final int nStartIndex,\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_643
{ "fields": [], "file": "ph-commons/src/test/java/com/helger/commons/concurrent/ExecutorServiceHelperTest.java", "identifier": "ExecutorServiceHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testAll ()\n {\n final ExecutorService aExecSvc = Executors.newFixedThreadPool (3);\n aExecSvc.submit ( () -> {\n // empty\n });\n assertTrue (ExecutorServiceHelper.shutdownAndWaitUntilAllTasksAreFinished (aExecSvc).isNotInterrupted ());\n\n try\n {\n // nu...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger (ExecutorServiceHelper.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger (ExecutorServiceHelper.class);", "type": "Logger", "var_name": "LOGGER"...
{ "body": "@Nonnull\n public static EInterrupt shutdownAndWaitUntilAllTasksAreFinished (@Nonnull final ExecutorService aES)\n {\n return shutdownAndWaitUntilAllTasksAreFinished (aES, 1, TimeUnit.SECONDS);\n }", "class_method_signature": "ExecutorServiceHelper.shutdownAndWaitUntilAllTasksAreFinished(@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_213
{ "fields": [ { "declarator": "DOCTYPE_XHTML10_QNAME = \"-//W3C//DTD XHTML 1.0 Strict//EN\"", "modifier": "private static final", "original_string": "private static final String DOCTYPE_XHTML10_QNAME = \"-//W3C//DTD XHTML 1.0 Strict//EN\";", "type": "String", "var_name": "DOCTYPE_XHT...
{ "body": "@Test\n public void testNestedCDATAs ()\n {\n final Document doc = XMLFactory.newDocument ();\n\n // Containing the forbidden CDATA end marker\n Element e = doc.createElement (\"a\");\n e.appendChild (doc.createCDATASection (\"a]]>b\"));\n assertEquals (\"<a><![CDATA[a]]]]><![CDATA[>b]]></...
{ "fields": [ { "declarator": "DEFAULT_XML_VERSION = EXMLVersion.XML_10", "modifier": "public static final", "original_string": "public static final EXMLVersion DEFAULT_XML_VERSION = EXMLVersion.XML_10;", "type": "EXMLVersion", "var_name": "DEFAULT_XML_VERSION" }, { "de...
{ "body": "@Nullable\n public static String getNodeAsString (@Nonnull final Node aNode, @Nonnull final IXMLWriterSettings aSettings)\n {\n // start serializing\n try (final NonBlockingStringWriter aWriter = new NonBlockingStringWriter (50 * CGlobal.BYTES_PER_KILOBYTE))\n {\n if (writeToWriter (aNode, ...
{ "created": "8/18/2014 7:21:36 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 23062279, "size": null, "stargazer_count": null, "stars": 20, "updates": "2020-01-27T18:40:50+00:00", "url": "https://github.com/phax/ph-commons" ...
23062279_706
{ "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 testTrimStartRepeatedlyString ()\n {\n assertEquals (\"Hallo Welt\", StringHelper.trimStartRepeatedly (\"Hallo Welt\", \"\"));\n assertEquals (\"Hallo Welt\", StringHelper.trimStartRepeatedly (\"Hallo Welt\", \"asd\"));\n assertEquals (\"allo Welt\", StringHelper.trimStartRep...
{ "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 trimStartRepeatedly (@Nullable final String sSrc, @Nullable final String sLead)\n {\n if (hasNoText (sSrc))\n return sSrc;\n\n final int nLeadLength = getLength (sLead);\n if (nLeadLength == 0)\n return sSrc;\n\n String ret = sSr...
{ "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_356
{ "fields": [], "file": "ph-commons/src/test/java/com/helger/commons/io/file/FileHelperTest.java", "identifier": "FileHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testExistsFile ()\n {\n assertFalse (FileHelper.existsFile (new File (\"oaaajeee\")));\n assertTrue (FileHelper.existsFile (ClassPathResource.getAsFile (\"streamutils-lines\")));\n assertFalse (FileHelper.existsFile (new File (\"src\")));\n }", "class_method_signature": "F...
{ "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": "public static boolean existsFile (@Nullable final File aFile)\n {\n // returns true if it exists() AND is a file!\n return aFile != null && aFile.isFile ();\n }", "class_method_signature": "FileHelper.existsFile(@Nullable final File aFile)", "constructor": false, "full_signature": "public sta...
{ "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_321
{ "fields": [], "file": "ph-commons/src/test/java/com/helger/commons/io/stream/BitOutputStreamTest.java", "identifier": "BitOutputStreamTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testWriteBitBigEndian () throws IOException\n {\n try (final NonBlockingByteArrayOutputStream aBAOS = new NonBlockingByteArrayOutputStream ();\n final BitOutputStream aBOS = new BitOutputStream (aBAOS, ByteOrder.BIG_ENDIAN))\n {\n assertEquals (ByteOrder.BIG_ENDIAN,...
{ "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 writeBit (final int aBit) throws IOException\n {\n // Cannot used \"locked\" because there is not IThrowingIntSupplier interface\n m_aLock.lock ();\n try\n {\n super.writeBit (aBit);\n }\n finally\n {\n m_aLock.unlock ();\n }\n }", "class_metho...
{ "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_771
{ "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 testIsUnsignedLong ()\n {\n assertTrue (StringParser.isUnsignedLong (\"1\"));\n assertFalse (StringParser.isUnsignedLong (\"1.2\"));\n assertTrue (StringParser.isUnsignedLong (\"0\"));\n assertTrue (StringParser.isUnsignedLong (\"0000\"));\n assertFalse (StringParser.is...
{ "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 isUnsignedLong (@Nullable final String sStr)\n {\n if (sStr != null)\n try\n {\n final long ret = Long.parseLong (sStr, DEFAULT_RADIX);\n return ret >= 0;\n }\n catch (final NumberFormatException ex)\n {\n // fall through\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_92
{ "fields": [], "file": "ph-collection/src/test/java/com/helger/collection/safe/SafeArrayListTest.java", "identifier": "SafeArrayListTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSafeArrayListNullFactory ()\n {\n // create with a \"null\"-creating factory\n final SafeArrayList <String> sv = new SafeArrayList <> ();\n assertEquals (0, sv.size ());\n\n // no such index 0 -> create using the factory\n assertNull (sv.get (0));\n assertEquals ...
{ "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 ELEMENTTYPE get (@Nonnegative final int nIndex)\n {\n _ensureSize (nIndex);\n return super.get (nIndex);\n }", "class_method_signature": "SafeArrayList.get(@Nonnegative final int nIndex)", "constructor": false, "full_signature": "@Override public ELEMENTTYPE get(@Nonnegati...
{ "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_264
{ "fields": [], "file": "ph-commons/src/test/java/com/helger/commons/url/URLParameterEncoderTest.java", "identifier": "URLParameterEncoderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testEncode ()\n {\n final URLParameterEncoder aPE = new URLParameterEncoder (StandardCharsets.ISO_8859_1);\n assertEquals (\"a+b+c\", aPE.getEncoded (\"a b c\"));\n assertEquals (\"a+b+c%3Ad\", aPE.getEncoded (\"a b c:d\"));\n }", "class_method_signature": "URLParameterEnc...
{ "fields": [ { "declarator": "m_aCharset", "modifier": "private final", "original_string": "private final Charset m_aCharset;", "type": "Charset", "var_name": "m_aCharset" } ], "file": "ph-commons/src/main/java/com/helger/commons/url/URLParameterEncoder.java", "identifier"...
{ "body": "@Nullable\n public String getEncoded (@Nullable final String sInput)\n {\n return sInput == null ? null : URLHelper.urlEncode (sInput, m_aCharset);\n }", "class_method_signature": "URLParameterEncoder.getEncoded(@Nullable final String sInput)", "constructor": false, "full_signature": "@Nullable...
{ "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_634
{ "fields": [], "file": "ph-commons/src/test/java/com/helger/commons/id/factory/MemoryStaticIntIDFactoryTest.java", "identifier": "MemoryStaticIntIDFactoryTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testAll ()\n {\n final MemoryStaticIntIDFactory x = new MemoryStaticIntIDFactory ();\n assertTrue (x.getNewID () >= MemoryStaticIntIDFactory.INITIAL_ID);\n CommonsTestHelper.testDefaultImplementationWithEqualContentObject (x, new MemoryStaticIntIDFactory ());\n }", "class_...
{ "fields": [ { "declarator": "INITIAL_ID = 10000", "modifier": "public static final", "original_string": "public static final int INITIAL_ID = 10000;", "type": "int", "var_name": "INITIAL_ID" }, { "declarator": "s_aID = new AtomicInteger (INITIAL_ID)", "modifier"...
{ "body": "@Nonnegative\n public int getNewID ()\n {\n return getNewStaticID ();\n }", "class_method_signature": "MemoryStaticIntIDFactory.getNewID()", "constructor": false, "full_signature": "@Nonnegative public int 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_458
{ "fields": [], "file": "ph-commons/src/test/java/com/helger/commons/math/MathHelperTest.java", "identifier": "MathHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetMinInt ()\n {\n assertEquals (5, MathHelper.getMinInt (5));\n assertEquals (5, MathHelper.getMinInt (5, 5, 5, 5));\n assertEquals (1, MathHelper.getMinInt (5, 3, 2, 1));\n assertEquals (3, MathHelper.getMinInt (5, 3, 7, 4));\n }", "class_method_signature": "MathH...
{ "fields": [ { "declarator": "LONG_HIGH_BITS = 0xFFFFFFFF80000000L", "modifier": "private static final", "original_string": "private static final long LONG_HIGH_BITS = 0xFFFFFFFF80000000L;", "type": "long", "var_name": "LONG_HIGH_BITS" }, { "declarator": "s_aInstance =...
{ "body": "public static int getMinInt (final int nValue, @Nonnull final int... aValues)\n {\n int ret = nValue;\n for (final int n : aValues)\n ret = Math.min (ret, n);\n return ret;\n }", "class_method_signature": "MathHelper.getMinInt(final int nValue, @Nonnull final int... aValues)", "construc...
{ "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_726
{ "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 testReplaceMultipleCharArrayToChar ()\n {\n assertArrayEquals (\"abc\".toCharArray (), StringHelper.replaceMultiple (\"abc\", \"def\".toCharArray (), ' '));\n assertArrayEquals (\" \".toCharArray (), StringHelper.replaceMultiple (\"abc\", \"abc\".toCharArray (), ' '));\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": "@Nonnull\n public static char [] replaceMultiple (@Nullable final String sInputString,\n @Nonnull final char [] aSearchChars,\n @Nonnull final char [] [] aReplacementStrings)\n {\n // Any input text?\n if (hasNoText (sI...
{ "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_376
{ "fields": [], "file": "ph-commons/src/test/java/com/helger/commons/io/file/FilenameHelperTest.java", "identifier": "FilenameHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetIndexOfExtension ()\n {\n assertEquals (-1, FilenameHelper.getIndexOfExtension (null));\n assertEquals (2, FilenameHelper.getIndexOfExtension (\"ab.cde\"));\n assertEquals (0, FilenameHelper.getIndexOfExtension (\".abcde\"));\n assertEquals (-1, FilenameHelper.getIn...
{ "fields": [ { "declarator": "EXTENSION_SEPARATOR = '.'", "modifier": "public static final", "original_string": "public static final char EXTENSION_SEPARATOR = '.';", "type": "char", "var_name": "EXTENSION_SEPARATOR" }, { "declarator": "ILLEGAL_FILENAME_CHAR_REPLACEMEN...
{ "body": "public static int getIndexOfExtension (@Nullable final String sFilename)\n {\n if (sFilename == null)\n return CGlobal.ILLEGAL_UINT;\n\n final int nExtensionIndex = sFilename.lastIndexOf (EXTENSION_SEPARATOR);\n final int nLastSepIndex = getIndexOfLastSeparator (sFilename);\n return nLast...
{ "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_8
{ "fields": [], "file": "ph-jaxb/src/test/java/com/helger/jaxb/validation/CollectingValidationEventHandlerTest.java", "identifier": "CollectingValidationEventHandlerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testReadWrite () throws JAXBException\n {\n final JAXBContext aCtx = JAXBContextCache.getInstance ().getFromCache (MockJAXBArchive.class);\n final Unmarshaller um = aCtx.createUnmarshaller ();\n\n {\n final CollectingValidationEventHandler cveh = new CollectingValidation...
{ "fields": [ { "declarator": "m_aRWLock = new SimpleReadWriteLock ()", "modifier": "protected final", "original_string": "protected final SimpleReadWriteLock m_aRWLock = new SimpleReadWriteLock ();", "type": "SimpleReadWriteLock", "var_name": "m_aRWLock" }, { "declarat...
{ "body": "@Nonnull\n @ReturnsMutableCopy\n public IErrorList getErrorList ()\n {\n return m_aRWLock.readLockedGet (m_aErrors::getClone);\n }", "class_method_signature": "CollectingValidationEventHandler.getErrorList()", "constructor": false, "full_signature": "@Nonnull @ReturnsMutableCopy public IErrorL...
{ "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_663
{ "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 testHexStringLeadingZeroByte ()\n {\n assertEquals (\"00ff\", StringHelper.getHexStringLeadingZero ((byte) -1, 4));\n assertEquals (\"0000\", StringHelper.getHexStringLeadingZero ((byte) 0, 4));\n assertEquals (\"0009\", StringHelper.getHexStringLeadingZero ((byte) 9, 4));\n ...
{ "fields": [ { "declarator": "STRING_NOT_FOUND = -1", "modifier": "public static final", "original_string": "public static final int STRING_NOT_FOUND = -1;", "type": "int", "var_name": "STRING_NOT_FOUND" }, { "declarator": "s_aSizeTableInt = { 9, 99, 999, 9999, 99999, ...
{ "body": "@Nonnull\n public static String getHexStringLeadingZero (final byte nValue, final int nDigits)\n {\n return getLeadingZero (getHexString (nValue), nDigits);\n }", "class_method_signature": "StringHelper.getHexStringLeadingZero(final byte nValue, final int nDigits)", "constructor": false, "full_...
{ "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_399
{ "fields": [], "file": "ph-commons/src/test/java/com/helger/commons/io/file/FilenameHelperTest.java", "identifier": "FilenameHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetPathUsingUnixSeparator ()\n {\n assertNull (FilenameHelper.getPathUsingUnixSeparator ((String) null));\n assertEquals (\"a\", FilenameHelper.getPathUsingUnixSeparator (\"a\"));\n assertEquals (\"a/b\", FilenameHelper.getPathUsingUnixSeparator (\"a/b\"));\n assertEqu...
{ "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 public static String getPathUsingUnixSeparator (@Nullable final File aFile)\n {\n return aFile == null ? null : getPathUsingUnixSeparator (aFile.getPath ());\n }", "class_method_signature": "FilenameHelper.getPathUsingUnixSeparator(@Nullable final File aFile)", "constructor": false, ...
{ "created": "8/18/2014 7:21:36 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 23062279, "size": null, "stargazer_count": null, "stars": 20, "updates": "2020-01-27T18:40:50+00:00", "url": "https://github.com/phax/ph-commons" ...
23062279_233
{ "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 testMultithreadedDOM ()\n {\n CommonsTestHelper.testInParallel (100,\n (IThrowingRunnable <SAXException>) () -> assertNotNull (DOMReader.readXMLDOM (new ClassPathResource (\"xml/buildinfo.xml\"))));\n }", "class_method_signature": "DOMReaderT...
{ "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_819
{ "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_KeyValue ()\n {\n final SortedMap <String, Integer> aSortedMap = newSortedMap (\"Hallo\", I5);\n assertNotNull (aSortedMap);\n assertEquals (1, aSortedMap.size ());\n assertNotNull (aSortedMap.get (\"Hallo\"));\n assertEquals (I5, aSortedMap.get (\"Hall...
{ "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_360
{ "fields": [], "file": "ph-commons/src/test/java/com/helger/commons/io/file/FileHelperTest.java", "identifier": "FileHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@SuppressFBWarnings (\"TQ_NEVER_VALUE_USED_WHERE_ALWAYS_REQUIRED\")\n @Test\n public void testGetFileSizeDisplay ()\n {\n assertEquals (\"0B\", FileHelper.getFileSizeDisplay (0));\n assertEquals (\"1B\", FileHelper.getFileSizeDisplay (1));\n assertEquals (\"1023B\", FileHelper.getFileSizeDispla...
{ "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": "@Nonnull\n public static String getFileSizeDisplay (@Nullable final File aFile)\n {\n return getFileSizeDisplay (aFile, 0);\n }", "class_method_signature": "FileHelper.getFileSizeDisplay(@Nullable final File aFile)", "constructor": false, "full_signature": "@Nonnull public static String getFile...
{ "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_730
{ "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 testMultiContains ()\n {\n final char [] aIn = \"abcde\".toCharArray ();\n assertTrue (StringHelper.containsAny (aIn, \"a\".toCharArray ()));\n assertFalse (StringHelper.containsAny (aIn, \"z\".toCharArray ()));\n assertFalse (StringHelper.containsAny (aIn, new char [0]));...
{ "fields": [ { "declarator": "STRING_NOT_FOUND = -1", "modifier": "public static final", "original_string": "public static final int STRING_NOT_FOUND = -1;", "type": "int", "var_name": "STRING_NOT_FOUND" }, { "declarator": "s_aSizeTableInt = { 9, 99, 999, 9999, 99999, ...
{ "body": "public static boolean containsAny (@Nullable final CharSequence aCS, @Nullable final ICharPredicate aFilter)\n {\n final int nLen = getLength (aCS);\n if (aFilter == null)\n return nLen > 0;\n\n if (nLen > 0)\n for (int i = 0; i < nLen; ++i)\n if (aFilter.test (aCS.charAt (i)))\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_225
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger (XMLCharsetDeterminatorTest.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger (XMLCharsetDeterminatorTest.class);", "type": "Logger", "var_name"...
{ "body": "@Test\n public void testAllBOMCharsets ()\n {\n for (final EUnicodeBOM eBOM : EUnicodeBOM.values ())\n if (eBOM.hasCharset ())\n {\n final Charset c = eBOM.getCharset ();\n final ICommonsList <String> aNames = new CommonsArrayList <> (c.name ());\n aNames.addAll (c.alias...
{ "fields": [ { "declarator": "FALLBACK_CHARSET = StandardCharsets.UTF_8", "modifier": "public static final", "original_string": "public static final Charset FALLBACK_CHARSET = StandardCharsets.UTF_8;", "type": "Charset", "var_name": "FALLBACK_CHARSET" }, { "declarator"...
{ "body": "@Nullable\n public static Charset determineXMLCharset (@Nonnull final byte [] aBytes)\n {\n ValueEnforcer.notNull (aBytes, \"Bytes\");\n\n Charset aParseCharset = null;\n int nSearchOfs = 0;\n\n if (aBytes.length > 0)\n {\n // Check if a BOM is present\n // Read at maximum 4 byte...
{ "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_675
{ "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 testImplodeIterable ()\n {\n final ICommonsList <String> aList = new CommonsArrayList <> (\"a\", \"b\", \"c\");\n assertEquals (\"\", StringHelper.getImploded (\".\", (String []) null));\n assertEquals (\"\", StringHelper.getImploded (\".\", (List <String>) null));\n asser...
{ "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_419
{ "fields": [], "file": "ph-commons/src/test/java/com/helger/commons/hierarchy/ChildrenProviderHasChildrenSortingTest.java", "identifier": "ChildrenProviderHasChildrenSortingTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testAll ()\n {\n final ChildrenProviderHasChildrenSorting <MockHasChildren> cr = new ChildrenProviderHasChildrenSorting <> (IHasID.getComparatorID ());\n assertFalse (cr.hasChildren (null));\n assertEquals (0, cr.getChildCount (null));\n assertNull (cr.getAllChildren (null...
{ "fields": [ { "declarator": "m_aComparator", "modifier": "private final", "original_string": "private final Comparator <? super CHILDTYPE> m_aComparator;", "type": "Comparator <? super CHILDTYPE>", "var_name": "m_aComparator" } ], "file": "ph-commons/src/main/java/com/helge...
{ "body": "@Override\n @Nullable\n public ICommonsList <? extends CHILDTYPE> getAllChildren (@Nullable final CHILDTYPE aCurrent)\n {\n // Get all children of the passed element\n final ICommonsCollection <? extends CHILDTYPE> ret = aCurrent == null ? null : aCurrent.getAllChildren ();\n\n // If there is a...
{ "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_767
{ "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 testParseBigDecimal ()\n {\n final BigDecimal aDefault = new BigDecimal (\"1234627864327.98234676875657234709\");\n\n // String\n assertEquals (BigDecimal.ONE, StringParser.parseBigDecimal (\"1\"));\n assertNull (StringParser.parseBigDecimal (\"abc\"));\n assertEquals (...
{ "fields": [ { "declarator": "DEFAULT_RADIX = 10", "modifier": "public static final", "original_string": "public static final int DEFAULT_RADIX = 10;", "type": "int", "var_name": "DEFAULT_RADIX" }, { "declarator": "s_aInstance = new StringParser ()", "modifier": ...
{ "body": "@Nullable\n public static BigDecimal parseBigDecimal (@Nullable final String sStr)\n {\n return parseBigDecimal (sStr, null);\n }", "class_method_signature": "StringParser.parseBigDecimal(@Nullable final String sStr)", "constructor": false, "full_signature": "@Nullable public static BigDecimal ...
{ "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_337
{ "fields": [], "file": "ph-commons/src/test/java/com/helger/commons/io/stream/StreamHelperTest.java", "identifier": "StreamHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testCreateWriter ()\n {\n assertNull (StreamHelper.createWriter (null, StandardCharsets.ISO_8859_1));\n final NonBlockingByteArrayOutputStream os = new NonBlockingByteArrayOutputStream ();\n assertNotNull (StreamHelper.createWriter (os, StandardCharsets.ISO_8859_1));\n\n t...
{ "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 OutputStreamWriter createWriter (@Nullable final OutputStream aOS, @Nonnull final Charset aCharset)\n {\n ValueEnforcer.notNull (aCharset, \"Charset\");\n return aOS == null ? null : new OutputStreamWriter (aOS, aCharset);\n }", "class_method_signature": "StreamHelper.c...
{ "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_622
{ "fields": [ { "declarator": "CONVERTIBLE_CLASSES = new Class <?> [] { Boolean.class,\n Byte.class,\n Character.class,\n ...
{ "body": "@Test\n public void testNoConverterButAssignable ()\n {\n // No type converter present, but objects are assignable\n final MockImplementation aImpl = new MockImplementation ();\n assertSame (aImpl, TypeConverter.convert (aImpl, IMockInterface.class));\n\n final MockSubImplementation aSubImpl ...
{ "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_272
{ "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 testDecode ()\n {\n final GZIPCodec aCodec = new GZIPCodec ();\n for (final String s : new String [] { \"abc\", \"\", \"test blank\", \"hällö special chars\" })\n {\n final byte [] aDecoded = s.getBytes (CHARSET);\n final byte [] aEncoded = aCodec.getEncoded (aDecod...
{ "fields": [], "file": "ph-commons/src/main/java/com/helger/commons/codec/GZIPCodec.java", "identifier": "GZIPCodec", "interfaces": "implements IByteArrayCodec", "methods": [ { "class_method_signature": "GZIPCodec.GZIPCodec()", "constructor": true, "full_signature": "public GZIPCodec()...
{ "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 || nLen == 0)\n return;\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_84
{ "fields": [], "file": "ph-json/src/test/java/com/helger/json/serialize/JsonWriterTest.java", "identifier": "JsonWriterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testWriteNewlineAtEnd ()\n {\n final String sCRLF = JsonWriterSettings.DEFAULT_NEWLINE_STRING;\n assertEquals (\"{\\\"foo\\\":\\\"bar\\\"}\", new JsonWriter ().writeAsString (new JsonObject ().add (\"foo\", \"bar\")));\n assertEquals (\"{\\\"foo\\\":\\\"bar\\\"}\",\n ...
{ "fields": [ { "declarator": "m_aSettings", "modifier": "private final", "original_string": "private final IJsonWriterSettings m_aSettings;", "type": "IJsonWriterSettings", "var_name": "m_aSettings" } ], "file": "ph-json/src/main/java/com/helger/json/serialize/JsonWriter.jav...
{ "body": "@Nonnull\n public String writeAsString (@Nonnull final IJson aJson)\n {\n ValueEnforcer.notNull (aJson, \"Json\");\n\n try (final NonBlockingStringWriter aWriter = new NonBlockingStringWriter (1024))\n {\n writeToWriter (aJson, aWriter);\n return aWriter.getAsString ();\n }\n cat...
{ "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_788
{ "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 testNewArrayFromArray ()\n {\n String [] x = newArray (\"s1\", \"s2\", \"s3\");\n assertNotNull (x);\n assertEquals (3, x.length);\n\n x = newArray (new String [0]);\n assertNotNull (x);\n assertEquals (0, x.length);\n }", "class_method_signature": "ArrayHelperTes...
{ "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_858
{ "fields": [], "file": "ph-commons/src/test/java/com/helger/commons/version/VersionRangeTest.java", "identifier": "VersionRangeTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testCtor2 ()\n {\n new VersionRange (Version.parse (\"1.0\"), Version.parse (\"2.0\"));\n try\n {\n // null floor not allowed\n new VersionRange (null, Version.parse (\"2.0\"));\n fail ();\n }\n catch (final NullPointerException ex)\n {}\n\n try\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": "@Nonnull\n public static VersionRange parse (@Nullable final String sVersionString)\n {\n final String s = sVersionString == null ? \"\" : sVersionString.trim ();\n if (s.length () == 0)\n {\n // empty string == range [0.0, infinity)\n return new VersionRange (Version.DEFAULT_VERSION, ...
{ "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_659
{ "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 testHexEncode ()\n {\n try\n {\n // null not allowed\n StringHelper.getHexEncoded (null);\n fail ();\n }\n catch (final NullPointerException ex)\n {}\n try\n {\n // null not allowed\n StringHelper.getHexEncoded (null, 0, 5);\n fail ()...
{ "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 getHexEncoded (@Nonnull final String sInput, @Nonnull final Charset aCharset)\n {\n ValueEnforcer.notNull (sInput, \"Input\");\n ValueEnforcer.notNull (aCharset, \"Charset\");\n\n return getHexEncoded (sInput.getBytes (aCharset));\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_209
{ "fields": [], "file": "ph-xml/src/test/java/com/helger/xml/serialize/write/XMLEmitterTest.java", "identifier": "XMLEmitterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testMisc ()\n {\n assertEquals (\"<!DOCTYPE qname PUBLIC \\\"pubid\\\" \\\"sysid\\\">\",\n XMLEmitter.getDocTypeHTMLRepresentation (EXMLSerializeVersion.XML_10,\n EXMLIncorrectCharacterHandling.DEFAULT,\n ...
{ "fields": [ { "declarator": "DEFAULT_THROW_EXCEPTION_ON_NESTED_COMMENTS = true", "modifier": "public static final", "original_string": "public static final boolean DEFAULT_THROW_EXCEPTION_ON_NESTED_COMMENTS = true;", "type": "boolean", "var_name": "DEFAULT_THROW_EXCEPTION_ON_NESTED...
{ "body": "@Nonnull\n public static String getDocTypeHTMLRepresentation (@Nonnull final EXMLSerializeVersion eXMLVersion,\n @Nonnull final EXMLIncorrectCharacterHandling eIncorrectCharHandling,\n @Nonnull final IM...
{ "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_10
{ "fields": [], "file": "ph-jaxb/src/test/java/com/helger/jaxb/JAXBHelperTest.java", "identifier": "JAXBHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testCloneWithScope ()\n {\n final JAXBElement <String> aJE = new JAXBElement <> (new QName (\"urn:example.org\", \"test2\"), String.class, JAXBHelperTest.class, \"any\");\n final JAXBElement <String> aClone = JAXBHelper.getClonedJAXBElement (aJE);\n assertNotNull (aClone);\n ...
{ "fields": [], "file": "ph-jaxb/src/main/java/com/helger/jaxb/JAXBHelper.java", "identifier": "JAXBHelper", "interfaces": "", "methods": [ { "class_method_signature": "JAXBHelper.JAXBHelper()", "constructor": true, "full_signature": "private JAXBHelper()", "identifier": "JAXBHelp...
{ "body": "@Nullable\n public static <DATATYPE> JAXBElement <DATATYPE> getClonedJAXBElement (@Nullable final JAXBElement <DATATYPE> aObj)\n {\n if (aObj == null)\n return null;\n\n final DATATYPE aClonedValue = CloneHelper.getClonedValue (aObj.getValue ());\n final JAXBElement <DATATYPE> ret = new JAX...
{ "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_435
{ "fields": [], "file": "ph-commons/src/test/java/com/helger/commons/base64/Base64Test.java", "identifier": "Base64Test", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testEncodeFileToFile () throws IOException\n {\n final File f1 = new File (\"base64.decoded\");\n final File f2 = new File (\"base64.encoded\");\n try\n {\n assertFalse (FileHelper.existsFile (f2));\n SimpleFileIO.writeFile (f1, \"Hallo Wält\", StandardCharsets.U...
{ "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 encodeFileToFile (@Nonnull final String infile, @Nonnull final File aFile) throws IOException\n {\n final String encoded = encodeFromFile (infile);\n try (final OutputStream out = FileHelper.getBufferedOutputStream (aFile))\n {\n // Strict, 7-bit output.\n out.write (...
{ "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_823
{ "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 testNewSet_Empty ()\n {\n final Set <String> aSet = newSet ();\n assertNotNull (aSet);\n assertEquals (0, aSet.size ());\n }", "class_method_signature": "CollectionHelperTest.testNewSet_Empty()", "constructor": false, "full_signature": "@Test public void testNewSet_Emp...
{ "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 <ELEMENTTYPE> CommonsHashSet <ELEMENTTYPE> newSet (@Nonnegative final int nInitialCapacity)\n {\n return new CommonsHashSet <> (nInitialCapacity);\n }", "class_method_signature": "CollectionHelper.newSet(@Nonnegative final int nInitialCapacity)", "c...
{ "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_120
{ "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": "@Test\n public void testStdMethods ()\n {\n final Settings s = new Settings (\"s1\");\n assertTrue (s.putIn (FIELD1, \"My value\").isChanged ());\n\n {\n final Settings t = new Settings (\"s1\");\n assertTrue (t.putIn (FIELD1, \"My value\").isChanged ());\n CommonsTestHelper.testD...
{ "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_570
{ "fields": [], "file": "ph-commons/src/test/java/com/helger/commons/csv/CSVReaderTest.java", "identifier": "CSVReaderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testEscapedEscape () throws IOException\n {\n\n final StringBuilder aSB = new StringBuilder ();\n\n // a,123\"4\",aReader\n aSB.append (\"a,\\\"123\\\\\\\\4567\\\",aReader\").append ('\\n');\n\n try (final CSVReader aReader = new CSVReader (new NonBlockingStringReader (aSB...
{ "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_47
{ "fields": [], "file": "ph-tree/src/test/java/com/helger/tree/util/TreeWithIDBuilderTest.java", "identifier": "TreeWithIDBuilderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testBuildFromChildren ()\n {\n final DefaultTreeWithID <String, MockHasChildren> aTree = TreeWithIDBuilder.buildTree (new MockChildrenProvider (new MockHasChildren (\"\",\n ...
{ "fields": [ { "declarator": "s_aInstance = new TreeWithIDBuilder ()", "modifier": "@PresentForCodeCoverage\n private static final", "original_string": "@PresentForCodeCoverage\n private static final TreeWithIDBuilder s_aInstance = new TreeWithIDBuilder ();", "type": "TreeWithIDBuilder"...
{ "body": "@Nonnull\n public static <KEYTYPE, DATATYPE extends IHasID <KEYTYPE>> DefaultTreeWithID <KEYTYPE, DATATYPE> buildTree (@Nonnull final Collection <? extends DATATYPE> aAll,\n @Nonnull final IParentP...
{ "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_462
{ "fields": [], "file": "ph-commons/src/test/java/com/helger/commons/math/MathHelperTest.java", "identifier": "MathHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testAbsInt ()\n {\n assertEquals (0, MathHelper.abs (0));\n assertEquals (5, MathHelper.abs (-5));\n assertEquals (5, MathHelper.abs (5));\n assertEquals (Integer.MAX_VALUE, MathHelper.abs (Integer.MIN_VALUE + 1));\n\n try\n {\n MathHelper.abs (Integer.MIN_VALUE...
{ "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": "@Nonnegative\n public static int abs (final int nValue)\n {\n // As Integer.MIN_VALUE is -2^31 and Integer.MAX_VALUE is 2^31-1 it means\n // that there is not integer value matching 2^31!!!\n if (nValue == Integer.MIN_VALUE)\n throw new IllegalArgumentException (\"There is not absolute valu...
{ "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_198
{ "fields": [ { "declarator": "TEST_XML = \"<?xml version=\\\"1.0\\\"?>\" +\n \"<!DOCTYPE verrryoot>\" +\n \"<verrryoot xmlns=\\\"sthgelse\\\">\" +\n \"<!-- arg - a comment -->\" +\n ...
{ "body": "@Test\n @Ignore (\"Takes too long and was already tested with JDK 1.8 runtime parser\")\n public void testSpecialCharactersXML10CDATA ()\n {\n final EXMLSerializeVersion eXMLSerializeVersion = EXMLSerializeVersion.XML_10;\n\n final XMLWriterSettings aSettings = new XMLWriterSettings ().setSerializ...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger (MicroWriter.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger (MicroWriter.class);", "type": "Logger", "var_name": "LOGGER" }, { ...
{ "body": "@Nullable\n public static String getNodeAsString (@Nonnull final IMicroNode aNode, @Nonnull final IXMLWriterSettings aSettings)\n {\n ValueEnforcer.notNull (aNode, \"Node\");\n ValueEnforcer.notNull (aSettings, \"Settings\");\n\n try (final NonBlockingStringWriter aWriter = new NonBlockingString...
{ "created": "8/18/2014 7:21:36 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 23062279, "size": null, "stargazer_count": null, "stars": 20, "updates": "2020-01-27T18:40:50+00:00", "url": "https://github.com/phax/ph-commons" ...