[jira] Created: (CLI-173) Upgrade to Java 5 features

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

[jira] Created: (CLI-173) Upgrade to Java 5 features

JIRA jira@apache.org
Upgrade to Java 5 features
--------------------------

                 Key: CLI-173
                 URL: https://issues.apache.org/jira/browse/CLI-173
             Project: Commons CLI
          Issue Type: Improvement
          Components: CLI-2.x
    Affects Versions: 2.1
            Reporter: Hendrik Maryns


Java 5 is end-of-life, and there are no generics to be seen in Commons.  What a shame.  Anyway, Collections is going there, let's do it here as well.  And while we're at it, introduce annotations and the like.

--
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: (CLI-173) Upgrade to Java 5 features

JIRA jira@apache.org

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

Hendrik Maryns updated CLI-173:
-------------------------------

    Attachment: generics.patch

I did most of it, except for the Validation package, since it is fundamentally flawed and cannot properly be generified.  Transformers from Collections could be used to fix that stuff.

Builds and passes all tests.

I also made DisplaySettings an enum and introduced @Override etc. where appropriate.

> Upgrade to Java 5 features
> --------------------------
>
>                 Key: CLI-173
>                 URL: https://issues.apache.org/jira/browse/CLI-173
>             Project: Commons CLI
>          Issue Type: Improvement
>          Components: CLI-2.x
>    Affects Versions: 2.1
>            Reporter: Hendrik Maryns
>         Attachments: generics.patch
>
>
> Java 5 is end-of-life, and there are no generics to be seen in Commons.  What a shame.  Anyway, Collections is going there, let's do it here as well.  And while we're at it, introduce annotations and the like.

--
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: (CLI-173) Upgrade to Java 5 features

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/CLI-173?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12641344#action_12641344 ]

Hendrik Maryns commented on CLI-173:
------------------------------------

I forgot to tell that the problem with the validators is the reason why it is impossible to generify one of the most important functions in the library: getValues() and its derivatives.  The logical solution would be to make it a List<String>, but through the validators, it can suddenly start emitting List<Class<?>> etc.

I would suggest to make it a List<String> and also have getValue() return a String.
We could then have another interface TransformingCommandLine<F,T> which introduces a method getAndTransformValues() which would return a List<T>.  Haven't thought it through yet, input welcome.

In any case can the patch be applied now without any consequences (that is, maybe you'll want to change the part regarding pom.xml and some other files, but the Java part is safe).

Oh, and we should then of course update the documentation too.

> Upgrade to Java 5 features
> --------------------------
>
>                 Key: CLI-173
>                 URL: https://issues.apache.org/jira/browse/CLI-173
>             Project: Commons CLI
>          Issue Type: Improvement
>          Components: CLI-2.x
>    Affects Versions: 2.1
>            Reporter: Hendrik Maryns
>         Attachments: generics.patch
>
>
> Java 5 is end-of-life, and there are no generics to be seen in Commons.  What a shame.  Anyway, Collections is going there, let's do it here as well.  And while we're at it, introduce annotations and the like.

--
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: (CLI-173) Upgrade to Java 5 features

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Henri Yandell updated CLI-173:
------------------------------

    Affects Version/s:     (was: 2.1)
        Fix Version/s: 2.0

> Upgrade to Java 5 features
> --------------------------
>
>                 Key: CLI-173
>                 URL: https://issues.apache.org/jira/browse/CLI-173
>             Project: Commons CLI
>          Issue Type: Improvement
>          Components: CLI-2.x
>            Reporter: Hendrik Maryns
>             Fix For: 2.0
>
>         Attachments: generics.patch
>
>
> Java 5 is end-of-life, and there are no generics to be seen in Commons.  What a shame.  Anyway, Collections is going there, let's do it here as well.  And while we're at it, introduce annotations and the like.

--
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: (CLI-173) Upgrade to Java 5 features

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Emmanuel Bourg updated CLI-173:
-------------------------------

    Attachment: cli2-jdk1.5-patch.patch

Attached the patch submitted by Haixing Hu in CLI-194

> Upgrade to Java 5 features
> --------------------------
>
>                 Key: CLI-173
>                 URL: https://issues.apache.org/jira/browse/CLI-173
>             Project: Commons CLI
>          Issue Type: Improvement
>          Components: CLI-2.x
>            Reporter: Hendrik Maryns
>             Fix For: 2.0
>
>         Attachments: cli2-jdk1.5-patch.patch, generics.patch
>
>
> Java 5 is end-of-life, and there are no generics to be seen in Commons.  What a shame.  Anyway, Collections is going there, let's do it here as well.  And while we're at it, introduce annotations and the like.

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