From eae8e8159dd5443d2c95370016cbbb889f235da0 Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Mon, 9 Apr 2012 16:56:35 +0000 Subject: [PATCH] LUCENE-3969: Remove useless success variable git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene3969@1311322 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/lucene/analysis/core/TestRandomChains.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestRandomChains.java b/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestRandomChains.java index d49e1c001e6..e09178320ae 100644 --- a/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestRandomChains.java +++ b/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestRandomChains.java @@ -606,14 +606,13 @@ public class TestRandomChains extends BaseTokenStreamTestCase { StringBuilder descr = new StringBuilder(); int numFilters = random.nextInt(3); for (int i = 0; i < numFilters; i++) { - boolean success = false; - while (!success) { + while (true) { final Constructor ctor = charfilters.get(random.nextInt(charfilters.size())); final Object args[] = newCharFilterArgs(random, spec.reader, ctor.getParameterTypes()); reader = createComponent(ctor, args, descr); if (reader != null) { - success = true; spec.reader = reader; + break; } } } @@ -627,14 +626,13 @@ public class TestRandomChains extends BaseTokenStreamTestCase { StringBuilder descr = new StringBuilder(); int numFilters = random.nextInt(5); for (int i = 0; i < numFilters; i++) { - boolean success = false; - while (!success) { + while (true) { final Constructor ctor = tokenfilters.get(random.nextInt(tokenfilters.size())); final Object args[] = newFilterArgs(random, spec.stream, ctor.getParameterTypes()); final TokenFilter flt = createComponent(ctor, args, descr); if (flt != null) { - success = true; spec.stream = flt; + break; } } }