diff -r 014cf6234586 -r fc73f83cd563 test/tools/javac/api/T6392782.java --- a/test/tools/javac/api/T6392782.java Thu Sep 09 09:42:45 2010 +0530 +++ b/test/tools/javac/api/T6392782.java Thu Sep 09 13:31:28 2010 -0700 @@ -47,12 +47,12 @@ check(scanner, 6, scanner.scan(trees, null)); CountNodes nodeCounter = new CountNodes(); - // 383 nodes with the regular parser; 384 nodes with EndPosParser - // We automatically swith to EndPosParser when calling JavacTask.parse() - check(nodeCounter, 384, nodeCounter.scan(trees, null)); + // 359 nodes with the regular parser; 360 nodes with EndPosParser + // We automatically switch to EndPosParser when calling JavacTask.parse() + check(nodeCounter, 360, nodeCounter.scan(trees, null)); CountIdentifiers idCounter = new CountIdentifiers(); - check(idCounter, 106, idCounter.scan(trees, null)); + check(idCounter, 107, idCounter.scan(trees, null)); } private static void check(TreeScanner scanner, int expect, int found) { @@ -73,10 +73,11 @@ } } - // example from TreeScanner javadoc static class CountNodes extends TreeScanner { @Override public Integer scan(Tree node, Void p) { + if (node == null) + return 0; Integer n = super.scan(node, p); return (n == null ? 0 : n) + 1; }