lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r836248 - in /lucene/java/trunk: ./ contrib/analyzers/common/src/java/org/apache/lucene/analysis/fa/ src/java/org/apache/lucene/search/ src/java/org/apache/lucene/search/function/ src/java/org/apache/lucene/search/spans/ src/java/org/apache...
Date Sat, 14 Nov 2009 19:26:49 GMT
Author: uschindler
Date: Sat Nov 14 19:26:49 2009
New Revision: 836248

URL: http://svn.apache.org/viewvc?rev=836248&view=rev
Log:
LUCENE-2052: add varargs where possible

Modified:
    lucene/java/trunk/CHANGES.txt
    lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/fa/PersianAnalyzer.java
    lucene/java/trunk/src/java/org/apache/lucene/search/ConjunctionScorer.java
    lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheTermsFilter.java
    lucene/java/trunk/src/java/org/apache/lucene/search/Query.java
    lucene/java/trunk/src/java/org/apache/lucene/search/function/CustomScoreQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanOrQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/util/FieldCacheSanityChecker.java
    lucene/java/trunk/src/java/org/apache/lucene/util/SortedVIntList.java

Modified: lucene/java/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/trunk/CHANGES.txt?rev=836248&r1=836247&r2=836248&view=diff
==============================================================================
--- lucene/java/trunk/CHANGES.txt (original)
+++ lucene/java/trunk/CHANGES.txt Sat Nov 14 19:26:49 2009
@@ -24,6 +24,12 @@
   status on the thread is cleared when this exception is thrown.
   (Mike McCandless)
 
+* LUCENE-2052: Some methods in Lucene core were changed to accept
+  Java 5 varargs. This is not a backwards compatibility problem as
+  long as you not try to override such a method. We left common
+  overridden methods unchanged and added varargs to constructors,
+  static, or final methods (MultiSearcher,...).  (Uwe Schindler)
+
 Changes in runtime behavior
 
 * LUCENE-1677: Remove the system property to set SegmentReader class

Modified: lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/fa/PersianAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/fa/PersianAnalyzer.java?rev=836248&r1=836247&r2=836248&view=diff
==============================================================================
--- lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/fa/PersianAnalyzer.java
(original)
+++ lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/fa/PersianAnalyzer.java
Sat Nov 14 19:26:49 2009
@@ -121,7 +121,7 @@
   /**
    * Builds an analyzer with the given stop words.
    */
-  public PersianAnalyzer(Version matchVersion, String[] stopwords) {
+  public PersianAnalyzer(Version matchVersion, String... stopwords) {
     stoptable = StopFilter.makeStopSet(stopwords);
     this.matchVersion = matchVersion;
   }

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/ConjunctionScorer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/ConjunctionScorer.java?rev=836248&r1=836247&r2=836248&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/ConjunctionScorer.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/ConjunctionScorer.java Sat Nov 14
19:26:49 2009
@@ -33,7 +33,7 @@
     this(similarity, scorers.toArray(new Scorer[scorers.size()]));
   }
 
-  public ConjunctionScorer(Similarity similarity, Scorer[] scorers) throws IOException {
+  public ConjunctionScorer(Similarity similarity, Scorer... scorers) throws IOException {
     super(similarity);
     this.scorers = scorers;
     coord = similarity.coord(scorers.length, scorers.length);

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheTermsFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheTermsFilter.java?rev=836248&r1=836247&r2=836248&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheTermsFilter.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheTermsFilter.java Sat Nov
14 19:26:49 2009
@@ -97,7 +97,7 @@
   private String field;
   private String[] terms;
 
-  public FieldCacheTermsFilter(String field, String[] terms) {
+  public FieldCacheTermsFilter(String field, String... terms) {
     this.field = field;
     this.terms = terms;
   }

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/Query.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/Query.java?rev=836248&r1=836247&r2=836248&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/Query.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/Query.java Sat Nov 14 19:26:49 2009
@@ -178,7 +178,7 @@
    *
    *<p>A utility for use by {@link #combine(Query[])} implementations.
    */
-  public static Query mergeBooleanQueries(BooleanQuery[] queries) {
+  public static Query mergeBooleanQueries(BooleanQuery... queries) {
     HashSet<BooleanClause> allClauses = new HashSet<BooleanClause>();
     for (BooleanQuery booleanQuery : queries) {
       for (BooleanClause clause : booleanQuery) {

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/function/CustomScoreQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/function/CustomScoreQuery.java?rev=836248&r1=836247&r2=836248&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/function/CustomScoreQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/function/CustomScoreQuery.java Sat
Nov 14 19:26:49 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/trunk/src/java/org/apache/lucene/search/spans/SpanOrQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanOrQuery.java?rev=836248&r1=836247&r2=836248&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanOrQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanOrQuery.java Sat Nov 14
19:26:49 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/trunk/src/java/org/apache/lucene/util/FieldCacheSanityChecker.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/util/FieldCacheSanityChecker.java?rev=836248&r1=836247&r2=836248&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/util/FieldCacheSanityChecker.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/util/FieldCacheSanityChecker.java Sat Nov
14 19:26:49 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");

Modified: lucene/java/trunk/src/java/org/apache/lucene/util/SortedVIntList.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/util/SortedVIntList.java?rev=836248&r1=836247&r2=836248&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/util/SortedVIntList.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/util/SortedVIntList.java Sat Nov 14 19:26:49
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);
   }
 



Mime
View raw message