lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: svn commit: r1311920 - /lucene/dev/branches/lucene3969/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestRandomChains.java
Date Tue, 10 Apr 2012 19:01:07 GMT
Sorry Uwe :)

I guess Emacs indents differently from Eclipse!

Mike McCandless

http://blog.mikemccandless.com

On Tue, Apr 10, 2012 at 2:50 PM,  <uschindler@apache.org> wrote:
> Author: uschindler
> Date: Tue Apr 10 18:50:54 2012
> New Revision: 1311920
>
> URL: http://svn.apache.org/viewvc?rev=1311920&view=rev
> Log:
> LUCENE-3969: revert Whitespace
>
> Modified:
>    lucene/dev/branches/lucene3969/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestRandomChains.java
>
> Modified: lucene/dev/branches/lucene3969/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestRandomChains.java
> URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3969/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestRandomChains.java?rev=1311920&r1=1311919&r2=1311920&view=diff
> ==============================================================================
> --- lucene/dev/branches/lucene3969/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestRandomChains.java
(original)
> +++ lucene/dev/branches/lucene3969/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestRandomChains.java
Tue Apr 10 18:50:54 2012
> @@ -105,30 +105,30 @@ public class TestRandomChains extends Ba
>     // nocommit can we promote some of these to be only
>     // offsets offenders?
>     Collections.<Class<?>>addAll(brokenComponents,
> -                                 // TODO: fix basetokenstreamtestcase
not to trip because this one has no CharTermAtt
> -                                 EmptyTokenizer.class,
> -                                 // doesn't actual reset itself!
> -                                 CachingTokenFilter.class,
> -                                 // doesn't consume whole stream!
> -                                 LimitTokenCountFilter.class,
> -                                 // Not broken: we forcefully add this,
so we shouldn't
> -                                 // also randomly pick it:
> -                                 ValidatingTokenFilter.class,
> -                                 // NOTE: these by themselves won't
cause any 'basic assertions' to fail.
> -                                 // but see https://issues.apache.org/jira/browse/LUCENE-3920,
if any
> -                                 // tokenfilter that combines words
(e.g. shingles) comes after them,
> -                                 // this will create bogus offsets because
their 'offsets go backwards',
> -                                 // causing shingle or whatever to make
a single token with a
> -                                 // startOffset thats > its endOffset
> -                                 // (see LUCENE-3738 for a list of other
offenders here)
> -                                 // broken!
> -                                 NGramTokenizer.class,
> -                                 // broken!
> -                                 NGramTokenFilter.class,
> -                                 // broken!
> -                                 EdgeNGramTokenizer.class,
> -                                 // broken!
> -                                 EdgeNGramTokenFilter.class
> +      // TODO: fix basetokenstreamtestcase not to trip because this one has no CharTermAtt
> +      EmptyTokenizer.class,
> +      // doesn't actual reset itself!
> +      CachingTokenFilter.class,
> +      // doesn't consume whole stream!
> +      LimitTokenCountFilter.class,
> +      // Not broken: we forcefully add this, so we shouldn't
> +      // also randomly pick it:
> +      ValidatingTokenFilter.class,
> +      // NOTE: these by themselves won't cause any 'basic assertions' to fail.
> +      // but see https://issues.apache.org/jira/browse/LUCENE-3920, if any
> +      // tokenfilter that combines words (e.g. shingles) comes after them,
> +      // this will create bogus offsets because their 'offsets go backwards',
> +      // causing shingle or whatever to make a single token with a
> +      // startOffset thats > its endOffset
> +      // (see LUCENE-3738 for a list of other offenders here)
> +      // broken!
> +      NGramTokenizer.class,
> +      // broken!
> +      NGramTokenFilter.class,
> +      // broken!
> +      EdgeNGramTokenizer.class,
> +      // broken!
> +      EdgeNGramTokenFilter.class
>     );
>   }
>
> @@ -137,18 +137,19 @@ public class TestRandomChains extends Ba
>   private static final Set<Class<?>> brokenOffsetsComponents = Collections.newSetFromMap(new
IdentityHashMap<Class<?>,Boolean>());
>   static {
>     Collections.<Class<?>>addAll(brokenOffsetsComponents,
> -                                 WordDelimiterFilter.class,
> -                                 TrimFilter.class,
> -                                 ReversePathHierarchyTokenizer.class,
> -                                 PathHierarchyTokenizer.class,
> -                                 HyphenationCompoundWordTokenFilter.class,
> -                                 DictionaryCompoundWordTokenFilter.class,
> -                                 // nocommit: corrumpts graphs (offset
consistency check):
> -                                 PositionFilter.class,
> -                                 // nocommit it seems to mess up offsets!?
> -                                 WikipediaTokenizer.class
> -                                 );
> +      WordDelimiterFilter.class,
> +      TrimFilter.class,
> +      ReversePathHierarchyTokenizer.class,
> +      PathHierarchyTokenizer.class,
> +      HyphenationCompoundWordTokenFilter.class,
> +      DictionaryCompoundWordTokenFilter.class,
> +      // nocommit: corrumpts graphs (offset consistency check):
> +      PositionFilter.class,
> +      // nocommit it seems to mess up offsets!?
> +      WikipediaTokenizer.class
> +    );
>   }
> +
>   @BeforeClass
>   public static void beforeClass() throws Exception {
>     List<Class<?>> analysisClasses = new ArrayList<Class<?>>();
> @@ -168,6 +169,7 @@ public class TestRandomChains extends Ba
>       ) {
>         continue;
>       }
> +
>       for (final Constructor<?> ctor : c.getConstructors()) {
>         // don't test synthetic or deprecated ctors, they likely have known bugs:
>         if (ctor.isSynthetic() || ctor.isAnnotationPresent(Deprecated.class)) {
> @@ -175,21 +177,22 @@ public class TestRandomChains extends Ba
>         }
>         if (Tokenizer.class.isAssignableFrom(c)) {
>           assertTrue(ctor.toGenericString() + " has unsupported parameter types",
> -                     allowedTokenizerArgs.containsAll(Arrays.asList(ctor.getParameterTypes())));
> +            allowedTokenizerArgs.containsAll(Arrays.asList(ctor.getParameterTypes())));
>           tokenizers.add(castConstructor(Tokenizer.class, ctor));
>         } else if (TokenFilter.class.isAssignableFrom(c)) {
>           assertTrue(ctor.toGenericString() + " has unsupported parameter types",
> -                     allowedTokenFilterArgs.containsAll(Arrays.asList(ctor.getParameterTypes())));
> +            allowedTokenFilterArgs.containsAll(Arrays.asList(ctor.getParameterTypes())));
>           tokenfilters.add(castConstructor(TokenFilter.class, ctor));
>         } else if (CharStream.class.isAssignableFrom(c)) {
>           assertTrue(ctor.toGenericString() + " has unsupported parameter types",
> -                     allowedCharFilterArgs.containsAll(Arrays.asList(ctor.getParameterTypes())));
> +            allowedCharFilterArgs.containsAll(Arrays.asList(ctor.getParameterTypes())));
>           charfilters.add(castConstructor(CharStream.class, ctor));
>         } else {
>           fail("Cannot get here");
>         }
>       }
>     }
> +
>     final Comparator<Constructor<?>> ctorComp = new Comparator<Constructor<?>>()
{
>       @Override
>       public int compare(Constructor<?> arg0, Constructor<?> arg1) {
> @@ -205,12 +208,14 @@ public class TestRandomChains extends Ba
>       System.out.println("charfilters = " + charfilters);
>     }
>   }
> +
>   @AfterClass
>   public static void afterClass() throws Exception {
>     tokenizers = null;
>     tokenfilters = null;
>     charfilters = null;
>   }
> +
>   /** Hack to work around the stupidness of Oracle's strict Java backwards compatibility.
>    * {@code Class<T>#getConstructors()} should return unmodifiable {@code List<Constructor<T>>}
not array! */
>   @SuppressWarnings("unchecked")
>
>

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


Mime
View raw message