lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <...@thetaphi.de>
Subject RE: TypeAttributeImpl
Date Fri, 21 Aug 2009 12:44:52 GMT
I changed this:

Revision: 806530
Author: uschindler
Date: 14:43:21, Freitag, 21. August 2009
Message:
use the type String and do not clone explicitely (Strings are final and
unmodifable)

----
Modified :
/lucene/java/trunk/src/java/org/apache/lucene/analysis/tokenattributes/TypeA
ttributeImpl.java

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de

> -----Original Message-----
> From: Uwe Schindler [mailto:uwe@thetaphi.de]
> Sent: Friday, August 21, 2009 12:46 AM
> To: java-dev@lucene.apache.org
> Subject: RE: TypeAttributeImpl
> 
> Not really, there is no reason fort hat in my opinion. And Token.copyTo()
> does not do this, but should then!
> 
> I think, remove it. Strings can always by kept, as they are final and
> unmodifiable.
> 
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: uwe@thetaphi.de
> 
> 
> > -----Original Message-----
> > From: Mark Miller [mailto:markrmiller@gmail.com]
> > Sent: Friday, August 21, 2009 12:39 AM
> > To: java-dev@lucene.apache.org
> > Subject: TypeAttributeImpl
> >
> > Getting into the nitpick stuff ;)
> >
> > In TypeAttributeImpl:
> >
> >   public void copyTo(AttributeImpl target) {
> >     TypeAttribute t = (TypeAttribute) target;
> >     t.setType(new String(type));
> >   }
> >
> > The class uses type.equals and type.hashCode - is there any reason to
> > create a new String object here? Just use type ...
> >
> > --
> > - Mark
> >
> > http://www.lucidimagination.com
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> > For additional commands, e-mail: java-dev-help@lucene.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org



---------------------------------------------------------------------
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