File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
server/src/main/java/org/elasticsearch/common/logging Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -364,16 +364,16 @@ static String escapeBackslashesAndQuotes(final String s) {
364
364
* We want a fast path check to avoid creating the string builder and copying characters if needed. So we walk the string looking
365
365
* for either of the characters that we need to escape. If we find a character that needs escaping, we start over and
366
366
*/
367
- boolean encodingNeeded = false ;
367
+ boolean escapingNeeded = false ;
368
368
for (int i = 0 ; i < s .length (); i ++) {
369
369
final char c = s .charAt (i );
370
370
if (c == '\\' || c == '"' ) {
371
- encodingNeeded = true ;
371
+ escapingNeeded = true ;
372
372
break ;
373
373
}
374
374
}
375
375
376
- if (encodingNeeded ) {
376
+ if (escapingNeeded ) {
377
377
final StringBuilder sb = new StringBuilder ();
378
378
for (final char c : s .toCharArray ()) {
379
379
if (c == '\\' || c == '"' ) {
@@ -409,7 +409,7 @@ static String escapeBackslashesAndQuotes(final String s) {
409
409
for (int i = 0x80 ; i <= 0xFF ; i ++) {
410
410
doesNotNeedEncoding .set (i );
411
411
}
412
- assert doesNotNeedEncoding .get ('%' ) == false ;
412
+ assert doesNotNeedEncoding .get ('%' ) == false : doesNotNeedEncoding ;
413
413
}
414
414
415
415
private static final Charset UTF_8 = Charset .forName ("UTF-8" );
You can’t perform that action at this time.
0 commit comments