[jira] Created: (LANG-396) Investigate for vararg usages

classic Classic list List threaded Threaded
18 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (LANG-396) Investigate for vararg usages

ASF GitHub Bot (Jira)
Investigate for vararg usages
-----------------------------

                 Key: LANG-396
                 URL: https://issues.apache.org/jira/browse/LANG-396
             Project: Commons Lang
          Issue Type: Task
            Reporter: Henri Yandell
             Fix For: LangTwo 1.0




--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (LANG-396) Investigate for vararg usages

ASF GitHub Bot (Jira)

     [ https://issues.apache.org/jira/browse/LANG-396?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell updated LANG-396:
-------------------------------

    Description: Which methods are good candidates for varargs.

> Investigate for vararg usages
> -----------------------------
>
>                 Key: LANG-396
>                 URL: https://issues.apache.org/jira/browse/LANG-396
>             Project: Commons Lang
>          Issue Type: Task
>            Reporter: Henri Yandell
>             Fix For: LangTwo 1.0
>
>
> Which methods are good candidates for varargs.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (LANG-396) Investigate for vararg usages

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

     [ https://issues.apache.org/jira/browse/LANG-396?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Richard Wheeldon updated LANG-396:
----------------------------------

    Attachment: VarargsCandidates.java

Short java file showing method signatures for candidates for varargs.


> Investigate for vararg usages
> -----------------------------
>
>                 Key: LANG-396
>                 URL: https://issues.apache.org/jira/browse/LANG-396
>             Project: Commons Lang
>          Issue Type: Task
>            Reporter: Henri Yandell
>             Fix For: LangTwo 1.0
>
>         Attachments: VarargsCandidates.java
>
>
> Which methods are good candidates for varargs.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LANG-396) Investigate for vararg usages

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/LANG-396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12682143#action_12682143 ]

James Carman commented on LANG-396:
-----------------------------------

I can tackle these if nobody else has already started.

> Investigate for vararg usages
> -----------------------------
>
>                 Key: LANG-396
>                 URL: https://issues.apache.org/jira/browse/LANG-396
>             Project: Commons Lang
>          Issue Type: Task
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>         Attachments: VarargsCandidates.java
>
>
> Which methods are good candidates for varargs.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LANG-396) Investigate for vararg usages

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/LANG-396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12682144#action_12682144 ]

James Carman commented on LANG-396:
-----------------------------------

Since we're not terribly concerned with backward compatibility, can we rearrange parameters so that varargs works?  Are we planning on renaming the packages?

> Investigate for vararg usages
> -----------------------------
>
>                 Key: LANG-396
>                 URL: https://issues.apache.org/jira/browse/LANG-396
>             Project: Commons Lang
>          Issue Type: Task
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>         Attachments: VarargsCandidates.java
>
>
> Which methods are good candidates for varargs.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LANG-396) Investigate for vararg usages

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/LANG-396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12682163#action_12682163 ]

Henri Yandell commented on LANG-396:
------------------------------------

Feel free to rearrange. Document the rearranging here.

We'll do a clirr/jardiff comparison and decide on renaming later. If there's not enough of a delta we can unrearrange, or we can change packages.

> Investigate for vararg usages
> -----------------------------
>
>                 Key: LANG-396
>                 URL: https://issues.apache.org/jira/browse/LANG-396
>             Project: Commons Lang
>          Issue Type: Task
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>         Attachments: VarargsCandidates.java
>
>
> Which methods are good candidates for varargs.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LANG-396) Investigate for vararg usages

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/LANG-396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12704503#action_12704503 ]

Henri Yandell commented on LANG-396:
------------------------------------

NumberUtils.min, NumberUtils.max varargs runs into the no overloading recommendation:

src/test/org/apache/commons/lang/math/NumberUtilsTest.java:[1175,42] reference to max is ambiguous, both method max(double...) in org.apache.commons.lang.math.NumberUtils and method max(float...) in org.apache.commons.lang.math.NumberUtils match


> Investigate for vararg usages
> -----------------------------
>
>                 Key: LANG-396
>                 URL: https://issues.apache.org/jira/browse/LANG-396
>             Project: Commons Lang
>          Issue Type: Task
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>         Attachments: VarargsCandidates.java
>
>
> Which methods are good candidates for varargs.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LANG-396) Investigate for vararg usages

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/LANG-396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12790033#action_12790033 ]

