lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler (JIRA)" <>
Subject [jira] Commented: (LUCENE-1855) Change AttributeSource API to use generics
Date Sun, 30 Aug 2009 17:49:32 GMT


Uwe Schindler commented on LUCENE-1855:

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:
>             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:
For additional commands, e-mail:

View raw message