langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java
changeset 26266 2d24bda701dc
parent 25874 83c19f00452c
child 26532 aa84b6606229
equal deleted inserted replaced
26265:46aacfffd3b5 26266:2d24bda701dc
    45 import com.sun.tools.javac.code.Scope.WriteableScope;
    45 import com.sun.tools.javac.code.Scope.WriteableScope;
    46 import com.sun.tools.javac.code.Symbol.*;
    46 import com.sun.tools.javac.code.Symbol.*;
    47 import com.sun.tools.javac.code.Symtab;
    47 import com.sun.tools.javac.code.Symtab;
    48 import com.sun.tools.javac.file.BaseFileObject;
    48 import com.sun.tools.javac.file.BaseFileObject;
    49 import com.sun.tools.javac.util.*;
    49 import com.sun.tools.javac.util.*;
       
    50 import com.sun.tools.javac.util.DefinedBy.Api;
    50 import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
    51 import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
    51 
    52 
    52 import static com.sun.tools.javac.code.Flags.*;
    53 import static com.sun.tools.javac.code.Flags.*;
    53 import static com.sun.tools.javac.code.Kinds.*;
    54 import static com.sun.tools.javac.code.Kinds.*;
    54 import static com.sun.tools.javac.code.TypeTag.CLASS;
    55 import static com.sun.tools.javac.code.TypeTag.CLASS;
   666                                                          startSbp,
   667                                                          startSbp,
   667                                                          sbp - startSbp));
   668                                                          sbp - startSbp));
   668                 outer = new ClassType(outer, sigToTypes('>'), t,
   669                 outer = new ClassType(outer, sigToTypes('>'), t,
   669                                       Type.noAnnotations) {
   670                                       Type.noAnnotations) {
   670                         boolean completed = false;
   671                         boolean completed = false;
   671                         @Override
   672                         @Override @DefinedBy(Api.LANGUAGE_MODEL)
   672                         public Type getEnclosingType() {
   673                         public Type getEnclosingType() {
   673                             if (!completed) {
   674                             if (!completed) {
   674                                 completed = true;
   675                                 completed = true;
   675                                 tsym.complete();
   676                                 tsym.complete();
   676                                 Type enclosingType = tsym.type.getEnclosingType();
   677                                 Type enclosingType = tsym.type.getEnclosingType();
  1654             super(null);
  1655             super(null);
  1655             this.enumType = enumType;
  1656             this.enumType = enumType;
  1656             this.enumerator = enumerator;
  1657             this.enumerator = enumerator;
  1657         }
  1658         }
  1658         public void accept(Visitor v) { ((ProxyVisitor)v).visitEnumAttributeProxy(this); }
  1659         public void accept(Visitor v) { ((ProxyVisitor)v).visitEnumAttributeProxy(this); }
  1659         @Override
  1660         @Override @DefinedBy(Api.LANGUAGE_MODEL)
  1660         public String toString() {
  1661         public String toString() {
  1661             return "/*proxy enum*/" + enumType + "." + enumerator;
  1662             return "/*proxy enum*/" + enumType + "." + enumerator;
  1662         }
  1663         }
  1663     }
  1664     }
  1664 
  1665 
  1667         ArrayAttributeProxy(List<Attribute> values) {
  1668         ArrayAttributeProxy(List<Attribute> values) {
  1668             super(null);
  1669             super(null);
  1669             this.values = values;
  1670             this.values = values;
  1670         }
  1671         }
  1671         public void accept(Visitor v) { ((ProxyVisitor)v).visitArrayAttributeProxy(this); }
  1672         public void accept(Visitor v) { ((ProxyVisitor)v).visitArrayAttributeProxy(this); }
  1672         @Override
  1673         @Override @DefinedBy(Api.LANGUAGE_MODEL)
  1673         public String toString() {
  1674         public String toString() {
  1674             return "{" + values + "}";
  1675             return "{" + values + "}";
  1675         }
  1676         }
  1676     }
  1677     }
  1677 
  1678 
  1683                                       List<Pair<Name,Attribute>> values) {
  1684                                       List<Pair<Name,Attribute>> values) {
  1684             super(type);
  1685             super(type);
  1685             this.values = values;
  1686             this.values = values;
  1686         }
  1687         }
  1687         public void accept(Visitor v) { ((ProxyVisitor)v).visitCompoundAnnotationProxy(this); }
  1688         public void accept(Visitor v) { ((ProxyVisitor)v).visitCompoundAnnotationProxy(this); }
  1688         @Override
  1689         @Override @DefinedBy(Api.LANGUAGE_MODEL)
  1689         public String toString() {
  1690         public String toString() {
  1690             StringBuilder buf = new StringBuilder();
  1691             StringBuilder buf = new StringBuilder();
  1691             buf.append("@");
  1692             buf.append("@");
  1692             buf.append(type.tsym.getQualifiedName());
  1693             buf.append(type.tsym.getQualifiedName());
  1693             buf.append("/*proxy*/{");
  1694             buf.append("/*proxy*/{");
  2424             super(null); // no file manager; never referenced for this file object
  2425             super(null); // no file manager; never referenced for this file object
  2425             this.name = name;
  2426             this.name = name;
  2426             this.flatname = flatname;
  2427             this.flatname = flatname;
  2427         }
  2428         }
  2428 
  2429 
  2429         @Override
  2430         @Override @DefinedBy(Api.COMPILER)
  2430         public URI toUri() {
  2431         public URI toUri() {
  2431             try {
  2432             try {
  2432                 return new URI(null, name.toString(), null);
  2433                 return new URI(null, name.toString(), null);
  2433             } catch (URISyntaxException e) {
  2434             } catch (URISyntaxException e) {
  2434                 throw new CannotCreateUriError(name.toString(), e);
  2435                 throw new CannotCreateUriError(name.toString(), e);
  2435             }
  2436             }
  2436         }
  2437         }
  2437 
  2438 
  2438         @Override
  2439         @Override @DefinedBy(Api.COMPILER)
  2439         public String getName() {
  2440         public String getName() {
  2440             return name.toString();
  2441             return name.toString();
  2441         }
  2442         }
  2442 
  2443 
  2443         @Override
  2444         @Override
  2444         public String getShortName() {
  2445         public String getShortName() {
  2445             return getName();
  2446             return getName();
  2446         }
  2447         }
  2447 
  2448 
  2448         @Override
  2449         @Override @DefinedBy(Api.COMPILER)
  2449         public JavaFileObject.Kind getKind() {
  2450         public JavaFileObject.Kind getKind() {
  2450             return getKind(getName());
  2451             return getKind(getName());
  2451         }
  2452         }
  2452 
  2453 
  2453         @Override
  2454         @Override @DefinedBy(Api.COMPILER)
  2454         public InputStream openInputStream() {
  2455         public InputStream openInputStream() {
  2455             throw new UnsupportedOperationException();
  2456             throw new UnsupportedOperationException();
  2456         }
  2457         }
  2457 
  2458 
  2458         @Override
  2459         @Override @DefinedBy(Api.COMPILER)
  2459         public OutputStream openOutputStream() {
  2460         public OutputStream openOutputStream() {
  2460             throw new UnsupportedOperationException();
  2461             throw new UnsupportedOperationException();
  2461         }
  2462         }
  2462 
  2463 
  2463         @Override
  2464         @Override @DefinedBy(Api.COMPILER)
  2464         public CharBuffer getCharContent(boolean ignoreEncodingErrors) {
  2465         public CharBuffer getCharContent(boolean ignoreEncodingErrors) {
  2465             throw new UnsupportedOperationException();
  2466             throw new UnsupportedOperationException();
  2466         }
  2467         }
  2467 
  2468 
  2468         @Override
  2469         @Override @DefinedBy(Api.COMPILER)
  2469         public Reader openReader(boolean ignoreEncodingErrors) {
  2470         public Reader openReader(boolean ignoreEncodingErrors) {
  2470             throw new UnsupportedOperationException();
  2471             throw new UnsupportedOperationException();
  2471         }
  2472         }
  2472 
  2473 
  2473         @Override
  2474         @Override @DefinedBy(Api.COMPILER)
  2474         public Writer openWriter() {
  2475         public Writer openWriter() {
  2475             throw new UnsupportedOperationException();
  2476             throw new UnsupportedOperationException();
  2476         }
  2477         }
  2477 
  2478 
  2478         @Override
  2479         @Override @DefinedBy(Api.COMPILER)
  2479         public long getLastModified() {
  2480         public long getLastModified() {
  2480             throw new UnsupportedOperationException();
  2481             throw new UnsupportedOperationException();
  2481         }
  2482         }
  2482 
  2483 
  2483         @Override
  2484         @Override @DefinedBy(Api.COMPILER)
  2484         public boolean delete() {
  2485         public boolean delete() {
  2485             throw new UnsupportedOperationException();
  2486             throw new UnsupportedOperationException();
  2486         }
  2487         }
  2487 
  2488 
  2488         @Override
  2489         @Override
  2489         protected String inferBinaryName(Iterable<? extends File> path) {
  2490         protected String inferBinaryName(Iterable<? extends File> path) {
  2490             return flatname.toString();
  2491             return flatname.toString();
  2491         }
  2492         }
  2492 
  2493 
  2493         @Override
  2494         @Override @DefinedBy(Api.COMPILER)
  2494         public boolean isNameCompatible(String simpleName, JavaFileObject.Kind kind) {
  2495         public boolean isNameCompatible(String simpleName, JavaFileObject.Kind kind) {
  2495             return true; // fail-safe mode
  2496             return true; // fail-safe mode
  2496         }
  2497         }
  2497 
  2498 
  2498         /**
  2499         /**