lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <...@thetaphi.de>
Subject RE: svn commit: r1326561 - /lucene/dev/trunk/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestRandomChains.java
Date Mon, 16 Apr 2012 11:36:52 GMT
It is correct now, I will revert again.

-----
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: Monday, April 16, 2012 1:17 PM
> To: commits@lucene.apache.org
> Subject: svn commit: r1326561 -
> /lucene/dev/trunk/modules/analysis/common/src/test/org/apache/lucene/anal
> ysis/core/TestRandomChains.java
> 
> Author: rmuir
> Date: Mon Apr 16 11:16:46 2012
> New Revision: 1326561
> 
> URL: http://svn.apache.org/viewvc?rev=1326561&view=rev
> Log:
> LUCENE-3990: revert broken refactoring AGAIN. charfilter does not delegate all
> read methods. I'm not wasting hours of my life debugging these test fails again
> to save 3 lines of code
> 
> Modified:
> 
> lucene/dev/trunk/modules/analysis/common/src/test/org/apache/lucene/analy
> sis/core/TestRandomChains.java
> 
> Modified:
> lucene/dev/trunk/modules/analysis/common/src/test/org/apache/lucene/analy
> sis/core/TestRandomChains.java
> URL:
> http://svn.apache.org/viewvc/lucene/dev/trunk/modules/analysis/common/src
> /test/org/apache/lucene/analysis/core/TestRandomChains.java?rev=1326561&
> r1=1326560&r2=1326561&view=diff
> ================================================================
> ==============
> ---
> lucene/dev/trunk/modules/analysis/common/src/test/org/apache/lucene/analy
> sis/core/TestRandomChains.java (original)
> +++ lucene/dev/trunk/modules/analysis/common/src/test/org/apache/lucene/
> +++ analysis/core/TestRandomChains.java Mon Apr 16 11:16:46 2012
> @@ -756,29 +756,74 @@ public class TestRandomChains extends Ba
>      }
>    }
> 
> -  static final class CheckThatYouDidntReadAnythingReaderWrapper extends
> CharFilter {
> -    boolean readSomething = false;
> +  // wants charfilter to be a filterreader...
> +  // do *NOT*, do *NOT* refactor me to be a charfilter: LUCENE-3990
> + static class CheckThatYouDidntReadAnythingReaderWrapper extends
> CharStream {
> +    boolean readSomething;
> +    CharStream in;
> 
>      CheckThatYouDidntReadAnythingReaderWrapper(Reader in) {
> -      super(CharReader.get(in));
> +      this.in = CharReader.get(in);
> +    }
> +
> +    @Override
> +    public int correctOffset(int currentOff) {
> +      return in.correctOffset(currentOff);
> +    }
> +
> +    @Override
> +    public void close() throws IOException {
> +      in.close();
>      }
> 
>      @Override
>      public int read(char[] cbuf, int off, int len) throws IOException {
>        readSomething = true;
> -      return input.read(cbuf, off, len);
> +      return in.read(cbuf, off, len);
>      }
> 
>      @Override
>      public int read() throws IOException {
>        readSomething = true;
> -      return input.read();
> +      return in.read();
> +    }
> +
> +    @Override
> +    public int read(CharBuffer target) throws IOException {
> +      readSomething = true;
> +      return in.read(target);
> +    }
> +
> +    @Override
> +    public void mark(int readAheadLimit) throws IOException {
> +      in.mark(readAheadLimit);
> +    }
> +
> +    @Override
> +    public boolean markSupported() {
> +      return in.markSupported();
> +    }
> +
> +    @Override
> +    public int read(char[] cbuf) throws IOException {
> +      readSomething = true;
> +      return in.read(cbuf);
> +    }
> +
> +    @Override
> +    public boolean ready() throws IOException {
> +      return in.ready();
> +    }
> +
> +    @Override
> +    public void reset() throws IOException {
> +      in.reset();
>      }
> 
>      @Override
>      public long skip(long n) throws IOException {
>        readSomething = true;
> -      return input.skip(n);
> +      return in.skip(n);
>      }
>    }
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message