/** * Gets the string to use for CHECKCAST instruction, returning the correct value for any type, including primitives and arrays * * @param returnType The type to cast to with CHECKCAST * @return CHECKCAST parameter */ static String getCastType(final Class<?> returnType) { if (returnType.isPrimitive()) { return getWrapperType(returnType); } else { return getAsmTypeAsString(returnType, false); } }
/** * Gets the string to use for CHECKCAST instruction, returning the correct value for any type, including primitives and arrays * * @param returnType The type to cast to with CHECKCAST * @return CHECKCAST parameter */ static String getCastType(final Class<?> returnType) { if (returnType.isPrimitive()) { return getWrapperType(returnType); } else { return getAsmTypeAsString(returnType, false); } }
final String wrapperType = getWrapperType(parameterType); mv.visitFieldInsn(GETSTATIC, wrapperType, "TYPE", "Ljava/lang/Class;"); } else { final String wrapperType = getWrapperType(parameterType); mv.visitVarInsn(getVarInsn(parameterType), index); mv.visitMethodInsn(INVOKEVIRTUAL, getWrapperType(returnType), getPrimitiveMethod(returnType), "()" + getPrimitiveLetter(returnType), false);
final String wrapperType = getWrapperType(parameterType); mv.visitFieldInsn(GETSTATIC, wrapperType, "TYPE", "Ljava/lang/Class;"); } else { final String wrapperType = getWrapperType(parameterType); mv.visitVarInsn(getVarInsn(parameterType), index); mv.visitMethodInsn(INVOKEVIRTUAL, getWrapperType(returnType), getPrimitiveMethod(returnType), "()" + getPrimitiveLetter(returnType), false);