lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r820553 [2/4] - in /lucene/java/trunk: ./ contrib/analyzers/common/ 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/apac...
Date Thu, 01 Oct 2009 07:53:53 GMT
Modified: lucene/java/trunk/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/SentenceTokenizer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/SentenceTokenizer.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/SentenceTokenizer.java (original)
+++ lucene/java/trunk/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/SentenceTokenizer.java Thu Oct  1 07:53:43 2009
@@ -68,9 +68,9 @@
   }
   
   private void init() {
-    termAtt = (TermAttribute) addAttribute(TermAttribute.class);
-    offsetAtt = (OffsetAttribute) addAttribute(OffsetAttribute.class);
-    typeAtt = (TypeAttribute) addAttribute(TypeAttribute.class);    
+    termAtt = addAttribute(TermAttribute.class);
+    offsetAtt = addAttribute(OffsetAttribute.class);
+    typeAtt = addAttribute(TypeAttribute.class);    
   }
   
   public boolean incrementToken() throws IOException {

Modified: lucene/java/trunk/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/WordTokenFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/WordTokenFilter.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/WordTokenFilter.java (original)
+++ lucene/java/trunk/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/WordTokenFilter.java Thu Oct  1 07:53:43 2009
@@ -56,9 +56,9 @@
   public WordTokenFilter(TokenStream in) {
     super(in);
     this.wordSegmenter = new WordSegmenter();
-    termAtt = (TermAttribute) addAttribute(TermAttribute.class);
-    offsetAtt = (OffsetAttribute) addAttribute(OffsetAttribute.class);
-    typeAtt = (TypeAttribute) addAttribute(TypeAttribute.class);
+    termAtt = addAttribute(TermAttribute.class);
+    offsetAtt = addAttribute(OffsetAttribute.class);
+    typeAtt = addAttribute(TypeAttribute.class);
   }
   
   public boolean incrementToken() throws IOException {   

Modified: lucene/java/trunk/contrib/collation/src/java/org/apache/lucene/collation/CollationKeyFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/collation/src/java/org/apache/lucene/collation/CollationKeyFilter.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/collation/src/java/org/apache/lucene/collation/CollationKeyFilter.java (original)
+++ lucene/java/trunk/contrib/collation/src/java/org/apache/lucene/collation/CollationKeyFilter.java Thu Oct  1 07:53:43 2009
@@ -85,7 +85,7 @@
   public CollationKeyFilter(TokenStream input, Collator collator) {
     super(input);
     this.collator = collator;
-    termAtt = (TermAttribute) addAttribute(TermAttribute.class);
+    termAtt = addAttribute(TermAttribute.class);
   }
 
   public boolean incrementToken() throws IOException {

Modified: lucene/java/trunk/contrib/collation/src/java/org/apache/lucene/collation/ICUCollationKeyFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/collation/src/java/org/apache/lucene/collation/ICUCollationKeyFilter.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/collation/src/java/org/apache/lucene/collation/ICUCollationKeyFilter.java (original)
+++ lucene/java/trunk/contrib/collation/src/java/org/apache/lucene/collation/ICUCollationKeyFilter.java Thu Oct  1 07:53:43 2009
@@ -83,7 +83,7 @@
   public ICUCollationKeyFilter(TokenStream input, Collator collator) {
     super(input);
     this.collator = collator;
-    termAtt = (TermAttribute) addAttribute(TermAttribute.class);
+    termAtt = addAttribute(TermAttribute.class);
   }
 
   public boolean incrementToken() throws IOException {

Modified: lucene/java/trunk/contrib/fast-vector-highlighter/src/test/org/apache/lucene/search/vectorhighlight/AbstractTestCase.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/fast-vector-highlighter/src/test/org/apache/lucene/search/vectorhighlight/AbstractTestCase.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/fast-vector-highlighter/src/test/org/apache/lucene/search/vectorhighlight/AbstractTestCase.java (original)
+++ lucene/java/trunk/contrib/fast-vector-highlighter/src/test/org/apache/lucene/search/vectorhighlight/AbstractTestCase.java Thu Oct  1 07:53:43 2009
@@ -195,8 +195,8 @@
       ch = 0;
     }
 
-    TermAttribute termAtt = (TermAttribute) addAttribute(TermAttribute.class);
-    OffsetAttribute offsetAtt = (OffsetAttribute) addAttribute(OffsetAttribute.class);
+    TermAttribute termAtt = addAttribute(TermAttribute.class);
+    OffsetAttribute offsetAtt = addAttribute(OffsetAttribute.class);
     public boolean incrementToken() throws IOException {
       if( !getNextPartialSnippet() )
         return false;

Modified: lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/Highlighter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/Highlighter.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/Highlighter.java (original)
+++ lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/Highlighter.java Thu Oct  1 07:53:43 2009
@@ -217,8 +217,8 @@
 		ArrayList docFrags = new ArrayList();
 		StringBuffer newText=new StringBuffer();
 		
-	    TermAttribute termAtt = (TermAttribute) tokenStream.addAttribute(TermAttribute.class);
-	    OffsetAttribute offsetAtt = (OffsetAttribute) tokenStream.addAttribute(OffsetAttribute.class);
+	    TermAttribute termAtt = tokenStream.addAttribute(TermAttribute.class);
+	    OffsetAttribute offsetAtt = tokenStream.addAttribute(OffsetAttribute.class);
 	    tokenStream.addAttribute(PositionIncrementAttribute.class);
 	    tokenStream.reset();
 	    

Modified: lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/QueryScorer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/QueryScorer.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/QueryScorer.java (original)
+++ lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/QueryScorer.java Thu Oct  1 07:53:43 2009
@@ -175,8 +175,8 @@
    */
   public TokenStream init(TokenStream tokenStream) throws IOException {
     position = -1;
-    termAtt = (TermAttribute) tokenStream.addAttribute(TermAttribute.class);
-    posIncAtt = (PositionIncrementAttribute) tokenStream.addAttribute(PositionIncrementAttribute.class);
+    termAtt = tokenStream.addAttribute(TermAttribute.class);
+    posIncAtt = tokenStream.addAttribute(PositionIncrementAttribute.class);
     if(!skipInitExtractor) {
       if(fieldWeightedSpanTerms != null) {
         fieldWeightedSpanTerms.clear();

Modified: lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/QueryTermScorer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/QueryTermScorer.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/QueryTermScorer.java (original)
+++ lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/QueryTermScorer.java Thu Oct  1 07:53:43 2009
@@ -95,7 +95,7 @@
    * @see org.apache.lucene.search.highlight.Scorer#init(org.apache.lucene.analysis.TokenStream)
    */
   public TokenStream init(TokenStream tokenStream) {
-    termAtt = (TermAttribute) tokenStream.addAttribute(TermAttribute.class);
+    termAtt = tokenStream.addAttribute(TermAttribute.class);
     return null;
   }
 

Modified: lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/SimpleFragmenter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/SimpleFragmenter.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/SimpleFragmenter.java (original)
+++ lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/SimpleFragmenter.java Thu Oct  1 07:53:43 2009
@@ -47,7 +47,7 @@
    * @see org.apache.lucene.search.highlight.Fragmenter#start(java.lang.String, org.apache.lucene.analysis.TokenStream)
    */
   public void start(String originalText, TokenStream stream) {
-    offsetAtt = (OffsetAttribute) stream.addAttribute(OffsetAttribute.class);
+    offsetAtt = stream.addAttribute(OffsetAttribute.class);
     currentNumFrags = 1;
   }
 

Modified: lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/SimpleSpanFragmenter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/SimpleSpanFragmenter.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/SimpleSpanFragmenter.java (original)
+++ lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/SimpleSpanFragmenter.java Thu Oct  1 07:53:43 2009
@@ -101,8 +101,8 @@
     position = -1;
     currentNumFrags = 1;
     textSize = originalText.length();
-    termAtt = (TermAttribute) tokenStream.addAttribute(TermAttribute.class);
-    posIncAtt = (PositionIncrementAttribute) tokenStream.addAttribute(PositionIncrementAttribute.class);
-    offsetAtt = (OffsetAttribute) tokenStream.addAttribute(OffsetAttribute.class);
+    termAtt = tokenStream.addAttribute(TermAttribute.class);
+    posIncAtt = tokenStream.addAttribute(PositionIncrementAttribute.class);
+    offsetAtt = tokenStream.addAttribute(OffsetAttribute.class);
   }
 }

Modified: lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/TokenGroup.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/TokenGroup.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/TokenGroup.java (original)
+++ lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/TokenGroup.java Thu Oct  1 07:53:43 2009
@@ -41,8 +41,8 @@
   private TermAttribute termAtt;
 
   public TokenGroup(TokenStream tokenStream) {
-    offsetAtt = (OffsetAttribute) tokenStream.addAttribute(OffsetAttribute.class);
-    termAtt = (TermAttribute) tokenStream.addAttribute(TermAttribute.class);
+    offsetAtt = tokenStream.addAttribute(OffsetAttribute.class);
+    termAtt = tokenStream.addAttribute(TermAttribute.class);
   }
 
   void addToken(float score) {

Modified: lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/TokenSources.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/TokenSources.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/TokenSources.java (original)
+++ lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/TokenSources.java Thu Oct  1 07:53:43 2009
@@ -147,8 +147,8 @@
     
           StoredTokenStream(Token tokens[]) {
             this.tokens = tokens;
-            termAtt = (TermAttribute) addAttribute(TermAttribute.class);
-            offsetAtt = (OffsetAttribute) addAttribute(OffsetAttribute.class);
+            termAtt = addAttribute(TermAttribute.class);
+            offsetAtt = addAttribute(OffsetAttribute.class);
           }
     
           public boolean incrementToken() throws IOException {

Modified: lucene/java/trunk/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java (original)
+++ lucene/java/trunk/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java Thu Oct  1 07:53:43 2009
@@ -1316,9 +1316,9 @@
       private PositionIncrementAttribute posIncrAtt;
       private OffsetAttribute offsetAtt;
       {
-        termAtt = (TermAttribute) addAttribute(TermAttribute.class);
-        posIncrAtt = (PositionIncrementAttribute) addAttribute(PositionIncrementAttribute.class);
-        offsetAtt = (OffsetAttribute) addAttribute(OffsetAttribute.class);
+        termAtt = addAttribute(TermAttribute.class);
+        posIncrAtt = addAttribute(PositionIncrementAttribute.class);
+        offsetAtt = addAttribute(OffsetAttribute.class);
         lst = new ArrayList();
         Token t;
         t = createToken("hi", 0, 2);
@@ -1363,9 +1363,9 @@
       private PositionIncrementAttribute posIncrAtt;
       private OffsetAttribute offsetAtt;
       {
-        termAtt = (TermAttribute) addAttribute(TermAttribute.class);
-        posIncrAtt = (PositionIncrementAttribute) addAttribute(PositionIncrementAttribute.class);
-        offsetAtt = (OffsetAttribute) addAttribute(OffsetAttribute.class);
+        termAtt = addAttribute(TermAttribute.class);
+        posIncrAtt = addAttribute(PositionIncrementAttribute.class);
+        offsetAtt = addAttribute(OffsetAttribute.class);
         lst = new ArrayList();
         Token t;
         t = createToken("hispeed", 0, 8);
@@ -1686,13 +1686,13 @@
   public SynonymTokenizer(TokenStream realStream, Map synonyms) {
     this.realStream = realStream;
     this.synonyms = synonyms;
-    realTermAtt = (TermAttribute) realStream.addAttribute(TermAttribute.class);
-    realPosIncrAtt = (PositionIncrementAttribute) realStream.addAttribute(PositionIncrementAttribute.class);
-    realOffsetAtt = (OffsetAttribute) realStream.addAttribute(OffsetAttribute.class);
-
-    termAtt = (TermAttribute) addAttribute(TermAttribute.class);
-    posIncrAtt = (PositionIncrementAttribute) addAttribute(PositionIncrementAttribute.class);
-    offsetAtt = (OffsetAttribute) addAttribute(OffsetAttribute.class);
+    realTermAtt = realStream.addAttribute(TermAttribute.class);
+    realPosIncrAtt = realStream.addAttribute(PositionIncrementAttribute.class);
+    realOffsetAtt = realStream.addAttribute(OffsetAttribute.class);
+
+    termAtt = addAttribute(TermAttribute.class);
+    posIncrAtt = addAttribute(PositionIncrementAttribute.class);
+    offsetAtt = addAttribute(OffsetAttribute.class);
   }
 
   public boolean incrementToken() throws IOException {

Modified: lucene/java/trunk/contrib/lucli/src/java/lucli/LuceneMethods.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/lucli/src/java/lucli/LuceneMethods.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/lucli/src/java/lucli/LuceneMethods.java (original)
+++ lucene/java/trunk/contrib/lucli/src/java/lucli/LuceneMethods.java Thu Oct  1 07:53:43 2009
@@ -282,8 +282,8 @@
           int position = 0;
           // Tokenize field and add to postingTable
           TokenStream stream = analyzer.tokenStream(fieldName, reader);
-          TermAttribute termAtt = (TermAttribute) stream.addAttribute(TermAttribute.class);
-          PositionIncrementAttribute posIncrAtt = (PositionIncrementAttribute) stream.addAttribute(PositionIncrementAttribute.class);
+          TermAttribute termAtt = stream.addAttribute(TermAttribute.class);
+          PositionIncrementAttribute posIncrAtt = stream.addAttribute(PositionIncrementAttribute.class);
           
           try {
             while (stream.incrementToken()) {

Modified: lucene/java/trunk/contrib/memory/src/java/org/apache/lucene/index/memory/AnalyzerUtil.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/memory/src/java/org/apache/lucene/index/memory/AnalyzerUtil.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/memory/src/java/org/apache/lucene/index/memory/AnalyzerUtil.java (original)
+++ lucene/java/trunk/contrib/memory/src/java/org/apache/lucene/index/memory/AnalyzerUtil.java Thu Oct  1 07:53:43 2009
@@ -75,10 +75,10 @@
       public TokenStream tokenStream(final String fieldName, Reader reader) {
         return new TokenFilter(child.tokenStream(fieldName, reader)) {
           private int position = -1;
-          private TermAttribute termAtt = (TermAttribute) addAttribute(TermAttribute.class);
-          private PositionIncrementAttribute posIncrAtt = (PositionIncrementAttribute) addAttribute(PositionIncrementAttribute.class);
-          private OffsetAttribute offsetAtt = (OffsetAttribute) addAttribute(OffsetAttribute.class);
-          private TypeAttribute typeAtt = (TypeAttribute) addAttribute(TypeAttribute.class);
+          private TermAttribute termAtt = addAttribute(TermAttribute.class);
+          private PositionIncrementAttribute posIncrAtt = addAttribute(PositionIncrementAttribute.class);
+          private OffsetAttribute offsetAtt = addAttribute(OffsetAttribute.class);
+          private TypeAttribute typeAtt = addAttribute(TypeAttribute.class);
          
           public boolean incrementToken() throws IOException {
             boolean hasNext = input.incrementToken();
@@ -307,7 +307,7 @@
     // compute frequencies of distinct terms
     HashMap map = new HashMap();
     TokenStream stream = analyzer.tokenStream("", new StringReader(text));
-    TermAttribute termAtt = (TermAttribute) stream.addAttribute(TermAttribute.class);
+    TermAttribute termAtt = stream.addAttribute(TermAttribute.class);
     try {
       while (stream.incrementToken()) {
         MutableInteger freq = (MutableInteger) map.get(termAtt.term());

Modified: lucene/java/trunk/contrib/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java (original)
+++ lucene/java/trunk/contrib/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java Thu Oct  1 07:53:43 2009
@@ -276,8 +276,8 @@
     return new TokenStream() {
       private Iterator iter = keywords.iterator();
       private int start = 0;
-      private TermAttribute termAtt = (TermAttribute) addAttribute(TermAttribute.class);
-      private OffsetAttribute offsetAtt = (OffsetAttribute) addAttribute(OffsetAttribute.class);
+      private TermAttribute termAtt = addAttribute(TermAttribute.class);
+      private OffsetAttribute offsetAtt = addAttribute(OffsetAttribute.class);
       
       public boolean incrementToken() {
         if (!iter.hasNext()) return false;
@@ -338,9 +338,9 @@
       int numOverlapTokens = 0;
       int pos = -1;
       
-      TermAttribute termAtt = (TermAttribute) stream.addAttribute(TermAttribute.class);
-      PositionIncrementAttribute posIncrAttribute = (PositionIncrementAttribute) stream.addAttribute(PositionIncrementAttribute.class);
-      OffsetAttribute offsetAtt = (OffsetAttribute) stream.addAttribute(OffsetAttribute.class);
+      TermAttribute termAtt = stream.addAttribute(TermAttribute.class);
+      PositionIncrementAttribute posIncrAttribute = stream.addAttribute(PositionIncrementAttribute.class);
+      OffsetAttribute offsetAtt = stream.addAttribute(OffsetAttribute.class);
       
       stream.reset();
       while (stream.incrementToken()) {

Modified: lucene/java/trunk/contrib/memory/src/java/org/apache/lucene/index/memory/PatternAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/memory/src/java/org/apache/lucene/index/memory/PatternAnalyzer.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/memory/src/java/org/apache/lucene/index/memory/PatternAnalyzer.java (original)
+++ lucene/java/trunk/contrib/memory/src/java/org/apache/lucene/index/memory/PatternAnalyzer.java Thu Oct  1 07:53:43 2009
@@ -332,8 +332,8 @@
     private Matcher matcher;
     private int pos = 0;
     private static final Locale locale = Locale.getDefault();
-    private TermAttribute termAtt = (TermAttribute) addAttribute(TermAttribute.class);
-    private OffsetAttribute offsetAtt = (OffsetAttribute) addAttribute(OffsetAttribute.class);
+    private TermAttribute termAtt = addAttribute(TermAttribute.class);
+    private OffsetAttribute offsetAtt = addAttribute(OffsetAttribute.class);
     
     public PatternTokenizer(String str, Pattern pattern, boolean toLowerCase) {
       this.str = str;
@@ -390,8 +390,8 @@
     private final boolean toLowerCase;
     private final Set stopWords;
     private static final Locale locale = Locale.getDefault();
-    private TermAttribute termAtt = (TermAttribute) addAttribute(TermAttribute.class);
-    private OffsetAttribute offsetAtt = (OffsetAttribute) addAttribute(OffsetAttribute.class);
+    private TermAttribute termAtt = addAttribute(TermAttribute.class);
+    private OffsetAttribute offsetAtt = addAttribute(OffsetAttribute.class);
     
     public FastStringTokenizer(String str, boolean isLetter, boolean toLowerCase, Set stopWords) {
       this.str = str;

Modified: lucene/java/trunk/contrib/memory/src/java/org/apache/lucene/index/memory/SynonymTokenFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/memory/src/java/org/apache/lucene/index/memory/SynonymTokenFilter.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/memory/src/java/org/apache/lucene/index/memory/SynonymTokenFilter.java (original)
+++ lucene/java/trunk/contrib/memory/src/java/org/apache/lucene/index/memory/SynonymTokenFilter.java Thu Oct  1 07:53:43 2009
@@ -72,9 +72,9 @@
     this.synonyms = synonyms;
     this.maxSynonyms = maxSynonyms;
     
-    this.termAtt = (TermAttribute) addAttribute(TermAttribute.class);
-    this.typeAtt = (TypeAttribute) addAttribute(TypeAttribute.class);
-    this.posIncrAtt = (PositionIncrementAttribute) addAttribute(PositionIncrementAttribute.class);
+    this.termAtt = addAttribute(TermAttribute.class);
+    this.typeAtt = addAttribute(TypeAttribute.class);
+    this.posIncrAtt = addAttribute(PositionIncrementAttribute.class);
   }
   
   /** Returns the next token in the stream, or null at EOS. */

Modified: lucene/java/trunk/contrib/misc/src/java/org/apache/lucene/queryParser/analyzing/AnalyzingQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/misc/src/java/org/apache/lucene/queryParser/analyzing/AnalyzingQueryParser.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/misc/src/java/org/apache/lucene/queryParser/analyzing/AnalyzingQueryParser.java (original)
+++ lucene/java/trunk/contrib/misc/src/java/org/apache/lucene/queryParser/analyzing/AnalyzingQueryParser.java Thu Oct  1 07:53:43 2009
@@ -106,7 +106,7 @@
 
     // get Analyzer from superclass and tokenize the term
     TokenStream source = getAnalyzer().tokenStream(field, new StringReader(termStr));
-    TermAttribute termAtt = (TermAttribute) source.addAttribute(TermAttribute.class);
+    TermAttribute termAtt = source.addAttribute(TermAttribute.class);
     
     int countTokens = 0;
     while (true) {
@@ -188,7 +188,7 @@
     // get Analyzer from superclass and tokenize the term
     TokenStream source = getAnalyzer().tokenStream(field, new StringReader(termStr));
     List tlist = new ArrayList();
-    TermAttribute termAtt = (TermAttribute) source.addAttribute(TermAttribute.class);
+    TermAttribute termAtt = source.addAttribute(TermAttribute.class);
     
     while (true) {
       try {
@@ -234,7 +234,7 @@
       throws ParseException {
     // get Analyzer from superclass and tokenize the term
     TokenStream source = getAnalyzer().tokenStream(field, new StringReader(termStr));
-    TermAttribute termAtt = (TermAttribute) source.addAttribute(TermAttribute.class);
+    TermAttribute termAtt = source.addAttribute(TermAttribute.class);
     String nextToken = null;
     boolean multipleTokens = false;
     
@@ -269,7 +269,7 @@
       throws ParseException {
     // get Analyzer from superclass and tokenize the terms
     TokenStream source = getAnalyzer().tokenStream(field, new StringReader(part1));
-    TermAttribute termAtt = (TermAttribute) source.addAttribute(TermAttribute.class);
+    TermAttribute termAtt = source.addAttribute(TermAttribute.class);
     boolean multipleTokens = false;
 
     // part1
@@ -293,7 +293,7 @@
 
     // part2
     source = getAnalyzer().tokenStream(field, new StringReader(part2));
-    termAtt = (TermAttribute) source.addAttribute(TermAttribute.class);
+    termAtt = source.addAttribute(TermAttribute.class);
     
     try {
       if (source.incrementToken()) {

Modified: lucene/java/trunk/contrib/misc/src/test/org/apache/lucene/queryParser/precedence/TestPrecedenceQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/misc/src/test/org/apache/lucene/queryParser/precedence/TestPrecedenceQueryParser.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/misc/src/test/org/apache/lucene/queryParser/precedence/TestPrecedenceQueryParser.java (original)
+++ lucene/java/trunk/contrib/misc/src/test/org/apache/lucene/queryParser/precedence/TestPrecedenceQueryParser.java Thu Oct  1 07:53:43 2009
@@ -67,8 +67,8 @@
     boolean inPhrase = false;
     int savedStart = 0, savedEnd = 0;
 
-    TermAttribute termAtt = (TermAttribute) addAttribute(TermAttribute.class);
-    OffsetAttribute offsetAtt = (OffsetAttribute) addAttribute(OffsetAttribute.class);
+    TermAttribute termAtt = addAttribute(TermAttribute.class);
+    OffsetAttribute offsetAtt = addAttribute(OffsetAttribute.class);
     
     public boolean incrementToken() throws IOException {
       if (inPhrase) {

Modified: lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/FuzzyLikeThisQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/FuzzyLikeThisQuery.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/FuzzyLikeThisQuery.java (original)
+++ lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/FuzzyLikeThisQuery.java Thu Oct  1 07:53:43 2009
@@ -182,7 +182,7 @@
     {
         if(f.queryString==null) return;
         TokenStream ts=analyzer.tokenStream(f.fieldName,new StringReader(f.queryString));
-        TermAttribute termAtt = (TermAttribute) ts.addAttribute(TermAttribute.class);
+        TermAttribute termAtt = ts.addAttribute(TermAttribute.class);
         
         int corpusNumDocs=reader.numDocs();
         Term internSavingTemplateTerm =new Term(f.fieldName); //optimization to avoid constructing new Term() objects

Modified: lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/similar/MoreLikeThis.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/similar/MoreLikeThis.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/similar/MoreLikeThis.java (original)
+++ lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/similar/MoreLikeThis.java Thu Oct  1 07:53:43 2009
@@ -829,7 +829,7 @@
 		   TokenStream ts = analyzer.tokenStream(fieldName, r);
 			int tokenCount=0;
 			// for every token
-			TermAttribute termAtt = (TermAttribute) ts.addAttribute(TermAttribute.class);
+			TermAttribute termAtt = ts.addAttribute(TermAttribute.class);
 			
 			while (ts.incrementToken()) {
 				String word = termAtt.term();

Modified: lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/similar/SimilarityQueries.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/similar/SimilarityQueries.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/similar/SimilarityQueries.java (original)
+++ lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/similar/SimilarityQueries.java Thu Oct  1 07:53:43 2009
@@ -86,7 +86,7 @@
 										  throws IOException
 	{	
 		TokenStream ts = a.tokenStream( field, new StringReader( body));
-		TermAttribute termAtt = (TermAttribute) ts.addAttribute(TermAttribute.class);
+		TermAttribute termAtt = ts.addAttribute(TermAttribute.class);
 		
 		BooleanQuery tmp = new BooleanQuery();
 		Set already = new HashSet(); // ignore dups

Modified: lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/QueryParserWrapper.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/QueryParserWrapper.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/QueryParserWrapper.java (original)
+++ lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/QueryParserWrapper.java Thu Oct  1 07:53:43 2009
@@ -55,11 +55,11 @@
 import org.apache.lucene.util.Parameter;
 
 /**
- * This class performs the query parsing using the new query parser implementation, but
- * keeps the old {@link QueryParser} API. <br/>
+ * This class performs the query parsing using the new query parser
+ * implementation, but keeps the old {@link QueryParser} API. <br/>
  * <br/>
- * This class should be used when the new query parser features are and
- * the old {@link QueryParser} API are needed at the same time. <br/>
+ * This class should be used when the new query parser features are and the old
+ * {@link QueryParser} API are needed at the same time. <br/>
  * 
  * @deprecated this class will be removed soon, it's a temporary class to be
  *             used along the transition from the old query parser to the new
@@ -79,12 +79,14 @@
     }
 
     static public final Operator OR = new Operator("OR");
+
     static public final Operator AND = new Operator("AND");
   }
 
   // the nested class:
   /** Alternative form of QueryParser.Operator.AND */
   public static final Operator AND_OPERATOR = Operator.AND;
+
   /** Alternative form of QueryParser.Operator.OR */
   public static final Operator OR_OPERATOR = Operator.OR;
 
@@ -111,6 +113,7 @@
   private SyntaxParser syntaxParser = new StandardSyntaxParser();
 
   private StandardQueryConfigHandler config;
+
   private StandardQueryParser qpHelper;
 
   private QueryNodeProcessor processorPipeline;
@@ -121,9 +124,9 @@
 
   public QueryParserWrapper(String defaultField, Analyzer analyzer) {
     this.defaultField = defaultField;
-    
+
     this.qpHelper = new StandardQueryParser();
-    
+
     this.config = (StandardQueryConfigHandler) qpHelper.getQueryConfigHandler();
 
     this.qpHelper.setAnalyzer(analyzer);
@@ -135,7 +138,7 @@
   StandardQueryParser getQueryParserHelper() {
     return qpHelper;
   }
-  
+
   public String getField() {
     return this.defaultField;
   }
@@ -144,8 +147,9 @@
 
     if (this.config != null
         && this.config.hasAttribute(AnalyzerAttribute.class)) {
-      return ((AnalyzerAttribute) this.config
-          .getAttribute(AnalyzerAttribute.class)).getAnalyzer();
+
+      return this.config.getAttribute(AnalyzerAttribute.class).getAnalyzer();
+
     }
 
     return null;
@@ -153,11 +157,10 @@
   }
 
   /**
-   * Sets the {@link StandardQueryBuilder} used to generate a {@link Query} object
-   * from the parsed and processed query node tree.
+   * Sets the {@link StandardQueryBuilder} used to generate a {@link Query}
+   * object from the parsed and processed query node tree.
    * 
-   * @param builder
-   *          the builder
+   * @param builder the builder
    */
   public void setQueryBuilder(StandardQueryBuilder builder) {
     this.builder = builder;
@@ -168,8 +171,7 @@
    * generated by the
    * {@link org.apache.lucene.queryParser.standard.parser.StandardSyntaxParser}.
    * 
-   * @param processor
-   *          the processor
+   * @param processor the processor
    */
   public void setQueryProcessor(QueryNodeProcessor processor) {
     this.processorPipeline = processor;
@@ -181,8 +183,7 @@
    * Sets the {@link QueryConfigHandler} used by the {@link QueryNodeProcessor}
    * set to this object.
    * 
-   * @param queryConfig
-   *          the query config handler
+   * @param queryConfig the query config handler
    */
   public void setQueryConfig(StandardQueryConfigHandler queryConfig) {
     this.config = queryConfig;
@@ -221,9 +222,10 @@
 
     if (this.config != null
         && this.config.hasAttribute(AllowLeadingWildcardAttribute.class)) {
-      return ((AllowLeadingWildcardAttribute) this.config
-          .getAttribute(AllowLeadingWildcardAttribute.class))
+
+      return this.config.getAttribute(AllowLeadingWildcardAttribute.class)
           .isAllowLeadingWildcard();
+
     }
 
     return false;
@@ -231,11 +233,13 @@
   }
 
   public MultiTermQuery.RewriteMethod getMultiTermRewriteMethod() {
+
     if (this.config != null
         && this.config.hasAttribute(MultiTermRewriteMethodAttribute.class)) {
-      return ((MultiTermRewriteMethodAttribute) this.config
-          .getAttribute(MultiTermRewriteMethodAttribute.class))
+
+      return this.config.getAttribute(MultiTermRewriteMethodAttribute.class)
           .getMultiTermRewriteMethod();
+
     }
 
     return MultiTermQuery.CONSTANT_SCORE_AUTO_REWRITE_DEFAULT;
@@ -250,8 +254,10 @@
       if (fieldConfig != null) {
 
         if (this.config.hasAttribute(DateResolutionAttribute.class)) {
-          return ((DateResolutionAttribute) this.config
-              .getAttribute(DateResolutionAttribute.class)).getDateResolution();
+
+          return this.config.getAttribute(DateResolutionAttribute.class)
+              .getDateResolution();
+
         }
 
       }
@@ -266,9 +272,10 @@
 
     if (this.config != null
         && this.config.hasAttribute(PositionIncrementsAttribute.class)) {
-      return ((PositionIncrementsAttribute) this.config
-          .getAttribute(PositionIncrementsAttribute.class))
+
+      return this.config.getAttribute(PositionIncrementsAttribute.class)
           .isPositionIncrementsEnabled();
+
     }
 
     return false;
@@ -286,8 +293,7 @@
   public Locale getLocale() {
 
     if (this.config != null && this.config.hasAttribute(LocaleAttribute.class)) {
-      return ((LocaleAttribute) this.config.getAttribute(LocaleAttribute.class))
-          .getLocale();
+      return this.config.getAttribute(LocaleAttribute.class).getLocale();
     }
 
     return Locale.getDefault();
@@ -298,9 +304,10 @@
 
     if (this.config != null
         && this.config.hasAttribute(LowercaseExpandedTermsAttribute.class)) {
-      return ((LowercaseExpandedTermsAttribute) this.config
-          .getAttribute(LowercaseExpandedTermsAttribute.class))
+
+      return this.config.getAttribute(LowercaseExpandedTermsAttribute.class)
           .isLowercaseExpandedTerms();
+
     }
 
     return true;
@@ -311,9 +318,10 @@
 
     if (this.config != null
         && this.config.hasAttribute(AllowLeadingWildcardAttribute.class)) {
-      return ((DefaultPhraseSlopAttribute) this.config
-          .getAttribute(DefaultPhraseSlopAttribute.class))
+
+      return this.config.getAttribute(DefaultPhraseSlopAttribute.class)
           .getDefaultPhraseSlop();
+
     }
 
     return 0;
@@ -324,8 +332,10 @@
 
     if (this.config != null
         && this.config.hasAttribute(RangeCollatorAttribute.class)) {
-      return ((RangeCollatorAttribute) this.config
-          .getAttribute(RangeCollatorAttribute.class)).getRangeCollator();
+
+      return this.config.getAttribute(RangeCollatorAttribute.class)
+          .getRangeCollator();
+
     }
 
     return null;
@@ -357,7 +367,7 @@
     this.qpHelper.setAllowLeadingWildcard(allowLeadingWildcard);
   }
 
-  public void setMultiTermRewriteMethod(MultiTermQuery.RewriteMethod method) {  
+  public void setMultiTermRewriteMethod(MultiTermQuery.RewriteMethod method) {
     this.qpHelper.setMultiTermRewriteMethod(method);
   }
 
@@ -365,8 +375,8 @@
     this.qpHelper.setDateResolution(dateResolution);
   }
 
-  private Map<CharSequence, DateTools.Resolution> dateRes =  new HashMap<CharSequence, DateTools.Resolution>();
-  
+  private Map<CharSequence, DateTools.Resolution> dateRes = new HashMap<CharSequence, DateTools.Resolution>();
+
   public void setDateResolution(String fieldName, Resolution dateResolution) {
     dateRes.put(fieldName, dateResolution);
     this.qpHelper.setDateResolution(dateRes);
@@ -385,8 +395,8 @@
     if (this.config != null
         && this.config.hasAttribute(DefaultOperatorAttribute.class)) {
 
-      return (((DefaultOperatorAttribute) this.config
-          .getAttribute(DefaultOperatorAttribute.class)).getOperator() == org.apache.lucene.queryParser.standard.config.DefaultOperatorAttribute.Operator.AND) ? AND_OPERATOR
+      return (this.config.getAttribute(DefaultOperatorAttribute.class)
+          .getOperator() == org.apache.lucene.queryParser.standard.config.DefaultOperatorAttribute.Operator.AND) ? AND_OPERATOR
           : OR_OPERATOR;
 
     }
@@ -449,8 +459,7 @@
   }
 
   /**
-   * @exception ParseException
-   *              throw in overridden method to disallow
+   * @exception ParseException throw in overridden method to disallow
    */
   protected Query getFieldQuery(String field, String queryText)
       throws ParseException {
@@ -458,7 +467,7 @@
   }
 
   @SuppressWarnings("unchecked")
-protected Query getBooleanQuery(List clauses, boolean disableCoord)
+  protected Query getBooleanQuery(List clauses, boolean disableCoord)
       throws ParseException {
     throw new UnsupportedOperationException();
   }
@@ -468,8 +477,7 @@
    * This method may be overridden, for example, to return a SpanNearQuery
    * instead of a PhraseQuery.
    * 
-   * @exception ParseException
-   *              throw in overridden method to disallow
+   * @exception ParseException throw in overridden method to disallow
    */
   protected Query getFieldQuery(String field, String queryText, int slop)
       throws ParseException {
@@ -477,8 +485,7 @@
   }
 
   /**
-   * @exception ParseException
-   *              throw in overridden method to disallow
+   * @exception ParseException throw in overridden method to disallow
    */
   protected Query getRangeQuery(String field, String part1, String part2,
       boolean inclusive) throws ParseException {

Modified: lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/StandardQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/StandardQueryParser.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/StandardQueryParser.java (original)
+++ lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/StandardQueryParser.java Thu Oct  1 07:53:43 2009
@@ -182,7 +182,7 @@
    * or {@link Operator#OR}.
    */
   public Operator getDefaultOperator() {
-    DefaultOperatorAttribute attr = (DefaultOperatorAttribute) getQueryConfigHandler().getAttribute(DefaultOperatorAttribute.class);
+    DefaultOperatorAttribute attr = getQueryConfigHandler().getAttribute(DefaultOperatorAttribute.class);
     return attr.getOperator();
   }
 
@@ -199,7 +199,7 @@
    *          the collator to use when constructing {@link RangeQueryNode}s
    */
   public void setRangeCollator(Collator collator) {
-    RangeCollatorAttribute attr = (RangeCollatorAttribute) getQueryConfigHandler().getAttribute(RangeCollatorAttribute.class);
+    RangeCollatorAttribute attr = getQueryConfigHandler().getAttribute(RangeCollatorAttribute.class);
     attr.setDateResolution(collator);
   }
 
@@ -208,7 +208,7 @@
    *         RangeQuerys.
    */
   public Collator getRangeCollator() {
-    RangeCollatorAttribute attr = (RangeCollatorAttribute) getQueryConfigHandler().getAttribute(RangeCollatorAttribute.class);
+    RangeCollatorAttribute attr = getQueryConfigHandler().getAttribute(RangeCollatorAttribute.class);
     return attr.getRangeCollator();
   }
 
@@ -221,7 +221,7 @@
    * above mentioned query is parsed as <code>capital AND of AND Hungary</code>
    */
   public void setDefaultOperator(Operator operator) {
-    DefaultOperatorAttribute attr = (DefaultOperatorAttribute) getQueryConfigHandler().getAttribute(DefaultOperatorAttribute.class);
+    DefaultOperatorAttribute attr = getQueryConfigHandler().getAttribute(DefaultOperatorAttribute.class);
     attr.setOperator(operator);
   }
 
@@ -235,7 +235,7 @@
    * Default: false.
    */
   public void setLowercaseExpandedTerms(boolean lowercaseExpandedTerms) {
-    LowercaseExpandedTermsAttribute attr= (LowercaseExpandedTermsAttribute) getQueryConfigHandler().getAttribute(LowercaseExpandedTermsAttribute.class);
+    LowercaseExpandedTermsAttribute attr = getQueryConfigHandler().getAttribute(LowercaseExpandedTermsAttribute.class);
     attr.setLowercaseExpandedTerms(lowercaseExpandedTerms);
   }
 
@@ -243,7 +243,7 @@
    * @see #setLowercaseExpandedTerms(boolean)
    */
   public boolean getLowercaseExpandedTerms() {
-    LowercaseExpandedTermsAttribute attr = (LowercaseExpandedTermsAttribute) getQueryConfigHandler().getAttribute(LowercaseExpandedTermsAttribute.class);
+    LowercaseExpandedTermsAttribute attr = getQueryConfigHandler().getAttribute(LowercaseExpandedTermsAttribute.class);
     return attr.isLowercaseExpandedTerms();
   }
 
@@ -257,7 +257,7 @@
    * Default: false.
    */
   public void setAllowLeadingWildcard(boolean allowLeadingWildcard) {
-    AllowLeadingWildcardAttribute attr = (AllowLeadingWildcardAttribute) getQueryConfigHandler().getAttribute(AllowLeadingWildcardAttribute.class);
+    AllowLeadingWildcardAttribute attr = getQueryConfigHandler().getAttribute(AllowLeadingWildcardAttribute.class);
     attr.setAllowLeadingWildcard(allowLeadingWildcard);
   }
 
@@ -271,7 +271,7 @@
    * Default: false.
    */
   public void setEnablePositionIncrements(boolean enabled) {
-    PositionIncrementsAttribute attr = (PositionIncrementsAttribute) getQueryConfigHandler().getAttribute(PositionIncrementsAttribute.class);
+    PositionIncrementsAttribute attr = getQueryConfigHandler().getAttribute(PositionIncrementsAttribute.class);
     attr.setPositionIncrementsEnabled(enabled);
   }
 
@@ -279,7 +279,7 @@
    * @see #setEnablePositionIncrements(boolean)
    */
   public boolean getEnablePositionIncrements() {
-    PositionIncrementsAttribute attr = (PositionIncrementsAttribute) getQueryConfigHandler().getAttribute(PositionIncrementsAttribute.class);
+    PositionIncrementsAttribute attr = getQueryConfigHandler().getAttribute(PositionIncrementsAttribute.class);
     return attr.isPositionIncrementsEnabled();
   }
 
@@ -294,7 +294,7 @@
    * not relevant then use this change the rewrite method.
    */
   public void setMultiTermRewriteMethod(MultiTermQuery.RewriteMethod method) {
-    MultiTermRewriteMethodAttribute attr = (MultiTermRewriteMethodAttribute) getQueryConfigHandler().getAttribute(MultiTermRewriteMethodAttribute.class);
+    MultiTermRewriteMethodAttribute attr = getQueryConfigHandler().getAttribute(MultiTermRewriteMethodAttribute.class);
     attr.setMultiTermRewriteMethod(method);
   }
 
@@ -302,7 +302,7 @@
    * @see #setMultiTermRewriteMethod(org.apache.lucene.search.MultiTermQuery.RewriteMethod)
    */
   public MultiTermQuery.RewriteMethod getMultiTermRewriteMethod() {
-    MultiTermRewriteMethodAttribute attr =(MultiTermRewriteMethodAttribute) getQueryConfigHandler().getAttribute(MultiTermRewriteMethodAttribute.class);    
+    MultiTermRewriteMethodAttribute attr = getQueryConfigHandler().getAttribute(MultiTermRewriteMethodAttribute.class);    
     return attr.getMultiTermRewriteMethod();
   }
 
@@ -312,7 +312,7 @@
       fields = new CharSequence[0];
     }
 
-    MultiFieldAttribute attr = (MultiFieldAttribute) getQueryConfigHandler().addAttribute(MultiFieldAttribute.class);
+    MultiFieldAttribute attr = getQueryConfigHandler().addAttribute(MultiFieldAttribute.class);
     attr.setFields(fields);
 
   }
@@ -324,7 +324,7 @@
    *          The fuzzyPrefixLength to set.
    */
   public void setFuzzyPrefixLength(int fuzzyPrefixLength) {
-    FuzzyAttribute attr = (FuzzyAttribute) getQueryConfigHandler().addAttribute(FuzzyAttribute.class);
+    FuzzyAttribute attr = getQueryConfigHandler().addAttribute(FuzzyAttribute.class);
     attr.setPrefixLength(fuzzyPrefixLength);
   }
 
@@ -332,7 +332,7 @@
    * Set locale used by date range parsing.
    */
   public void setLocale(Locale locale) {
-    LocaleAttribute attr = (LocaleAttribute) getQueryConfigHandler().addAttribute(LocaleAttribute.class);
+    LocaleAttribute attr = getQueryConfigHandler().addAttribute(LocaleAttribute.class);
     attr.setLocale(locale);
   }
 
@@ -340,7 +340,7 @@
    * Returns current locale, allowing access by subclasses.
    */
   public Locale getLocale() {
-    LocaleAttribute attr = (LocaleAttribute) getQueryConfigHandler().addAttribute(LocaleAttribute.class);
+    LocaleAttribute attr = getQueryConfigHandler().addAttribute(LocaleAttribute.class);
     return attr.getLocale();
   }
 
@@ -349,12 +349,12 @@
    * required. Default value is zero.
    */
   public void setDefaultPhraseSlop(int defaultPhraseSlop) {
-    DefaultPhraseSlopAttribute attr = (DefaultPhraseSlopAttribute) getQueryConfigHandler().addAttribute(DefaultPhraseSlopAttribute.class);
+    DefaultPhraseSlopAttribute attr = getQueryConfigHandler().addAttribute(DefaultPhraseSlopAttribute.class);
     attr.setDefaultPhraseSlop(defaultPhraseSlop);
   }
 
   public void setAnalyzer(Analyzer analyzer) {
-    AnalyzerAttribute attr= (AnalyzerAttribute) getQueryConfigHandler().getAttribute(AnalyzerAttribute.class);
+    AnalyzerAttribute attr = getQueryConfigHandler().getAttribute(AnalyzerAttribute.class);
     attr.setAnalyzer(analyzer);
   }
   
@@ -362,7 +362,7 @@
     QueryConfigHandler config = this.getQueryConfigHandler();
 
     if ( config.hasAttribute(AnalyzerAttribute.class)) {
-      AnalyzerAttribute attr= (AnalyzerAttribute) config.getAttribute(AnalyzerAttribute.class);
+      AnalyzerAttribute attr = config.getAttribute(AnalyzerAttribute.class);
       return attr.getAnalyzer();
     }
 
@@ -373,7 +373,7 @@
    * @see #setAllowLeadingWildcard(boolean)
    */
   public boolean getAllowLeadingWildcard() {
-    AllowLeadingWildcardAttribute attr = (AllowLeadingWildcardAttribute) getQueryConfigHandler().addAttribute(AllowLeadingWildcardAttribute.class);
+    AllowLeadingWildcardAttribute attr = getQueryConfigHandler().addAttribute(AllowLeadingWildcardAttribute.class);
     return attr.isAllowLeadingWildcard();
   }
 
@@ -381,7 +381,7 @@
    * Get the minimal similarity for fuzzy queries.
    */
   public float getFuzzyMinSim() {
-    FuzzyAttribute attr = (FuzzyAttribute) getQueryConfigHandler().addAttribute(FuzzyAttribute.class);
+    FuzzyAttribute attr = getQueryConfigHandler().addAttribute(FuzzyAttribute.class);
     return attr.getFuzzyMinSimilarity();
   }
 
@@ -391,7 +391,7 @@
    * @return Returns the fuzzyPrefixLength.
    */
   public int getFuzzyPrefixLength() {
-    FuzzyAttribute attr = (FuzzyAttribute) getQueryConfigHandler().addAttribute(FuzzyAttribute.class);
+    FuzzyAttribute attr = getQueryConfigHandler().addAttribute(FuzzyAttribute.class);
     return attr.getPrefixLength();
   }
 
@@ -399,7 +399,7 @@
    * Gets the default slop for phrases.
    */
   public int getPhraseSlop() {
-    DefaultPhraseSlopAttribute attr = (DefaultPhraseSlopAttribute) getQueryConfigHandler().addAttribute(DefaultPhraseSlopAttribute.class);
+    DefaultPhraseSlopAttribute attr = getQueryConfigHandler().addAttribute(DefaultPhraseSlopAttribute.class);
     return attr.getDefaultPhraseSlop();
   }
 
@@ -408,22 +408,22 @@
    * {@link FuzzyQuery#defaultMinSimilarity}.
    */
   public void setFuzzyMinSim(float fuzzyMinSim) {
-    FuzzyAttribute attr = (FuzzyAttribute) getQueryConfigHandler().addAttribute(FuzzyAttribute.class);
+    FuzzyAttribute attr = getQueryConfigHandler().addAttribute(FuzzyAttribute.class);
     attr.setFuzzyMinSimilarity(fuzzyMinSim);
   }
   
   public void setFieldsBoost(Map<CharSequence, Float> boosts) {
-    FieldBoostMapAttribute attr = (FieldBoostMapAttribute) getQueryConfigHandler().addAttribute(FieldBoostMapAttribute.class);
+    FieldBoostMapAttribute attr = getQueryConfigHandler().addAttribute(FieldBoostMapAttribute.class);
     attr.setFieldBoostMap(boosts);
   }
 
   public void setDateResolution(DateTools.Resolution dateResolution) {
-    DateResolutionAttribute attr = (DateResolutionAttribute) getQueryConfigHandler().addAttribute(DateResolutionAttribute.class);
+    DateResolutionAttribute attr = getQueryConfigHandler().addAttribute(DateResolutionAttribute.class);
     attr.setDateResolution(dateResolution);
   }
 
   public void setDateResolution(Map<CharSequence, DateTools.Resolution> dateRes) {
-    FieldDateResolutionMapAttribute attr = (FieldDateResolutionMapAttribute) getQueryConfigHandler().addAttribute(FieldDateResolutionMapAttribute.class);
+    FieldDateResolutionMapAttribute attr = getQueryConfigHandler().addAttribute(FieldDateResolutionMapAttribute.class);
     attr.setFieldDateResolutionMap(dateRes);
   }
   

Modified: lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/config/FieldBoostMapFCListener.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/config/FieldBoostMapFCListener.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/config/FieldBoostMapFCListener.java (original)
+++ lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/config/FieldBoostMapFCListener.java Thu Oct  1 07:53:43 2009
@@ -44,8 +44,8 @@
 
   public void buildFieldConfig(FieldConfig fieldConfig) {    
     if (this.config.hasAttribute(FieldBoostMapAttribute.class)) {
-      FieldBoostMapAttribute fieldBoostMapAttr = (FieldBoostMapAttribute) this.config.getAttribute(FieldBoostMapAttribute.class);
-      BoostAttribute boostAttr = (BoostAttribute) fieldConfig.addAttribute(BoostAttribute.class);
+      FieldBoostMapAttribute fieldBoostMapAttr = this.config.getAttribute(FieldBoostMapAttribute.class);
+      BoostAttribute boostAttr = fieldConfig.addAttribute(BoostAttribute.class);
       
       Float boost = fieldBoostMapAttr.getFieldBoostMap().get(fieldConfig.getFieldName());
 

Modified: lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/config/FieldDateResolutionFCListener.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/config/FieldDateResolutionFCListener.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/config/FieldDateResolutionFCListener.java (original)
+++ lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/config/FieldDateResolutionFCListener.java Thu Oct  1 07:53:43 2009
@@ -24,9 +24,10 @@
 
 /**
  * This listener listens for every field configuration request and assign a
- * {@link DateResolutionAttribute} to the equivalent {@link FieldConfig} based on a
- * defined map: fieldName -> DateTools.Resolution stored in {@link FieldDateResolutionMapAttribute}
- * in the {@link DateResolutionAttribute}.
+ * {@link DateResolutionAttribute} to the equivalent {@link FieldConfig} based
+ * on a defined map: fieldName -> DateTools.Resolution stored in
+ * {@link FieldDateResolutionMapAttribute} in the
+ * {@link DateResolutionAttribute}.
  * 
  * @see DateResolutionAttribute
  * @see FieldDateResolutionMapAttribute
@@ -38,27 +39,27 @@
   private static final long serialVersionUID = -5929802948798314067L;
 
   private QueryConfigHandler config = null;
-  
+
   public FieldDateResolutionFCListener(QueryConfigHandler config) {
     this.config = config;
   }
-  
+
   public void buildFieldConfig(FieldConfig fieldConfig) {
-    DateResolutionAttribute fieldDateResAttr = (DateResolutionAttribute) fieldConfig
+    DateResolutionAttribute fieldDateResAttr = fieldConfig
         .addAttribute(DateResolutionAttribute.class);
     DateTools.Resolution dateRes = null;
 
     if (this.config.hasAttribute(FieldDateResolutionMapAttribute.class)) {
-      FieldDateResolutionMapAttribute dateResMapAttr = (FieldDateResolutionMapAttribute) this.config
+      FieldDateResolutionMapAttribute dateResMapAttr = this.config
           .addAttribute(FieldDateResolutionMapAttribute.class);
       dateRes = dateResMapAttr.getFieldDateResolutionMap().get(
           fieldConfig.getFieldName().toString());
     }
 
     if (dateRes == null) {
-      
+
       if (this.config.hasAttribute(DateResolutionAttribute.class)) {
-        DateResolutionAttribute dateResAttr = (DateResolutionAttribute) this.config
+        DateResolutionAttribute dateResAttr = this.config
             .addAttribute(DateResolutionAttribute.class);
         dateRes = dateResAttr.getDateResolution();
 

Modified: lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/AllowLeadingWildcardProcessor.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/AllowLeadingWildcardProcessor.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/AllowLeadingWildcardProcessor.java (original)
+++ lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/AllowLeadingWildcardProcessor.java Thu Oct  1 07:53:43 2009
@@ -49,7 +49,7 @@
 
     if (getQueryConfigHandler().hasAttribute(AllowLeadingWildcardAttribute.class)) {
 
-      AllowLeadingWildcardAttribute alwAttr= (AllowLeadingWildcardAttribute) getQueryConfigHandler().getAttribute(AllowLeadingWildcardAttribute.class);
+      AllowLeadingWildcardAttribute alwAttr= getQueryConfigHandler().getAttribute(AllowLeadingWildcardAttribute.class);
       if (!alwAttr.isAllowLeadingWildcard()) {
         return super.process(queryTree);
       }

Modified: lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/AnalyzerQueryNodeProcessor.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/AnalyzerQueryNodeProcessor.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/AnalyzerQueryNodeProcessor.java (original)
+++ lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/AnalyzerQueryNodeProcessor.java Thu Oct  1 07:53:43 2009
@@ -80,17 +80,16 @@
 
     if (getQueryConfigHandler().hasAttribute(AnalyzerAttribute.class)) {
 
-      this.analyzer = ((AnalyzerAttribute) getQueryConfigHandler()
-          .getAttribute(AnalyzerAttribute.class)).getAnalyzer();
+      this.analyzer = getQueryConfigHandler().getAttribute(
+          AnalyzerAttribute.class).getAnalyzer();
 
       this.positionIncrementsEnabled = false;
 
       if (getQueryConfigHandler().hasAttribute(
           PositionIncrementsAttribute.class)) {
 
-        if (((PositionIncrementsAttribute) getQueryConfigHandler()
-            .getAttribute(PositionIncrementsAttribute.class))
-            .isPositionIncrementsEnabled()) {
+        if (getQueryConfigHandler().getAttribute(
+            PositionIncrementsAttribute.class).isPositionIncrementsEnabled()) {
 
           this.positionIncrementsEnabled = true;
 
@@ -130,8 +129,7 @@
       boolean severalTokensAtSamePosition = false;
 
       if (buffer.hasAttribute(PositionIncrementAttribute.class)) {
-        posIncrAtt = (PositionIncrementAttribute) buffer
-            .getAttribute(PositionIncrementAttribute.class);
+        posIncrAtt = buffer.getAttribute(PositionIncrementAttribute.class);
       }
 
       try {
@@ -167,8 +165,7 @@
         return new NoTokenFoundQueryNode();
       }
 
-      TermAttribute termAtt = (TermAttribute) buffer
-          .getAttribute(TermAttribute.class);
+      TermAttribute termAtt = buffer.getAttribute(TermAttribute.class);
 
       if (numTokens == 0) {
         return new NoTokenFoundQueryNode();
@@ -209,7 +206,8 @@
 
           }
 
-          return new GroupQueryNode(new StandardBooleanQueryNode(children, true));
+          return new GroupQueryNode(
+              new StandardBooleanQueryNode(children, true));
 
         } else {
           // phrase query:

Modified: lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/BoostQueryNodeProcessor.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/BoostQueryNodeProcessor.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/BoostQueryNodeProcessor.java (original)
+++ lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/BoostQueryNodeProcessor.java Thu Oct  1 07:53:43 2009
@@ -52,7 +52,7 @@
         FieldConfig fieldConfig = config.getFieldConfig(fieldNode.getField());
 
         if (fieldConfig != null && fieldConfig.hasAttribute(BoostAttribute.class)) {
-          BoostAttribute boostAttr = (BoostAttribute) fieldConfig.getAttribute(BoostAttribute.class);
+          BoostAttribute boostAttr = fieldConfig.getAttribute(BoostAttribute.class);
 
           return new BoostQueryNode(node, boostAttr.getBoost());
 

Modified: lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/DefaultPhraseSlopQueryNodeProcessor.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/DefaultPhraseSlopQueryNodeProcessor.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/DefaultPhraseSlopQueryNodeProcessor.java (original)
+++ lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/DefaultPhraseSlopQueryNodeProcessor.java Thu Oct  1 07:53:43 2009
@@ -55,9 +55,8 @@
     if (queryConfig != null) {
 
       if (queryConfig.hasAttribute(DefaultPhraseSlopAttribute.class)) {
-        this.defaultPhraseSlop = ((DefaultPhraseSlopAttribute) queryConfig
-            .getAttribute(DefaultPhraseSlopAttribute.class))
-            .getDefaultPhraseSlop();
+        this.defaultPhraseSlop = queryConfig.getAttribute(
+            DefaultPhraseSlopAttribute.class).getDefaultPhraseSlop();
 
         return super.process(queryTree);
 

Modified: lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/FuzzyQueryNodeProcessor.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/FuzzyQueryNodeProcessor.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/FuzzyQueryNodeProcessor.java (original)
+++ lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/FuzzyQueryNodeProcessor.java Thu Oct  1 07:53:43 2009
@@ -55,8 +55,7 @@
       QueryConfigHandler config = getQueryConfigHandler();
 
       if (config != null && config.hasAttribute(FuzzyAttribute.class)) {
-        FuzzyAttribute fuzzyAttr = (FuzzyAttribute) config
-            .getAttribute(FuzzyAttribute.class);
+        FuzzyAttribute fuzzyAttr = config.getAttribute(FuzzyAttribute.class);
         fuzzyNode.setPrefixLength(fuzzyAttr.getPrefixLength());
 
         if (fuzzyNode.getSimilarity() < 0) {

Modified: lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/GroupQueryNodeProcessor.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/GroupQueryNodeProcessor.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/GroupQueryNodeProcessor.java (original)
+++ lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/GroupQueryNodeProcessor.java Thu Oct  1 07:53:43 2009
@@ -70,8 +70,8 @@
           "DefaultOperatorAttribute should be set on the QueryConfigHandler");
     }
 
-    usingAnd = Operator.AND == ((DefaultOperatorAttribute) getQueryConfigHandler()
-        .getAttribute(DefaultOperatorAttribute.class)).getOperator();
+    this.usingAnd = Operator.AND == getQueryConfigHandler()
+        .getAttribute(DefaultOperatorAttribute.class).getOperator();
 
     if (queryTree instanceof GroupQueryNode) {
       queryTree = ((GroupQueryNode) queryTree).getChild();

Modified: lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/LowercaseExpandedTermsQueryNodeProcessor.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/LowercaseExpandedTermsQueryNodeProcessor.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/LowercaseExpandedTermsQueryNodeProcessor.java (original)
+++ lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/LowercaseExpandedTermsQueryNodeProcessor.java Thu Oct  1 07:53:43 2009
@@ -52,10 +52,11 @@
     if (getQueryConfigHandler().hasAttribute(
         LowercaseExpandedTermsAttribute.class)) {
 
-      if (((LowercaseExpandedTermsAttribute) getQueryConfigHandler()
-          .getAttribute(LowercaseExpandedTermsAttribute.class))
-          .isLowercaseExpandedTerms()) {
+      if (getQueryConfigHandler().getAttribute(
+          LowercaseExpandedTermsAttribute.class).isLowercaseExpandedTerms()) {
+        
         return super.process(queryTree);
+        
       }
 
     }
@@ -69,7 +70,7 @@
     if (node instanceof WildcardQueryNode || node instanceof FuzzyQueryNode
         || node instanceof ParametricQueryNode) {
 
-      FieldQueryNode fieldNode = (FieldQueryNode) node;      
+      FieldQueryNode fieldNode = (FieldQueryNode) node;
       fieldNode.setText(UnescapedCharSequence.toLowerCase(fieldNode.getText()));
     }
 

Modified: lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/MultiFieldQueryNodeProcessor.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/MultiFieldQueryNodeProcessor.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/MultiFieldQueryNodeProcessor.java (original)
+++ lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/MultiFieldQueryNodeProcessor.java Thu Oct  1 07:53:43 2009
@@ -81,8 +81,8 @@
               "MultiFieldAttribute should be set on the QueryConfigHandler");
         }
 
-        CharSequence[] fields = ((MultiFieldAttribute) getQueryConfigHandler()
-            .getAttribute(MultiFieldAttribute.class)).getFields();
+        CharSequence[] fields = getQueryConfigHandler().getAttribute(
+            MultiFieldAttribute.class).getFields();
 
         if (fields != null && fields.length > 0) {
           fieldNode.setField(fields[0]);

Modified: lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/MultiTermRewriteMethodProcessor.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/MultiTermRewriteMethodProcessor.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/MultiTermRewriteMethodProcessor.java (original)
+++ lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/MultiTermRewriteMethodProcessor.java Thu Oct  1 07:53:43 2009
@@ -27,31 +27,37 @@
 import org.apache.lucene.search.MultiTermQuery;
 
 /**
- * This processor instates the default {@link
- * org.apache.lucene.search.MultiTermQuery.RewriteMethod}, {@link
- * MultiTermQuery#CONSTANT_SCORE_AUTO_REWRITE_DEFAULT}, for
- * multi-term query nodes.
+ * This processor instates the default
+ * {@link org.apache.lucene.search.MultiTermQuery.RewriteMethod},
+ * {@link MultiTermQuery#CONSTANT_SCORE_AUTO_REWRITE_DEFAULT}, for multi-term
+ * query nodes.
  */
-public class MultiTermRewriteMethodProcessor extends QueryNodeProcessorImpl {  
+public class MultiTermRewriteMethodProcessor extends QueryNodeProcessorImpl {
 
   protected QueryNode postProcessNode(QueryNode node) {
-    
-    // set setMultiTermRewriteMethod for WildcardQueryNode and PrefixWildcardQueryNode
-    if (node instanceof WildcardQueryNode || node instanceof  ParametricRangeQueryNode) {
-      
-      if (!getQueryConfigHandler().hasAttribute(MultiTermRewriteMethodAttribute.class)) {
-        // This should not happen, this attribute is created in the StandardQueryConfigHandler
-        throw new IllegalArgumentException("MultiTermRewriteMethodAttribute should be set on the QueryConfigHandler");
+
+    // set setMultiTermRewriteMethod for WildcardQueryNode and
+    // PrefixWildcardQueryNode
+    if (node instanceof WildcardQueryNode
+        || node instanceof ParametricRangeQueryNode) {
+
+      if (!getQueryConfigHandler().hasAttribute(
+          MultiTermRewriteMethodAttribute.class)) {
+        // This should not happen, this attribute is created in the
+        // StandardQueryConfigHandler
+        throw new IllegalArgumentException(
+            "MultiTermRewriteMethodAttribute should be set on the QueryConfigHandler");
       }
 
-      //read the attribute value and use a TAG to take the value to the Builder
-      MultiTermQuery.RewriteMethod rewriteMethod = ((MultiTermRewriteMethodAttribute) getQueryConfigHandler()
-          .getAttribute(MultiTermRewriteMethodAttribute.class))
+      // read the attribute value and use a TAG to take the value to the Builder
+      MultiTermQuery.RewriteMethod rewriteMethod = getQueryConfigHandler()
+          .getAttribute(MultiTermRewriteMethodAttribute.class)
           .getMultiTermRewriteMethod();
 
       node.setTag(MultiTermRewriteMethodAttribute.TAG_ID, rewriteMethod);
+
     }
-    
+
     return node;
   }
 

Modified: lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/ParametricRangeQueryNodeProcessor.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/ParametricRangeQueryNodeProcessor.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/ParametricRangeQueryNodeProcessor.java (original)
+++ lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/ParametricRangeQueryNodeProcessor.java Thu Oct  1 07:53:43 2009
@@ -84,13 +84,17 @@
       boolean inclusive = false;
 
       if (getQueryConfigHandler().hasAttribute(RangeCollatorAttribute.class)) {
-        collator = ((RangeCollatorAttribute) getQueryConfigHandler()
-            .getAttribute(RangeCollatorAttribute.class)).getRangeCollator();
+
+        collator = getQueryConfigHandler().getAttribute(
+            RangeCollatorAttribute.class).getRangeCollator();
+
       }
 
       if (getQueryConfigHandler().hasAttribute(LocaleAttribute.class)) {
-        locale = ((LocaleAttribute) getQueryConfigHandler().getAttribute(
-            LocaleAttribute.class)).getLocale();
+
+        locale = getQueryConfigHandler().getAttribute(LocaleAttribute.class)
+            .getLocale();
+
       }
 
       FieldConfig fieldConfig = getQueryConfigHandler().getFieldConfig(
@@ -99,8 +103,10 @@
       if (fieldConfig != null) {
 
         if (fieldConfig.hasAttribute(DateResolutionAttribute.class)) {
-          dateRes = ((DateResolutionAttribute) fieldConfig
-              .getAttribute(DateResolutionAttribute.class)).getDateResolution();
+
+          dateRes = fieldConfig.getAttribute(DateResolutionAttribute.class)
+              .getDateResolution();
+
         }
 
       }

Modified: lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/spans/TestSpanQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/spans/TestSpanQueryParser.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/spans/TestSpanQueryParser.java (original)
+++ lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/spans/TestSpanQueryParser.java Thu Oct  1 07:53:43 2009
@@ -116,11 +116,14 @@
     this.spansQueryTreeBuilder = new SpansQueryTreeBuilder();
 
     // set up the processor pipeline
-    this.spanProcessorPipeline.setQueryConfigHandler(this.spanQueryConfigHandler);
+    this.spanProcessorPipeline
+        .setQueryConfigHandler(this.spanQueryConfigHandler);
 
     this.spanProcessorPipeline.addProcessor(new WildcardQueryNodeProcessor());
-    this.spanProcessorPipeline.addProcessor(new SpansValidatorQueryNodeProcessor());
-    this.spanProcessorPipeline.addProcessor(new UniqueFieldQueryNodeProcessor());
+    this.spanProcessorPipeline
+        .addProcessor(new SpansValidatorQueryNodeProcessor());
+    this.spanProcessorPipeline
+        .addProcessor(new UniqueFieldQueryNodeProcessor());
 
   }
 
@@ -130,7 +133,7 @@
 
   public SpanQuery getSpanQuery(CharSequence uniqueField, CharSequence query)
       throws QueryNodeException {
-    UniqueFieldAttribute uniqueFieldAtt = (UniqueFieldAttribute) this.spanQueryConfigHandler
+    UniqueFieldAttribute uniqueFieldAtt = this.spanQueryConfigHandler
         .getAttribute(UniqueFieldAttribute.class);
     uniqueFieldAtt.setUniqueField(uniqueField);
 

Modified: lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/spans/TestSpanQueryParserSimpleSample.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/spans/TestSpanQueryParserSimpleSample.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/spans/TestSpanQueryParserSimpleSample.java (original)
+++ lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/spans/TestSpanQueryParserSimpleSample.java Thu Oct  1 07:53:43 2009
@@ -119,7 +119,7 @@
     // create a config handler with a attribute used in
     // UniqueFieldQueryNodeProcessor
     QueryConfigHandler spanQueryConfigHandler = new SpansQueryConfigHandler();
-    UniqueFieldAttribute uniqueFieldAtt = (UniqueFieldAttribute) spanQueryConfigHandler
+    UniqueFieldAttribute uniqueFieldAtt = spanQueryConfigHandler
         .getAttribute(UniqueFieldAttribute.class);
     uniqueFieldAtt.setUniqueField("index");
 

Modified: lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/spans/UniqueFieldQueryNodeProcessor.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/spans/UniqueFieldQueryNodeProcessor.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/spans/UniqueFieldQueryNodeProcessor.java (original)
+++ lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/spans/UniqueFieldQueryNodeProcessor.java Thu Oct  1 07:53:43 2009
@@ -62,8 +62,8 @@
             "UniqueFieldAttribute should be defined in the config handler!");
       }
 
-      CharSequence uniqueField = ((UniqueFieldAttribute) queryConfig
-          .getAttribute(UniqueFieldAttribute.class)).getUniqueField();
+      CharSequence uniqueField = queryConfig.getAttribute(
+          UniqueFieldAttribute.class).getUniqueField();
 
       fieldNode.setField(uniqueField);
 

Modified: lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestMultiAnalyzerQPHelper.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestMultiAnalyzerQPHelper.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestMultiAnalyzerQPHelper.java (original)
+++ lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestMultiAnalyzerQPHelper.java Thu Oct  1 07:53:43 2009
@@ -174,10 +174,10 @@
 
     public TestFilter(TokenStream in) {
       super(in);
-      termAtt = (TermAttribute) addAttribute(TermAttribute.class);
-      posIncrAtt = (PositionIncrementAttribute) addAttribute(PositionIncrementAttribute.class);
-      offsetAtt = (OffsetAttribute) addAttribute(OffsetAttribute.class);
-      typeAtt = (TypeAttribute) addAttribute(TypeAttribute.class);
+      termAtt = addAttribute(TermAttribute.class);
+      posIncrAtt = addAttribute(PositionIncrementAttribute.class);
+      offsetAtt = addAttribute(OffsetAttribute.class);
+      typeAtt = addAttribute(TypeAttribute.class);
 
     }
 
@@ -278,8 +278,8 @@
 
     public TestPosIncrementFilter(TokenStream in) {
       super(in);
-      termAtt = (TermAttribute) addAttribute(TermAttribute.class);
-      posIncrAtt = (PositionIncrementAttribute) addAttribute(PositionIncrementAttribute.class);
+      termAtt = addAttribute(TermAttribute.class);
+      posIncrAtt = addAttribute(PositionIncrementAttribute.class);
     }
 
     private Token token = new Token();

Modified: lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestMultiAnalyzerWrapper.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestMultiAnalyzerWrapper.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestMultiAnalyzerWrapper.java (original)
+++ lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestMultiAnalyzerWrapper.java Thu Oct  1 07:53:43 2009
@@ -168,10 +168,10 @@
 
     public TestFilter(TokenStream in) {
       super(in);
-      termAtt = (TermAttribute) addAttribute(TermAttribute.class);
-      posIncrAtt = (PositionIncrementAttribute) addAttribute(PositionIncrementAttribute.class);
-      offsetAtt = (OffsetAttribute) addAttribute(OffsetAttribute.class);
-      typeAtt = (TypeAttribute) addAttribute(TypeAttribute.class);
+      termAtt = addAttribute(TermAttribute.class);
+      posIncrAtt = addAttribute(PositionIncrementAttribute.class);
+      offsetAtt = addAttribute(OffsetAttribute.class);
+      typeAtt = addAttribute(TypeAttribute.class);
 
     }
 
@@ -272,8 +272,8 @@
 
     public TestPosIncrementFilter(TokenStream in) {
       super(in);
-      termAtt = (TermAttribute) addAttribute(TermAttribute.class);
-      posIncrAtt = (PositionIncrementAttribute) addAttribute(PositionIncrementAttribute.class);
+      termAtt = addAttribute(TermAttribute.class);
+      posIncrAtt = addAttribute(PositionIncrementAttribute.class);
     }
 
     private Token token = new Token();

Modified: lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestQPHelper.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestQPHelper.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestQPHelper.java (original)
+++ lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestQPHelper.java Thu Oct  1 07:53:43 2009
@@ -106,8 +106,8 @@
      */
     public QPTestFilter(TokenStream in) {
       super(in);
-      termAtt = (TermAttribute) addAttribute(TermAttribute.class);
-      offsetAtt = (OffsetAttribute) addAttribute(OffsetAttribute.class);
+      termAtt = addAttribute(TermAttribute.class);
+      offsetAtt = addAttribute(OffsetAttribute.class);
     }
 
     boolean inPhrase = false;
@@ -1189,8 +1189,8 @@
       if (upto == 4) {
         return false;
       }
-      PositionIncrementAttribute posIncr = (PositionIncrementAttribute) addAttribute(PositionIncrementAttribute.class);
-      TermAttribute term = (TermAttribute) addAttribute(TermAttribute.class);
+      PositionIncrementAttribute posIncr = addAttribute(PositionIncrementAttribute.class);
+      TermAttribute term = addAttribute(TermAttribute.class);
       if (upto == 0) {
         posIncr.setPositionIncrement(1);
         term.setTermBuffer("a");

Modified: lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestQueryParserWrapper.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestQueryParserWrapper.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestQueryParserWrapper.java (original)
+++ lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestQueryParserWrapper.java Thu Oct  1 07:53:43 2009
@@ -101,8 +101,8 @@
      */
     public QPTestFilter(TokenStream in) {
       super(in);
-      termAtt = (TermAttribute) addAttribute(TermAttribute.class);
-      offsetAtt = (OffsetAttribute) addAttribute(OffsetAttribute.class);
+      termAtt = addAttribute(TermAttribute.class);
+      offsetAtt = addAttribute(OffsetAttribute.class);
     }
 
     boolean inPhrase = false;

Modified: lucene/java/trunk/contrib/snowball/src/java/org/apache/lucene/analysis/snowball/SnowballFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/snowball/src/java/org/apache/lucene/analysis/snowball/SnowballFilter.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/snowball/src/java/org/apache/lucene/analysis/snowball/SnowballFilter.java (original)
+++ lucene/java/trunk/contrib/snowball/src/java/org/apache/lucene/analysis/snowball/SnowballFilter.java Thu Oct  1 07:53:43 2009
@@ -39,7 +39,7 @@
   public SnowballFilter(TokenStream input, SnowballProgram stemmer) {
     super(input);
     this.stemmer = stemmer;
-    termAtt = (TermAttribute) addAttribute(TermAttribute.class);
+    termAtt = addAttribute(TermAttribute.class);
   }
 
   /**
@@ -60,7 +60,7 @@
     } catch (Exception e) {
       throw new RuntimeException(e.toString());
     }
-    termAtt = (TermAttribute) addAttribute(TermAttribute.class);
+    termAtt = addAttribute(TermAttribute.class);
   }
 
   /** Returns the next input Token, after being stemmed */

Modified: lucene/java/trunk/contrib/snowball/src/test/org/apache/lucene/analysis/snowball/TestSnowball.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/snowball/src/test/org/apache/lucene/analysis/snowball/TestSnowball.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/snowball/src/test/org/apache/lucene/analysis/snowball/TestSnowball.java (original)
+++ lucene/java/trunk/contrib/snowball/src/test/org/apache/lucene/analysis/snowball/TestSnowball.java Thu Oct  1 07:53:43 2009
@@ -69,12 +69,12 @@
   
   public void testFilterTokens() throws Exception {
     SnowballFilter filter = new SnowballFilter(new TestTokenStream(), "English");
-    TermAttribute termAtt = (TermAttribute) filter.getAttribute(TermAttribute.class);
-    OffsetAttribute offsetAtt = (OffsetAttribute) filter.getAttribute(OffsetAttribute.class);
-    TypeAttribute typeAtt = (TypeAttribute) filter.getAttribute(TypeAttribute.class);
-    PayloadAttribute payloadAtt = (PayloadAttribute) filter.getAttribute(PayloadAttribute.class);
-    PositionIncrementAttribute posIncAtt = (PositionIncrementAttribute) filter.getAttribute(PositionIncrementAttribute.class);
-    FlagsAttribute flagsAtt = (FlagsAttribute) filter.getAttribute(FlagsAttribute.class);
+    TermAttribute termAtt = filter.getAttribute(TermAttribute.class);
+    OffsetAttribute offsetAtt = filter.getAttribute(OffsetAttribute.class);
+    TypeAttribute typeAtt = filter.getAttribute(TypeAttribute.class);
+    PayloadAttribute payloadAtt = filter.getAttribute(PayloadAttribute.class);
+    PositionIncrementAttribute posIncAtt = filter.getAttribute(PositionIncrementAttribute.class);
+    FlagsAttribute flagsAtt = filter.getAttribute(FlagsAttribute.class);
     
     filter.incrementToken();
 
@@ -97,12 +97,12 @@
     
     TestTokenStream() {
       super();
-      termAtt = (TermAttribute) addAttribute(TermAttribute.class);
-      offsetAtt = (OffsetAttribute) addAttribute(OffsetAttribute.class);
-      typeAtt = (TypeAttribute) addAttribute(TypeAttribute.class);
-      payloadAtt = (PayloadAttribute) addAttribute(PayloadAttribute.class);
-      posIncAtt = (PositionIncrementAttribute) addAttribute(PositionIncrementAttribute.class);
-      flagsAtt = (FlagsAttribute) addAttribute(FlagsAttribute.class);
+      termAtt = addAttribute(TermAttribute.class);
+      offsetAtt = addAttribute(OffsetAttribute.class);
+      typeAtt = addAttribute(TypeAttribute.class);
+      payloadAtt = addAttribute(PayloadAttribute.class);
+      posIncAtt = addAttribute(PositionIncrementAttribute.class);
+      flagsAtt = addAttribute(FlagsAttribute.class);
     }
     
     public boolean incrementToken() {

Modified: lucene/java/trunk/contrib/wikipedia/src/java/org/apache/lucene/wikipedia/analysis/WikipediaTokenizer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/wikipedia/src/java/org/apache/lucene/wikipedia/analysis/WikipediaTokenizer.java?rev=820553&r1=820552&r2=820553&view=diff
==============================================================================
--- lucene/java/trunk/contrib/wikipedia/src/java/org/apache/lucene/wikipedia/analysis/WikipediaTokenizer.java (original)
+++ lucene/java/trunk/contrib/wikipedia/src/java/org/apache/lucene/wikipedia/analysis/WikipediaTokenizer.java Thu Oct  1 07:53:43 2009
@@ -181,11 +181,11 @@
   private void init(int tokenOutput, Set untokenizedTypes) {
     this.tokenOutput = tokenOutput;
     this.untokenizedTypes = untokenizedTypes;
-    this.offsetAtt = (OffsetAttribute) addAttribute(OffsetAttribute.class);
-    this.typeAtt = (TypeAttribute) addAttribute(TypeAttribute.class);
-    this.posIncrAtt = (PositionIncrementAttribute) addAttribute(PositionIncrementAttribute.class);
-    this.termAtt = (TermAttribute) addAttribute(TermAttribute.class);
-    this.flagsAtt = (FlagsAttribute) addAttribute(FlagsAttribute.class);    
+    this.offsetAtt = addAttribute(OffsetAttribute.class);
+    this.typeAtt = addAttribute(TypeAttribute.class);
+    this.posIncrAtt = addAttribute(PositionIncrementAttribute.class);
+    this.termAtt = addAttribute(TermAttribute.class);
+    this.flagsAtt = addAttribute(FlagsAttribute.class);    
   }
 
   /** @deprecated Will be removed in Lucene 3.0. This method is final, as it should



Mime
View raw message