--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java Tue Sep 26 15:08:56 2017 +0530
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java Tue Sep 26 12:52:53 2017 +0100
@@ -1136,7 +1136,7 @@
* For an array that contains an annotated type, return that annotated type.
* TODO: currently only used by Pretty. Describe behavior better.
*/
- public static JCTree innermostType(JCTree type) {
+ public static JCTree innermostType(JCTree type, boolean skipAnnos) {
JCTree lastAnnotatedType = null;
JCTree cur = type;
loop: while (true) {
@@ -1157,7 +1157,7 @@
break loop;
}
}
- if (lastAnnotatedType!=null) {
+ if (!skipAnnos && lastAnnotatedType!=null) {
return lastAnnotatedType;
} else {
return cur;