code: private static boolean charIsEscaped(String str, int index) {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "charIsEscaped", new Object[]{str, index});
  
      // precondition, null str or out of range index returns false.
      if (str == null || index < 0 || index >= str.length()) return false;
  
      // A character is escaped if it is preceded by an odd number of '\'s.
      int nEscape = 0;
      int i = index-1;
      while(i>=0 && str.charAt(i) == '\\') {
        nEscape++;
        i--;
      }
      boolean result = nEscape % 2 == 1 ;
  
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "charIsEscaped",  result);
      return result;
    }
docs: Test if the specified character is escaped.
  Checks whether the character at the specified index is preceded by an
  escape character. The test is non-trivial because it has to check that
  the escape character is itself non-escaped.
  @param str The string in which to perform the check
  @param index The index in the string of the character that we are interested in.
  @return true if the specified character is escaped.