lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENE-1998) Use Java 5 enums
Date Wed, 21 Oct 2009 07:23:59 GMT

    [ 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


Mime
View raw message