< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/code/SymbolMetadata.java

Print this page




 238 
 239         if (l.isEmpty()) {
 240             // no-op
 241         } else if (attributes.isEmpty()) {
 242             attributes = l;
 243         } else {
 244             attributes = attributes.prependList(l);
 245         }
 246         return this;
 247     }
 248 
 249     private List<Attribute.Compound> filterDeclSentinels(List<Attribute.Compound> a) {
 250         return (a == DECL_IN_PROGRESS || a == DECL_NOT_STARTED)
 251                 ? List.nil()
 252                 : a;
 253     }
 254 
 255     private boolean isStarted() {
 256         return attributes != DECL_NOT_STARTED;
 257     }
































 258 }


 238 
 239         if (l.isEmpty()) {
 240             // no-op
 241         } else if (attributes.isEmpty()) {
 242             attributes = l;
 243         } else {
 244             attributes = attributes.prependList(l);
 245         }
 246         return this;
 247     }
 248 
 249     private List<Attribute.Compound> filterDeclSentinels(List<Attribute.Compound> a) {
 250         return (a == DECL_IN_PROGRESS || a == DECL_NOT_STARTED)
 251                 ? List.nil()
 252                 : a;
 253     }
 254 
 255     private boolean isStarted() {
 256         return attributes != DECL_NOT_STARTED;
 257     }
 258 
 259     private List<Attribute.Compound> removeFromCompoundList(List<Attribute.Compound> l, Attribute.Compound compound) {
 260         ListBuffer<Attribute.Compound> lb = new ListBuffer<>();
 261         for (Attribute.Compound c : l) {
 262             if (c != compound) {
 263                 lb.add(c);
 264             }
 265         }
 266         return lb.toList();
 267     }
 268 
 269     private List<Attribute.TypeCompound> removeFromTypeCompoundList(List<Attribute.TypeCompound> l, Attribute.TypeCompound compound) {
 270         ListBuffer<Attribute.TypeCompound> lb = new ListBuffer<>();
 271         for (Attribute.TypeCompound c : l) {
 272             if (c != compound) {
 273                 lb.add(c);
 274             }
 275         }
 276         return lb.toList();
 277     }
 278 
 279     public void remove(Attribute.Compound compound) {
 280         if (attributes.contains(compound)) {
 281             attributes = removeFromCompoundList(attributes, compound);
 282         } else if (type_attributes.contains(compound)) {
 283             type_attributes = removeFromTypeCompoundList(type_attributes, (TypeCompound)compound);
 284         } else if (init_type_attributes.contains(compound)) {
 285             init_type_attributes = removeFromTypeCompoundList(init_type_attributes, (TypeCompound)compound);
 286         } else if (clinit_type_attributes.contains(compound)) {
 287             clinit_type_attributes = removeFromTypeCompoundList(clinit_type_attributes, (TypeCompound)compound);
 288         }
 289     }
 290 }
< prev index next >