Byte results[] = newByte[-(-128) + 127 +1]; for(int i = 0; i < results.length; i++)
results[i] = (byte)(i-128);
for(int i = 0; i < results.length; i++) { Byte B = (byte)(i-128); if (B != results[i]) {
cached = false;
System.err.println("Byte value " + B + " is not cached appropriately.");
}
}
for(int i = Byte.MIN_VALUE; i < Byte.MAX_VALUE; i++) { Byte B;
B = (byte)i; if (B.byteValue() != i) {
cached = false;
System.err.println("Erroneous autoboxing conversion for " + "byte value " + i + " .");
}
}
Character results[] = new Character[127 +1]; for(int i = 0; i < results.length; i++)
results[i] = (char)i;
for(int i = 0; i < results.length; i++) {
Character C = (char)i; if (C != results[i]) {
cached = false;
System.err.println("Char value " + C + " is not cached appropriately.");
}
}
for(int i = Character.MIN_VALUE; i < Character.MAX_VALUE; i++) {
Character C;
C = (char)i; if (C.charValue() != i) {
cached = false;
System.err.println("Erroneous autoboxing conversion for " + "char value " + i + " .");
}
}
Integer results[] = new Integer[-(-128) + 127 +1]; for(int i = 0; i < results.length; i++)
results[i] = (i-128);
for(int i = 0; i < results.length; i++) {
Integer I = (i-128); if (I != results[i]) {
cached = false;
System.err.println("Integer value " + I + " is not cached appropriately.");
}
}
for(int i = -256; i < 255; i++) {
Integer I;
I = i; if (I.intValue() != i) {
cached = false;
System.err.println("Erroneous autoboxing conversion for " + "int value " + i + " .");
}
}
Long results[] = newLong[-(-128) + 127 +1]; for(int i = 0; i < results.length; i++)
results[i] = (long)(i-128);
for(int i = 0; i < results.length; i++) { Long L = (long)(i-128); if (L != results[i]) {
cached = false;
System.err.println("Long value " + L + " is not cached appropriately.");
}
}
for(int i = -256; i < 255; i++) {
Integer L;
L = i; if (L.longValue() != i) {
cached = false;
System.err.println("Erroneous autoboxing conversion for " + "int value " + i + " .");
}
}
Short results[] = newShort[-(-128) + 127 +1]; for(int i = 0; i < results.length; i++)
results[i] = (short)(i-128);
for(int i = 0; i < results.length; i++) { Short S = (short)(i-128); if (S != results[i]) {
cached = false;
System.err.println("Short value " + S + " is not cached appropriately.");
}
}
for(int i = Short.MIN_VALUE; i < Short.MAX_VALUE; i++) { Short S;
S = (short)i; if (S.shortValue() != i) {
cached = false;
System.err.println("Erroneous autoboxing conversion for " + "short value " + i + " .");
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.