Henri Yandell commented on LANG-396:
------------------------------------

The invokeMethod's on MethodUtils should be moved to varargs to match the underlying API in 1.5.

> Investigate for vararg usages
> -----------------------------
>
>                 Key: LANG-396
>                 URL: https://issues.apache.org/jira/browse/LANG-396
>             Project: Commons Lang
>          Issue Type: Task
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>         Attachments: VarargsCandidates.java
>
>
> Which methods are good candidates for varargs.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LANG-396) Investigate for vararg usages

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/LANG-396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12791828#action_12791828 ]

Henri Yandell commented on LANG-396:
------------------------------------

DateUtils.parseDate should take a vararg String... of patterns.

> Investigate for vararg usages
> -----------------------------
>
>                 Key: LANG-396
>                 URL: https://issues.apache.org/jira/browse/LANG-396
>             Project: Commons Lang
>          Issue Type: Task
>          Components: General
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>         Attachments: VarargsCandidates.java
>
>
> Which methods are good candidates for varargs.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LANG-396) Investigate for vararg usages

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/LANG-396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848032#action_12848032 ]

Henri Yandell commented on LANG-396:
------------------------------------

MethodUtils methods vararg'd.

> Investigate for vararg usages
> -----------------------------
>
>                 Key: LANG-396
>                 URL: https://issues.apache.org/jira/browse/LANG-396
>             Project: Commons Lang
>          Issue Type: Task
>          Components: General
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>         Attachments: VarargsCandidates.java
>
>
> Which methods are good candidates for varargs.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LANG-396) Investigate for vararg usages

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/LANG-396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848033#action_12848033 ]

Henri Yandell commented on LANG-396:
------------------------------------

DateUtils.parseDate also vararg'd.


> Investigate for vararg usages
> -----------------------------
>
>                 Key: LANG-396
>                 URL: https://issues.apache.org/jira/browse/LANG-396
>             Project: Commons Lang
>          Issue Type: Task
>          Components: General
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>         Attachments: VarargsCandidates.java
>
>
> Which methods are good candidates for varargs.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LANG-396) Investigate for vararg usages

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/LANG-396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848036#action_12848036 ]

Henri Yandell commented on LANG-396:
------------------------------------

svn ci -m "Vararging more methods.  StringUtils.getCommonPrefix, StringUtils.indexOfDifference, WordUtils.initials, WordUtils.uncapitalize, WordUtils.capitalizeFully, WordUtils.capitalize, BooleanUtils.xor. LANG-396" src/
Sending        src/main/java/org/apache/commons/lang3/BooleanUtils.java
Sending        src/main/java/org/apache/commons/lang3/StringUtils.java
Sending        src/main/java/org/apache/commons/lang3/text/WordUtils.java
Transmitting file data ...
Committed revision 925967.


> Investigate for vararg usages
> -----------------------------
>
>                 Key: LANG-396
>                 URL: https://issues.apache.org/jira/browse/LANG-396
>             Project: Commons Lang
>          Issue Type: Task
>          Components: General
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>         Attachments: VarargsCandidates.java
>
>
> Which methods are good candidates for varargs.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LANG-396) Investigate for vararg usages

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/LANG-396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848039#action_12848039 ]

Henri Yandell commented on LANG-396:
------------------------------------

 svn ci -m "Vararging constructor methods; much like the method ones were in MethodUtils. LANG-396" src/
Sending        src/main/java/org/apache/commons/lang3/reflect/ConstructorUtils.java
Transmitting file data .
Committed revision 925970.


> Investigate for vararg usages
> -----------------------------
>
>                 Key: LANG-396
>                 URL: https://issues.apache.org/jira/browse/LANG-396
>             Project: Commons Lang
>          Issue Type: Task
>          Components: General
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>         Attachments: VarargsCandidates.java
>
>
> Which methods are good candidates for varargs.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LANG-396) Investigate for vararg usages

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/LANG-396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848041#action_12848041 ]

Henri Yandell commented on LANG-396:
------------------------------------

Possible solution to the NumberUtils problem would be to split them off as FloatUtils, DoubleUtils etc.

