svn commit: r227300 - /jakarta/bcel/trunk/src/java/org/apache/bcel/util/BCELFactory.java

[email protected]
Newsgroups gmane.comp.jakarta.bcel.devel
Message-ID <[email protected]>
Author: dbrosius
Date: Wed Aug  3 20:57:27 2005
New Revision: 227300

URL: http://svn.apache.org/viewcvs?rev=227300&view=rev
Log:
Bug 35991: When generating ANEWARRAY statements, pass the basic type to the createNewArray call, not the Array type itself.

Modified:
    jakarta/bcel/trunk/src/java/org/apache/bcel/util/BCELFactory.java

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/util/BCELFactory.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/util/BCELFactory.java?rev=227300&r1=227299&r2=227300&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/util/BCELFactory.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/util/BCELFactory.java Wed Aug  3 20:57:27 2005
@@ -5,10 +5,12 @@
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
+
 import org.apache.bcel.Constants;
 import org.apache.bcel.classfile.Utility;
 import org.apache.bcel.generic.AllocationInstruction;
 import org.apache.bcel.generic.ArrayInstruction;
+import org.apache.bcel.generic.ArrayType;
 import org.apache.bcel.generic.BranchHandle;
 import org.apache.bcel.generic.BranchInstruction;
 import org.apache.bcel.generic.CHECKCAST;
@@ -177,8 +179,10 @@
 
     case Constants.ANEWARRAY:
     case Constants.NEWARRAY:
+      if (type instanceof ArrayType)
+    	  type = ((ArrayType)type).getBasicType();
       _out.println("il.append(_factory.createNewArray(" +
-		   BCELifier.printType(type) + ", (short) " + dim + "));");
+    		  BCELifier.printType(type) + ", (short) " + dim + "));");
       break;
 
     default:
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.