mirror of https://github.com/apache/lucene.git
LUCENE-1257: Change some occurrences of StringBuffer in public/protected APIs of contrib/surround to StringBuilder
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@821443 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4a210f1b69
commit
b75e96f2f4
|
@ -2,6 +2,12 @@ Lucene contrib change Log
|
|||
|
||||
======================= Trunk (not yet released) =======================
|
||||
|
||||
Changes in backwards compatibility policy
|
||||
|
||||
* LUCENE-1257: Change some occurences of StringBuffer in public/protected
|
||||
APIs of contrib/surround to StringBuilder.
|
||||
(Paul Elschot via Uwe Schindler)
|
||||
|
||||
Changes in runtime behavior
|
||||
|
||||
API Changes
|
||||
|
|
|
@ -57,7 +57,7 @@ public abstract class ComposedQuery extends SrndQuery {
|
|||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuffer r = new StringBuffer();
|
||||
StringBuilder r = new StringBuilder();
|
||||
if (isOperatorInfix()) {
|
||||
infixToString(r);
|
||||
} else {
|
||||
|
@ -72,7 +72,7 @@ public abstract class ComposedQuery extends SrndQuery {
|
|||
protected String getBracketOpen() { return "(";}
|
||||
protected String getBracketClose() { return ")";}
|
||||
|
||||
protected void infixToString(StringBuffer r) {
|
||||
protected void infixToString(StringBuilder r) {
|
||||
/* Brackets are possibly redundant in the result. */
|
||||
Iterator sqi = getSubQueriesIterator();
|
||||
r.append(getBracketOpen());
|
||||
|
@ -88,7 +88,7 @@ public abstract class ComposedQuery extends SrndQuery {
|
|||
r.append(getBracketClose());
|
||||
}
|
||||
|
||||
protected void prefixToString(StringBuffer r) {
|
||||
protected void prefixToString(StringBuilder r) {
|
||||
Iterator sqi = getSubQueriesIterator();
|
||||
r.append(getOperatorName()); /* prefix operator */
|
||||
r.append(getBracketOpen());
|
||||
|
|
|
@ -75,7 +75,7 @@ public class FieldsQuery extends SrndQuery { /* mostly untested */
|
|||
public char getFieldOperator() { return fieldOp;}
|
||||
|
||||
public String toString() {
|
||||
StringBuffer r = new StringBuffer();
|
||||
StringBuilder r = new StringBuilder();
|
||||
r.append("(");
|
||||
fieldNamesToString(r);
|
||||
r.append(q.toString());
|
||||
|
@ -83,7 +83,7 @@ public class FieldsQuery extends SrndQuery { /* mostly untested */
|
|||
return r.toString();
|
||||
}
|
||||
|
||||
protected void fieldNamesToString(StringBuffer r) {
|
||||
protected void fieldNamesToString(StringBuilder r) {
|
||||
Iterator fni = getFieldNames().listIterator();
|
||||
while (fni.hasNext()) {
|
||||
r.append((String) fni.next());
|
||||
|
|
|
@ -45,10 +45,10 @@ public abstract class SimpleTerm
|
|||
return this.toStringUnquoted().compareTo( ost.toStringUnquoted());
|
||||
}
|
||||
|
||||
protected void suffixToString(StringBuffer r) {;} /* override for prefix query */
|
||||
protected void suffixToString(StringBuilder r) {;} /* override for prefix query */
|
||||
|
||||
public String toString() {
|
||||
StringBuffer r = new StringBuffer();
|
||||
StringBuilder r = new StringBuilder();
|
||||
if (isQuoted()) {
|
||||
r.append(getQuote());
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ public class SrndPrefixQuery extends SimpleTerm {
|
|||
|
||||
public String toStringUnquoted() {return getPrefix();}
|
||||
|
||||
protected void suffixToString(StringBuffer r) {r.append(getSuffixOperator());}
|
||||
protected void suffixToString(StringBuilder r) {r.append(getSuffixOperator());}
|
||||
|
||||
public void visitMatchingTerms(
|
||||
IndexReader reader,
|
||||
|
|
|
@ -36,7 +36,7 @@ public abstract class SrndQuery implements Cloneable {
|
|||
|
||||
public String getWeightOperator() {return "^";}
|
||||
|
||||
protected void weightToString(StringBuffer r) { /* append the weight part of a query */
|
||||
protected void weightToString(StringBuilder r) { /* append the weight part of a query */
|
||||
if (isWeighted()) {
|
||||
r.append(getWeightOperator());
|
||||
r.append(getWeightString());
|
||||
|
|
|
@ -52,7 +52,7 @@ public class SrndTruncQuery extends SimpleTerm {
|
|||
return (c != unlimited) && (c != mask);
|
||||
}
|
||||
|
||||
protected void appendRegExpForChar(char c, StringBuffer re) {
|
||||
protected void appendRegExpForChar(char c, StringBuilder re) {
|
||||
if (c == unlimited)
|
||||
re.append(".*");
|
||||
else if (c == mask)
|
||||
|
@ -68,7 +68,7 @@ public class SrndTruncQuery extends SimpleTerm {
|
|||
}
|
||||
prefix = truncated.substring(0, i);
|
||||
|
||||
StringBuffer re = new StringBuffer();
|
||||
StringBuilder re = new StringBuilder();
|
||||
while (i < truncated.length()) {
|
||||
appendRegExpForChar(truncated.charAt(i), re);
|
||||
i++;
|
||||
|
|
|
@ -30,7 +30,7 @@ public class ExceptionQueryTst {
|
|||
this.verbose = verbose;
|
||||
}
|
||||
|
||||
public void doTest(StringBuffer failQueries) {
|
||||
public void doTest(StringBuilder failQueries) {
|
||||
boolean pass = false;
|
||||
SrndQuery lq = null;
|
||||
try {
|
||||
|
@ -55,7 +55,7 @@ public class ExceptionQueryTst {
|
|||
}
|
||||
|
||||
public static String getFailQueries(String[] exceptionQueries, boolean verbose) {
|
||||
StringBuffer failQueries = new StringBuffer();
|
||||
StringBuilder failQueries = new StringBuilder();
|
||||
for (int i = 0; i < exceptionQueries.length; i++ ) {
|
||||
new ExceptionQueryTst( exceptionQueries[i], verbose).doTest(failQueries);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue