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 <uw...@thetaphi.de> on 2010/04/11 11:39:21 UTC
RE: svn commit: r932773 - /lucene/dev/trunk/solr/src/test/org/apache/solr/analysis/TestLuceneMatchVersion.java
Robert,
as the comment says, it’s a hack. How about simply adding a public getter method for the matchVersion to the base class StopwordAwareAna?
Uwe
-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de
> -----Original Message-----
> From: rmuir@apache.org [mailto:rmuir@apache.org]
> Sent: Saturday, April 10, 2010 7:52 PM
> To: java-commits@lucene.apache.org
> Subject: svn commit: r932773 -
> /lucene/dev/trunk/solr/src/test/org/apache/solr/analysis/TestLuceneMatc
> hVersion.java
>
> Author: rmuir
> Date: Sat Apr 10 17:51:30 2010
> New Revision: 932773
>
> URL: http://svn.apache.org/viewvc?rev=932773&view=rev
> Log:
> fix failing test, StdAnalyzer now stores this in its superclass
>
> Modified:
>
> lucene/dev/trunk/solr/src/test/org/apache/solr/analysis/TestLuceneMatch
> Version.java
>
> Modified:
> lucene/dev/trunk/solr/src/test/org/apache/solr/analysis/TestLuceneMatch
> Version.java
> URL:
> http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/test/org/apache/
> solr/analysis/TestLuceneMatchVersion.java?rev=932773&r1=932772&r2=93277
> 3&view=diff
> =======================================================================
> =======
> ---
> lucene/dev/trunk/solr/src/test/org/apache/solr/analysis/TestLuceneMatch
> Version.java (original)
> +++
> lucene/dev/trunk/solr/src/test/org/apache/solr/analysis/TestLuceneMatch
> Version.java Sat Apr 10 17:51:30 2010
> @@ -68,8 +68,8 @@ public class TestLuceneMatchVersion exte
> tok = (StandardTokenizer) tsi.getTokenizer();
> assertFalse(tok.isReplaceInvalidAcronym());
>
> - // this is a hack to get the private matchVersion field in
> StandardAnalyzer, may break in later lucene versions - we have no
> getter :(
> - final Field matchVersionField =
> StandardAnalyzer.class.getDeclaredField("matchVersion");
> + // this is a hack to get the private matchVersion field in
> StandardAnalyzer's superclass, may break in later lucene versions - we
> have no getter :(
> + final Field matchVersionField =
> StandardAnalyzer.class.getSuperclass().getDeclaredField("matchVersion")
> ;
> matchVersionField.setAccessible(true);
>
> type = schema.getFieldType("textStandardAnalyzerDefault");
>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org
RE: svn commit: r932773 - /lucene/dev/trunk/solr/src/test/org/apache/solr/analysis/TestLuceneMatchVersion.java
Posted by Uwe Schindler <uw...@thetaphi.de>.
This is why i added the comment. But I forgot about it when I committed the lucene refactoring J So lets fix it with a simple getter!
-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
<http://www.thetaphi.de/> http://www.thetaphi.de
eMail: uwe@thetaphi.de
From: Robert Muir [mailto:rcmuir@gmail.com]
Sent: Sunday, April 11, 2010 11:47 AM
To: java-dev@lucene.apache.org
Subject: Re: svn commit: r932773 - /lucene/dev/trunk/solr/src/test/org/apache/solr/analysis/TestLuceneMatchVersion.java
I agree we should do something better, I do not like the way the test looks now (no offense) as it is prone to break...
On Sun, Apr 11, 2010 at 5:39 AM, Uwe Schindler <uw...@thetaphi.de> wrote:
Robert,
as the comment says, it’s a hack. How about simply adding a public getter method for the matchVersion to the base class StopwordAwareAna?
Uwe
-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de
> -----Original Message-----
> From: rmuir@apache.org [mailto:rmuir@apache.org]
> Sent: Saturday, April 10, 2010 7:52 PM
> To: java-commits@lucene.apache.org
> Subject: svn commit: r932773 -
> /lucene/dev/trunk/solr/src/test/org/apache/solr/analysis/TestLuceneMatc
> hVersion.java
>
> Author: rmuir
> Date: Sat Apr 10 17:51:30 2010
> New Revision: 932773
>
> URL: http://svn.apache.org/viewvc?rev=932773 <http://svn.apache.org/viewvc?rev=932773&view=rev> &view=rev
> Log:
> fix failing test, StdAnalyzer now stores this in its superclass
>
> Modified:
>
> lucene/dev/trunk/solr/src/test/org/apache/solr/analysis/TestLuceneMatch
> Version.java
>
> Modified:
> lucene/dev/trunk/solr/src/test/org/apache/solr/analysis/TestLuceneMatch
> Version.java
> URL:
> http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/test/org/apache/
> solr/analysis/TestLuceneMatchVersion.java?rev=932773&r1=932772&r2=93277
> 3&view=diff
> =======================================================================
> =======
> ---
> lucene/dev/trunk/solr/src/test/org/apache/solr/analysis/TestLuceneMatch
> Version.java (original)
> +++
> lucene/dev/trunk/solr/src/test/org/apache/solr/analysis/TestLuceneMatch
> Version.java Sat Apr 10 17:51:30 2010
> @@ -68,8 +68,8 @@ public class TestLuceneMatchVersion exte
> tok = (StandardTokenizer) tsi.getTokenizer();
> assertFalse(tok.isReplaceInvalidAcronym());
>
> - // this is a hack to get the private matchVersion field in
> StandardAnalyzer, may break in later lucene versions - we have no
> getter :(
> - final Field matchVersionField =
> StandardAnalyzer.class.getDeclaredField("matchVersion");
> + // this is a hack to get the private matchVersion field in
> StandardAnalyzer's superclass, may break in later lucene versions - we
> have no getter :(
> + final Field matchVersionField =
> StandardAnalyzer.class.getSuperclass().getDeclaredField("matchVersion")
> ;
> matchVersionField.setAccessible(true);
>
> type = schema.getFieldType("textStandardAnalyzerDefault");
>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org
--
Robert Muir
rcmuir@gmail.com
Re: svn commit: r932773 - /lucene/dev/trunk/solr/src/test/org/apache/solr/analysis/TestLuceneMatchVersion.java
Posted by Robert Muir <rc...@gmail.com>.
I agree we should do something better, I do not like the way the test looks
now (no offense) as it is prone to break...
On Sun, Apr 11, 2010 at 5:39 AM, Uwe Schindler <uw...@thetaphi.de> wrote:
> Robert,
>
> as the comment says, it’s a hack. How about simply adding a public getter
> method for the matchVersion to the base class StopwordAwareAna?
>
> Uwe
>
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: uwe@thetaphi.de
>
>
> > -----Original Message-----
> > From: rmuir@apache.org [mailto:rmuir@apache.org]
> > Sent: Saturday, April 10, 2010 7:52 PM
> > To: java-commits@lucene.apache.org
> > Subject: svn commit: r932773 -
> > /lucene/dev/trunk/solr/src/test/org/apache/solr/analysis/TestLuceneMatc
> > hVersion.java
> >
> > Author: rmuir
> > Date: Sat Apr 10 17:51:30 2010
> > New Revision: 932773
> >
> > URL: http://svn.apache.org/viewvc?rev=932773&view=rev
> > Log:
> > fix failing test, StdAnalyzer now stores this in its superclass
> >
> > Modified:
> >
> > lucene/dev/trunk/solr/src/test/org/apache/solr/analysis/TestLuceneMatch
> > Version.java
> >
> > Modified:
> > lucene/dev/trunk/solr/src/test/org/apache/solr/analysis/TestLuceneMatch
> > Version.java
> > URL:
> > http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/test/org/apache/
> > solr/analysis/TestLuceneMatchVersion.java?rev=932773&r1=932772&r2=93277
> > 3&view=diff
> > =======================================================================
> > =======
> > ---
> > lucene/dev/trunk/solr/src/test/org/apache/solr/analysis/TestLuceneMatch
> > Version.java (original)
> > +++
> > lucene/dev/trunk/solr/src/test/org/apache/solr/analysis/TestLuceneMatch
> > Version.java Sat Apr 10 17:51:30 2010
> > @@ -68,8 +68,8 @@ public class TestLuceneMatchVersion exte
> > tok = (StandardTokenizer) tsi.getTokenizer();
> > assertFalse(tok.isReplaceInvalidAcronym());
> >
> > - // this is a hack to get the private matchVersion field in
> > StandardAnalyzer, may break in later lucene versions - we have no
> > getter :(
> > - final Field matchVersionField =
> > StandardAnalyzer.class.getDeclaredField("matchVersion");
> > + // this is a hack to get the private matchVersion field in
> > StandardAnalyzer's superclass, may break in later lucene versions - we
> > have no getter :(
> > + final Field matchVersionField =
> > StandardAnalyzer.class.getSuperclass().getDeclaredField("matchVersion")
> > ;
> > matchVersionField.setAccessible(true);
> >
> > type = schema.getFieldType("textStandardAnalyzerDefault");
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>
>
--
Robert Muir
rcmuir@gmail.com