You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2015/09/12 14:06:28 UTC

svn commit: r1702625 - /commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/ConstantPoolGen.java

Author: sebb
Date: Sat Sep 12 12:06:27 2015
New Revision: 1702625

URL: http://svn.apache.org/r1702625
Log:
Document other Constant types

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

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/ConstantPoolGen.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/ConstantPoolGen.java?rev=1702625&r1=1702624&r2=1702625&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/ConstantPoolGen.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/ConstantPoolGen.java Sat Sep 12 12:06:27 2015
@@ -75,7 +75,7 @@ public class ConstantPoolGen {
     private static final String METHODREF_DELIM = ":";
     private static final String IMETHODREF_DELIM = "#";
     private static final String FIELDREF_DELIM = "&";
-    private static final String NAT_DELIM = "%";
+    private static final String NAT_DELIM = "%"; // Name and Type
 
     private static class Index {
 
@@ -180,6 +180,22 @@ public class ConstantPoolGen {
                 if (!cp_table.containsKey(key)) {
                     cp_table.put(key, new Index(i));
                 }
+            } else if (c == null) { // entries may be null
+                // nothing to do
+            } else if (c instanceof ConstantInteger) {
+                // nothing to do
+            } else if (c instanceof ConstantLong) {
+                // nothing to do
+            } else if (c instanceof ConstantFloat) {
+                // nothing to do
+            } else if (c instanceof ConstantDouble) {
+                // nothing to do
+            } else if (c instanceof org.apache.commons.bcel6.classfile.ConstantMethodType) {
+                // TODO should this be handled somehow?
+            } else if (c instanceof org.apache.commons.bcel6.classfile.ConstantMethodHandle) {
+                // TODO should this be handled somehow?
+            } else {
+                assert false : "Unexpected constant type: " + c.getClass().getName();
             }
         }
     }