Polishing

This commit is contained in:
Juergen Hoeller
2018-06-29 23:05:40 +02:00
parent de8d4e917d
commit 740751bc01

View File

@@ -353,7 +353,7 @@ public class CodeFlow implements Opcodes {
// nop // nop
} }
else { else {
throw new IllegalStateException("cannot get from "+stackTop+" to "+targetDescriptor); throw new IllegalStateException("Cannot get from " + stackTop + " to " + targetDescriptor);
} }
} }
else if (stackTop == 'J') { else if (stackTop == 'J') {
@@ -370,7 +370,7 @@ public class CodeFlow implements Opcodes {
mv.visitInsn(L2I); mv.visitInsn(L2I);
} }
else { else {
throw new IllegalStateException("cannot get from "+stackTop+" to "+targetDescriptor); throw new IllegalStateException("Cannot get from " + stackTop + " to " + targetDescriptor);
} }
} }
else if (stackTop == 'F') { else if (stackTop == 'F') {
@@ -387,7 +387,7 @@ public class CodeFlow implements Opcodes {
mv.visitInsn(F2I); mv.visitInsn(F2I);
} }
else { else {
throw new IllegalStateException("cannot get from "+stackTop+" to "+targetDescriptor); throw new IllegalStateException("Cannot get from " + stackTop + " to " + targetDescriptor);
} }
} }
else if (stackTop == 'D') { else if (stackTop == 'D') {
@@ -404,7 +404,7 @@ public class CodeFlow implements Opcodes {
mv.visitInsn(D2I); mv.visitInsn(D2I);
} }
else { else {
throw new IllegalStateException("cannot get from "+stackDescriptor+" to "+targetDescriptor); throw new IllegalStateException("Cannot get from " + stackDescriptor + " to " + targetDescriptor);
} }
} }
} }
@@ -653,6 +653,7 @@ public class CodeFlow implements Opcodes {
} }
/** /**
* Convert a type descriptor to the single character primitive descriptor.
* @param descriptor a descriptor for a type that should have a primitive representation * @param descriptor a descriptor for a type that should have a primitive representation
* @return the single character descriptor for a primitive input descriptor * @return the single character descriptor for a primitive input descriptor
*/ */
@@ -768,9 +769,8 @@ public class CodeFlow implements Opcodes {
} }
/** /**
* Deduce the descriptor for a type. Descriptors are like JVM type names but missing * Deduce the descriptor for a type. Descriptors are like JVM type names but missing the
* the trailing ';' so for Object the descriptor is "Ljava/lang/Object" for int it is * trailing ';' so for Object the descriptor is "Ljava/lang/Object" for int it is "I".
* "I".
* @param type the type (may be primitive) for which to determine the descriptor * @param type the type (may be primitive) for which to determine the descriptor
* @return the descriptor * @return the descriptor
*/ */
@@ -944,7 +944,7 @@ public class CodeFlow implements Opcodes {
case 'S': return T_SHORT; case 'S': return T_SHORT;
case 'Z': return T_BOOLEAN; case 'Z': return T_BOOLEAN;
default: default:
throw new IllegalArgumentException("Unexpected arraytype "+arraytype.charAt(0)); throw new IllegalArgumentException("Unexpected arraytype " + arraytype.charAt(0));
} }
} }
@@ -978,10 +978,10 @@ public class CodeFlow implements Opcodes {
} }
else { else {
if (arraytype.charAt(0) == '[') { if (arraytype.charAt(0) == '[') {
// Handling the nested array case here. If vararg // Handling the nested array case here.
// is [[I then we want [I and not [I; // If vararg is [[I then we want [I and not [I;
if (CodeFlow.isReferenceTypeArray(arraytype)) { if (CodeFlow.isReferenceTypeArray(arraytype)) {
mv.visitTypeInsn(ANEWARRAY, arraytype+";"); mv.visitTypeInsn(ANEWARRAY, arraytype + ";");
} }
else { else {
mv.visitTypeInsn(ANEWARRAY, arraytype); mv.visitTypeInsn(ANEWARRAY, arraytype);
@@ -1024,7 +1024,7 @@ public class CodeFlow implements Opcodes {
case 'S': return "Ljava/lang/Short"; case 'S': return "Ljava/lang/Short";
case 'Z': return "Ljava/lang/Boolean"; case 'Z': return "Ljava/lang/Boolean";
default: default:
throw new IllegalArgumentException("Unexpected non primitive descriptor "+primitiveDescriptor); throw new IllegalArgumentException("Unexpected non primitive descriptor " + primitiveDescriptor);
} }
} }