jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1063801 - in /jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene: AbstractExcerpt.java FieldComparatorBase.java MoreLikeThis.java SearchIndex.java SharedFieldComparatorSource.java
Date Wed, 26 Jan 2011 17:15:42 GMT
Author: mduerig
Date: Wed Jan 26 17:15:41 2011
New Revision: 1063801

URL: http://svn.apache.org/viewvc?rev=1063801&view=rev
Log:
JCR-2415: Update Lucene to 3.0
- removed uneccessary casts

Modified:
    jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/AbstractExcerpt.java
    jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/FieldComparatorBase.java
    jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MoreLikeThis.java
    jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
    jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SharedFieldComparatorSource.java

Modified: jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/AbstractExcerpt.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/AbstractExcerpt.java?rev=1063801&r1=1063800&r2=1063801&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/AbstractExcerpt.java
(original)
+++ jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/AbstractExcerpt.java
Wed Jan 26 17:15:41 2011
@@ -234,8 +234,8 @@ public abstract class AbstractExcerpt im
         TokenStream ts = index.getTextAnalyzer().tokenStream("", r);
         try {
             while (ts.incrementToken()) {
-                OffsetAttribute offset = (OffsetAttribute) ts.getAttribute(OffsetAttribute.class);
-                TermAttribute term = (TermAttribute) ts.getAttribute(TermAttribute.class);
+                OffsetAttribute offset = ts.getAttribute(OffsetAttribute.class);
+                TermAttribute term = ts.getAttribute(TermAttribute.class);
                 String termText = term.term();
                 TermVectorOffsetInfo[] info = termMap.get(termText);
                 if (info == null) {

Modified: jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/FieldComparatorBase.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/FieldComparatorBase.java?rev=1063801&r1=1063800&r2=1063801&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/FieldComparatorBase.java
(original)
+++ jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/FieldComparatorBase.java
Wed Jan 26 17:15:41 2011
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.jackrabbit.core.query.lucene;
 
 import org.apache.lucene.search.FieldComparator;

Modified: jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MoreLikeThis.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MoreLikeThis.java?rev=1063801&r1=1063800&r2=1063801&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MoreLikeThis.java
(original)
+++ jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MoreLikeThis.java
Wed Jan 26 17:15:41 2011
@@ -737,7 +737,7 @@ public final class MoreLikeThis {
         int tokenCount = 0;
         // for every token
         while (ts.incrementToken()) {
-            TermAttribute term = (TermAttribute) ts.getAttribute(TermAttribute.class);
+            TermAttribute term = ts.getAttribute(TermAttribute.class);
             String word =  term.term();
             tokenCount++;
             if (tokenCount > maxNumTokensParsed) {
@@ -748,7 +748,7 @@ public final class MoreLikeThis {
             }
 
             // increment frequency
-            Int cnt = (Int) termFreqMap.get(word);
+            Int cnt = termFreqMap.get(word);
             if (cnt == null) {
                 termFreqMap.put(word, new Int());
             } else {

Modified: jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java?rev=1063801&r1=1063800&r2=1063801&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
(original)
+++ jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
Wed Jan 26 17:15:41 2011
@@ -1382,9 +1382,11 @@ public class SearchIndex extends Abstrac
 
                                     // assume properties fields use SingleTokenStream
                                     TokenStream tokenStream = field.tokenStreamValue();
-                                    TermAttribute termAttribute = (TermAttribute) tokenStream.addAttribute(TermAttribute.class);
-                                    PayloadAttribute payloadAttribute = (PayloadAttribute)
tokenStream.addAttribute(PayloadAttribute.class);
+                                    TermAttribute termAttribute = tokenStream.addAttribute(TermAttribute.class);
+                                    PayloadAttribute payloadAttribute = tokenStream.addAttribute(PayloadAttribute.class);
                                     tokenStream.incrementToken();
+                                    tokenStream.end();
+                                    tokenStream.close();
 
                                     String value = new String(termAttribute.termBuffer(),
0, termAttribute.termLength());
                                     if (value.startsWith(namePrefix)) {

Modified: jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SharedFieldComparatorSource.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SharedFieldComparatorSource.java?rev=1063801&r1=1063800&r2=1063801&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SharedFieldComparatorSource.java
(original)
+++ jackrabbit/sandbox/JCR-2415-lucene-3.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SharedFieldComparatorSource.java
Wed Jan 26 17:15:41 2011
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.jackrabbit.core.query.lucene;
 
 import org.apache.jackrabbit.core.HierarchyManager;



Mime
View raw message