commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r1702146 - /commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/FieldOrMethod.java
Date Thu, 10 Sep 2015 01:52:11 GMT
Author: chas
Date: Thu Sep 10 01:52:11 2015
New Revision: 1702146

URL: http://svn.apache.org/r1702146
Log:
BCEL-236: remove deprecated FieldOrMethod.getClassType - update javadoc, throw ClassGenException
upon call with invalid type

Modified:
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/FieldOrMethod.java

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/FieldOrMethod.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/FieldOrMethod.java?rev=1702146&r1=1702145&r2=1702146&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/FieldOrMethod.java
(original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/FieldOrMethod.java
Thu Sep 10 01:52:11 2015
@@ -111,10 +111,18 @@ public abstract class FieldOrMethod exte
     }
 
 
-    /** @return type of the referenced class/interface
+    /** 
+     * Get the ObjectType of the method return or field.
+     * 
+     * @return type of the referenced class/interface
+     * @throws ClassGenException when the field is (or method returns) an array, 
      */
     @Override
     public ObjectType getLoadClassType( ConstantPoolGen cpg ) {
-        return (ObjectType)getReferenceType(cpg);
+        ReferenceType rt = getReferenceType(cpg);
+        if(rt instanceof ObjectType) {
+            return (ObjectType)rt;
+        }
+        throw new ClassGenException(rt.getSignature() + " does not represent an ObjectType");
     }
 }



Mime
View raw message