lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r821185 [1/2] - in /lucene/java/trunk: contrib/analyzers/common/src/java/org/apache/lucene/analysis/compound/hyphenation/ contrib/analyzers/common/src/java/org/apache/lucene/analysis/de/ contrib/analyzers/common/src/java/org/apache/lucene/a...
Date Fri, 02 Oct 2009 22:11:14 GMT
Author: uschindler
Date: Fri Oct  2 22:11:10 2009
New Revision: 821185

URL: http://svn.apache.org/viewvc?rev=821185&view=rev
Log:
LUCENE-1257: Replace StringBuffer by StringBuilder where possible

Modified:
    lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/compound/hyphenation/Hyphen.java
    lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/compound/hyphenation/HyphenationTree.java
    lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/compound/hyphenation/PatternParser.java
    lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/compound/hyphenation/TernaryTree.java
    lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/de/GermanStemmer.java
    lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/fr/FrenchStemmer.java
    lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/nl/DutchStemmer.java
    lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/ru/RussianStemmer.java
    lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/shingle/ShingleFilter.java
    lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/shingle/ShingleMatrixFilter.java
    lucene/java/trunk/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/SentenceTokenizer.java
    lucene/java/trunk/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/BiSegGraph.java
    lucene/java/trunk/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/HHMMSegmenter.java
    lucene/java/trunk/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/SegGraph.java
    lucene/java/trunk/contrib/ant/src/java/org/apache/lucene/ant/HtmlDocument.java
    lucene/java/trunk/contrib/collation/src/test/org/apache/lucene/collation/CollationTestBase.java
    lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/GradientFormatter.java
    lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/Highlighter.java
    lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/SimpleHTMLEncoder.java
    lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/SimpleHTMLFormatter.java
    lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/SpanGradientFormatter.java
    lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/TextFragment.java
    lucene/java/trunk/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java
    lucene/java/trunk/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedTermFreqVector.java
    lucene/java/trunk/contrib/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java
    lucene/java/trunk/contrib/memory/src/java/org/apache/lucene/index/memory/SynonymMap.java
    lucene/java/trunk/contrib/misc/src/java/org/apache/lucene/misc/ChainedFilter.java
    lucene/java/trunk/contrib/misc/src/java/org/apache/lucene/queryParser/analyzing/AnalyzingQueryParser.java
    lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/BooleanFilter.java
    lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/similar/MoreLikeThis.java
    lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/PathQueryNode.java
    lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/util/UnescapedCharSequence.java
    lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/QueryParserUtil.java
    lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/QueryParserWrapper.java
    lucene/java/trunk/contrib/regex/src/java/org/apache/lucene/search/regex/SpanRegexQuery.java
    lucene/java/trunk/contrib/remote/src/test/org/apache/lucene/search/TestRemoteSort.java
    lucene/java/trunk/contrib/wikipedia/src/java/org/apache/lucene/wikipedia/analysis/WikipediaTokenizer.java
    lucene/java/trunk/contrib/wikipedia/src/java/org/apache/lucene/wikipedia/analysis/WikipediaTokenizerImpl.java
    lucene/java/trunk/contrib/wikipedia/src/java/org/apache/lucene/wikipedia/analysis/WikipediaTokenizerImpl.jflex
    lucene/java/trunk/contrib/xml-query-parser/src/java/org/apache/lucene/xmlparser/DOMUtils.java
    lucene/java/trunk/src/java/org/apache/lucene/analysis/BaseCharFilter.java
    lucene/java/trunk/src/java/org/apache/lucene/analysis/NumericTokenStream.java
    lucene/java/trunk/src/java/org/apache/lucene/analysis/Token.java
    lucene/java/trunk/src/java/org/apache/lucene/document/AbstractField.java
    lucene/java/trunk/src/java/org/apache/lucene/document/DateField.java
    lucene/java/trunk/src/java/org/apache/lucene/document/Document.java
    lucene/java/trunk/src/java/org/apache/lucene/document/NumberTools.java
    lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java
    lucene/java/trunk/src/java/org/apache/lucene/index/MergePolicy.java
    lucene/java/trunk/src/java/org/apache/lucene/index/SegmentInfos.java
    lucene/java/trunk/src/java/org/apache/lucene/index/SegmentTermVector.java
    lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.java
    lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.jj
    lucene/java/trunk/src/java/org/apache/lucene/search/BooleanQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/BooleanScorer.java
    lucene/java/trunk/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/Explanation.java
    lucene/java/trunk/src/java/org/apache/lucene/search/FieldCache.java
    lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheRangeFilter.java
    lucene/java/trunk/src/java/org/apache/lucene/search/FieldDoc.java
    lucene/java/trunk/src/java/org/apache/lucene/search/FilteredQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/FuzzyQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/Hit.java
    lucene/java/trunk/src/java/org/apache/lucene/search/MatchAllDocsQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/MultiPhraseQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/MultiTermQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/NumericRangeQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/PhraseQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/PrefixFilter.java
    lucene/java/trunk/src/java/org/apache/lucene/search/PrefixQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/QueryTermVector.java
    lucene/java/trunk/src/java/org/apache/lucene/search/Similarity.java
    lucene/java/trunk/src/java/org/apache/lucene/search/Sort.java
    lucene/java/trunk/src/java/org/apache/lucene/search/SortField.java
    lucene/java/trunk/src/java/org/apache/lucene/search/TermQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/TermRangeQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/WildcardQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/function/CustomScoreQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/payloads/PayloadNearQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/spans/FieldMaskingSpanQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanFirstQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanNearQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanNotQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanOrQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanTermQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/store/FSDirectory.java
    lucene/java/trunk/src/java/org/apache/lucene/util/FieldCacheSanityChecker.java
    lucene/java/trunk/src/test/org/apache/lucene/analysis/TestASCIIFoldingFilter.java
    lucene/java/trunk/src/test/org/apache/lucene/analysis/TestCharArraySet.java
    lucene/java/trunk/src/test/org/apache/lucene/analysis/TestStopFilter.java
    lucene/java/trunk/src/test/org/apache/lucene/analysis/TestTeeSinkTokenFilter.java
    lucene/java/trunk/src/test/org/apache/lucene/analysis/TestTeeTokenFilter.java
    lucene/java/trunk/src/test/org/apache/lucene/analysis/TestToken.java
    lucene/java/trunk/src/test/org/apache/lucene/analysis/tokenattributes/TestTermAttributeImpl.java
    lucene/java/trunk/src/test/org/apache/lucene/index/DocHelper.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexReaderReopen.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriter.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterReader.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestOmitTf.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestPayloads.java
    lucene/java/trunk/src/test/org/apache/lucene/search/BaseTestRangeFilter.java
    lucene/java/trunk/src/test/org/apache/lucene/search/CheckHits.java
    lucene/java/trunk/src/test/org/apache/lucene/search/QueryUtils.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestCustomSearcherSort.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiThreadTermVectors.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestSort.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestThreadSafe.java
    lucene/java/trunk/src/test/org/apache/lucene/store/TestWindowsMMap.java
    lucene/java/trunk/src/test/org/apache/lucene/util/English.java
    lucene/java/trunk/src/test/org/apache/lucene/util/TestIndexableBinaryStringTools.java
    lucene/java/trunk/src/test/org/apache/lucene/util/_TestUtil.java

Modified: lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/compound/hyphenation/Hyphen.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/compound/hyphenation/Hyphen.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/compound/hyphenation/Hyphen.java (original)
+++ lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/compound/hyphenation/Hyphen.java Fri Oct  2 22:11:10 2009
@@ -56,7 +56,7 @@
         && preBreak.equals("-")) {
       return "-";
     }
-    StringBuffer res = new StringBuffer("{");
+    StringBuilder res = new StringBuilder("{");
     res.append(preBreak);
     res.append("}{");
     res.append(postBreak);

