langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java
changeset 42828 cce89649f958
parent 42827 36468b5fa7f4
child 43138 680d378b9d64
equal deleted inserted replaced
42827:36468b5fa7f4 42828:cce89649f958
   138      *  Attributes of class symbols should be accessed through the accessor
   138      *  Attributes of class symbols should be accessed through the accessor
   139      *  method to make sure that the class symbol is loaded.
   139      *  method to make sure that the class symbol is loaded.
   140      */
   140      */
   141     public List<Attribute.Compound> getRawAttributes() {
   141     public List<Attribute.Compound> getRawAttributes() {
   142         return (metadata == null)
   142         return (metadata == null)
   143                 ? List.<Attribute.Compound>nil()
   143                 ? List.nil()
   144                 : metadata.getDeclarationAttributes();
   144                 : metadata.getDeclarationAttributes();
   145     }
   145     }
   146 
   146 
   147     /** An accessor method for the type attributes of this symbol.
   147     /** An accessor method for the type attributes of this symbol.
   148      *  Attributes of class symbols should be accessed through the accessor
   148      *  Attributes of class symbols should be accessed through the accessor
   149      *  method to make sure that the class symbol is loaded.
   149      *  method to make sure that the class symbol is loaded.
   150      */
   150      */
   151     public List<Attribute.TypeCompound> getRawTypeAttributes() {
   151     public List<Attribute.TypeCompound> getRawTypeAttributes() {
   152         return (metadata == null)
   152         return (metadata == null)
   153                 ? List.<Attribute.TypeCompound>nil()
   153                 ? List.nil()
   154                 : metadata.getTypeAttributes();
   154                 : metadata.getTypeAttributes();
   155     }
   155     }
   156 
   156 
   157     /** Fetch a particular annotation from a symbol. */
   157     /** Fetch a particular annotation from a symbol. */
   158     public Attribute.Compound attribute(Symbol anno) {
   158     public Attribute.Compound attribute(Symbol anno) {
   190         }
   190         }
   191     }
   191     }
   192 
   192 
   193     public List<Attribute.TypeCompound> getClassInitTypeAttributes() {
   193     public List<Attribute.TypeCompound> getClassInitTypeAttributes() {
   194         return (metadata == null)
   194         return (metadata == null)
   195                 ? List.<Attribute.TypeCompound>nil()
   195                 ? List.nil()
   196                 : metadata.getClassInitTypeAttributes();
   196                 : metadata.getClassInitTypeAttributes();
   197     }
   197     }
   198 
   198 
   199     public List<Attribute.TypeCompound> getInitTypeAttributes() {
   199     public List<Attribute.TypeCompound> getInitTypeAttributes() {
   200         return (metadata == null)
   200         return (metadata == null)
   201                 ? List.<Attribute.TypeCompound>nil()
   201                 ? List.nil()
   202                 : metadata.getInitTypeAttributes();
   202                 : metadata.getInitTypeAttributes();
   203     }
   203     }
   204 
   204 
   205     public void setInitTypeAttributes(List<Attribute.TypeCompound> l) {
   205     public void setInitTypeAttributes(List<Attribute.TypeCompound> l) {
   206         initedMetadata().setInitTypeAttributes(l);
   206         initedMetadata().setInitTypeAttributes(l);
   210         initedMetadata().setClassInitTypeAttributes(l);
   210         initedMetadata().setClassInitTypeAttributes(l);
   211     }
   211     }
   212 
   212 
   213     public List<Attribute.Compound> getDeclarationAttributes() {
   213     public List<Attribute.Compound> getDeclarationAttributes() {
   214         return (metadata == null)
   214         return (metadata == null)
   215                 ? List.<Attribute.Compound>nil()
   215                 ? List.nil()
   216                 : metadata.getDeclarationAttributes();
   216                 : metadata.getDeclarationAttributes();
   217     }
   217     }
   218 
   218 
   219     public boolean hasAnnotations() {
   219     public boolean hasAnnotations() {
   220         return (metadata != null && !metadata.isEmpty());
   220         return (metadata != null && !metadata.isEmpty());
  1246         }
  1246         }
  1247 
  1247 
  1248         public Type erasure(Types types) {
  1248         public Type erasure(Types types) {
  1249             if (erasure_field == null)
  1249             if (erasure_field == null)
  1250                 erasure_field = new ClassType(types.erasure(type.getEnclosingType()),
  1250                 erasure_field = new ClassType(types.erasure(type.getEnclosingType()),
  1251                                               List.<Type>nil(), this,
  1251                                               List.nil(), this,
  1252                                               type.getMetadata());
  1252                                               type.getMetadata());
  1253             return erasure_field;
  1253             return erasure_field;
  1254         }
  1254         }
  1255 
  1255 
  1256         public String className() {
  1256         public String className() {