[GitHub] commons-text issue #57: TEXT-98: Remove isDelimiter and use HashSets for del...
Github user ameyjadiye commented on the issue: https://github.com/apache/commons-text/pull/57 @arunvinudss , just addition to @PascalSchumacher comment , at this point we don't know other than Commons text who else having dependancy on `isDelimiter` so better we can make it depricated and we can remove code all together in 2.x --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org
[GitHub] commons-text pull request #56: add-some-Unit Tests
Github user asfgit closed the pull request at: https://github.com/apache/commons-text/pull/56 --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org
[GitHub] commons-text issue #56: add-some-Unit Tests
Github user PascalSchumacher commented on the issue: https://github.com/apache/commons-text/pull/56 Thanks! :+1: --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org
[GitHub] commons-text issue #57: TEXT-98: Remove isDelimiter and use HashSets for del...
Github user PascalSchumacher commented on the issue: https://github.com/apache/commons-text/pull/57 @arunvinudss While I agree that `isDelimiter` should have been private, it is public and was released with commons-text `1.1`. Due to the strict binary compatibilities promise of commons it can not be removed before `2.0`. For now the best we can do is mark it as deprecated and explain that it will be removed in version `2.0`. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org
[GitHub] commons-text issue #57: TEXT-98: Remove isDelimiter and use HashSets for del...
Github user arunvinudss commented on the issue: https://github.com/apache/commons-text/pull/57 @ameyjadiye I want to remove the isDelimiter method. I would be surprised if someone uses isDelimiter separately because all it does is to check if a given element is present in an array or not. Moreover the isDelimiter char version is already dead code as we don't use it anymore. I would say the scope of the isDelimiter should have been private. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org
[GitHub] commons-text issue #56: add-some-Unit Tests
Github user TheRealHaui commented on the issue: https://github.com/apache/commons-text/pull/56 Obviously a problem occurred with Travis: > The command "eval mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V " failed. Retrying, 2 of 3. > Error: JAVA_HOME is not defined correctly. > We cannot execute /usr/lib/jvm/java-7-oracle/bin/java --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org
[GitHub] commons-text issue #56: add-some-Unit Tests
Github user coveralls commented on the issue: https://github.com/apache/commons-text/pull/56 [![Coverage Status](https://coveralls.io/builds/12526449/badge)](https://coveralls.io/builds/12526449) Coverage increased (+0.9%) to 98.163% when pulling **12129b2beafc74f8f04957cc52b464a3eacdd3a9 on TheRealHaui:add-some-Unit-Tests** into **aaf4aba369ed0b97d17bc9343f763b0d099dbc2f on apache:master**. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org
[GitHub] commons-text issue #56: add-some-Unit Tests
Github user coveralls commented on the issue: https://github.com/apache/commons-text/pull/56 [![Coverage Status](https://coveralls.io/builds/12526449/badge)](https://coveralls.io/builds/12526449) Coverage increased (+0.9%) to 98.163% when pulling **12129b2beafc74f8f04957cc52b464a3eacdd3a9 on TheRealHaui:add-some-Unit-Tests** into **aaf4aba369ed0b97d17bc9343f763b0d099dbc2f on apache:master**. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org
[GitHub] commons-text pull request #56: add-some-Unit Tests
Github user TheRealHaui commented on a diff in the pull request: https://github.com/apache/commons-text/pull/56#discussion_r129109286 --- Diff: src/test/java/org/apache/commons/text/ExtendedMessageFormatTest.java --- @@ -416,6 +416,81 @@ public void testSetFormatsByArgumentIndex() { emf.setFormatsByArgumentIndex(new Format[]{new LowerCaseFormat(), new UpperCaseFormat()}); } +@Test +public void testFailsToCreateExtendedMessageFormatTakingThreeArgumentsThrowsIllegalArgumentExceptionOne() { +Map map = new HashMap(); +ExtendedMessageFormat extendedMessageFormat = null; --- End diff -- Corrected. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org
[GitHub] commons-text pull request #56: add-some-Unit Tests
Github user TheRealHaui commented on a diff in the pull request: https://github.com/apache/commons-text/pull/56#discussion_r129108740 --- Diff: src/test/java/org/apache/commons/text/ExtendedMessageFormatTest.java --- @@ -416,6 +416,81 @@ public void testSetFormatsByArgumentIndex() { emf.setFormatsByArgumentIndex(new Format[]{new LowerCaseFormat(), new UpperCaseFormat()}); } +@Test +public void testFailsToCreateExtendedMessageFormatTakingThreeArgumentsThrowsIllegalArgumentExceptionOne() { +Map map = new HashMap(); --- End diff -- Corrected. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org
[GitHub] commons-text pull request #56: add-some-Unit Tests
Github user TheRealHaui commented on a diff in the pull request: https://github.com/apache/commons-text/pull/56#discussion_r129106989 --- Diff: src/test/java/org/apache/commons/text/ExtendedMessageFormatTest.java --- @@ -416,6 +416,81 @@ public void testSetFormatsByArgumentIndex() { emf.setFormatsByArgumentIndex(new Format[]{new LowerCaseFormat(), new UpperCaseFormat()}); } +@Test +public void testFailsToCreateExtendedMessageFormatTakingThreeArgumentsThrowsIllegalArgumentExceptionOne() { --- End diff -- Corrected. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org
[GitHub] commons-text pull request #57: TEXT-98: Remove isDelimiter and use HashSets ...
Github user ameyjadiye commented on a diff in the pull request: https://github.com/apache/commons-text/pull/57#discussion_r129102634 --- Diff: src/main/java/org/apache/commons/text/WordUtils.java --- @@ -747,45 +750,29 @@ public static boolean containsAllWords(final CharSequence word, final CharSequen return true; } - //--- +// --- /** - * Is the character a delimiter. + * + * Converts an array of delimiters to a hash set of code points. Code point of space(32) is added as the default + * value if delimiters is null. The generated hash set provides O(1) lookup time. + * * - * @param ch the character to check - * @param delimiters the delimiters - * @return true if it is a delimiter + * @param delimiters set of characters to determine capitalization, null means whitespace + * @return Set */ -public static boolean isDelimiter(final char ch, final char[] delimiters) { --- End diff -- Rather removing we should keep this method. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org
[GitHub] commons-text pull request #57: TEXT-98: Remove isDelimiter and use HashSets ...
Github user ameyjadiye commented on a diff in the pull request: https://github.com/apache/commons-text/pull/57#discussion_r129102692 --- Diff: src/main/java/org/apache/commons/text/WordUtils.java --- @@ -747,45 +750,29 @@ public static boolean containsAllWords(final CharSequence word, final CharSequen return true; } - //--- +// --- /** - * Is the character a delimiter. + * + * Converts an array of delimiters to a hash set of code points. Code point of space(32) is added as the default + * value if delimiters is null. The generated hash set provides O(1) lookup time. + * * - * @param ch the character to check - * @param delimiters the delimiters - * @return true if it is a delimiter + * @param delimiters set of characters to determine capitalization, null means whitespace + * @return Set */ -public static boolean isDelimiter(final char ch, final char[] delimiters) { -if (delimiters == null) { -return Character.isWhitespace(ch); -} -for (final char delimiter : delimiters) { -if (ch == delimiter) { -return true; +private static Set generateDelimiterSet(final char[] delimiters) { +Set delimiterHashSet = new HashSet<>(); +if (delimiters == null || delimiters.length == 0) { +if (delimiters == null) { +delimiterHashSet.add(Character.codePointAt(new char[] {' '}, 0)); } +return delimiterHashSet; } -return false; -} - //--- -/** - * Is the codePoint a delimiter. - * - * @param codePoint the codePint to check - * @param delimiters the delimiters - * @return true if it is a delimiter - */ -public static boolean isDelimiter(final int codePoint, final char[] delimiters) { --- End diff -- Rather removing we should keep this method. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org