@@ -48,19 +48,19 @@ public String unescape(String str) {
4848 char c = str .charAt (slashIndex + 1 );
4949 char r = (c < unescapeMap .length ) ? unescapeMap [c ] : NO_REPLACEMENT ;
5050 if (r != NO_REPLACEMENT ) {
51- unescaped .append (str . substring ( offset , slashIndex ) );
51+ unescaped .append (str , offset , slashIndex );
5252 unescaped .append (r );
5353 offset = slashIndex + 2 ;
5454 } else if (unescapeUnicodeEscapes && c == 'u' ) {
5555 String hexCode = str .substring (slashIndex + 2 , slashIndex + 6 );
5656 String replacement = new String (Character .toChars (Integer .parseInt (hexCode , 16 )));
57- unescaped .append (str . substring ( offset , slashIndex ) );
57+ unescaped .append (str , offset , slashIndex );
5858 unescaped .append (replacement );
5959 offset = slashIndex + 6 ;
6060 }
6161 slashIndex = str .indexOf ('\\' , slashIndex + 2 );
6262 }
63- unescaped .append (str . substring ( offset , str .length () ));
63+ unescaped .append (str , offset , str .length ());
6464 return unescaped .toString ();
6565 } else {
6666 return str ;
@@ -74,14 +74,14 @@ public String escape(String str) {
7474 char c = str .charAt (i );
7575 char r = (c < escapeMap .length ) ? escapeMap [c ] : NO_REPLACEMENT ;
7676 if (r != NO_REPLACEMENT ) {
77- escaped .append (str . substring ( offset , i ) );
77+ escaped .append (str , offset , i );
7878 escaped .append ('\\' );
7979 escaped .append (r );
8080 offset = i + 1 ;
8181 }
8282 }
8383 if (offset < str .length ()) {
84- escaped .append (str . substring ( offset , str .length () ));
84+ escaped .append (str , offset , str .length ());
8585 }
8686 return escaped .toString ();
8787 }
0 commit comments