/* *Copyrightc2011,2013Oracleand/oritsaffiliates.Allrightsreserved. *DONOTALTERORREMOVECOPYRIGHTNOTICESORTHISFILEHEADER. * *Thiscodeisfreesoftware;youcanredistributeitand/ormodifyit *underthetermsoftheGNUGeneralPublicLicenseversion2only,as *publishedbytheFreeSoftwareFoundation. * *Thiscodeisdistributedinthehopethatitwillbeuseful,butWITHOUT *ANYWARRANTY;withouteventheimpliedwarrantyofMERCHANTABILITYor *FITNESSFORAPARTICULARPURPOSE.SeetheGNUGeneralPublicLicense *version2formoredetails(copyisincludedinLICENSEfilejava.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74 *accompaniedthiscode). * *YoushouldhavereceivedacopyoftheGNUGeneralPublicLicenseversion *2alongwiththiswork;ifnot,writetotheFreeSoftwareFoundation, *Inc.,51FranklinSt,FifthFloor,Boston,MA02110-1301USA.
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 *PleasecontactOracle,500OracleParkway,RedwoodShores,CA94065USA *orvisitwww.oracle.comifyouneedadditionalinformationorhaveany *questions.
*/
static(i;i<N_TESTS;i)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
publicstaticmain(String[]args)throwsException{
/* *IfMAX_VALUEcounted"+countedjava.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62 *because(apparently)badcodeisonlygeneratedwhencomparing *<=MAX_VALUEinthedoTestmethod.
*/
Test6992759 test = new Test6992759(); for (int i = 0; i < N_TESTS; i += 1) {
test.doTest(10, Integer.MAX_VALUE, i); //test.doTest(10, Integer.MAX_VALUE - 1, i);
}
System.out.println("No failure");
}
void doTest(int expected, int max, int i) { int counted; for (counted = 0;
(counted <= max) && (counted < expected);
counted += 1) {
} if (counted != expected) { thrownew RuntimeException("Failed test iteration=" + i + " max=" + max + " counted=" + counted + " expected=" + expected);
}
}
}
Messung V0.5 in Prozent
¤ 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.0.28Bemerkung:
¤
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.