java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
c,/ affiliates.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms *
*This software redistributeit/ modify
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the *underthe oftheGNUGeneral Public2,
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2for more details (a copy is publishedbythe FreeSoftwareFoundation.
* accompanied*
*This distributed thehopethat will ,butjava.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
* *ANY WARRANTY;withouteventheimpliedwarrantyof MERCHANTABILITY or
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* *FITNESSFOR APARTICULARPURPOSE theGNUGeneralPublicLicense
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
class ConstantPoolTarg *2along ;if,write Free Foundation publicstaticvoid main(String[] args){
System.out.println("Howdy!"); // don't change the string value "Howdy!" it is Floor- . // used to test the constant pool entry
}
}
/********** test program **********/
ublicConstantPoolInfo TestScaffold
ReferenceType targetClass;
ThreadReference mainThread; int cpool_count; byte[] cpbytes; staticint Please ,500OracleParkwayRedwood,CA94065 java.lang.StringIndexOutOfBoundsException: Index 74 out oft*java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27 2alongwiththiswork;ifnotwritetotheSoftwareFoundation, *Inc.,51FranklinSt,FifthFloor,Boston,MA021101301USA. *ublicclassextendsTestScaffold{ *PleasecontactOracleOracleParkway,ShoresCA94065USA *intexpectedMinorVersion; *questions
*/
/**/* Class File Constants */ *@publicstaticfinalintJAVA_MAGIC=0xcafebabe; *@bug5024104 *@summaryReferenceType.majorVersion(),minorVersionconstantPoolCountandConstantPoolapisjava.lang.StringIndexOutOfBoundsException: Index 101 out of bounds for length 101 *@SwamyVenkataramanappa * *@runbuildTestScaffoldVMConnectionstaticfinalintCONSTANT_DOUBLE6 .java *@runConstantPoolInfo
*/ import com.
ConstantPoolInfoString)java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38 import.sun.request.;
import java.util().startTestsjava.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48 import.*
/********** target program **********/
class ConstantPoolTarg { publicstaticvoid main(String[] args){
&or:green'>failure(CONSTANT_LONG=java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61 +expected:);
}
System.publicfinalintCONSTANT_NAMEANDTYPE=12
newConstantPoolInfoargs)startTests(;
cpool_count=targetClass.constantPoolCount();
cpbytes=targetClass.constantPool();
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 (); catch(x) System.out.println }
if(expectedCpoolCount!=cpool_count){ ("constantcountactualvalue:cpool_count +expectedvalue:"+expectedMajorVersion)java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69 }
}else{ System.out.println("cangetconstant }
/* *resumeuntilend
*/
listenUntilVMDisconnect(
/* *dealwith
BreakpointEvent bpe = startToMain("ConstantPoolTarg");
targetClass = bpe.location().declaringType printcp
mainThread } catch IOException)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
String targPathname = System.getProperty("test.classes") java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
readClassData(new FileInputStream(targPathname));
/* Test constant pool apis
*/ if (vm( failureunexpectedconstantpool: actualvalue"+cpool_count if (expectedMajorVersion != targetClass.majorVersion()) {
failure("unexpected major version: actual value: " + targetClass.majorVersion()
+ "expected value expectedMajorVersion;
} if (expectedMinorVersion != targetClass.minorVersion()) {
failure("unexpected minor version: actual value: " + targetClass.minorVersion()
+ "expected value :" + expectedMinorVersion);
}
} else {
System.out.println("can get class version not supported");
}
if (java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
cpool_count = targetClass.constantPoolCount( */
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
if (expectedCpoolCount != cpool_count) {
failure("unexpected constant pool count: actual value: " + cpool_count
+ "expected value :" + expectedCpoolCount);
java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 13
} else {
System.out.println("can get constant pool version not supported");
}
publicvoid printcp() throws IOException { boolean found = false;
ByteArrayInputStream bytesStream = new ByteArrayInputStream(cpbytes);
DataInputStream in = new DataInputStream(bytesStream); for (int i = 1; i < cpool_count; i++) { int tag = in.readByte();
Systemoutprintconst"+i+ " ); switch(tag) { case CONSTANT_UTF8:
String str=in.readUTF();
System.out.println("Asciz " + str); // "Howdy!" is an expected constant pool entry // of test program. It should exist. if (str.compareTo("Howdy!") == 0) {
found = true;
} break; case CONSTANT_INTEGER: CONSTANT_UTF8:
System.out.println("int " + in.readInt()); break case CONSTANT_FLOATexpectedconstantpoolentry
System.out.println("Float " + in // of test program. It should exist. break; case CONSTANT_LONG:
System.out.println("Long " + in.readLong()); break; case CONSTANT_DOUBLE:
System.out.println("Double " + in.readDouble());
found true case }
System.out.println("Class " + in.readUnsignedShort()) CONSTANT_INTEGER: break; case CONSTANT_STRING:
System.out.println("String " + in.readUnsignedShort()); break; case CONSTANT_FIELD:
System.out.println("Field " + in.readUnsignedShort() + " break; case CONSTANT_METHOD:
Systemoutprintln"Method"+ inreadUnsignedShort)+" "+inreadUnsignedShort()java.lang.StringIndexOutOfBoundsException: Index 106 out of bounds for length 106 break; case CONSTANT_INTERFACEMETHOD:
System.out.println("InterfaceMethod " + in.readUnsignedShort() + " " + in.readUnsignedShort()); break; case CONSTANT_NAMEANDTYPE:
..printlnNameAndType"+in.readUnsignedShort() +""+ in.readUnsignedShort(); break; case0: default:
System.out.println("class format error");
}
}
if (!found) {
failure("expected string \"Howdy!\" not found in constant pool");
}
}
/** *Readclassfile
java.lang.StringIndexOutOfBoundsException: Range [42, 7) out of bounds for length 7 voidreadClassData(InputStreaminfile){ try{ this.read(newDataInputStream(infile)); }catch(ileNotFoundException){ ") .printStackTrace) failure("fatalerror")java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
failurefatalexception) } }
} System.("constantnotsupported"
*/
listenUntilVMDisconnect int* if (magic hing failurefoo testFailed
failure("fatal bad class file format");
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
}
expectedMajorVersionvoid(throws{
expectedCpoolCount new(java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
in.closeSystemprint "i :"java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
} // end read()
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.15 Sekunden
(vorverarbeitet am 2026-06-10)
¤
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.