langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java
changeset 21498 58c2486db8d0
parent 21488 4a69e26aa999
child 21704 e215a6216604
equal deleted inserted replaced
21497:ad075a07ee79 21498:58c2486db8d0
  4094             }
  4094             }
  4095         });
  4095         });
  4096     }
  4096     }
  4097 
  4097 
  4098     private static List<Attribute.TypeCompound> fromAnnotations(List<JCAnnotation> annotations) {
  4098     private static List<Attribute.TypeCompound> fromAnnotations(List<JCAnnotation> annotations) {
  4099         if (annotations.isEmpty())
  4099         if (annotations.isEmpty()) {
  4100             return List.nil();
  4100             return List.nil();
       
  4101         }
  4101 
  4102 
  4102         ListBuffer<Attribute.TypeCompound> buf = new ListBuffer<>();
  4103         ListBuffer<Attribute.TypeCompound> buf = new ListBuffer<>();
  4103         for (JCAnnotation anno : annotations) {
  4104         for (JCAnnotation anno : annotations) {
  4104             if (anno.attribute != null) {
  4105             if (anno.attribute != null) {
  4105                 // TODO: this null-check is only needed for an obscure
  4106                 // TODO: this null-check is only needed for an obscure
  4107                 // the attribute is not set yet. For an example failure
  4108                 // the attribute is not set yet. For an example failure
  4108                 // try the referenceinfos/NestedTypes.java test.
  4109                 // try the referenceinfos/NestedTypes.java test.
  4109                 // Any better solutions?
  4110                 // Any better solutions?
  4110                 buf.append((Attribute.TypeCompound) anno.attribute);
  4111                 buf.append((Attribute.TypeCompound) anno.attribute);
  4111             }
  4112             }
       
  4113             // Eventually we will want to throw an exception here, but
       
  4114             // we can't do that just yet, because it gets triggered
       
  4115             // when attempting to attach an annotation that isn't
       
  4116             // defined.
  4112         }
  4117         }
  4113         return buf.toList();
  4118         return buf.toList();
  4114     }
  4119     }
  4115 
  4120 
  4116     public void visitErroneous(JCErroneous tree) {
  4121     public void visitErroneous(JCErroneous tree) {