langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java
changeset 22691 ea96f68e3d9a
parent 22685 c8d0807378b6
child 22696 0a916fd27b8b
equal deleted inserted replaced
22690:86dd707d616a 22691:ea96f68e3d9a
  4091             return List.nil();
  4091             return List.nil();
  4092         }
  4092         }
  4093 
  4093 
  4094         ListBuffer<Attribute.TypeCompound> buf = new ListBuffer<>();
  4094         ListBuffer<Attribute.TypeCompound> buf = new ListBuffer<>();
  4095         for (JCAnnotation anno : annotations) {
  4095         for (JCAnnotation anno : annotations) {
  4096             if (anno.attribute != null) {
  4096             Assert.checkNonNull(anno.attribute);
  4097                 // TODO: this null-check is only needed for an obscure
  4097             buf.append((Attribute.TypeCompound) anno.attribute);
  4098                 // ordering issue, where annotate.flush is called when
       
  4099                 // the attribute is not set yet. For an example failure
       
  4100                 // try the referenceinfos/NestedTypes.java test.
       
  4101                 // Any better solutions?
       
  4102                 buf.append((Attribute.TypeCompound) anno.attribute);
       
  4103             }
       
  4104             // Eventually we will want to throw an exception here, but
       
  4105             // we can't do that just yet, because it gets triggered
       
  4106             // when attempting to attach an annotation that isn't
       
  4107             // defined.
       
  4108         }
  4098         }
  4109         return buf.toList();
  4099         return buf.toList();
  4110     }
  4100     }
  4111 
  4101 
  4112     public void visitErroneous(JCErroneous tree) {
  4102     public void visitErroneous(JCErroneous tree) {