You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Attila Király (JIRA)" <ji...@apache.org> on 2011/04/28 11:38:03 UTC

[jira] [Created] (WICKET-3651) Replace EnumeratedType with java enum

Replace EnumeratedType with java enum
-------------------------------------

                 Key: WICKET-3651
                 URL: https://issues.apache.org/jira/browse/WICKET-3651
             Project: Wicket
          Issue Type: Improvement
          Components: wicket-core, wicket-examples, wicket-extensions
    Affects Versions: 1.5-RC3
            Reporter: Attila Király
         Attachments: WICKET-3651.patch

Most of the EnumeratedType subclasses in wicket can be replaced with Java enums. The sole exception is the Action class, but the EnumeratedType superclass is not needed there either.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (WICKET-3651) Replace EnumeratedType with java enum

Posted by "Attila Király (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-3651?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13026236#comment-13026236 ] 

Attila Király commented on WICKET-3651:
---------------------------------------

That is true. As I see the extensibility is only really used with the Action class (and that works even after removing the EnumeratedType superclass). In the most cases extending do not make much sense as the code can only handle the predefined values anyways.

My other issue with EnumeratedType is that I do not really see the benefit of it extending StringValue. It seems this functionallity is not used.

Last but not least EnumeratedType stores the EnumeratedType instances in a static map and that is imho a memory leak possibility (if EnumeratedType and its subclasses are loaded by different class loaders).

> Replace EnumeratedType with java enum
> -------------------------------------
>
>                 Key: WICKET-3651
>                 URL: https://issues.apache.org/jira/browse/WICKET-3651
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-core, wicket-examples, wicket-extensions
>    Affects Versions: 1.5-RC3
>            Reporter: Attila Király
>         Attachments: WICKET-3651.patch
>
>
> Most of the EnumeratedType subclasses in wicket can be replaced with Java enums. The sole exception is the Action class, but the EnumeratedType superclass is not needed there either.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (WICKET-3651) Replace EnumeratedType with java enum

Posted by "Attila Király (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-3651?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Attila Király updated WICKET-3651:
----------------------------------

    Attachment: WICKET-3651.patch

Attaching proposed patch made for trunk. Tests pass.

> Replace EnumeratedType with java enum
> -------------------------------------
>
>                 Key: WICKET-3651
>                 URL: https://issues.apache.org/jira/browse/WICKET-3651
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-core, wicket-examples, wicket-extensions
>    Affects Versions: 1.5-RC3
>            Reporter: Attila Király
>         Attachments: WICKET-3651.patch
>
>
> Most of the EnumeratedType subclasses in wicket can be replaced with Java enums. The sole exception is the Action class, but the EnumeratedType superclass is not needed there either.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (WICKET-3651) Replace EnumeratedType with java enum

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-3651?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov resolved WICKET-3651.
-------------------------------------

    Resolution: Won't Fix

I don't see benefit of replacing this class with Java 1.5 enum.
We cannot remove the class from the library because it may be used in user applications.
In my previous project we use it instead of enum because it can be extended. 

> Replace EnumeratedType with java enum
> -------------------------------------
>
>                 Key: WICKET-3651
>                 URL: https://issues.apache.org/jira/browse/WICKET-3651
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-core, wicket-examples, wicket-extensions
>    Affects Versions: 1.5-RC3
>            Reporter: Attila Király
>         Attachments: WICKET-3651.patch
>
>
> Most of the EnumeratedType subclasses in wicket can be replaced with Java enums. The sole exception is the Action class, but the EnumeratedType superclass is not needed there either.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (WICKET-3651) Replace EnumeratedType with java enum

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-3651?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13026231#comment-13026231 ] 

Martin Grigorov commented on WICKET-3651:
-----------------------------------------

The cool feature of EnumeratedType is that it can be extended/inherited. I like it more than Java's enum.

> Replace EnumeratedType with java enum
> -------------------------------------
>
>                 Key: WICKET-3651
>                 URL: https://issues.apache.org/jira/browse/WICKET-3651
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-core, wicket-examples, wicket-extensions
>    Affects Versions: 1.5-RC3
>            Reporter: Attila Király
>         Attachments: WICKET-3651.patch
>
>
> Most of the EnumeratedType subclasses in wicket can be replaced with Java enums. The sole exception is the Action class, but the EnumeratedType superclass is not needed there either.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira