--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java Thu Dec 11 18:23:17 2014 -0800
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java Fri Dec 12 18:07:24 2014 +0000
@@ -313,6 +313,14 @@
}
}
+ /** Return true if the tree corresponds to a statement */
+ public static boolean isStatement(JCTree tree) {
+ return (tree instanceof JCStatement) &&
+ !tree.hasTag(CLASSDEF) &&
+ !tree.hasTag(Tag.BLOCK) &&
+ !tree.hasTag(METHODDEF);
+ }
+
/**
* Return true if the AST corresponds to a static select of the kind A.B
*/