langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java
changeset 21040 3e32f68d2151
parent 21006 534673718919
child 21043 3b000be15694
equal deleted inserted replaced
21039:fe603c712085 21040:3e32f68d2151
  1875         public void visitCompoundAnnotationProxy(CompoundAnnotationProxy proxy) {
  1875         public void visitCompoundAnnotationProxy(CompoundAnnotationProxy proxy) {
  1876             result = deproxyCompound(proxy);
  1876             result = deproxyCompound(proxy);
  1877         }
  1877         }
  1878     }
  1878     }
  1879 
  1879 
  1880     class AnnotationDefaultCompleter extends AnnotationDeproxy implements Annotate.Annotator {
  1880     class AnnotationDefaultCompleter extends AnnotationDeproxy implements Annotate.Worker {
  1881         final MethodSymbol sym;
  1881         final MethodSymbol sym;
  1882         final Attribute value;
  1882         final Attribute value;
  1883         final JavaFileObject classFile = currentClassFile;
  1883         final JavaFileObject classFile = currentClassFile;
  1884         @Override
  1884         @Override
  1885         public String toString() {
  1885         public String toString() {
  1887         }
  1887         }
  1888         AnnotationDefaultCompleter(MethodSymbol sym, Attribute value) {
  1888         AnnotationDefaultCompleter(MethodSymbol sym, Attribute value) {
  1889             this.sym = sym;
  1889             this.sym = sym;
  1890             this.value = value;
  1890             this.value = value;
  1891         }
  1891         }
  1892         // implement Annotate.Annotator.enterAnnotation()
  1892         // implement Annotate.Worker.run()
  1893         public void enterAnnotation() {
  1893         public void run() {
  1894             JavaFileObject previousClassFile = currentClassFile;
  1894             JavaFileObject previousClassFile = currentClassFile;
  1895             try {
  1895             try {
  1896                 // Reset the interim value set earlier in
  1896                 // Reset the interim value set earlier in
  1897                 // attachAnnotationDefault().
  1897                 // attachAnnotationDefault().
  1898                 sym.defaultValue = null;
  1898                 sym.defaultValue = null;
  1902                 currentClassFile = previousClassFile;
  1902                 currentClassFile = previousClassFile;
  1903             }
  1903             }
  1904         }
  1904         }
  1905     }
  1905     }
  1906 
  1906 
  1907     class AnnotationCompleter extends AnnotationDeproxy implements Annotate.Annotator {
  1907     class AnnotationCompleter extends AnnotationDeproxy implements Annotate.Worker {
  1908         final Symbol sym;
  1908         final Symbol sym;
  1909         final List<CompoundAnnotationProxy> l;
  1909         final List<CompoundAnnotationProxy> l;
  1910         final JavaFileObject classFile;
  1910         final JavaFileObject classFile;
  1911         @Override
  1911         @Override
  1912         public String toString() {
  1912         public String toString() {
  1915         AnnotationCompleter(Symbol sym, List<CompoundAnnotationProxy> l) {
  1915         AnnotationCompleter(Symbol sym, List<CompoundAnnotationProxy> l) {
  1916             this.sym = sym;
  1916             this.sym = sym;
  1917             this.l = l;
  1917             this.l = l;
  1918             this.classFile = currentClassFile;
  1918             this.classFile = currentClassFile;
  1919         }
  1919         }
  1920         // implement Annotate.Annotator.enterAnnotation()
  1920         // implement Annotate.Worker.run()
  1921         public void enterAnnotation() {
  1921         public void run() {
  1922             JavaFileObject previousClassFile = currentClassFile;
  1922             JavaFileObject previousClassFile = currentClassFile;
  1923             try {
  1923             try {
  1924                 currentClassFile = classFile;
  1924                 currentClassFile = classFile;
  1925                 List<Attribute.Compound> newList = deproxyCompoundList(l);
  1925                 List<Attribute.Compound> newList = deproxyCompoundList(l);
  1926                 if (sym.annotationsPendingCompletion()) {
  1926                 if (sym.annotationsPendingCompletion()) {
  1953             }
  1953             }
  1954             return buf.toList();
  1954             return buf.toList();
  1955         }
  1955         }
  1956 
  1956 
  1957         @Override
  1957         @Override
  1958         public void enterAnnotation() {
  1958         public void run() {
  1959             JavaFileObject previousClassFile = currentClassFile;
  1959             JavaFileObject previousClassFile = currentClassFile;
  1960             try {
  1960             try {
  1961                 currentClassFile = classFile;
  1961                 currentClassFile = classFile;
  1962                 List<Attribute.TypeCompound> newList = deproxyTypeCompoundList(proxies);
  1962                 List<Attribute.TypeCompound> newList = deproxyTypeCompoundList(proxies);
  1963                 sym.setTypeAttributes(newList.prependList(sym.getRawTypeAttributes()));
  1963                 sym.setTypeAttributes(newList.prependList(sym.getRawTypeAttributes()));