private static char checkQuotes(String quotes,char openQuote) throws XMPException {
  char closeQuote;
  int charKind=classifyCharacter(openQuote);
  if (charKind != UCK_QUOTE) {
    throw new XMPException("Invalid quoting character",XMPError.BADPARAM);
  }
  if (quotes.length() == 1) {
    closeQuote=openQuote;
  }
 else {
    closeQuote=quotes.charAt(1);
    charKind=classifyCharacter(closeQuote);
    if (charKind != UCK_QUOTE) {
      throw new XMPException("Invalid quoting character",XMPError.BADPARAM);
    }
  }
  if (closeQuote != getClosingQuote(openQuote)) {
    throw new XMPException("Mismatched quote pair",XMPError.BADPARAM);
  }
  return closeQuote;
}

private static char checkQuotes ( String quotes , char openQuote ) throws XMPException { char closeQuote ; int charKind = classifyCharacter ( openQuote ) ; if ( charKind != UCK_QUOTE ) { throw new XMPException ( "Invalid quoting character" , XMPError . BADPARAM ) ; } if ( quotes . length ( ) == 1 ) { closeQuote = openQuote ; } else { closeQuote = quotes . charAt ( 1 ) ; charKind = classifyCharacter ( closeQuote ) ; if ( charKind != UCK_QUOTE ) { throw new XMPException ( "Invalid quoting character" , XMPError . BADPARAM ) ; } } if ( closeQuote != getClosingQuote ( openQuote ) ) { throw new XMPException ( "Mismatched quote pair" , XMPError . BADPARAM ) ; } return closeQuote ; }
make sure the open and close quotes are a legitimate pair and return the correct closing quote or an exception .
