You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@lucene.apache.org by ma...@apache.org on 2009/11/16 22:24:47 UTC
svn commit: r880963 [7/7] - in /lucene/java/branches/flex_1458: ./ contrib/
contrib/analyzers/common/src/java/org/apache/lucene/analysis/ar/
contrib/analyzers/common/src/java/org/apache/lucene/analysis/br/
contrib/analyzers/common/src/java/org/apache/l...
Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Searcher.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Searcher.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Searcher.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Searcher.java Mon Nov 16 21:24:41 2009
@@ -22,6 +22,7 @@
import org.apache.lucene.document.Document;
import org.apache.lucene.index.CorruptIndexException;
import org.apache.lucene.index.Term;
+import org.apache.lucene.document.FieldSelector;
/**
* An abstract base class for search implementations. Implements the main search
@@ -161,6 +162,7 @@
abstract public int maxDoc() throws IOException;
abstract public TopDocs search(Weight weight, Filter filter, int n) throws IOException;
abstract public Document doc(int i) throws CorruptIndexException, IOException;
+ abstract public Document doc(int docid, FieldSelector fieldSelector) throws CorruptIndexException, IOException;
abstract public Query rewrite(Query query) throws IOException;
abstract public Explanation explain(Weight weight, int doc) throws IOException;
abstract public TopFieldDocs search(Weight weight, Filter filter, int n, Sort sort) throws IOException;
Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Similarity.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Similarity.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Similarity.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Similarity.java Mon Nov 16 21:24:41 2009
@@ -659,7 +659,7 @@
/** Computes a score factor based on a term or phrase's frequency in a
- * document. This value is multiplied by the {@link #idf(Term, Searcher)}
+ * document. This value is multiplied by the {@link #idf(int, int)}
* factor for each term in the query and these products are then summed to
* form the initial score for a document.
*
@@ -693,7 +693,7 @@
public abstract float sloppyFreq(int distance);
/** Computes a score factor based on a term or phrase's frequency in a
- * document. This value is multiplied by the {@link #idf(Term, Searcher)}
+ * document. This value is multiplied by the {@link #idf(int, int)}
* factor for each term in the query and these products are then summed to
* form the initial score for a document.
*
Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Sort.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Sort.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Sort.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Sort.java Mon Nov 16 21:24:41 2009
@@ -103,7 +103,7 @@
/**
* Represents sorting by computed relevance. Using this sort criteria returns
* the same results as calling
- * {@link Searcher#search(Query) Searcher#search()}without a sort criteria,
+ * {@link Searcher#search(Query,int) Searcher#search()}without a sort criteria,
* only with slightly more overhead.
*/
public static final Sort RELEVANCE = new Sort();
@@ -116,7 +116,7 @@
/**
* Sorts by computed relevance. This is the same sort criteria as calling
- * {@link Searcher#search(Query) Searcher#search()}without a sort criteria,
+ * {@link Searcher#search(Query,int) Searcher#search()}without a sort criteria,
* only with slightly more overhead.
*/
public Sort() {
Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TermRangeQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TermRangeQuery.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TermRangeQuery.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TermRangeQuery.java Mon Nov 16 21:24:41 2009
@@ -165,7 +165,6 @@
return buffer.toString();
}
- //@Override
@Override
public int hashCode() {
final int prime = 31;
@@ -179,7 +178,6 @@
return result;
}
- //@Override
@Override
public boolean equals(Object obj) {
if (this == obj)
Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TimeLimitingCollector.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TimeLimitingCollector.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TimeLimitingCollector.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TimeLimitingCollector.java Mon Nov 16 21:24:41 2009
@@ -20,6 +20,7 @@
import java.io.IOException;
import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.util.ThreadInterruptedException;
/**
* The {@link TimeLimitingCollector} is used to timeout search requests that
@@ -78,8 +79,7 @@
try {
Thread.sleep( resolution );
} catch (InterruptedException ie) {
- Thread.currentThread().interrupt();
- throw new RuntimeException(ie);
+ throw new ThreadInterruptedException(ie);
}
}
}
Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TopDocsCollector.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TopDocsCollector.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TopDocsCollector.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TopDocsCollector.java Mon Nov 16 21:24:41 2009
@@ -28,7 +28,7 @@
* Extending classes can override {@link #topDocs(int, int)} and
* {@link #getTotalHits()} in order to provide their own implementation.
*/
-public abstract class TopDocsCollector<T> extends Collector {
+public abstract class TopDocsCollector<T extends ScoreDoc> extends Collector {
// This is used in case topDocs() is called with illegal parameters, or there
// simply aren't (enough) results.
@@ -55,7 +55,7 @@
*/
protected void populateResults(ScoreDoc[] results, int howMany) {
for (int i = howMany - 1; i >= 0; i--) {
- results[i] = (ScoreDoc) pq.pop();
+ results[i] = pq.pop();
}
}
Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TopFieldCollector.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TopFieldCollector.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TopFieldCollector.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TopFieldCollector.java Mon Nov 16 21:24:41 2009
@@ -59,7 +59,7 @@
final void updateBottom(int doc) {
// bottom.score is already set to Float.NaN in add().
- bottom.docID = docBase + doc;
+ bottom.doc = docBase + doc;
bottom = pq.updateTop();
}
@@ -122,7 +122,7 @@
if (queueFull) {
// Fastmatch: return if this hit is not competitive
final int cmp = reverseMul * comparator.compareBottom(doc);
- if (cmp < 0 || (cmp == 0 && doc + docBase > bottom.docID)) {
+ if (cmp < 0 || (cmp == 0 && doc + docBase > bottom.doc)) {
return;
}
@@ -164,7 +164,7 @@
}
final void updateBottom(int doc, float score) {
- bottom.docID = docBase + doc;
+ bottom.doc = docBase + doc;
bottom.score = score;
bottom = pq.updateTop();
}
@@ -230,7 +230,7 @@
if (queueFull) {
// Fastmatch: return if this hit is not competitive
final int cmp = reverseMul * comparator.compareBottom(doc);
- if (cmp < 0 || (cmp == 0 && doc + docBase > bottom.docID)) {
+ if (cmp < 0 || (cmp == 0 && doc + docBase > bottom.doc)) {
return;
}
@@ -280,7 +280,7 @@
}
final void updateBottom(int doc, float score) {
- bottom.docID = docBase + doc;
+ bottom.doc = docBase + doc;
bottom.score = score;
bottom = pq.updateTop();
}
@@ -347,7 +347,7 @@
if (queueFull) {
// Fastmatch: return if this hit is not competitive
final int cmp = reverseMul * comparator.compareBottom(doc);
- if (cmp < 0 || (cmp == 0 && doc + docBase > bottom.docID)) {
+ if (cmp < 0 || (cmp == 0 && doc + docBase > bottom.doc)) {
return;
}
@@ -392,7 +392,7 @@
final void updateBottom(int doc) {
// bottom.score is already set to Float.NaN in add().
- bottom.docID = docBase + doc;
+ bottom.doc = docBase + doc;
bottom = pq.updateTop();
}
@@ -488,7 +488,7 @@
break;
} else if (i == comparators.length - 1) {
// This is the equals case.
- if (doc + docBase > bottom.docID) {
+ if (doc + docBase > bottom.doc) {
// Definitely not competitive
return;
}
@@ -545,7 +545,7 @@
}
final void updateBottom(int doc, float score) {
- bottom.docID = docBase + doc;
+ bottom.doc = docBase + doc;
bottom.score = score;
bottom = pq.updateTop();
}
@@ -640,7 +640,7 @@
break;
} else if (i == comparators.length - 1) {
// This is the equals case.
- if (doc + docBase > bottom.docID) {
+ if (doc + docBase > bottom.doc) {
// Definitely not competitive
return;
}
@@ -695,7 +695,7 @@
}
final void updateBottom(int doc, float score) {
- bottom.docID = docBase + doc;
+ bottom.doc = docBase + doc;
bottom.score = score;
bottom = pq.updateTop();
}
@@ -788,7 +788,7 @@
break;
} else if (i == comparators.length - 1) {
// This is the equals case.
- if (doc + docBase > bottom.docID) {
+ if (doc + docBase > bottom.doc) {
// Definitely not competitive
return;
}
@@ -972,7 +972,7 @@
} else {
for (int i = howMany - 1; i >= 0; i--) {
Entry entry = pq.pop();
- results[i] = new FieldDoc(entry.docID, entry.score);
+ results[i] = new FieldDoc(entry.doc, entry.score);
}
}
}
Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/CustomScoreQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/CustomScoreQuery.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/CustomScoreQuery.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/CustomScoreQuery.java Mon Nov 16 21:24:41 2009
@@ -82,7 +82,7 @@
* {@link org.apache.lucene.search.function.FieldScoreQuery FieldScoreQueries}.
* This parameter is optional - it can be null or even an empty array.
*/
- public CustomScoreQuery(Query subQuery, ValueSourceQuery valSrcQueries[]) {
+ public CustomScoreQuery(Query subQuery, ValueSourceQuery... valSrcQueries) {
super();
this.subQuery = subQuery;
this.valSrcQueries = valSrcQueries!=null?
Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/FieldCacheSource.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/FieldCacheSource.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/FieldCacheSource.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/FieldCacheSource.java Mon Nov 16 21:24:41 2009
@@ -44,10 +44,7 @@
* composite (multi-segment) reader, this can easily cause
* double RAM usage for the values in the FieldCache. It's
* best to switch your application to pass only atomic
- * (single segment) readers to this API. Alternatively, for
- * a short-term fix, you could wrap your ValueSource using
- * {@link MultiValueSource}, which costs more CPU per lookup
- * but will not consume double the FieldCache RAM.</p>
+ * (single segment) readers to this API.</p>
*/
public abstract class FieldCacheSource extends ValueSource {
private String field;
Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/OrdFieldSource.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/OrdFieldSource.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/OrdFieldSource.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/OrdFieldSource.java Mon Nov 16 21:24:41 2009
@@ -49,10 +49,7 @@
* composite (multi-segment) reader, this can easily cause
* double RAM usage for the values in the FieldCache. It's
* best to switch your application to pass only atomic
- * (single segment) readers to this API. Alternatively, for
- * a short-term fix, you could wrap your ValueSource using
- * {@link MultiValueSource}, which costs more CPU per lookup
- * but will not consume double the FieldCache RAM.</p>
+ * (single segment) readers to this API.</p>
*/
public class OrdFieldSource extends ValueSource {
Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/ReverseOrdFieldSource.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/ReverseOrdFieldSource.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/ReverseOrdFieldSource.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/ReverseOrdFieldSource.java Mon Nov 16 21:24:41 2009
@@ -50,10 +50,7 @@
* composite (multi-segment) reader, this can easily cause
* double RAM usage for the values in the FieldCache. It's
* best to switch your application to pass only atomic
- * (single segment) readers to this API. Alternatively, for
- * a short-term fix, you could wrap your ValueSource using
- * {@link MultiValueSource}, which costs more CPU per lookup
- * but will not consume double the FieldCache RAM.</p>
+ * (single segment) readers to this API.</p>
*/
public class ReverseOrdFieldSource extends ValueSource {
Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/package.html
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/package.html?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/package.html (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/package.html Mon Nov 16 21:24:41 2009
@@ -36,8 +36,8 @@
Search over indices.
Applications usually call {@link
-org.apache.lucene.search.Searcher#search(Query)} or {@link
-org.apache.lucene.search.Searcher#search(Query,Filter)}.
+org.apache.lucene.search.Searcher#search(Query,int)} or {@link
+org.apache.lucene.search.Searcher#search(Query,Filter,int)}.
<!-- FILL IN MORE HERE -->
</p>
Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/payloads/PayloadNearQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/payloads/PayloadNearQuery.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/payloads/PayloadNearQuery.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/payloads/PayloadNearQuery.java Mon Nov 16 21:24:41 2009
@@ -43,13 +43,12 @@
* {@link org.apache.lucene.search.spans.TermSpans} occurs.
* <p/>
* In order to take advantage of this, you must override
- * {@link org.apache.lucene.search.Similarity#scorePayload(String, byte[],int,int)}
+ * {@link org.apache.lucene.search.Similarity#scorePayload}
* which returns 1 by default.
* <p/>
* Payload scores are aggregated using a pluggable {@link PayloadFunction}.
*
- * @see org.apache.lucene.search.Similarity#scorePayload(String, byte[], int,
- * int)
+ * @see org.apache.lucene.search.Similarity#scorePayload
*/
public class PayloadNearQuery extends SpanNearQuery {
protected String fieldName;
@@ -106,7 +105,6 @@
return buffer.toString();
}
- // @Override
@Override
public int hashCode() {
final int prime = 31;
@@ -116,7 +114,6 @@
return result;
}
- // @Override
@Override
public boolean equals(Object obj) {
if (this == obj)
@@ -145,11 +142,6 @@
super(query, searcher);
}
- public Scorer scorer(IndexReader reader) throws IOException {
- return new PayloadNearSpanScorer(query.getSpans(reader), this,
- similarity, reader.norms(query.getField()));
- }
-
@Override
public Scorer scorer(IndexReader reader, boolean scoreDocsInOrder,
boolean topScorer) throws IOException {
Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/spans/SpanOrQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/spans/SpanOrQuery.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/spans/SpanOrQuery.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/spans/SpanOrQuery.java Mon Nov 16 21:24:41 2009
@@ -37,7 +37,7 @@
private String field;
/** Construct a SpanOrQuery merging the provided clauses. */
- public SpanOrQuery(SpanQuery[] clauses) {
+ public SpanOrQuery(SpanQuery... clauses) {
// copy clauses array into an ArrayList
this.clauses = new ArrayList<SpanQuery>(clauses.length);
Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/store/Directory.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/store/Directory.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/store/Directory.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/store/Directory.java Mon Nov 16 21:24:41 2009
@@ -20,6 +20,8 @@
import java.io.IOException;
import java.io.Closeable;
+import org.apache.lucene.index.IndexFileNameFilter;
+
/** A Directory is a flat list of files. Files may be written once, when they
* are created. Once a file is created it may only be opened for read, or
* deleted. Random access is permitted both when reading and writing.
@@ -45,9 +47,8 @@
protected LockFactory lockFactory;
/** Returns an array of strings, one for each file in the
- * directory. Unlike {@link #list} this method does no
- * filtering of the contents in a directory, and it will
- * never return null (throws IOException instead).
+ * directory.
+ * @throws IOException
*/
public abstract String[] listAll() throws IOException;
@@ -157,9 +158,6 @@
return this.toString();
}
- // nocommit -- note runtime change that all files are
- // copied
-
/**
* Copy contents of a directory src to a directory dest.
* If a file in src already exists in dest then the
@@ -170,8 +168,9 @@
* are undefined and you could easily hit a
* FileNotFoundException.
*
- * <p><b>NOTE:</b> this method copies all files, not only
- * files that look like index files
+ * <p><b>NOTE:</b> this method only copies files that look
+ * like index files (ie, have extensions matching the
+ * known extensions of index files).
*
* @param src source directory
* @param dest destination directory
@@ -181,9 +180,14 @@
public static void copy(Directory src, Directory dest, boolean closeDirSrc) throws IOException {
final String[] files = src.listAll();
+ IndexFileNameFilter filter = IndexFileNameFilter.getFilter();
+
byte[] buf = new byte[BufferedIndexOutput.BUFFER_SIZE];
for (int i = 0; i < files.length; i++) {
+ if (!filter.accept(null, files[i]))
+ continue;
+
IndexOutput os = null;
IndexInput is = null;
try {
Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/store/FSDirectory.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/store/FSDirectory.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/store/FSDirectory.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/store/FSDirectory.java Mon Nov 16 21:24:41 2009
@@ -24,6 +24,7 @@
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
+import org.apache.lucene.util.ThreadInterruptedException;
import org.apache.lucene.util.Constants;
/**
@@ -317,10 +318,7 @@
// Pause 5 msec
Thread.sleep(5);
} catch (InterruptedException ie) {
- // In 3.0 we will change this to throw
- // InterruptedException instead
- Thread.currentThread().interrupt();
- throw new RuntimeException(ie);
+ throw new ThreadInterruptedException(ie);
}
}
}
Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/store/FileSwitchDirectory.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/store/FileSwitchDirectory.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/store/FileSwitchDirectory.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/store/FileSwitchDirectory.java Mon Nov 16 21:24:41 2009
@@ -18,6 +18,7 @@
*/
import java.io.IOException;
+
import java.util.Set;
/**
Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/store/Lock.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/store/Lock.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/store/Lock.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/store/Lock.java Mon Nov 16 21:24:41 2009
@@ -17,6 +17,7 @@
* limitations under the License.
*/
+import org.apache.lucene.util.ThreadInterruptedException;
import java.io.IOException;
/** An interprocess mutex lock.
@@ -88,11 +89,8 @@
}
try {
Thread.sleep(LOCK_POLL_INTERVAL);
- } catch (InterruptedException e) {
- // In 3.0 we will change this to throw
- // InterruptedException instead
- Thread.currentThread().interrupt();
- throw new IOException(e.toString());
+ } catch (InterruptedException ie) {
+ throw new ThreadInterruptedException(ie);
}
locked = obtain();
}
Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/store/NoLockFactory.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/store/NoLockFactory.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/store/NoLockFactory.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/store/NoLockFactory.java Mon Nov 16 21:24:41 2009
@@ -21,7 +21,6 @@
/**
* Use this {@link LockFactory} to disable locking entirely.
- * This LockFactory is used when you call {@link FSDirectory#setDisableLocks}.
* Only one instance of this lock is created. You should call {@link
* #getNoLockFactory()} to get the instance.
*
Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/store/RAMDirectory.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/store/RAMDirectory.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/store/RAMDirectory.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/store/RAMDirectory.java Mon Nov 16 21:24:41 2009
@@ -22,6 +22,7 @@
import java.io.Serializable;
import java.util.HashMap;
import java.util.Set;
+import org.apache.lucene.util.ThreadInterruptedException;
/**
* A memory-resident {@link Directory} implementation. Locking
@@ -124,10 +125,7 @@
try {
Thread.sleep(0, 1);
} catch (InterruptedException ie) {
- // In 3.0 we will change this to throw
- // InterruptedException instead
- Thread.currentThread().interrupt();
- throw new RuntimeException(ie);
+ throw new ThreadInterruptedException(ie);
}
ts2 = System.currentTimeMillis();
} while(ts1 == ts2);
@@ -198,8 +196,7 @@
file = fileMap.get(name);
}
if (file == null)
- // nocommit
- throw new FileNotFoundException(name + " dir=" + this);
+ throw new FileNotFoundException(name);
return new RAMInputStream(file);
}
Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/store/SimpleFSLockFactory.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/store/SimpleFSLockFactory.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/store/SimpleFSLockFactory.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/store/SimpleFSLockFactory.java Mon Nov 16 21:24:41 2009
@@ -38,7 +38,7 @@
* is hit when trying to create a writer, in which case you
* need to explicitly clear the lock file first. You can
* either manually remove the file, or use the {@link
- * org.apache.lucene.index.IndexReader#unlock(Directory)}
+ * org.apache.lucene.index.IndexWriter#unlock(Directory)}
* API. But, first be certain that no writer is in fact
* writing to the index otherwise you can easily corrupt
* your index.</p>
Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/AttributeSource.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/AttributeSource.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/AttributeSource.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/AttributeSource.java Mon Nov 16 21:24:41 2009
@@ -410,7 +410,7 @@
} else
return false;
}
-
+
@Override
public String toString() {
StringBuilder sb = new StringBuilder().append('(');
Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/Constants.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/Constants.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/Constants.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/Constants.java Mon Nov 16 21:24:41 2009
@@ -70,7 +70,7 @@
return s.toString();
}
- public static final String LUCENE_MAIN_VERSION = ident("3.0");
+ public static final String LUCENE_MAIN_VERSION = ident("3.1");
public static final String LUCENE_VERSION;
static {
Added: lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/DummyConcurrentLock.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/DummyConcurrentLock.java?rev=880963&view=auto
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/DummyConcurrentLock.java (added)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/DummyConcurrentLock.java Mon Nov 16 21:24:41 2009
@@ -0,0 +1,51 @@
+package org.apache.lucene.util;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.Condition;
+import java.util.concurrent.locks.ReentrantLock;
+
+/**
+ * A dummy lock as a replacement for {@link ReentrantLock} to disable locking
+ */
+public final class DummyConcurrentLock implements Lock {
+
+ /** a default instance, can be always used, as this {@link Lock} is stateless. */
+ public static final DummyConcurrentLock INSTANCE = new DummyConcurrentLock();
+
+ public void lock() {}
+
+ public void lockInterruptibly() {}
+
+ public boolean tryLock() {
+ return true;
+ }
+
+ public boolean tryLock(long time, TimeUnit unit) {
+ return true;
+ }
+
+ public void unlock() {}
+
+ public Condition newCondition() {
+ throw new UnsupportedOperationException();
+ }
+
+}
Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/FieldCacheSanityChecker.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/FieldCacheSanityChecker.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/FieldCacheSanityChecker.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/FieldCacheSanityChecker.java Mon Nov 16 21:24:41 2009
@@ -78,10 +78,10 @@
/**
* Quick and dirty convenience method that instantiates an instance with
- * "good defaults" and uses it to test the CacheEntry[]
+ * "good defaults" and uses it to test the CacheEntrys
* @see #check
*/
- public static Insanity[] checkSanity(CacheEntry[] cacheEntries) {
+ public static Insanity[] checkSanity(CacheEntry... cacheEntries) {
FieldCacheSanityChecker sanityChecker = new FieldCacheSanityChecker();
// doesn't check for interned
sanityChecker.setRamUsageEstimator(new RamUsageEstimator(false));
@@ -96,7 +96,7 @@
* (:TODO: is this a bad idea? are we masking a real problem?)
* </p>
*/
- public Insanity[] check(CacheEntry[] cacheEntries) {
+ public Insanity[] check(CacheEntry... cacheEntries) {
if (null == cacheEntries || 0 == cacheEntries.length)
return new Insanity[0];
@@ -324,7 +324,7 @@
private final InsanityType type;
private final String msg;
private final CacheEntry[] entries;
- public Insanity(InsanityType type, String msg, CacheEntry[] entries) {
+ public Insanity(InsanityType type, String msg, CacheEntry... entries) {
if (null == type) {
throw new IllegalArgumentException
("Insanity requires non-null InsanityType");
Added: lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/NamedThreadFactory.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/NamedThreadFactory.java?rev=880963&view=auto
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/NamedThreadFactory.java (added)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/NamedThreadFactory.java Mon Nov 16 21:24:41 2009
@@ -0,0 +1,67 @@
+package org.apache.lucene.util;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.concurrent.Executors;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.atomic.AtomicInteger;
+
+/**
+ * A default {@link ThreadFactory} implementation that accepts the name prefix
+ * of the created threads as a constructor argument. Otherwise, this factory
+ * yields the same semantics as the thread factory returned by
+ * {@link Executors#defaultThreadFactory()}.
+ */
+public class NamedThreadFactory implements ThreadFactory {
+ private static final AtomicInteger threadPoolNumber = new AtomicInteger(1);
+ private final ThreadGroup group;
+ private final AtomicInteger threadNumber = new AtomicInteger(1);
+ private static final String NAME_PATTERN = "%s-%d-thread";
+ private final String threadNamePrefix;
+
+ /**
+ * Creates a new {@link NamedThreadFactory} instance
+ *
+ * @param threadNamePrefix the name prefix assigned to each thread created.
+ */
+ public NamedThreadFactory(String threadNamePrefix) {
+ final SecurityManager s = System.getSecurityManager();
+ group = (s != null) ? s.getThreadGroup() : Thread.currentThread()
+ .getThreadGroup();
+ this.threadNamePrefix = String.format(NAME_PATTERN,
+ checkPrefix(threadNamePrefix), threadPoolNumber.getAndIncrement());
+ }
+
+ private static String checkPrefix(String prefix) {
+ return prefix == null || prefix.length() == 0 ? "Lucene" : prefix;
+ }
+
+ /**
+ * Creates a new {@link Thread}
+ *
+ * @see java.util.concurrent.ThreadFactory#newThread(java.lang.Runnable)
+ */
+ public Thread newThread(Runnable r) {
+ final Thread t = new Thread(group, r, String.format("%s-%d",
+ this.threadNamePrefix, threadNumber.getAndIncrement()), 0);
+ t.setDaemon(false);
+ t.setPriority(Thread.NORM_PRIORITY);
+ return t;
+ }
+
+}
Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/SimpleStringInterner.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/SimpleStringInterner.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/SimpleStringInterner.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/SimpleStringInterner.java Mon Nov 16 21:24:41 2009
@@ -46,7 +46,6 @@
this.maxChainLength = Math.max(2,maxChainLength);
}
- // @Override
@Override
public String intern(String s) {
int h = s.hashCode();
Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/SortedVIntList.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/SortedVIntList.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/SortedVIntList.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/SortedVIntList.java Mon Nov 16 21:24:41 2009
@@ -50,7 +50,7 @@
*
* @param sortedInts A sorted array of non negative integers.
*/
- public SortedVIntList(int[] sortedInts) {
+ public SortedVIntList(int... sortedInts) {
this(sortedInts, sortedInts.length);
}
Added: lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/ThreadInterruptedException.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/ThreadInterruptedException.java?rev=880963&view=auto
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/ThreadInterruptedException.java (added)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/ThreadInterruptedException.java Mon Nov 16 21:24:41 2009
@@ -0,0 +1,30 @@
+package org.apache.lucene.util;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Thrown by lucene on detecting that Thread.interrupt() had
+ * been called. Unlike Java's InterruptedException, this
+ * exception is not checked..
+ */
+
+public final class ThreadInterruptedException extends RuntimeException {
+ public ThreadInterruptedException(InterruptedException ie) {
+ super(ie);
+ }
+}
Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/Version.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/Version.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/Version.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/Version.java Mon Nov 16 21:24:41 2009
@@ -44,6 +44,9 @@
/** Match settings and bugs in Lucene's 3.0 release. */
LUCENE_30,
+
+ /** Match settings and bugs in Lucene's 3.1 release. */
+ LUCENE_31,
/* Add new constants for later versions **here** to respect order! */
Modified: lucene/java/branches/flex_1458/src/site/changes/changes2html.pl
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/site/changes/changes2html.pl?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/site/changes/changes2html.pl (original)
+++ lucene/java/branches/flex_1458/src/site/changes/changes2html.pl Mon Nov 16 21:24:41 2009
@@ -614,7 +614,8 @@
'2.2.0' => '2007-06-19', '2.3.0' => '2008-01-21',
'2.3.1' => '2008-02-22', '2.3.2' => '2008-05-05',
'2.4.0' => '2008-10-06', '2.4.1' => '2009-03-09',
- '2.9.0' => '2009-09-23');
+ '2.9.0' => '2009-09-23', '2.9.1' => '2009-11-06',
+ '3.0.0' => '2009-11-25');
}
Modified: lucene/java/branches/flex_1458/src/site/src/documentation/content/xdocs/fileformats.xml
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/site/src/documentation/content/xdocs/fileformats.xml?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/site/src/documentation/content/xdocs/fileformats.xml (original)
+++ lucene/java/branches/flex_1458/src/site/src/documentation/content/xdocs/fileformats.xml Mon Nov 16 21:24:41 2009
@@ -12,7 +12,7 @@
<p>
This document defines the index file formats used
- in Lucene version 2.9. If you are using a different
+ in Lucene version 3.1. If you are using a different
version of Lucene, please consult the copy of
<code>docs/fileformats.html</code>
that was distributed
@@ -27,7 +27,7 @@
languages</a>. If these versions are to remain compatible with Apache
Lucene, then a language-independent definition of the Lucene index
format is required. This document thus attempts to provide a
- complete and independent definition of the Apache Lucene 2.9 file
+ complete and independent definition of the Apache Lucene 3.1 file
formats.
</p>
@@ -1259,7 +1259,8 @@
<li>low order bit is one for tokenized fields</li>
<li>second bit is one for fields containing binary data</li>
<li>third bit is one for fields with compression option enabled
- (if compression is enabled, the algorithm used is ZLIB)</li>
+ (if compression is enabled, the algorithm used is ZLIB),
+ only available for indexes until Lucene version 2.9.x</li>
</ul>
</p>
<p>Value -->
Modified: lucene/java/branches/flex_1458/src/site/src/documentation/content/xdocs/index.xml
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/site/src/documentation/content/xdocs/index.xml?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/site/src/documentation/content/xdocs/index.xml (original)
+++ lucene/java/branches/flex_1458/src/site/src/documentation/content/xdocs/index.xml Mon Nov 16 21:24:41 2009
@@ -6,7 +6,7 @@
<body>
<p>
- This is the official documentation for Lucene Java 2.9 <BR/>
+ This is the official documentation for Lucene Java 3.1 <BR/>
Please use the menu on the left to access the Javadocs and different documents.
</p>
<p>
Modified: lucene/java/branches/flex_1458/src/site/src/documentation/content/xdocs/scoring.xml
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/site/src/documentation/content/xdocs/scoring.xml?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/site/src/documentation/content/xdocs/scoring.xml (original)
+++ lucene/java/branches/flex_1458/src/site/src/documentation/content/xdocs/scoring.xml Mon Nov 16 21:24:41 2009
@@ -147,11 +147,8 @@
control finally passes to the <a href="api/core/org/apache/lucene/search/Weight.html">Weight</a> implementation and its
<a href="api/core/org/apache/lucene/search/Scorer.html">Scorer</a> instance. In the case of any type of
<a href="api/core/org/apache/lucene/search/BooleanQuery.html">BooleanQuery</a>, scoring is handled by the
- <a href="http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/BooleanQuery.java?view=log">BooleanWeight2</a> (link goes to ViewVC BooleanQuery java code which contains the BooleanWeight2 inner class),
- unless
- <a href="api/core/org/apache/lucene/search/Weight.html#scoresDocsOutOfOrder()">
- Weight#scoresDocsOutOfOrder()</a> method is set to true,
- in which case the
+ <a href="http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/BooleanQuery.java?view=log">BooleanWeight2</a>
+ (link goes to ViewVC BooleanQuery java code which contains the BooleanWeight2 inner class) or
<a href="http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/BooleanQuery.java?view=log">BooleanWeight</a>
(link goes to ViewVC BooleanQuery java code, which contains the BooleanWeight inner class) from the 1.4 version of Lucene is used by default.
See <a href="http://svn.apache.org/repos/asf/lucene/java/trunk/CHANGES.txt">CHANGES.txt</a> under release 1.9 RC1 for more information on choosing which Scorer to use.
Modified: lucene/java/branches/flex_1458/src/site/src/documentation/content/xdocs/site.xml
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/site/src/documentation/content/xdocs/site.xml?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/site/src/documentation/content/xdocs/site.xml (original)
+++ lucene/java/branches/flex_1458/src/site/src/documentation/content/xdocs/site.xml Mon Nov 16 21:24:41 2009
@@ -82,6 +82,7 @@
<javadoc-contrib-xml-query-parser label="XML Query Parser" href="ext:javadocs-contrib-xml-query-parser"/>
</javadoc-contrib>
</javadoc>
+ <systemrequirements label="System Requirements" href="systemrequirements.html"/>
<contributions label="Contributions" href="contributions.html"/>
<faq label="FAQ" href="ext:faq" />
<file-formats label="File Formats" href="fileformats.html"/>
Added: lucene/java/branches/flex_1458/src/site/src/documentation/content/xdocs/systemrequirements.xml
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/site/src/documentation/content/xdocs/systemrequirements.xml?rev=880963&view=auto
==============================================================================
--- lucene/java/branches/flex_1458/src/site/src/documentation/content/xdocs/systemrequirements.xml (added)
+++ lucene/java/branches/flex_1458/src/site/src/documentation/content/xdocs/systemrequirements.xml Mon Nov 16 21:24:41 2009
@@ -0,0 +1,29 @@
+<?xml version="1.0"?>
+<document>
+<header><title>Apache Lucene - System Requirements</title></header>
+<properties>
+<author email="gsingers@apache.org">Grant Ingersoll, Uwe Schindler</author>
+</properties>
+<body>
+ <!-- <section id="Code Coverage"><title>Code Coverage</title>
+ <p>Code Coverage reports are available <a
+ href="">here</a></p>
+ </section> -->
+<section id="System Requirements"><title>System Requirements</title>
+<p>
+ Lucene Java 3.0.0 has the following minimum requirements:
+ <ul>
+ <li>Java 1.5.x or greater.</li>
+ <li>ANT 1.7.0 or greater.</li>
+ <li>JUnit 3.8.2 if you wish to run the unit tests.</li>
+ <li>CPU, Disk and Memory requirements are based on the many choices made in implementing Lucene (document size, number of documents, and number of hits retrieved to name a few.)
+ The benchmarks page has some information related to performance on particular platforms.</li>
+ </ul>
+</p>
+<p>Contrib modules may have other requirements, refer to their documentation and build files for information.</p>
+
+</section>
+
+
+</body>
+</document>
Modified: lucene/java/branches/flex_1458/src/site/src/documentation/content/xdocs/tabs.xml
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/site/src/documentation/content/xdocs/tabs.xml?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/site/src/documentation/content/xdocs/tabs.xml (original)
+++ lucene/java/branches/flex_1458/src/site/src/documentation/content/xdocs/tabs.xml Mon Nov 16 21:24:41 2009
@@ -42,7 +42,7 @@
<!--
<tab label="Lucene 2.3.0 Documentation" href="http://lucene.apache.org/java/2_3_0/"/>
-->
- <tab label="Lucene 2.9 Documentation" dir=""/>
+ <tab label="Lucene 3.1 Documentation" dir=""/>
<!--
Modified: lucene/java/branches/flex_1458/src/test/org/apache/lucene/TestSnapshotDeletionPolicy.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/test/org/apache/lucene/TestSnapshotDeletionPolicy.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/test/org/apache/lucene/TestSnapshotDeletionPolicy.java (original)
+++ lucene/java/branches/flex_1458/src/test/org/apache/lucene/TestSnapshotDeletionPolicy.java Mon Nov 16 21:24:41 2009
@@ -36,7 +36,7 @@
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.TestIndexWriter;
import org.apache.lucene.index.SnapshotDeletionPolicy;
-
+import org.apache.lucene.util.ThreadInterruptedException;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util._TestUtil;
@@ -141,8 +141,7 @@
try {
Thread.sleep(1);
} catch (InterruptedException ie) {
- Thread.currentThread().interrupt();
- throw new RuntimeException(ie);
+ throw new ThreadInterruptedException(ie);
}
}
}
Propchange: lucene/java/branches/flex_1458/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Nov 16 21:24:41 2009
@@ -1,3 +1,4 @@
/lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:748824
/lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:829134,829881,831036
-/lucene/java/trunk/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:824912-825292,826213-833960
+/lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:880793
+/lucene/java/trunk/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:824912-825292,826213-833960,880727-880846
Propchange: lucene/java/branches/flex_1458/src/test/org/apache/lucene/document/TestDateTools.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Nov 16 21:24:41 2009
@@ -1,3 +1,4 @@
/lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/document/TestDateTools.java:748824
/lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/document/TestDateTools.java:829134,829881,831036
-/lucene/java/trunk/src/test/org/apache/lucene/document/TestDateTools.java:824912-825292,826213-833960
+/lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/document/TestDateTools.java:880793
+/lucene/java/trunk/src/test/org/apache/lucene/document/TestDateTools.java:824912-825292,826213-833960,880727-880846
Propchange: lucene/java/branches/flex_1458/src/test/org/apache/lucene/document/TestNumberTools.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Nov 16 21:24:41 2009
@@ -1,3 +1,4 @@
/lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/document/TestNumberTools.java:748824
/lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/document/TestNumberTools.java:829134,829881,831036
-/lucene/java/trunk/src/test/org/apache/lucene/document/TestNumberTools.java:824912-825292,826213-833960
+/lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/document/TestNumberTools.java:880793
+/lucene/java/trunk/src/test/org/apache/lucene/document/TestNumberTools.java:824912-825292,826213-833960,880727-880846
Propchange: lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Nov 16 21:24:41 2009
@@ -1,3 +1,4 @@
/lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:748824
/lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:829134,829881,831036
-/lucene/java/trunk/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:824912-825292,826213-833960
+/lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:880793
+/lucene/java/trunk/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:824912-825292,826213-833960,880727-880846
Modified: lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestIndexReader.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestIndexReader.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestIndexReader.java (original)
+++ lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestIndexReader.java Mon Nov 16 21:24:41 2009
@@ -1766,8 +1766,25 @@
// expected
}
}
+ }
- r2.close();
+ // LUCENE-2046
+ public void testPrepareCommitIsCurrent() throws Throwable {
+ Directory dir = new MockRAMDirectory();
+ IndexWriter writer = new IndexWriter(dir, new WhitespaceAnalyzer(), IndexWriter.MaxFieldLength.UNLIMITED);
+ Document doc = new Document();
+ writer.addDocument(doc);
+ IndexReader r = IndexReader.open(dir, true);
+ assertTrue(r.isCurrent());
+ writer.addDocument(doc);
+ writer.prepareCommit();
+ assertTrue(r.isCurrent());
+ IndexReader r2 = r.reopen();
+ assertTrue(r == r2);
+ writer.commit();
+ assertFalse(r.isCurrent());
+ writer.close();
+ r.close();
dir.close();
}
}
Modified: lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestIndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestIndexWriter.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestIndexWriter.java (original)
+++ lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestIndexWriter.java Mon Nov 16 21:24:41 2009
@@ -64,10 +64,10 @@
import org.apache.lucene.store.MockRAMDirectory;
import org.apache.lucene.store.RAMDirectory;
import org.apache.lucene.store.SingleInstanceLockFactory;
-import org.apache.lucene.store.NoLockFactory;
import org.apache.lucene.util.UnicodeUtil;
import org.apache.lucene.util._TestUtil;
import org.apache.lucene.util.Version;
+import org.apache.lucene.util.ThreadInterruptedException;
public class TestIndexWriter extends LuceneTestCase {
public TestIndexWriter(String name) {
@@ -526,6 +526,7 @@
infos.read(dir);
new IndexFileDeleter(dir, new KeepOnlyLastCommitDeletionPolicy(), infos, null, null, Codecs.getDefault());
String[] endFiles = dir.listAll();
+
Arrays.sort(startFiles);
Arrays.sort(endFiles);
@@ -2217,8 +2218,7 @@
try {
Thread.sleep(1);
} catch (InterruptedException ie) {
- Thread.currentThread().interrupt();
- throw new RuntimeException(ie);
+ throw new ThreadInterruptedException(ie);
}
if (fullCount++ >= 5)
break;
@@ -3510,7 +3510,6 @@
TermPositions tps = s.getIndexReader().termPositions(new Term("field", "a"));
assertTrue(tps.next());
assertEquals(1, tps.freq());
- // would be -1 if we called w.setAllowMinus1Position();
assertEquals(0, tps.nextPosition());
w.close();
@@ -4322,6 +4321,10 @@
assertTrue(dir.fileExists("myrandomfile"));
+ // Make sure this does not copy myrandomfile:
+ Directory dir2 = new RAMDirectory(dir);
+ assertTrue(!dir2.fileExists("myrandomfile"));
+
} finally {
dir.close();
_TestUtil.rmDir(indexDir);
@@ -4365,60 +4368,77 @@
private class IndexerThreadInterrupt extends Thread {
volatile boolean failed;
volatile boolean finish;
+
+ boolean allowInterrupt = false;
+
@Override
public void run() {
RAMDirectory dir = new RAMDirectory();
IndexWriter w = null;
+ boolean first = true;
while(!finish) {
try {
- //IndexWriter.unlock(dir);
- w = new IndexWriter(dir, new WhitespaceAnalyzer(), IndexWriter.MaxFieldLength.UNLIMITED);
- ((ConcurrentMergeScheduler) w.getMergeScheduler()).setSuppressExceptions();
- //w.setInfoStream(System.out);
- w.setMaxBufferedDocs(2);
- w.setMergeFactor(2);
- Document doc = new Document();
- doc.add(new Field("field", "some text contents", Field.Store.YES, Field.Index.ANALYZED));
- for(int i=0;i<100;i++) {
- w.addDocument(doc);
- w.commit();
+
+ while(true) {
+ if (w != null) {
+ w.close();
+ }
+ w = new IndexWriter(dir, new WhitespaceAnalyzer(), IndexWriter.MaxFieldLength.UNLIMITED);
+
+ //((ConcurrentMergeScheduler) w.getMergeScheduler()).setSuppressExceptions();
+ if (!first && !allowInterrupt) {
+ // tell main thread it can interrupt us any time,
+ // starting now
+ allowInterrupt = true;
+ }
+
+ w.setMaxBufferedDocs(2);
+ w.setMergeFactor(2);
+ Document doc = new Document();
+ doc.add(new Field("field", "some text contents", Field.Store.YES, Field.Index.ANALYZED));
+ for(int i=0;i<100;i++) {
+ w.addDocument(doc);
+ w.commit();
+ }
+ w.close();
+ _TestUtil.checkIndex(dir);
+ IndexReader.open(dir, true).close();
+
+ if (first && !allowInterrupt) {
+ // Strangely, if we interrupt a thread before
+ // all classes are loaded, the class loader
+ // seems to do scary things with the interrupt
+ // status. In java 1.5, it'll throw an
+ // incorrect ClassNotFoundException. In java
+ // 1.6, it'll silently clear the interrupt.
+ // So, on first iteration through here we
+ // don't open ourselves up for interrupts
+ // until we've done the above loop.
+ allowInterrupt = true;
+ first = false;
+ }
}
- } catch (RuntimeException re) {
+ } catch (ThreadInterruptedException re) {
Throwable e = re.getCause();
- if (e instanceof InterruptedException) {
- // Make sure IW restored interrupted bit
- if (!interrupted()) {
- System.out.println("FAILED; InterruptedException hit but thread.interrupted() was false");
- e.printStackTrace(System.out);
- failed = true;
- break;
- }
- } else {
- System.out.println("FAILED; unexpected exception");
+ assertTrue(e instanceof InterruptedException);
+ if (finish) {
+ break;
+ }
+
+ // Make sure IW cleared the interrupted bit
+ // TODO: remove that false once test is fixed for real
+ if (false && interrupted()) {
+ System.out.println("FAILED; InterruptedException hit but thread.interrupted() was true");
e.printStackTrace(System.out);
failed = true;
break;
}
+
} catch (Throwable t) {
System.out.println("FAILED; unexpected exception");
t.printStackTrace(System.out);
failed = true;
break;
- } finally {
- try {
- // Clear interrupt if pending
- synchronized(this) {
- interrupted();
- if (w != null) {
- w.close();
- }
- }
- } catch (Throwable t) {
- System.out.println("FAILED; unexpected exception during close");
- t.printStackTrace(System.out);
- failed = true;
- break;
- }
}
}
@@ -4447,16 +4467,24 @@
IndexerThreadInterrupt t = new IndexerThreadInterrupt();
t.setDaemon(true);
t.start();
- for(int i=0;i<100;i++) {
+
+ // issue 100 interrupts to child thread
+ int i = 0;
+ while(i < 100) {
Thread.sleep(1);
- synchronized(t) {
+
+ if (t.allowInterrupt) {
+ i++;
+ t.allowInterrupt = false;
t.interrupt();
}
+ if (!t.isAlive()) {
+ break;
+ }
}
+ t.allowInterrupt = false;
t.finish = true;
- synchronized(t) {
- t.interrupt();
- }
+ t.interrupt();
t.join();
assertFalse(t.failed);
}
Modified: lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestIndexWriterReader.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestIndexWriterReader.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestIndexWriterReader.java (original)
+++ lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestIndexWriterReader.java Mon Nov 16 21:24:41 2009
@@ -38,6 +38,7 @@
import org.apache.lucene.store.AlreadyClosedException;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util._TestUtil;
+import org.apache.lucene.util.ThreadInterruptedException;
public class TestIndexWriterReader extends LuceneTestCase {
static PrintStream infoStream;
@@ -331,7 +332,7 @@
try {
threads[i].join();
} catch (InterruptedException ie) {
- Thread.currentThread().interrupt();
+ throw new ThreadInterruptedException(ie);
}
}
}
@@ -373,7 +374,7 @@
try {
threads[i].join();
} catch (InterruptedException ie) {
- Thread.currentThread().interrupt();
+ throw new ThreadInterruptedException(ie);
}
}
Modified: lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestTermVectorsReader.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestTermVectorsReader.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestTermVectorsReader.java (original)
+++ lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestTermVectorsReader.java Mon Nov 16 21:24:41 2009
@@ -51,13 +51,13 @@
super(s);
}
- private class TestToken implements Comparable {
+ private class TestToken implements Comparable<TestToken> {
String text;
int pos;
int startOffset;
int endOffset;
- public int compareTo(Object other) {
- return pos - ((TestToken) other).pos;
+ public int compareTo(TestToken other) {
+ return pos - other.pos;
}
}
Modified: lucene/java/branches/flex_1458/src/test/org/apache/lucene/search/JustCompileSearch.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/test/org/apache/lucene/search/JustCompileSearch.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/test/org/apache/lucene/search/JustCompileSearch.java (original)
+++ lucene/java/branches/flex_1458/src/test/org/apache/lucene/search/JustCompileSearch.java Mon Nov 16 21:24:41 2009
@@ -141,6 +141,7 @@
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
}
+ @Override
public Document doc(int n, FieldSelector fieldSelector)
throws CorruptIndexException, IOException {
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
@@ -469,7 +470,7 @@
public void normalize(float norm) {
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
}
-
+
@Override
public float sumOfSquaredWeights() throws IOException {
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
Modified: lucene/java/branches/flex_1458/src/test/org/apache/lucene/search/TestDocIdSet.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/test/org/apache/lucene/search/TestDocIdSet.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/test/org/apache/lucene/search/TestDocIdSet.java (original)
+++ lucene/java/branches/flex_1458/src/test/org/apache/lucene/search/TestDocIdSet.java Mon Nov 16 21:24:41 2009
@@ -42,7 +42,7 @@
final int maxdoc=10;
final DocIdSet innerSet = new DocIdSet() {
- // @Override
+ @Override
public DocIdSetIterator iterator() {
return new DocIdSetIterator() {
@@ -53,13 +53,13 @@
return docid;
}
- //@Override
+ @Override
public int nextDoc() throws IOException {
docid++;
return docid < maxdoc ? docid : (docid = NO_MORE_DOCS);
}
- //@Override
+ @Override
public int advance(int target) throws IOException {
while (nextDoc() < target) {}
return docid;
@@ -70,7 +70,7 @@
DocIdSet filteredSet = new FilteredDocIdSet(innerSet){
- // @Override
+ @Override
protected boolean match(int docid) {
return docid%2 == 0; //validate only even docids
}
Modified: lucene/java/branches/flex_1458/src/test/org/apache/lucene/search/TestFieldCache.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/test/org/apache/lucene/search/TestFieldCache.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/test/org/apache/lucene/search/TestFieldCache.java (original)
+++ lucene/java/branches/flex_1458/src/test/org/apache/lucene/search/TestFieldCache.java Mon Nov 16 21:24:41 2009
@@ -99,7 +99,7 @@
assertSame("Second request with explicit parser return same array", bytes, cache.getBytes(reader, "theByte", FieldCache.DEFAULT_BYTE_PARSER));
assertTrue("bytes Size: " + bytes.length + " is not: " + NUM_DOCS, bytes.length == NUM_DOCS);
for (int i = 0; i < bytes.length; i++) {
- assertTrue(bytes[i] + " does not equal: " + (Byte.MAX_VALUE - i) + " doc=" + i, bytes[i] == (byte) (Byte.MAX_VALUE - i));
+ assertTrue(bytes[i] + " does not equal: " + (Byte.MAX_VALUE - i), bytes[i] == (byte) (Byte.MAX_VALUE - i));
}
Modified: lucene/java/branches/flex_1458/src/test/org/apache/lucene/search/TestFuzzyQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/test/org/apache/lucene/search/TestFuzzyQuery.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/test/org/apache/lucene/search/TestFuzzyQuery.java (original)
+++ lucene/java/branches/flex_1458/src/test/org/apache/lucene/search/TestFuzzyQuery.java Mon Nov 16 21:24:41 2009
@@ -343,7 +343,7 @@
assertEquals("Giga byte", searcher.doc(hits[0].doc).get("field"));
r.close();
}
-
+
private void addDoc(String text, IndexWriter writer) throws IOException {
Document doc = new Document();
doc.add(new Field("field", text, Field.Store.YES, Field.Index.ANALYZED));
Modified: lucene/java/branches/flex_1458/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java (original)
+++ lucene/java/branches/flex_1458/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java Mon Nov 16 21:24:41 2009
@@ -129,6 +129,7 @@
searcher.close();
indexStore.close();
+
}
private void add(String s, IndexWriter writer) throws IOException {
Modified: lucene/java/branches/flex_1458/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java (original)
+++ lucene/java/branches/flex_1458/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java Mon Nov 16 21:24:41 2009
@@ -32,6 +32,7 @@
import org.apache.lucene.store.RAMDirectory;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.Version;
+import org.apache.lucene.util.ThreadInterruptedException;
/**
* Tests the {@link TimeLimitingCollector}. This test checks (1) search
@@ -84,7 +85,8 @@
searcher = new IndexSearcher(directory, true);
String qtxt = "one";
- for (int i = 0; i < docText.length; i++) {
+ // start from 1, so that the 0th doc never matches
+ for (int i = 1; i < docText.length; i++) {
qtxt += ' ' + docText[i]; // large query so that search will be longer
}
QueryParser queryParser = new QueryParser(Version.LUCENE_CURRENT, FIELD_NAME, new WhitespaceAnalyzer());
@@ -327,8 +329,7 @@
try {
Thread.sleep(slowdown);
} catch (InterruptedException ie) {
- Thread.currentThread().interrupt();
- throw new RuntimeException(ie);
+ throw new ThreadInterruptedException(ie);
}
}
assert docId >= 0: " base=" + docBase + " doc=" + doc;
Modified: lucene/java/branches/flex_1458/src/test/org/apache/lucene/util/LocalizedTestCase.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/test/org/apache/lucene/util/LocalizedTestCase.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/test/org/apache/lucene/util/LocalizedTestCase.java (original)
+++ lucene/java/branches/flex_1458/src/test/org/apache/lucene/util/LocalizedTestCase.java Mon Nov 16 21:24:41 2009
@@ -65,19 +65,19 @@
this.testWithDifferentLocales = testWithDifferentLocales;
}
- // @Override
+ @Override
protected void setUp() throws Exception {
super.setUp();
Locale.setDefault(locale);
}
- // @Override
+ @Override
protected void tearDown() throws Exception {
Locale.setDefault(defaultLocale);
super.tearDown();
}
- // @Override
+ @Override
public void runBare() throws Throwable {
// Do the test with the default Locale (default)
try {
Modified: lucene/java/branches/flex_1458/src/test/org/apache/lucene/util/LuceneTestCase.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/test/org/apache/lucene/util/LuceneTestCase.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/test/org/apache/lucene/util/LuceneTestCase.java (original)
+++ lucene/java/branches/flex_1458/src/test/org/apache/lucene/util/LuceneTestCase.java Mon Nov 16 21:24:41 2009
@@ -201,7 +201,7 @@
return new Random(seed);
}
- // @Override
+ @Override
public void runBare() throws Throwable {
try {
seed = null;
Modified: lucene/java/branches/flex_1458/src/test/org/apache/lucene/util/TestNumericUtils.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/test/org/apache/lucene/util/TestNumericUtils.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/test/org/apache/lucene/util/TestNumericUtils.java (original)
+++ lucene/java/branches/flex_1458/src/test/org/apache/lucene/util/TestNumericUtils.java Mon Nov 16 21:24:41 2009
@@ -179,7 +179,7 @@
final OpenBitSet bits=useBitSet ? new OpenBitSet(upper-lower+1) : null;
NumericUtils.splitLongRange(new NumericUtils.LongRangeBuilder() {
- //@Override
+ @Override
public void addRange(long min, long max, int shift) {
assertTrue("min, max should be inside bounds", min>=lower && min<=upper && max>=lower && max<=upper);
if (useBitSet) for (long l=min; l<=max; l++) {
@@ -261,7 +261,7 @@
final OpenBitSet bits=useBitSet ? new OpenBitSet(upper-lower+1) : null;
NumericUtils.splitIntRange(new NumericUtils.IntRangeBuilder() {
- //@Override
+ @Override
public void addRange(int min, int max, int shift) {
assertTrue("min, max should be inside bounds", min>=lower && min<=upper && max>=lower && max<=upper);
if (useBitSet) for (int i=min; i<=max; i++) {
Modified: lucene/java/branches/flex_1458/src/test/org/apache/lucene/util/TestPriorityQueue.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/test/org/apache/lucene/util/TestPriorityQueue.java?rev=880963&r1=880962&r2=880963&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/test/org/apache/lucene/util/TestPriorityQueue.java (original)
+++ lucene/java/branches/flex_1458/src/test/org/apache/lucene/util/TestPriorityQueue.java Mon Nov 16 21:24:41 2009
@@ -61,7 +61,7 @@
int last = Integer.MIN_VALUE;
for (int i = 0; i < count; i++)
{
- Integer next = (Integer)pq.pop();
+ Integer next = pq.pop();
assertTrue(next.intValue() >= last);
last = next.intValue();
sum2 += last;