> Investigate for vararg usages
> -----------------------------
>
>                 Key: LANG-396
>                 URL: https://issues.apache.org/jira/browse/LANG-396
>             Project: Commons Lang
>          Issue Type: Task
>          Components: General
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>         Attachments: VarargsCandidates.java
>
>
> Which methods are good candidates for varargs.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LANG-396) Investigate for vararg usages

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/LANG-396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848498#action_12848498 ]

Henri Yandell commented on LANG-396:
------------------------------------

Note that some of the methods in Richard's patch were new methods rather than modifications.

> Investigate for vararg usages
> -----------------------------
>
>                 Key: LANG-396
>                 URL: https://issues.apache.org/jira/browse/LANG-396
>             Project: Commons Lang
>          Issue Type: Task
>          Components: General
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>         Attachments: VarargsCandidates.java
>
>
> Which methods are good candidates for varargs.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LANG-396) Investigate for vararg usages

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/LANG-396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848504#action_12848504 ]

Henri Yandell commented on LANG-396:
------------------------------------

Remaining possibilities seem to just be in StringUtils now:

---

While it might make sense for the first, it would be confusing for the second.  Skip.

    public static String[] stripAll(String[] strs);
    public static String[] stripAll(String[] strs, String stripChars);

---

Generally all the same type, the char[]/String[] could be vararged, but isn't a great fit.

    public static int indexOfAny(CharSequence cs, char[] searchChars);
    public static boolean containsAny(String cs, char[] searchChars);
    public static int indexOfAnyBut(CharSequence cs, char[] searchChars);
    public static boolean containsOnly(CharSequence cs, char[] valid);
    public static boolean containsNone(CharSequence cs, char[] searchChars);
    public static int indexOfAny(String str, String[] searchStrs);
    public static int lastIndexOfAny(String str, String[] searchStrs);
    public static boolean startsWithAny(String string, String[] searchStrings);


---

The join method itself would be great to have vararg'd, but the other options will get in its way. Reversing the parameters won't help with the desire for a join(Object... elements) API.

    public static String join(Object[] array);
    public static String join(Object[] array, char separator);
    public static String join(Object[] array, char separator, int startIndex, int endIndex);
    public static String join(Object[] array, String separator);
    public static String join(Object[] array, String separator, int startIndex, int endIndex);

A new method should solve that. We removed the deprecated concatenate method; with String.concat now existing I think we can bring in a StringUtils.concat(Object... elements) method. Also tempting to add a StringUtils.concatWith(String separator, Object... elements) method.

> Investigate for vararg usages
> -----------------------------
>
>                 Key: LANG-396
>                 URL: https://issues.apache.org/jira/browse/LANG-396
>             Project: Commons Lang
>          Issue Type: Task
>          Components: General
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>         Attachments: VarargsCandidates.java
>
>
> Which methods are good candidates for varargs.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LANG-396) Investigate for vararg usages

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/LANG-396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848509#action_12848509 ]

Henri Yandell commented on LANG-396:
------------------------------------

svn ci -m "Adding concat(Object...) and concatWith(String, Object...) methods to provide vararg'd versions of the more prominent join methods. This ties into the String.concat method. LANG-396" src/
Sending        src/main/java/org/apache/commons/lang3/StringUtils.java
Sending        src/test/java/org/apache/commons/lang3/StringUtilsTest.java
Transmitting file data ..
Committed revision 926448.


> Investigate for vararg usages
> -----------------------------
>
>                 Key: LANG-396
>                 URL: https://issues.apache.org/jira/browse/LANG-396
>             Project: Commons Lang
>          Issue Type: Task
>          Components: General
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>         Attachments: VarargsCandidates.java
>
>
> Which methods are good candidates for varargs.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Closed: (LANG-396) Investigate for vararg usages

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

     [ https://issues.apache.org/jira/browse/LANG-396?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell closed LANG-396.
------------------------------

    Resolution: Fixed

Resolving the issue.

LANG-611 has been created to look at the various improvements in the patch.

> Investigate for vararg usages
> -----------------------------
>
>                 Key: LANG-396
>                 URL: https://issues.apache.org/jira/browse/LANG-396
>             Project: Commons Lang
>          Issue Type: Task
>          Components: General
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>         Attachments: VarargsCandidates.java
>
>
> Which methods are good candidates for varargs.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.