langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/TypeAnnotations.java
changeset 34762 d68b7daca533
parent 33712 fd1ce6d7ac63
child 35358 edabc0b735a5
equal deleted inserted replaced
34761:6400aa5e70e6 34762:d68b7daca533
   113      * determine the correct positions for type annotations.
   113      * determine the correct positions for type annotations.
   114      * This version only visits types in signatures and should be
   114      * This version only visits types in signatures and should be
   115      * called from MemberEnter.
   115      * called from MemberEnter.
   116      */
   116      */
   117     public void organizeTypeAnnotationsSignatures(final Env<AttrContext> env, final JCClassDecl tree) {
   117     public void organizeTypeAnnotationsSignatures(final Env<AttrContext> env, final JCClassDecl tree) {
   118         annotate.afterTypes(new Runnable() {
   118         annotate.afterTypes(() -> {
   119             @Override
   119             JavaFileObject oldSource = log.useSource(env.toplevel.sourcefile);
   120             public void run() {
   120             try {
   121                 JavaFileObject oldSource = log.useSource(env.toplevel.sourcefile);
   121                 new TypeAnnotationPositions(true).scan(tree);
   122 
   122             } finally {
   123                 try {
   123                 log.useSource(oldSource);
   124                     new TypeAnnotationPositions(true).scan(tree);
       
   125                 } finally {
       
   126                     log.useSource(oldSource);
       
   127                 }
       
   128             }
   124             }
   129         });
   125         });
   130     }
   126     }
   131 
   127 
   132     public void validateTypeAnnotationsSignatures(final Env<AttrContext> env, final JCClassDecl tree) {
   128     public void validateTypeAnnotationsSignatures(final Env<AttrContext> env, final JCClassDecl tree) {
   133         annotate.validate(new Runnable() { //validate annotations
   129         annotate.validate(() -> { //validate annotations
   134             @Override
   130             JavaFileObject oldSource = log.useSource(env.toplevel.sourcefile);
   135             public void run() {
   131             try {
   136                 JavaFileObject oldSource = log.useSource(env.toplevel.sourcefile);
   132                 attr.validateTypeAnnotations(tree, true);
   137 
   133             } finally {
   138                 try {
   134                 log.useSource(oldSource);
   139                     attr.validateTypeAnnotations(tree, true);
       
   140                 } finally {
       
   141                     log.useSource(oldSource);
       
   142                 }
       
   143             }
   135             }
   144         });
   136         });
   145     }
   137     }
   146 
   138 
   147     /**
   139     /**