1 6 package de.uka.ipd.coverage.utils; 7 8 import org.apache.bcel.classfile.Constant; 9 import org.apache.bcel.generic.Type; 10 11 15 public class BCELFillIn { 16 20 public static Type findType(Constant constant) { 21 byte tag = constant.getTag(); 22 Type[] types = new Type[] { 23 Type.BOOLEAN, 24 Type.BYTE, 25 Type.CHAR, 26 Type.DOUBLE, 27 Type.FLOAT, 28 Type.INT, 29 Type.LONG, 30 Type.NULL, 31 Type.OBJECT, 32 Type.SHORT, 33 Type.STRING, 34 Type.STRINGBUFFER, 35 Type.THROWABLE, 36 Type.UNKNOWN, 37 }; 38 for (int i = 0; i < types.length; i++) { 39 if (tag == types[i].getType()) { 40 return types[i]; 41 } 42 } 43 throw new AssertionError ("constant " + constant + " has unknown type."); } 45 46 } 47 | Popular Tags |