in src/main/java/org/apache/bcel/generic/Type.java [183:222]
public static Type getType(final Class<?> cls) {
Objects.requireNonNull(cls, "cls");
/*
* That's an amazingly easy case, because getName() returns the signature. That's what we would have liked anyway.
*/
if (cls.isArray()) {
return getType(cls.getName());
}
if (!cls.isPrimitive()) { // "Real" class
return ObjectType.getInstance(cls.getName());
}
if (cls == Integer.TYPE) {
return INT;
}
if (cls == Void.TYPE) {
return VOID;
}
if (cls == Double.TYPE) {
return DOUBLE;
}
if (cls == Float.TYPE) {
return FLOAT;
}
if (cls == Boolean.TYPE) {
return BOOLEAN;
}
if (cls == Byte.TYPE) {
return BYTE;
}
if (cls == Short.TYPE) {
return SHORT;
}
if (cls == Long.TYPE) {
return LONG;
}
if (cls == Character.TYPE) {
return CHAR;
}
throw new IllegalStateException("Unknown primitive type " + cls);
}