@@ -63,7 +63,6 @@ public class Context {
63
63
private final Query query ;
64
64
private final QueryBuilder qbuilder ;
65
65
private final LineMatcher [] m ;
66
- private char [] buffer ;
67
66
PlainLineTokenizer tokens ;
68
67
String queryAsURI ;
69
68
@@ -99,7 +98,6 @@ public Context(Query query, QueryBuilder qbuilder) {
99
98
if (m != null ) {
100
99
buildQueryAsURI (qbuilder .getQueries ());
101
100
//System.err.println("Found Matchers = "+ m.length + " for " + query);
102
- buffer = new char [MAXFILEREAD ];
103
101
tokens = new PlainLineTokenizer ((Reader ) null );
104
102
}
105
103
}
@@ -213,7 +211,7 @@ public boolean getContext2(RuntimeEnvironment env, IndexSearcher searcher,
213
211
214
212
try {
215
213
List <String > fieldList = qbuilder .getContextFields ();
216
- String [] fields = fieldList .toArray (new String [fieldList . size () ]);
214
+ String [] fields = fieldList .toArray (new String [0 ]);
217
215
218
216
String res = uhi .highlightFieldsUnion (fields , query , docId ,
219
217
linelimit );
@@ -299,7 +297,8 @@ public boolean getContext(Reader in, Writer out, String urlPrefix,
299
297
if (scopes != null ) {
300
298
Scope scp = scopes .getScope (tag .line );
301
299
scope = scp .getName () + "()" ;
302
- scopeUrl = "<a href=\" " + urlPrefixE + pathE + "#" + Integer .toString (scp .getLineFrom ()) + "\" >" + scope + "</a>" ;
300
+ scopeUrl = "<a href=\" " + urlPrefixE + pathE + "#" +
301
+ scp .getLineFrom () + "\" >" + scope + "</a>" ;
303
302
}
304
303
305
304
/* desc[0] is matched symbol
@@ -368,7 +367,7 @@ public boolean getContext(Reader in, Writer out, String urlPrefix,
368
367
if (in == null ) {
369
368
return anything ;
370
369
}
371
- int charsRead = 0 ;
370
+ int charsRead ;
372
371
boolean truncated = false ;
373
372
374
373
boolean lim = limit ;
@@ -378,6 +377,7 @@ public boolean getContext(Reader in, Writer out, String urlPrefix,
378
377
}
379
378
380
379
if (lim ) {
380
+ char [] buffer = new char [MAXFILEREAD ];
381
381
try {
382
382
charsRead = in .read (buffer );
383
383
if (charsRead == MAXFILEREAD ) {
0 commit comments