@@ -187,10 +187,11 @@ public JSONPointer(List<String> refTokens) {
187187 this .refTokens = new ArrayList <String >(refTokens );
188188 }
189189
190+ /**
191+ * @see https://tools.ietf.org/html/rfc6901#section-3
192+ */
190193 private static String unescape (String token ) {
191- return token .replace ("~1" , "/" ).replace ("~0" , "~" )
192- .replace ("\\ \" " , "\" " )
193- .replace ("\\ \\ " , "\\ " );
194+ return token .replace ("~1" , "/" ).replace ("~0" , "~" );
194195 }
195196
196197 /**
@@ -263,16 +264,15 @@ public String toString() {
263264 /**
264265 * Escapes path segment values to an unambiguous form.
265266 * The escape char to be inserted is '~'. The chars to be escaped
266- * are ~, which maps to ~0, and /, which maps to ~1. Backslashes
267- * and double quote chars are also escaped.
267+ * are ~, which maps to ~0, and /, which maps to ~1.
268268 * @param token the JSONPointer segment value to be escaped
269269 * @return the escaped value for the token
270+ *
271+ * @see https://tools.ietf.org/html/rfc6901#section-3
270272 */
271273 private static String escape (String token ) {
272274 return token .replace ("~" , "~0" )
273- .replace ("/" , "~1" )
274- .replace ("\\ " , "\\ \\ " )
275- .replace ("\" " , "\\ \" " );
275+ .replace ("/" , "~1" );
276276 }
277277
278278 /**
0 commit comments