1.1 --- a/src/share/classes/com/sun/tools/classfile/Attribute.java Fri Jun 28 19:47:54 2013 -0700 1.2 +++ b/src/share/classes/com/sun/tools/classfile/Attribute.java Sat Jun 29 20:12:24 2013 +0100 1.3 @@ -77,10 +77,12 @@ 1.4 1.5 public Attribute createAttribute(ClassReader cr, int name_index, byte[] data) 1.6 throws IOException { 1.7 - if (standardAttributes == null) 1.8 + if (standardAttributes == null) { 1.9 init(); 1.10 + } 1.11 1.12 ConstantPool cp = cr.getConstantPool(); 1.13 + String reasonForDefaultAttr; 1.14 try { 1.15 String name = cp.getUTF8Value(name_index); 1.16 Class<? extends Attribute> attrClass = standardAttributes.get(name); 1.17 @@ -90,14 +92,18 @@ 1.18 Constructor<? extends Attribute> constr = attrClass.getDeclaredConstructor(constrArgTypes); 1.19 return constr.newInstance(new Object[] { cr, name_index, data.length }); 1.20 } catch (Throwable t) { 1.21 + reasonForDefaultAttr = t.toString(); 1.22 // fall through and use DefaultAttribute 1.23 // t.printStackTrace(); 1.24 } 1.25 + } else { 1.26 + reasonForDefaultAttr = "unknown attribute"; 1.27 } 1.28 } catch (ConstantPoolException e) { 1.29 + reasonForDefaultAttr = e.toString(); 1.30 // fall through and use DefaultAttribute 1.31 } 1.32 - return new DefaultAttribute(cr, name_index, data); 1.33 + return new DefaultAttribute(cr, name_index, data, reasonForDefaultAttr); 1.34 } 1.35 1.36 protected void init() {