Index: SignatureVerifier.java =================================================================== --- SignatureVerifier.java (revision 686314) +++ SignatureVerifier.java (working copy) @@ -830,24 +830,61 @@ } /** - * Skips any "white space" and returns whether there are more + * Skips any "white space" and /* style comments + * and returns whether there are more * characters to be parsed. */ protected boolean skip() throws IOException { - char c; - do { - ir.mark(1); - int i; - if ((i = ir.read()) < 0) { + Character c; + // Permitted states are white, commentSlashStar, commentSlashSlash + String state = "white"; + final Character SLASH = '/'; + final Character STAR = '*'; + while (true) { + c = peek(); + if (c == null) return false; - } - c = (char)i; - } while (Character.isWhitespace(c)); + if (state.equals("commentSlashStar") && STAR.equals(c)) { + c = peek(); + if (c == null) + return false; + if (SLASH.equals(c)) { + state = "white"; + } + break; + } + if (state.equals("white") && SLASH.equals(c)) { + c = peek(); + if (c == null) + return false; + if (STAR.equals(c)) { + state = "commentSlashStar"; + continue; + } else { + break; + } + } + if (state.equals("white") && !Character.isWhitespace(c)) { + break; + } + } ir.reset(); return true; } /** + * Returns next char, or null if there is none + */ + protected Character peek() throws IOException { + ir.mark(1); + int i; + if ((i = ir.read()) < 0) { + return null; + } + return Character.valueOf((char)i); + } + + /** * Scans for an (unqualified) identifier. * @return null if the next token is not an identifier */