langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationProxyMaker.java
changeset 1789 7ac8c0815000
parent 10 06bc494ca11e
child 1870 57a1138dffc8
equal deleted inserted replaced
1788:ced0a1a7ec80 1789:7ac8c0815000
   215                     runtimeType = runtimeTypeSaved;
   215                     runtimeType = runtimeTypeSaved;
   216                 }
   216                 }
   217             }
   217             }
   218         }
   218         }
   219 
   219 
   220         @SuppressWarnings("unchecked")
   220         @SuppressWarnings({"unchecked", "rawtypes"})
   221         public void visitEnum(Attribute.Enum e) {
   221         public void visitEnum(Attribute.Enum e) {
   222             if (runtimeType.isEnum()) {
   222             if (runtimeType.isEnum()) {
   223                 String constName = e.value.toString();
   223                 String constName = e.value.toString();
   224                 try {
   224                 try {
   225                     value = Enum.valueOf((Class)runtimeType, constName);
   225                     value = Enum.valueOf((Class)runtimeType, constName);
   226                 } catch (IllegalArgumentException ex) {
   226                 } catch (IllegalArgumentException ex) {
   227                     value = new EnumConstantNotPresentExceptionProxy(
   227                     value = new EnumConstantNotPresentExceptionProxy(
   228                                                         (Class)runtimeType, constName);
   228                                                         (Class<Enum<?>>)runtimeType, constName);
   229                 }
   229                 }
   230             } else {
   230             } else {
   231                 value = null;   // indicates a type mismatch
   231                 value = null;   // indicates a type mismatch
   232             }
   232             }
   233         }
   233         }