You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Uwe Schindler (JIRA)" <ji...@apache.org> on 2009/10/21 09:23:59 UTC

[jira] Commented: (LUCENE-1998) Use Java 5 enums

    [ https://issues.apache.org/jira/browse/LUCENE-1998?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12768118#action_12768118 ] 

Uwe Schindler commented on LUCENE-1998:
---------------------------------------

I tested it here, we have no backwards problem (at least with "normal" usage). The dynamic linker of Java when running old Java 1.4 code against the new enum classes has no problem with the replaced superclass: Old code compiled against Field.Store.XXX against lucene-core-2.9.jar with superclass Parameter works perfectly with the new lucene-core-3.0.jar. This works because we only use the parameter class as a type safe enumeration an did not call any methods (only maybe toString()) of it. So the linker has no problem.

I would simply apply this ptach to trunk. I would also remove the Parameter class completely, as it breaks no code (only if somebody has used that class for own enums). Maybe we should deprecate Parameter in 2.9.1 and say that it will be removed in 3.0 as this version uses Java5's enum. But it also does not hurt if we keep it and mark it deprecated as in the patch.

To your patch: I only added the license header back in the Version class. It must be there.

> Use Java 5 enums
> ----------------
>
>                 Key: LUCENE-1998
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1998
>             Project: Lucene - Java
>          Issue Type: Improvement
>    Affects Versions: 3.0
>            Reporter: DM Smith
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: LUCENE-1998_enum.patch
>
>
> Replace the use of o.a.l.util.Parameter with Java 5 enums, deprecating Parameter.
> Replace other custom enum patterns with Java 5 enums.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org