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

Uwe Schindler edited comment on LUCENE-1855 at 8/30/09 10:49 AM:
-----------------------------------------------------------------

About the backwards compatibility: After adding generics, the backwards test 
should run all tests from 2.9 (compiled with 1.4) against the generified trunk 
jar. After branching I would start to manage this.

Normally generics do not bring backwards incompatibility, because they are 
simple removed. You only have probloems at places, where the the erased 
generics should not be replaced by java.lang.Object. Eg in the 
AttributeSource.addAttribute() call, it should return a Attribute (subclass) as 
in 2.9 and not Object (because of this you need to generify the whole method by 
the generics prefix, defining "A" as subclass of "Attribute"). If you use an 
naive approach to add generics, it could lead to addAttribute returns Object 
(and so a link error would occur). To prevent this, the backwards tests against 
2.9 are a good solution.

By the way, the generics for AttributeSource were copied from j.l.Class and its 
methods to get annotations :)

      was (Author: thetaphi):
    About the backwards compatibility: After adding generics, the backwards 
test should run all tests from 2.9 (compiled with 1.4) against the generified 
trunk jar. After branching I would start to manage this.

Normally generics do not bring backwards incompatibility, because they are 
simple removed. You only have probloems at places, where the the erased 
generics should not be replaced by java.lang.Object. Eg in the AttributeSource 
call, it should return a Attribute and not Object (because of this you need to 
generify the whole method by the generics prefix, defining "A" as subclass of 
"Attribute"). If you use an naive approach to add generics, it could lead to 
addAttribute returns Object (and so a link error would occur). To prevent this, 
the backwards tests against 2.9 are a good solution.

By the way, the generics for AttributeSource were copied from j.l.Class and its 
methods to get annotations :)
  
> Change AttributeSource API to use generics
> ------------------------------------------
>
>                 Key: LUCENE-1855
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1855
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Analysis
>            Reporter: Michael Busch
>            Assignee: Uwe Schindler
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: LUCENE-1855.patch
>
>
> The AttributeSource API will be easier to use with JDK 1.5 generics.
> Uwe, if you started working on a patch for this already feel free to assign 
> this to you.

-- 
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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to