hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicType.java
changeset 360 21d113ecbf6a
parent 1 489c9b5090e2
child 670 ddf3e9583f2f
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicType.java	Fri Apr 11 09:56:35 2008 -0400
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicType.java	Sun Apr 13 17:43:42 2008 -0400
@@ -273,6 +273,10 @@
     return (OopField) field;
   }
 
+  public NarrowOopField getNarrowOopField(String fieldName) throws WrongTypeException {
+    return (NarrowOopField) new BasicNarrowOopField(getOopField(fieldName));
+  }
+
   public AddressField getAddressField(String fieldName) {
     // This type can not be inferred (for now), so provide a wrapper
     Field field = getField(fieldName);
@@ -287,7 +291,7 @@
       name was already present in this class. */
   public void addField(Field field) {
     if (nameToFieldMap.get(field.getName()) != null) {
-      throw new RuntimeException("field of name \"" + field.getName() + "\" already present");
+      throw new RuntimeException("field of name \"" + field.getName() + "\" already present in type " + this);
     }
 
     nameToFieldMap.put(field.getName(), field);