Modified: lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/compound/hyphenation/HyphenationTree.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/compound/hyphenation/HyphenationTree.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/compound/hyphenation/HyphenationTree.java (original)
+++ lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/compound/hyphenation/HyphenationTree.java Fri Oct  2 22:11:10 2009
@@ -91,7 +91,7 @@
   }
 
   protected String unpackValues(int k) {
-    StringBuffer buf = new StringBuffer();
+    StringBuilder buf = new StringBuilder();
     byte v = vspace.get(k++);
     while (v != 0) {
       char c = (char) ((v >>> 4) - 1 + '0');
@@ -169,7 +169,7 @@
   }
 
   protected byte[] getValues(int k) {
-    StringBuffer buf = new StringBuffer();
+    StringBuilder buf = new StringBuilder();
     byte v = vspace.get(k++);
     while (v != 0) {
       char c = (char) ((v >>> 4) - 1);

Modified: lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/compound/hyphenation/PatternParser.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/compound/hyphenation/PatternParser.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/compound/hyphenation/PatternParser.java (original)
+++ lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/compound/hyphenation/PatternParser.java Fri Oct  2 22:11:10 2009
@@ -51,7 +51,7 @@
 
   PatternConsumer consumer;
 
-  StringBuffer token;
+  StringBuilder token;
 
   ArrayList exception;
 
@@ -68,7 +68,7 @@
   static final int ELEM_HYPHEN = 4;
 
   public PatternParser() throws HyphenationException {
-    token = new StringBuffer();
+    token = new StringBuilder();
     parser = createParser();
     parser.setContentHandler(this);
     parser.setErrorHandler(this);
@@ -191,7 +191,7 @@
   }
 
   protected static String getPattern(String word) {
-    StringBuffer pat = new StringBuffer();
+    StringBuilder pat = new StringBuilder();
     int len = word.length();
     for (int i = 0; i < len; i++) {
       if (!Character.isDigit(word.charAt(i))) {
@@ -207,7 +207,7 @@
       Object item = ex.get(i);
       if (item instanceof String) {
         String str = (String) item;
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         for (int j = 0; j < str.length(); j++) {
           char c = str.charAt(j);
           if (c != hyphenChar) {
@@ -233,7 +233,7 @@
   }
 
   protected String getExceptionWord(ArrayList ex) {
-    StringBuffer res = new StringBuffer();
+    StringBuilder res = new StringBuilder();
     for (int i = 0; i < ex.size(); i++) {
       Object item = ex.get(i);
       if (item instanceof String) {
@@ -248,7 +248,7 @@
   }
 
   protected static String getInterletterValues(String pat) {
-    StringBuffer il = new StringBuffer();
+    StringBuilder il = new StringBuilder();
     String word = pat + "a"; // add dummy letter to serve as sentinel
     int len = word.length();
     for (int i = 0; i < len; i++) {
@@ -399,7 +399,7 @@
    * Returns a string of the location.
    */
   private String getLocationString(SAXParseException ex) {
-    StringBuffer str = new StringBuffer();
+    StringBuilder str = new StringBuilder();
 
     String systemId = ex.getSystemId();
     if (systemId != null) {

Modified: lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/compound/hyphenation/TernaryTree.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/compound/hyphenation/TernaryTree.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/compound/hyphenation/TernaryTree.java (original)
+++ lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/compound/hyphenation/TernaryTree.java Fri Oct  2 22:11:10 2009
@@ -495,14 +495,14 @@
     Stack ns;
 
     /**
-     * key stack implemented with a StringBuffer
+     * key stack implemented with a StringBuilder
      */
-    StringBuffer ks;
+    StringBuilder ks;
 
     public Iterator() {
       cur = -1;
       ns = new Stack();
-      ks = new StringBuffer();
+      ks = new StringBuilder();
       rewind();
     }
 
@@ -619,7 +619,7 @@
       }
       // The current node should be a data node and
       // the key should be in the key stack (at least partially)
-      StringBuffer buf = new StringBuffer(ks.toString());
+      StringBuilder buf = new StringBuilder(ks.toString());
       if (sc[cur] == 0xFFFF) {
         int p = lo[cur];
         while (kv.get(p) != 0) {

Modified: lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/de/GermanStemmer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/de/GermanStemmer.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/de/GermanStemmer.java (original)
+++ lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/de/GermanStemmer.java Fri Oct  2 22:11:10 2009
@@ -33,7 +33,7 @@
     /**
      * Buffer for the terms while stemming them.
      */
-    private StringBuffer sb = new StringBuffer();
+    private StringBuilder sb = new StringBuilder();
 
     /**
      * Amount of characters that are removed with <tt>substitute()</tt> while stemming.
@@ -52,7 +52,7 @@
       term = term.toLowerCase();
       if ( !isStemmable( term ) )
         return term;
-      // Reset the StringBuffer.
+      // Reset the StringBuilder.
       sb.delete( 0, sb.length() );
       sb.insert( 0, term );
       // Stemming starts here...
@@ -86,7 +86,7 @@
      * discriminators in the most of those cases.
      * The algorithm is context free, except of the length restrictions.
      */
-    private void strip( StringBuffer buffer )
+    private void strip( StringBuilder buffer )
     {
       boolean doMore = true;
       while ( doMore && buffer.length() > 3 ) {
@@ -126,7 +126,7 @@
      * Does some optimizations on the term. This optimisations are
      * contextual.
      */
-    private void optimize( StringBuffer buffer )
+    private void optimize( StringBuilder buffer )
     {
       // Additional step for female plurals of professions and inhabitants.
       if ( buffer.length() > 5 && buffer.substring( buffer.length() - 5, buffer.length() ).equals( "erin*" ) ) {
@@ -142,7 +142,7 @@
     /**
      * Removes a particle denotion ("ge") from a term.
      */
-    private void removeParticleDenotion( StringBuffer buffer )
+    private void removeParticleDenotion( StringBuilder buffer )
     {
       if ( buffer.length() > 4 ) {
         for ( int c = 0; c < buffer.length() - 3; c++ ) {
@@ -164,7 +164,7 @@
      * - Substitute some common character combinations with a token:
      *   sch/ch/ei/ie/ig/st -> $/§/%/&/#/!
      */
-    private void substitute( StringBuffer buffer )
+    private void substitute( StringBuilder buffer )
     {
       substCount = 0;
       for ( int c = 0; c < buffer.length(); c++ ) {
@@ -232,7 +232,7 @@
      * character combinations. Umlauts will remain as their corresponding vowel,
      * as "ß" remains as "ss".
      */
-    private void resubstitute( StringBuffer buffer )
+    private void resubstitute( StringBuilder buffer )
     {
       for ( int c = 0; c < buffer.length(); c++ ) {
         if ( buffer.charAt( c ) == '*' ) {

Modified: lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/fr/FrenchStemmer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/fr/FrenchStemmer.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/fr/FrenchStemmer.java (original)
+++ lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/fr/FrenchStemmer.java Fri Oct  2 22:11:10 2009
@@ -32,12 +32,12 @@
     /**
      * Buffer for the terms while stemming them.
      */
-    private StringBuffer sb = new StringBuffer();
+    private StringBuilder sb = new StringBuilder();
 
     /**
      * A temporary buffer, used to reconstruct R2
      */
-     private StringBuffer tb = new StringBuffer();
+     private StringBuilder tb = new StringBuilder();
 
 	/**
 	 * Region R0 is equal to the whole buffer
@@ -92,7 +92,7 @@
 		// Use lowercase for medium stemming.
 		term = term.toLowerCase();
 
-		// Reset the StringBuffer.
+		// Reset the StringBuilder.
 		sb.delete( 0, sb.length() );
 		sb.insert( 0, term );
 
@@ -207,7 +207,7 @@
 	 * or changed were done in the amment, emment, ments or ment suffixes<br>
 	 * refer to http://snowball.sourceforge.net/french/stemmer.html for an explanation
 	 *
-	 * @return boolean - true if something changed in the StringBuffer
+	 * @return boolean - true if something changed in the StringBuilder
 	 */
 	private boolean step2a() {
 		String[] search = { "îmes", "îtes", "iraIent", "irait", "irais", "irai", "iras", "ira",
@@ -553,10 +553,10 @@
 	 * Retrieve the "R zone" (1 or 2 depending on the buffer) and return the corresponding string<br>
 	 * "R is the region after the first non-vowel following a vowel
 	 * or is the null region at the end of the word if there is no such non-vowel"<br>
-	 * @param buffer java.lang.StringBuffer - the in buffer
+	 * @param buffer java.lang.StringBuilder - the in buffer
 	 * @return java.lang.String - the resulting string
 	 */
-	private String retrieveR( StringBuffer buffer ) {
+	private String retrieveR( StringBuilder buffer ) {
 		int len = buffer.length();
 		int pos = -1;
 		for (int c = 0; c < len; c++) {
@@ -590,10 +590,10 @@
 	 * "If the word begins with two vowels, RV is the region after the third letter,
 	 * otherwise the region after the first vowel not at the beginning of the word,
 	 * or the end of the word if these positions cannot be found."<br>
-	 * @param buffer java.lang.StringBuffer - the in buffer
+	 * @param buffer java.lang.StringBuilder - the in buffer
 	 * @return java.lang.String - the resulting string
 	 */
-	private String retrieveRV( StringBuffer buffer ) {
+	private String retrieveRV( StringBuilder buffer ) {
 		int len = buffer.length();
 		if ( buffer.length() > 3)
 		{
@@ -627,10 +627,10 @@
 	 * Turns y preceded OR followed by a vowel to UpperCase<br>
 	 * Turns u preceded by q to UpperCase<br>
      *
-     * @param buffer java.util.StringBuffer - the buffer to treat
-     * @return java.util.StringBuffer - the treated buffer
+     * @param buffer java.util.StringBuilder - the buffer to treat
+     * @return java.util.StringBuilder - the treated buffer
      */
-    private StringBuffer treatVowels( StringBuffer buffer ) {
+    private StringBuilder treatVowels( StringBuilder buffer ) {
 		for ( int c = 0; c < buffer.length(); c++ ) {
 			char ch = buffer.charAt( c );
 

Modified: lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/nl/DutchStemmer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/nl/DutchStemmer.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/nl/DutchStemmer.java (original)
+++ lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/nl/DutchStemmer.java Fri Oct  2 22:11:10 2009
@@ -32,7 +32,7 @@
   /**
    * Buffer for the terms while stemming them.
    */
-  private StringBuffer sb = new StringBuffer();
+  private StringBuilder sb = new StringBuilder();
   private boolean _removedE;
   private Map _stemDict;
 
@@ -56,7 +56,7 @@
       else
         return null;
 
-    // Reset the StringBuffer.
+    // Reset the StringBuilder.
     sb.delete(0, sb.length());
     sb.insert(0, term);
     // Stemming starts here...
@@ -74,7 +74,7 @@
     return sb.toString();
   }
 
-  private boolean enEnding(StringBuffer sb) {
+  private boolean enEnding(StringBuilder sb) {
     String[] enend = new String[]{"ene", "en"};
     for (int i = 0; i < enend.length; i++) {
       String end = enend[i];
@@ -93,7 +93,7 @@
   }
 
 
-  private void step1(StringBuffer sb) {
+  private void step1(StringBuilder sb) {
     if (_R1 >= sb.length())
       return;
 
@@ -129,7 +129,7 @@
    *
    * @param sb String being stemmed
    */
-  private void step2(StringBuffer sb) {
+  private void step2(StringBuilder sb) {
     _removedE = false;
     if (_R1 >= sb.length())
       return;
@@ -149,7 +149,7 @@
    *
    * @param sb String being stemmed
    */
-  private void step3a(StringBuffer sb) {
+  private void step3a(StringBuilder sb) {
     if (_R2 >= sb.length())
       return;
     String s = sb.toString();
@@ -174,7 +174,7 @@
    *
    * @param sb String being stemmed
    */
-  private void step3b(StringBuffer sb) {
+  private void step3b(StringBuilder sb) {
     if (_R2 >= sb.length())
       return;
     String s = sb.toString();
@@ -229,7 +229,7 @@
    *
    * @param sb String being stemmed
    */
-  private void step4(StringBuffer sb) {
+  private void step4(StringBuilder sb) {
     if (sb.length() < 4)
       return;
     String end = sb.substring(sb.length() - 4, sb.length());
@@ -262,7 +262,7 @@
   /**
    * Substitute ä, ë, ï, ö, ü, á , é, í, ó, ú
    */
-  private void substitute(StringBuffer buffer) {
+  private void substitute(StringBuilder buffer) {
     for (int i = 0; i < buffer.length(); i++) {
       switch (buffer.charAt(i)) {
         case 'ä':
@@ -299,22 +299,22 @@
     }
   }
 
-  /*private boolean isValidSEnding(StringBuffer sb) {
+  /*private boolean isValidSEnding(StringBuilder sb) {
     return isValidSEnding(sb, sb.length() - 1);
   }*/
 
-  private boolean isValidSEnding(StringBuffer sb, int index) {
+  private boolean isValidSEnding(StringBuilder sb, int index) {
     char c = sb.charAt(index);
     if (isVowel(c) || c == 'j')
       return false;
     return true;
   }
 
-  /*private boolean isValidEnEnding(StringBuffer sb) {
+  /*private boolean isValidEnEnding(StringBuilder sb) {
     return isValidEnEnding(sb, sb.length() - 1);
   }*/
 
-  private boolean isValidEnEnding(StringBuffer sb, int index) {
+  private boolean isValidEnEnding(StringBuilder sb, int index) {
     char c = sb.charAt(index);
     if (isVowel(c))
       return false;
@@ -326,18 +326,18 @@
     return true;
   }
 
-  private void unDouble(StringBuffer sb) {
+  private void unDouble(StringBuilder sb) {
     unDouble(sb, sb.length());
   }
 
-  private void unDouble(StringBuffer sb, int endIndex) {
+  private void unDouble(StringBuilder sb, int endIndex) {
     String s = sb.substring(0, endIndex);
     if (s.endsWith("kk") || s.endsWith("tt") || s.endsWith("dd") || s.endsWith("nn") || s.endsWith("mm") || s.endsWith("ff")) {
       sb.delete(endIndex - 1, endIndex);
     }
   }
 
-  private int getRIndex(StringBuffer sb, int start) {
+  private int getRIndex(StringBuilder sb, int start) {
     if (start == 0)
       start = 1;
     int i = start;
@@ -350,7 +350,7 @@
     return i + 1;
   }
 
-  private void storeYandI(StringBuffer sb) {
+  private void storeYandI(StringBuilder sb) {
     if (sb.charAt(0) == 'y')
       sb.setCharAt(0, 'Y');
 
@@ -378,7 +378,7 @@
       sb.setCharAt(last, 'Y');
   }
 
-  private void reStoreYandI(StringBuffer sb) {
+  private void reStoreYandI(StringBuilder sb) {
     String tmp = sb.toString();
     sb.delete(0, sb.length());
     sb.insert(0, tmp.replaceAll("I", "i").replaceAll("Y", "y"));

Modified: lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/ru/RussianStemmer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/ru/RussianStemmer.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/ru/RussianStemmer.java (original)
+++ lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/ru/RussianStemmer.java Fri Oct  2 22:11:10 2009
@@ -255,9 +255,9 @@
      * Adjectival ending is an adjective ending,
      * optionally preceded by participle ending.
      * Creation date: (17/03/2002 12:14:58 AM)
-     * @param stemmingZone java.lang.StringBuffer
+     * @param stemmingZone java.lang.StringBuilder
      */
-    private boolean adjectival(StringBuffer stemmingZone)
+    private boolean adjectival(StringBuilder stemmingZone)
     {
         // look for adjective ending in a stemming zone
         if (!findAndRemoveEnding(stemmingZone, adjectiveEndings))
@@ -275,9 +275,9 @@
     /**
      * Derivational endings
      * Creation date: (17/03/2002 12:14:58 AM)
-     * @param stemmingZone java.lang.StringBuffer
+     * @param stemmingZone java.lang.StringBuilder
      */
-    private boolean derivational(StringBuffer stemmingZone)
+    private boolean derivational(StringBuilder stemmingZone)
     {
         int endingLength = findEnding(stemmingZone, derivationalEndings);
         if (endingLength == 0)
@@ -302,7 +302,7 @@
      * Finds ending among given ending class and returns the length of ending found(0, if not found).
      * Creation date: (17/03/2002 8:18:34 PM)
      */
-    private int findEnding(StringBuffer stemmingZone, int startIndex, char[][] theEndingClass)
+    private int findEnding(StringBuilder stemmingZone, int startIndex, char[][] theEndingClass)
     {
         boolean match = false;
         for (int i = theEndingClass.length - 1; i >= 0; i--)
@@ -333,7 +333,7 @@
         return 0;
     }
 
-    private int findEnding(StringBuffer stemmingZone, char[][] theEndingClass)
+    private int findEnding(StringBuilder stemmingZone, char[][] theEndingClass)
     {
         return findEnding(stemmingZone, stemmingZone.length() - 1, theEndingClass);
     }
@@ -342,7 +342,7 @@
      * Finds the ending among the given class of endings and removes it from stemming zone.
      * Creation date: (17/03/2002 8:18:34 PM)
      */
-    private boolean findAndRemoveEnding(StringBuffer stemmingZone, char[][] theEndingClass)
+    private boolean findAndRemoveEnding(StringBuilder stemmingZone, char[][] theEndingClass)
     {
         int endingLength = findEnding(stemmingZone, theEndingClass);
         if (endingLength == 0)
@@ -360,7 +360,7 @@
      * preceded by any of given predecessors, and if so, removes it from stemming zone.
      * Creation date: (17/03/2002 8:18:34 PM)
      */
-    private boolean findAndRemoveEnding(StringBuffer stemmingZone,
+    private boolean findAndRemoveEnding(StringBuilder stemmingZone,
         char[][] theEndingClass, char[][] thePredessors)
     {
         int endingLength = findEnding(stemmingZone, theEndingClass);
@@ -445,9 +445,9 @@
     /**
      * Noun endings.
      * Creation date: (17/03/2002 12:14:58 AM)
-     * @param stemmingZone java.lang.StringBuffer
+     * @param stemmingZone java.lang.StringBuilder
      */
-    private boolean noun(StringBuffer stemmingZone)
+    private boolean noun(StringBuilder stemmingZone)
     {
         return findAndRemoveEnding(stemmingZone, nounEndings);
     }
@@ -455,9 +455,9 @@
     /**
      * Perfective gerund endings.
      * Creation date: (17/03/2002 12:14:58 AM)
-     * @param stemmingZone java.lang.StringBuffer
+     * @param stemmingZone java.lang.StringBuilder
      */
-    private boolean perfectiveGerund(StringBuffer stemmingZone)
+    private boolean perfectiveGerund(StringBuilder stemmingZone)
     {
         return findAndRemoveEnding(
             stemmingZone,
@@ -469,9 +469,9 @@
     /**
      * Reflexive endings.
      * Creation date: (17/03/2002 12:14:58 AM)
-     * @param stemmingZone java.lang.StringBuffer
+     * @param stemmingZone java.lang.StringBuilder
      */
-    private boolean reflexive(StringBuffer stemmingZone)
+    private boolean reflexive(StringBuilder stemmingZone)
     {
         return findAndRemoveEnding(stemmingZone, reflexiveEndings);
     }
@@ -479,9 +479,9 @@
     /**
      * Insert the method's description here.
      * Creation date: (17/03/2002 12:14:58 AM)
-     * @param stemmingZone java.lang.StringBuffer
+     * @param stemmingZone java.lang.StringBuilder
      */
-    private boolean removeI(StringBuffer stemmingZone)
+    private boolean removeI(StringBuilder stemmingZone)
     {
         if (stemmingZone.length() > 0
             && stemmingZone.charAt(stemmingZone.length() - 1) == I)
@@ -498,9 +498,9 @@
     /**
      * Insert the method's description here.
      * Creation date: (17/03/2002 12:14:58 AM)
-     * @param stemmingZone java.lang.StringBuffer
+     * @param stemmingZone java.lang.StringBuilder
      */
-    private boolean removeSoft(StringBuffer stemmingZone)
+    private boolean removeSoft(StringBuilder stemmingZone)
     {
         if (stemmingZone.length() > 0
             && stemmingZone.charAt(stemmingZone.length() - 1) == SOFT)
@@ -525,7 +525,7 @@
         markPositions(input);
         if (RV == 0)
             return input; //RV wasn't detected, nothing to stem
-        StringBuffer stemmingZone = new StringBuffer(input.substring(RV));
+        StringBuilder stemmingZone = new StringBuilder(input.substring(RV));
         // stemming goes on in RV
         // Step 1
 
@@ -555,9 +555,9 @@
     /**
      * Superlative endings.
      * Creation date: (17/03/2002 12:14:58 AM)
-     * @param stemmingZone java.lang.StringBuffer
+     * @param stemmingZone java.lang.StringBuilder
      */
-    private boolean superlative(StringBuffer stemmingZone)
+    private boolean superlative(StringBuilder stemmingZone)
     {
         return findAndRemoveEnding(stemmingZone, superlativeEndings);
     }
@@ -565,9 +565,9 @@
     /**
      * Undoubles N.
      * Creation date: (17/03/2002 12:14:58 AM)
-     * @param stemmingZone java.lang.StringBuffer
+     * @param stemmingZone java.lang.StringBuilder
      */
-    private boolean undoubleN(StringBuffer stemmingZone)
+    private boolean undoubleN(StringBuilder stemmingZone)
     {
         char[][] doubleN = {
             { N, N }
@@ -586,9 +586,9 @@
     /**
      * Verb endings.
      * Creation date: (17/03/2002 12:14:58 AM)
-     * @param stemmingZone java.lang.StringBuffer
+     * @param stemmingZone java.lang.StringBuilder
      */
-    private boolean verb(StringBuffer stemmingZone)
+    private boolean verb(StringBuilder stemmingZone)
     {
         return findAndRemoveEnding(
             stemmingZone,

Modified: lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/shingle/ShingleFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/shingle/ShingleFilter.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/shingle/ShingleFilter.java (original)
+++ lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/shingle/ShingleFilter.java Fri Oct  2 22:11:10 2009
@@ -44,7 +44,7 @@
 public class ShingleFilter extends TokenFilter {
 
   private LinkedList shingleBuf = new LinkedList();
-  private StringBuffer[] shingles;
+  private StringBuilder[] shingles;
   private String tokenType = "shingle";
 
   /**
@@ -140,15 +140,15 @@
     if (maxShingleSize < 2) {
       throw new IllegalArgumentException("Max shingle size must be >= 2");
     }
-    shingles = new StringBuffer[maxShingleSize];
+    shingles = new StringBuilder[maxShingleSize];
     for (int i = 0; i < shingles.length; i++) {
-      shingles[i] = new StringBuffer();
+      shingles[i] = new StringBuilder();
     }
     this.maxShingleSize = maxShingleSize;
   }
 
   /**
-   * Clear the StringBuffers that are used for storing the output shingles.
+   * Clear the StringBuilders that are used for storing the output shingles.
    */
   private void clearShingles() {
     for (int i = 0; i < shingles.length; i++) {
@@ -188,7 +188,7 @@
         restoreState(nextToken);
         typeAtt.setType(tokenType);
         offsetAtt.setOffset(offsetAtt.startOffset(), endOffsets[shingleBufferPosition]);
-        StringBuffer buf = shingles[shingleBufferPosition];
+        StringBuilder buf = shingles[shingleBufferPosition];
         int termLength = buf.length();
         char[] termBuffer = termAtt.termBuffer();
         if (termBuffer.length < termLength)

Modified: lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/shingle/ShingleMatrixFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/shingle/ShingleMatrixFilter.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/shingle/ShingleMatrixFilter.java (original)
+++ lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/shingle/ShingleMatrixFilter.java Fri Oct  2 22:11:10 2009
@@ -451,7 +451,7 @@
         }
 
         // shingle token factory
-        StringBuffer sb = new StringBuffer(termLength + 10); // paranormal ability to foresee the future.
+        StringBuilder sb = new StringBuilder(termLength + 10); // paranormal ability to foresee the future.
         for (Iterator iterator = shingle.iterator(); iterator.hasNext();) {
           Token shingleToken = (Token) iterator.next();
           if (spacerCharacter != null && sb.length() > 0) {

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=821185&r1=821184&r2=821185&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 Fri Oct  2 22:11:10 2009
@@ -44,7 +44,7 @@
    */
   private final static String PUNCTION = "。,!?;,!?;";
 
-  private final StringBuffer buffer = new StringBuffer();
+  private final StringBuilder buffer = new StringBuilder();
 
   private int tokenStart = 0, tokenEnd = 0;
   

Modified: lucene/java/trunk/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/BiSegGraph.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/BiSegGraph.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/BiSegGraph.java (original)
+++ lucene/java/trunk/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/BiSegGraph.java Fri Oct  2 22:11:10 2009
@@ -225,7 +225,7 @@
   }
 
   public String toString() {
-    StringBuffer sb = new StringBuffer();
+    StringBuilder sb = new StringBuilder();
     Collection values = tokenPairListTable.values();
     for (Iterator iter1 = values.iterator(); iter1.hasNext();) {
       List segList = (List) iter1.next();

Modified: lucene/java/trunk/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/HHMMSegmenter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/HHMMSegmenter.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/HHMMSegmenter.java (original)
+++ lucene/java/trunk/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/HHMMSegmenter.java Fri Oct  2 22:11:10 2009
@@ -47,7 +47,7 @@
     int length = sentence.length();
     int foundIndex;
     int[] charTypeArray = getCharTypes(sentence);
-    StringBuffer wordBuf = new StringBuffer();
+    StringBuilder wordBuf = new StringBuilder();
     SegToken token;
     int frequency = 0; // word的出现次数
     boolean hasFullWidth;

Modified: lucene/java/trunk/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/SegGraph.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/SegGraph.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/SegGraph.java (original)
+++ lucene/java/trunk/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/SegGraph.java Fri Oct  2 22:11:10 2009
@@ -141,7 +141,7 @@
 
   public String toString() {
     List tokenList = this.toTokenList();
-    StringBuffer sb = new StringBuffer();
+    StringBuilder sb = new StringBuilder();
     for (Iterator iter = tokenList.iterator(); iter.hasNext();) {
       SegToken t = (SegToken) iter.next();
       sb.append(t + "\n");

Modified: lucene/java/trunk/contrib/ant/src/java/org/apache/lucene/ant/HtmlDocument.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/ant/src/java/org/apache/lucene/ant/HtmlDocument.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/contrib/ant/src/java/org/apache/lucene/ant/HtmlDocument.java (original)
+++ lucene/java/trunk/contrib/ant/src/java/org/apache/lucene/ant/HtmlDocument.java Fri Oct  2 22:11:10 2009
@@ -275,7 +275,7 @@
      */
     private String getBodyText(Node node) {
         NodeList nl = node.getChildNodes();
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder buffer = new StringBuilder();
         for (int i = 0; i < nl.getLength(); i++) {
             Node child = nl.item(i);
             switch (child.getNodeType()) {

Modified: lucene/java/trunk/contrib/collation/src/test/org/apache/lucene/collation/CollationTestBase.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/collation/src/test/org/apache/lucene/collation/CollationTestBase.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/contrib/collation/src/test/org/apache/lucene/collation/CollationTestBase.java (original)
+++ lucene/java/trunk/contrib/collation/src/test/org/apache/lucene/collation/CollationTestBase.java Fri Oct  2 22:11:10 2009
@@ -292,7 +292,7 @@
   private void assertMatches(Searcher searcher, Query query, Sort sort, 
                              String expectedResult) throws IOException {
     ScoreDoc[] result = searcher.search(query, null, 1000, sort).scoreDocs;
-    StringBuffer buff = new StringBuffer(10);
+    StringBuilder buff = new StringBuilder(10);
     int n = result.length;
     for (int i = 0 ; i < n ; ++i) {
       Document doc = searcher.doc(result[i].doc);

Modified: lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/GradientFormatter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/GradientFormatter.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/GradientFormatter.java (original)
+++ lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/GradientFormatter.java Fri Oct  2 22:11:10 2009
@@ -123,7 +123,7 @@
         {
             return originalText;
         }
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append("<font ");
         if (highlightForeground)
         {
@@ -148,7 +148,7 @@
         int rVal = getColorVal(fgRMin, fgRMax, score);
         int gVal = getColorVal(fgGMin, fgGMax, score);
         int bVal = getColorVal(fgBMin, fgBMax, score);
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append("#");
         sb.append(intToHex(rVal));
         sb.append(intToHex(gVal));
@@ -161,7 +161,7 @@
         int rVal = getColorVal(bgRMin, bgRMax, score);
         int gVal = getColorVal(bgGMin, bgGMax, score);
         int bVal = getColorVal(bgBMin, bgBMax, score);
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append("#");
         sb.append(intToHex(rVal));
         sb.append(intToHex(gVal));

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=821185&r1=821184&r2=821185&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 Fri Oct  2 22:11:10 2009
@@ -215,7 +215,7 @@
 		throws IOException, InvalidTokenOffsetsException
 	{
 		ArrayList docFrags = new ArrayList();
-		StringBuffer newText=new StringBuffer();
+		StringBuilder newText=new StringBuilder();
 		
 	    TermAttribute termAtt = tokenStream.addAttribute(TermAttribute.class);
 	    OffsetAttribute offsetAtt = tokenStream.addAttribute(OffsetAttribute.class);
@@ -486,7 +486,7 @@
 		throws IOException, InvalidTokenOffsetsException
 	{
 		String sections[] =	getBestFragments(tokenStream,text, maxNumFragments);
-		StringBuffer result = new StringBuffer();
+		StringBuilder result = new StringBuilder();
 		for (int i = 0; i < sections.length; i++)
 		{
 			if (i > 0)

Modified: lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/SimpleHTMLEncoder.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/SimpleHTMLEncoder.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/SimpleHTMLEncoder.java (original)
+++ lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/SimpleHTMLEncoder.java Fri Oct  2 22:11:10 2009
@@ -40,7 +40,7 @@
 			return "";
 		}
 
-		StringBuffer result = new StringBuffer(plainText.length());
+		StringBuilder result = new StringBuilder(plainText.length());
 
 		for (int index=0; index<plainText.length(); index++) 
 		{

Modified: lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/SimpleHTMLFormatter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/SimpleHTMLFormatter.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/SimpleHTMLFormatter.java (original)
+++ lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/SimpleHTMLFormatter.java Fri Oct  2 22:11:10 2009
@@ -47,9 +47,9 @@
 	    return originalText;
 	  }
 	  
-	  // Allocate StringBuffer with the right number of characters from the
+	  // Allocate StringBuilder with the right number of characters from the
     // beginning, to avoid char[] allocations in the middle of appends.
-	  StringBuffer returnBuffer = new StringBuffer(preTag.length() + originalText.length() + postTag.length());
+	  StringBuilder returnBuffer = new StringBuilder(preTag.length() + originalText.length() + postTag.length());
 	  returnBuffer.append(preTag);
 	  returnBuffer.append(originalText);
 	  returnBuffer.append(postTag);

Modified: lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/SpanGradientFormatter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/SpanGradientFormatter.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/SpanGradientFormatter.java (original)
+++ lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/SpanGradientFormatter.java Fri Oct  2 22:11:10 2009
@@ -50,7 +50,7 @@
         }
 
 		// try to size sb correctly
-        StringBuffer sb = new StringBuffer( originalText.length() + EXTRA);
+        StringBuilder sb = new StringBuilder( originalText.length() + EXTRA);
 		
 		sb.append("<span style=\""); 
 		if (highlightForeground) 
@@ -71,7 +71,7 @@
         return sb.toString();
     }
 
-	// guess how much extra text we'll add to the text we're highlighting to try to avoid a  StringBuffer resize
+	// guess how much extra text we'll add to the text we're highlighting to try to avoid a  StringBuilder resize
 	private static final String TEMPLATE = "<span style=\"background: #EEEEEE; color: #000000;\">...</span>";
 	private static final int EXTRA = TEMPLATE.length();	
 }

Modified: lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/TextFragment.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/TextFragment.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/TextFragment.java (original)
+++ lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/TextFragment.java Fri Oct  2 22:11:10 2009
@@ -25,12 +25,19 @@
  */
 public class TextFragment
 {
-	StringBuffer markedUpText;
+	CharSequence markedUpText;
 	int fragNum;
 	int textStartPos;
 	int textEndPos;
 	float score;
 
+	public TextFragment(CharSequence markedUpText,int textStartPos, int fragNum)
+	{
+		this.markedUpText=markedUpText;
+		this.textStartPos = textStartPos;
+		this.fragNum = fragNum;
+	}
+  /** @deprecated */
 	public TextFragment(StringBuffer markedUpText,int textStartPos, int fragNum)
 	{
 		this.markedUpText=markedUpText;
@@ -73,7 +80,7 @@
 	/* Returns the marked-up text for this text fragment 
 	 */
 	public String toString() {
-		return markedUpText.substring(textStartPos, textEndPos);
+		return markedUpText.subSequence(textStartPos, textEndPos).toString();
 	}
 
 }

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=821185&r1=821184&r2=821185&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 Fri Oct  2 22:11:10 2009
@@ -1034,7 +1034,7 @@
         TermQuery query = new TermQuery(new Term("data", goodWord));
 
         String match = null;
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append(goodWord);
         for (int i = 0; i < 10000; i++) {
           sb.append(" ");

Modified: lucene/java/trunk/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedTermFreqVector.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedTermFreqVector.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedTermFreqVector.java (original)
+++ lucene/java/trunk/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedTermFreqVector.java Fri Oct  2 22:11:10 2009
@@ -58,7 +58,7 @@
   }
 
   public String toString() {
-    StringBuffer sb = new StringBuffer();
+    StringBuilder sb = new StringBuilder();
     sb.append('{');
     sb.append(field).append(": ");
     if (terms != null) {

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=821185&r1=821184&r2=821185&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 Fri Oct  2 22:11:10 2009
@@ -507,7 +507,7 @@
    * @return the string representation
    */
   public String toString() {
-    StringBuffer result = new StringBuffer(256);    
+    StringBuilder result = new StringBuilder(256);    
     sortFields();   
     int sumChars = 0;
     int sumPositions = 0;
@@ -688,7 +688,7 @@
     public String toString(int stride) {
       int s = size() / stride;
       int len = Math.min(10, s); // avoid printing huge lists
-      StringBuffer buf = new StringBuffer(4*len);
+      StringBuilder buf = new StringBuilder(4*len);
       buf.append("[");
       for (int i = 0; i < len; i++) {
         buf.append(get(i*stride));

Modified: lucene/java/trunk/contrib/memory/src/java/org/apache/lucene/index/memory/SynonymMap.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/memory/src/java/org/apache/lucene/index/memory/SynonymMap.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/contrib/memory/src/java/org/apache/lucene/index/memory/SynonymMap.java (original)
+++ lucene/java/trunk/contrib/memory/src/java/org/apache/lucene/index/memory/SynonymMap.java Fri Oct  2 22:11:10 2009
@@ -122,7 +122,7 @@
    * @return a String representation
    */
   public String toString() {
-    StringBuffer buf = new StringBuffer();
+    StringBuilder buf = new StringBuilder();
     Iterator iter = new TreeMap(table).keySet().iterator();
     int count = 0;
     int f0 = 0;
@@ -327,7 +327,7 @@
     }
     
     // assemble large string containing all words
-    StringBuffer buf = new StringBuffer(len);
+    StringBuilder buf = new StringBuilder(len);
     for (int j=0; j < size; j++) buf.append(words[j]);
     String allWords = new String(buf.toString()); // ensure compact string across JDK versions
     buf = null;

Modified: lucene/java/trunk/contrib/misc/src/java/org/apache/lucene/misc/ChainedFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/misc/src/java/org/apache/lucene/misc/ChainedFilter.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/contrib/misc/src/java/org/apache/lucene/misc/ChainedFilter.java (original)
+++ lucene/java/trunk/contrib/misc/src/java/org/apache/lucene/misc/ChainedFilter.java Fri Oct  2 22:11:10 2009
@@ -201,7 +201,7 @@
 
     public String toString()
     {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append("ChainedFilter: [");
         for (int i = 0; i < chain.length; i++)
         {

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=821185&r1=821184&r2=821185&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 Fri Oct  2 22:11:10 2009
@@ -80,7 +80,7 @@
     /* somewhat a hack: find/store wildcard chars
      * in order to put them back after analyzing */
     boolean isWithinToken = (!termStr.startsWith("?") && !termStr.startsWith("*"));
-    StringBuffer tmpBuffer = new StringBuffer();
+    StringBuilder tmpBuffer = new StringBuilder();
     char[] chars = termStr.toCharArray();
     for (int i = 0; i < termStr.length(); i++) {
       if (chars[i] == '?' || chars[i] == '*') {
@@ -154,7 +154,7 @@
     } else {
       /* the term was tokenized, let's rebuild to one token
        * with wildcards put back in postion */
-      StringBuffer sb = new StringBuffer();
+      StringBuilder sb = new StringBuilder();
       for (int i = 0; i < tlist.size(); i++) {
         sb.append((String) tlist.get(i));
         if (wlist != null && wlist.size() > i) {

Modified: lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/BooleanFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/BooleanFilter.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/BooleanFilter.java (original)
+++ lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/BooleanFilter.java Fri Oct  2 22:11:10 2009
@@ -182,7 +182,7 @@
   /** Prints a user-readable version of this query. */
   public String toString()
   {
-    StringBuffer buffer = new StringBuffer();
+    StringBuilder buffer = new StringBuilder();
     buffer.append("BooleanFilter(");
     appendFilters(shouldFilters, "", buffer);
     appendFilters(mustFilters, "+", buffer);
@@ -191,7 +191,7 @@
     return buffer.toString();
   }
   
-  private void appendFilters(ArrayList filters, String occurString, StringBuffer buffer)
+  private void appendFilters(ArrayList filters, String occurString, StringBuilder buffer)
   {
     if (filters != null) {
       for (int i = 0; i < filters.size(); i++) {

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=821185&r1=821184&r2=821185&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 Fri Oct  2 22:11:10 2009
@@ -681,7 +681,7 @@
      * Describe the parameters that control how the "more like this" query is formed.
      */
     public String describeParams() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append("\t" + "maxQueryTerms  : " + maxQueryTerms + "\n");
         sb.append("\t" + "minWordLen     : " + minWordLen + "\n");
         sb.append("\t" + "maxWordLen     : " + maxWordLen + "\n");

Modified: lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/PathQueryNode.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/PathQueryNode.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/PathQueryNode.java (original)
+++ lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/PathQueryNode.java Fri Oct  2 22:11:10 2009
@@ -171,7 +171,7 @@
   }
 
   private CharSequence getPathString() {
-    StringBuffer path = new StringBuffer();
+    StringBuilder path = new StringBuilder();
 
     for (QueryText pathelement : values) {
       path.append("/").append(pathelement.value);
@@ -180,7 +180,7 @@
   }
 
   public CharSequence toQueryString(EscapeQuerySyntax escaper) {
-    StringBuffer path = new StringBuffer();
+    StringBuilder path = new StringBuilder();
     path.append("/").append(getFirstPathElement());
 
     for (QueryText pathelement : getPathElements(1)) {

Modified: lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/util/UnescapedCharSequence.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/util/UnescapedCharSequence.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/util/UnescapedCharSequence.java (original)
+++ lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/util/UnescapedCharSequence.java Fri Oct  2 22:11:10 2009
@@ -96,7 +96,7 @@
    */
   public String toStringEscaped() {
     // non efficient implementation
-    StringBuffer result = new StringBuffer();
+    StringBuilder result = new StringBuilder();
     for (int i = 0; i >= this.length(); i++) {
       if (this.chars[i] == '\\') {
         result.append('\\');
@@ -117,7 +117,7 @@
    */
   public String toStringEscaped(char[] enabledChars) {
     // TODO: non efficient implementation, refactor this code
-    StringBuffer result = new StringBuffer();
+    StringBuilder result = new StringBuilder();
     for (int i = 0; i < this.length(); i++) {
       if (this.chars[i] == '\\') {
         result.append('\\');

Modified: lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/QueryParserUtil.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/QueryParserUtil.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/QueryParserUtil.java (original)
+++ lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/QueryParserUtil.java Fri Oct  2 22:11:10 2009
@@ -188,7 +188,7 @@
    * escaped are escaped by a preceding <code>\</code>.
    */
   public static String escape(String s) {
-    StringBuffer sb = new StringBuffer();
+    StringBuilder sb = new StringBuilder();
     for (int i = 0; i < s.length(); i++) {
       char c = s.charAt(i);
       // These characters are part of the query syntax and must be escaped

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=821185&r1=821184&r2=821185&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 Fri Oct  2 22:11:10 2009
@@ -95,7 +95,7 @@
    * escaped are escaped by a preceding <code>\</code>.
    */
   public static String escape(String s) {
-    StringBuffer sb = new StringBuffer();
+    StringBuilder sb = new StringBuilder();
     for (int i = 0; i < s.length(); i++) {
       char c = s.charAt(i);
       // These characters are part of the query syntax and must be escaped

Modified: lucene/java/trunk/contrib/regex/src/java/org/apache/lucene/search/regex/SpanRegexQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/regex/src/java/org/apache/lucene/search/regex/SpanRegexQuery.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/contrib/regex/src/java/org/apache/lucene/search/regex/SpanRegexQuery.java (original)
+++ lucene/java/trunk/contrib/regex/src/java/org/apache/lucene/search/regex/SpanRegexQuery.java Fri Oct  2 22:11:10 2009
@@ -107,7 +107,7 @@
   }
 
   public String toString(String field) {
-    StringBuffer buffer = new StringBuffer();
+    StringBuilder buffer = new StringBuilder();
     buffer.append("spanRegexQuery(");
     buffer.append(term);
     buffer.append(")");

Modified: lucene/java/trunk/contrib/remote/src/test/org/apache/lucene/search/TestRemoteSort.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/remote/src/test/org/apache/lucene/search/TestRemoteSort.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/contrib/remote/src/test/org/apache/lucene/search/TestRemoteSort.java (original)
+++ lucene/java/trunk/contrib/remote/src/test/org/apache/lucene/search/TestRemoteSort.java Fri Oct  2 22:11:10 2009
@@ -146,7 +146,7 @@
   }
   
   public String getRandomNumberString(int num, int low, int high) {
-    StringBuffer sb = new StringBuffer();
+    StringBuilder sb = new StringBuilder();
     for (int i = 0; i < num; i++) {
       sb.append(getRandomNumber(low, high));
     }
@@ -158,7 +158,7 @@
   }
   
   public String getRandomCharString(int num, int start, int end) {
-    StringBuffer sb = new StringBuffer();
+    StringBuilder sb = new StringBuilder();
     for (int i = 0; i < num; i++) {
       sb.append(new Character((char) getRandomNumber(start, end)));
     }
@@ -394,7 +394,7 @@
     TopDocs hits = searcher.search (query, null, expectedResult.length(), sort);
     ScoreDoc[] result = hits.scoreDocs;
     assertEquals(hits.totalHits, expectedResult.length());
-    StringBuffer buff = new StringBuffer(10);
+    StringBuilder buff = new StringBuilder(10);
     int n = result.length;
     for (int i=0; i<n; ++i) {
       Document doc = searcher.doc(result[i].doc);

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=821185&r1=821184&r2=821185&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 Fri Oct  2 22:11:10 2009
@@ -236,7 +236,7 @@
 
   private void collapseAndSaveTokens(int tokenType, String type) throws IOException {
     //collapse
-    StringBuffer buffer = new StringBuffer(32);
+    StringBuilder buffer = new StringBuilder(32);
     int numAdded = scanner.setText(buffer);
     //TODO: how to know how much whitespace to add
     int theStart = scanner.yychar();
@@ -279,7 +279,7 @@
 
   private void collapseTokens(int tokenType) throws IOException {
     //collapse
-    StringBuffer buffer = new StringBuffer(32);
+    StringBuilder buffer = new StringBuilder(32);
     int numAdded = scanner.setText(buffer);
     //TODO: how to know how much whitespace to add
     int theStart = scanner.yychar();

Modified: lucene/java/trunk/contrib/wikipedia/src/java/org/apache/lucene/wikipedia/analysis/WikipediaTokenizerImpl.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/wikipedia/src/java/org/apache/lucene/wikipedia/analysis/WikipediaTokenizerImpl.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/contrib/wikipedia/src/java/org/apache/lucene/wikipedia/analysis/WikipediaTokenizerImpl.java (original)
+++ lucene/java/trunk/contrib/wikipedia/src/java/org/apache/lucene/wikipedia/analysis/WikipediaTokenizerImpl.java Fri Oct  2 22:11:10 2009
@@ -480,7 +480,7 @@
   t.setTermBuffer(zzBuffer, zzStartRead, zzMarkedPos-zzStartRead);
 }
 
-final int setText(StringBuffer buffer){
+final int setText(StringBuilder buffer){
   int length = zzMarkedPos - zzStartRead;
   buffer.append(zzBuffer, zzStartRead, length);
   return length;

Modified: lucene/java/trunk/contrib/wikipedia/src/java/org/apache/lucene/wikipedia/analysis/WikipediaTokenizerImpl.jflex
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/wikipedia/src/java/org/apache/lucene/wikipedia/analysis/WikipediaTokenizerImpl.jflex?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/contrib/wikipedia/src/java/org/apache/lucene/wikipedia/analysis/WikipediaTokenizerImpl.jflex (original)
+++ lucene/java/trunk/contrib/wikipedia/src/java/org/apache/lucene/wikipedia/analysis/WikipediaTokenizerImpl.jflex Fri Oct  2 22:11:10 2009
@@ -85,7 +85,7 @@
   t.setTermBuffer(zzBuffer, zzStartRead, zzMarkedPos-zzStartRead);
 }
 
-final int setText(StringBuffer buffer){
+final int setText(StringBuilder buffer){
   int length = zzMarkedPos - zzStartRead;
   buffer.append(zzBuffer, zzStartRead, length);
   return length;

Modified: lucene/java/trunk/contrib/xml-query-parser/src/java/org/apache/lucene/xmlparser/DOMUtils.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/xml-query-parser/src/java/org/apache/lucene/xmlparser/DOMUtils.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/contrib/xml-query-parser/src/java/org/apache/lucene/xmlparser/DOMUtils.java (original)
+++ lucene/java/trunk/contrib/xml-query-parser/src/java/org/apache/lucene/xmlparser/DOMUtils.java Fri Oct  2 22:11:10 2009
@@ -197,7 +197,7 @@
 	//MH changed to Node from Element 25/11/2005
 	public static String getText(Node e)
 	{
-		StringBuffer sb=new StringBuffer();
+		StringBuilder sb=new StringBuilder();
 		getTextBuffer(e, sb);
 		return sb.toString();
 	}
@@ -215,7 +215,7 @@
 		return null;
 	}	
 
-	private static void getTextBuffer(Node e, StringBuffer sb)
+	private static void getTextBuffer(Node e, StringBuilder sb)
 	{
 	    for (Node kid = e.getFirstChild(); kid != null; kid = kid.getNextSibling())
 		{

Modified: lucene/java/trunk/src/java/org/apache/lucene/analysis/BaseCharFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/analysis/BaseCharFilter.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/analysis/BaseCharFilter.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/analysis/BaseCharFilter.java Fri Oct  2 22:11:10 2009
@@ -80,7 +80,7 @@
     }
 
     public String toString() {
-      StringBuffer sb = new StringBuffer();
+      StringBuilder sb = new StringBuilder();
       sb.append('(');
       sb.append(off);
       sb.append(',');

Modified: lucene/java/trunk/src/java/org/apache/lucene/analysis/NumericTokenStream.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/analysis/NumericTokenStream.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/analysis/NumericTokenStream.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/analysis/NumericTokenStream.java Fri Oct  2 22:11:10 2009
@@ -235,7 +235,7 @@
   
   @Override
   public String toString() {
-    final StringBuffer sb = new StringBuffer("(numeric,valSize=").append(valSize);
+    final StringBuilder sb = new StringBuilder("(numeric,valSize=").append(valSize);
     sb.append(",precisionStep=").append(precisionStep).append(')');
     return sb.toString();
   }

Modified: lucene/java/trunk/src/java/org/apache/lucene/analysis/Token.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/analysis/Token.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/analysis/Token.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/analysis/Token.java Fri Oct  2 22:11:10 2009
@@ -607,7 +607,7 @@
   }
   
   public String toString() {
-    StringBuffer sb = new StringBuffer();
+    StringBuilder sb = new StringBuilder();
     sb.append('(');
     initTermBuffer();
     if (termBuffer == null)

Modified: lucene/java/trunk/src/java/org/apache/lucene/document/AbstractField.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/document/AbstractField.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/document/AbstractField.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/document/AbstractField.java Fri Oct  2 22:11:10 2009
@@ -305,7 +305,7 @@
 
   /** Prints a Field for human consumption. */
   public final String toString() {
-    StringBuffer result = new StringBuffer();
+    StringBuilder result = new StringBuilder();
     if (isStored) {
       result.append("stored");
       if (isCompressed)

Modified: lucene/java/trunk/src/java/org/apache/lucene/document/DateField.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/document/DateField.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/document/DateField.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/document/DateField.java Fri Oct  2 22:11:10 2009
@@ -102,7 +102,7 @@
 
     // Pad with leading zeros
     if (s.length() < DATE_LEN) {
-      StringBuffer sb = new StringBuffer(s);
+      StringBuilder sb = new StringBuilder(s);
       while (sb.length() < DATE_LEN)
         sb.insert(0, 0);
       s = sb.toString();

Modified: lucene/java/trunk/src/java/org/apache/lucene/document/Document.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/document/Document.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/document/Document.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/document/Document.java Fri Oct  2 22:11:10 2009
@@ -317,7 +317,7 @@
   
   /** Prints the fields of a document for human consumption. */
   public final String toString() {
-    StringBuffer buffer = new StringBuffer();
+    StringBuilder buffer = new StringBuilder();
     buffer.append("Document<");
     for (int i = 0; i < fields.size(); i++) {
       Fieldable field = (Fieldable)fields.get(i);

Modified: lucene/java/trunk/src/java/org/apache/lucene/document/NumberTools.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/document/NumberTools.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/document/NumberTools.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/document/NumberTools.java Fri Oct  2 22:11:10 2009
@@ -81,7 +81,7 @@
             return MIN_STRING_VALUE;
         }
 
-        StringBuffer buf = new StringBuffer(STR_SIZE);
+        StringBuilder buf = new StringBuilder(STR_SIZE);
 
         if (l < 0) {
             buf.append(NEGATIVE_PREFIX);

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java Fri Oct  2 22:11:10 2009
@@ -5220,7 +5220,7 @@
   }
 
   private synchronized String segString(SegmentInfos infos) {
-    StringBuffer buffer = new StringBuffer();
+    StringBuilder buffer = new StringBuilder();
     final int count = infos.size();
     for(int i = 0; i < count; i++) {
       if (i > 0) {

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/MergePolicy.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/MergePolicy.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/MergePolicy.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/MergePolicy.java Fri Oct  2 22:11:10 2009
@@ -123,7 +123,7 @@
     }
 
     String segString(Directory dir) {
-      StringBuffer b = new StringBuffer();
+      StringBuilder b = new StringBuilder();
       final int numSegments = segments.size();
       for(int i=0;i<numSegments;i++) {
         if (i > 0) b.append(' ');
@@ -159,7 +159,7 @@
     }
 
     public String segString(Directory dir) {
-      StringBuffer b = new StringBuffer();
+      StringBuilder b = new StringBuilder();
       b.append("MergeSpec:\n");
       final int count = merges.size();
       for(int i=0;i<count;i++)

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/SegmentInfos.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/SegmentInfos.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/SegmentInfos.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/SegmentInfos.java Fri Oct  2 22:11:10 2009
@@ -895,7 +895,7 @@
   }
 
   public synchronized String segString(Directory directory) {
-    StringBuffer buffer = new StringBuffer();
+    StringBuilder buffer = new StringBuilder();
     final int count = size();
     for(int i = 0; i < count; i++) {
       if (i > 0) {

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/SegmentTermVector.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/SegmentTermVector.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/SegmentTermVector.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/SegmentTermVector.java Fri Oct  2 22:11:10 2009
@@ -40,7 +40,7 @@
   }
 
   public String toString() {
-    StringBuffer sb = new StringBuffer();
+    StringBuilder sb = new StringBuilder();
     sb.append('{');
     sb.append(field).append(": ");
     if(terms != null){

Modified: lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.java Fri Oct  2 22:11:10 2009
@@ -1131,7 +1131,7 @@
    * expects to be escaped are escaped by a preceding <code>\</code>.
    */
   public static String escape(String s) {
-    StringBuffer sb = new StringBuffer();
+    StringBuilder sb = new StringBuilder();
     for (int i = 0; i < s.length(); i++) {
       char c = s.charAt(i);
       // These characters are part of the query syntax and must be escaped

Modified: lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.jj
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.jj?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.jj (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.jj Fri Oct  2 22:11:10 2009
@@ -1155,7 +1155,7 @@
    * expects to be escaped are escaped by a preceding <code>\</code>.
    */
   public static String escape(String s) {
-    StringBuffer sb = new StringBuffer();
+    StringBuilder sb = new StringBuilder();
     for (int i = 0; i < s.length(); i++) {
       char c = s.charAt(i);
       // These characters are part of the query syntax and must be escaped

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/BooleanQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/BooleanQuery.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/BooleanQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/BooleanQuery.java Fri Oct  2 22:11:10 2009
@@ -464,7 +464,7 @@
 
   /** Prints a user-readable version of this query. */
   public String toString(String field) {
-    StringBuffer buffer = new StringBuffer();
+    StringBuilder buffer = new StringBuilder();
     boolean needParens=(getBoost() != 1.0) || (getMinimumNumberShouldMatch()>0) ;
     if (needParens) {
       buffer.append("(");

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/BooleanScorer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/BooleanScorer.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/BooleanScorer.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/BooleanScorer.java Fri Oct  2 22:11:10 2009
@@ -357,7 +357,7 @@
   }
 
   public String toString() {
-    StringBuffer buffer = new StringBuffer();
+    StringBuilder buffer = new StringBuilder();
     buffer.append("boolean(");
     for (SubScorer sub = scorers; sub != null; sub = sub.next) {
       buffer.append(sub.scorer.toString());

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java Fri Oct  2 22:11:10 2009
@@ -224,7 +224,7 @@
    * @return a string that shows what we do, of the form "(disjunct1 | disjunct2 | ... | disjunctn)^boost"
    */
   public String toString(String field) {
-    StringBuffer buffer = new StringBuffer();
+    StringBuilder buffer = new StringBuilder();
     buffer.append("(");
     int numDisjunctions = disjuncts.size();
     for (int i = 0 ; i < numDisjunctions; i++) {

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/Explanation.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/Explanation.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/Explanation.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/Explanation.java Fri Oct  2 22:11:10 2009
@@ -86,7 +86,7 @@
     return toString(0);
   }
   protected String toString(int depth) {
-    StringBuffer buffer = new StringBuffer();
+    StringBuilder buffer = new StringBuilder();
     for (int i = 0; i < depth; i++) {
       buffer.append("  ");
     }
@@ -106,7 +106,7 @@
 
   /** Render an explanation as HTML. */
   public String toHtml() {
-    StringBuffer buffer = new StringBuffer();
+    StringBuilder buffer = new StringBuilder();
     buffer.append("<ul>\n");
 
     buffer.append("<li>");

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/FieldCache.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/FieldCache.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/FieldCache.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/FieldCache.java Fri Oct  2 22:11:10 2009
@@ -563,7 +563,7 @@
     
     
     public String toString() {
-      StringBuffer b = new StringBuffer();
+      StringBuilder b = new StringBuilder();
       b.append("'").append(getReaderKey()).append("'=>");
       b.append("'").append(getFieldName()).append("',");
       b.append(getCacheType()).append(",").append(getCustom());

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheRangeFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheRangeFilter.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheRangeFilter.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheRangeFilter.java Fri Oct  2 22:11:10 2009
@@ -431,7 +431,7 @@
   }
   
   public final String toString() {
-    final StringBuffer sb = new StringBuffer(field).append(":");
+    final StringBuilder sb = new StringBuilder(field).append(":");
     return sb.append(includeLower ? '[' : '{')
       .append((lowerVal == null) ? "*" : lowerVal.toString())
       .append(" TO ")

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/FieldDoc.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/FieldDoc.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/FieldDoc.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/FieldDoc.java Fri Oct  2 22:11:10 2009
@@ -63,7 +63,7 @@
 	public String toString() {
 	  // super.toString returns the doc and score information, so just add the
           // fields information
-	  StringBuffer sb = new StringBuffer(super.toString());
+	  StringBuilder sb = new StringBuilder(super.toString());
 	  sb.append("[");
 	  for (int i = 0; i < fields.length; i++) {
             sb.append(fields[i]).append(", ");

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/FilteredQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/FilteredQuery.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/FilteredQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/FilteredQuery.java Fri Oct  2 22:11:10 2009
@@ -206,7 +206,7 @@
 
   /** Prints a user-readable version of this query. */
   public String toString (String s) {
-    StringBuffer buffer = new StringBuffer();
+    StringBuilder buffer = new StringBuilder();
     buffer.append("filtered(");
     buffer.append(query.toString(s));
     buffer.append(")->");

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/FuzzyQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/FuzzyQuery.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/FuzzyQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/FuzzyQuery.java Fri Oct  2 22:11:10 2009
@@ -173,7 +173,7 @@
   }
     
   public String toString(String field) {
-    StringBuffer buffer = new StringBuffer();
+    StringBuilder buffer = new StringBuilder();
     if (!term.field().equals(field)) {
         buffer.append(term.field());
         buffer.append(":");

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/Hit.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/Hit.java?rev=821185&r1=821184&r2=821185&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/Hit.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/Hit.java Fri Oct  2 22:11:10 2009
@@ -113,7 +113,7 @@
    * Prints the parameters to be used to discover the promised result.
    */
   public String toString() {
-    StringBuffer buffer = new StringBuffer();
+    StringBuilder buffer = new StringBuilder();
     buffer.append("Hit<");
     buffer.append(hits.toString());
     buffer.append(" [");



Mime
View raw message