langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java
changeset 14804 f93a8d60b9a4
parent 14725 65836e833f59
child 14949 45f43822bbde
equal deleted inserted replaced
14803:88347e495d34 14804:f93a8d60b9a4
  1358     /** Attach the default value for an annotation element.
  1358     /** Attach the default value for an annotation element.
  1359      */
  1359      */
  1360     void attachAnnotationDefault(final Symbol sym) {
  1360     void attachAnnotationDefault(final Symbol sym) {
  1361         final MethodSymbol meth = (MethodSymbol)sym; // only on methods
  1361         final MethodSymbol meth = (MethodSymbol)sym; // only on methods
  1362         final Attribute value = readAttributeValue();
  1362         final Attribute value = readAttributeValue();
       
  1363 
       
  1364         // The default value is set later during annotation. It might
       
  1365         // be the case that the Symbol sym is annotated _after_ the
       
  1366         // repeating instances that depend on this default value,
       
  1367         // because of this we set an interim value that tells us this
       
  1368         // element (most likely) has a default.
       
  1369         //
       
  1370         // Set interim value for now, reset just before we do this
       
  1371         // properly at annotate time.
       
  1372         meth.defaultValue = value;
  1363         annotate.normal(new AnnotationDefaultCompleter(meth, value));
  1373         annotate.normal(new AnnotationDefaultCompleter(meth, value));
  1364     }
  1374     }
  1365 
  1375 
  1366     Type readTypeOrClassSymbol(int i) {
  1376     Type readTypeOrClassSymbol(int i) {
  1367         // support preliminary jsr175-format class files
  1377         // support preliminary jsr175-format class files
  1678         }
  1688         }
  1679         // implement Annotate.Annotator.enterAnnotation()
  1689         // implement Annotate.Annotator.enterAnnotation()
  1680         public void enterAnnotation() {
  1690         public void enterAnnotation() {
  1681             JavaFileObject previousClassFile = currentClassFile;
  1691             JavaFileObject previousClassFile = currentClassFile;
  1682             try {
  1692             try {
       
  1693                 // Reset the interim value set earlier in
       
  1694                 // attachAnnotationDefault().
       
  1695                 sym.defaultValue = null;
  1683                 currentClassFile = classFile;
  1696                 currentClassFile = classFile;
  1684                 sym.defaultValue = deproxy(sym.type.getReturnType(), value);
  1697                 sym.defaultValue = deproxy(sym.type.getReturnType(), value);
  1685             } finally {
  1698             } finally {
  1686                 currentClassFile = previousClassFile;
  1699                 currentClassFile = previousClassFile;
  1687             }
  1700             }