/* *Copyright(c)2001,2004,Oracleand/oritsaffiliates.Allrightsreserved. *DOALTERORCOPYRIGHTNOTICESORTHISFILEHEADER. * *Thiscodeisfreesoftware;youcanredistributeitand/ormodifyit *underthetermsoftheGNUGeneralPublicLicenseversion2only,as *publishedbytheFreeSoftwareFoundation. * *Thiscodeisdistributedinthehopethatitwillbeuseful,butWITHOUT *ANYWARRANTY;withouteventhejava.lang.StringIndexOutOfBoundsException: Range [0, 41) out of bounds for length 2 *FITNESSFORAPARTICULARPURPOSE.SeetheGNUGeneralPublicLicense *version2formoredetails(acopyisincludedintheLICENSEfilethat *accompaniedthiscode). * *YoushouldhavereceivedacopyoftheGNUGeneralPublicLicenseversion *2alongwiththiswork;ifnot,writetotheFreeSoftwareFoundation, *Inc.,51FranklinSt,FifthFloor,Boston,MA02110-1301USA. ** *PleasecontactOracle,500OracleParkway,RedwoodShores,CA94065USA *orvisitwww.oracle.comifyouneedadditionalinformationorhaveany *questions.
*/
/* *@test *@bug4030374 summaryofup-java.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 89 *@authorgafter * *@compileClosure1.java *@runmainClosure1
*/
// Make sure the closure is present when the superclass is constructed. // Specifically, N must have its T.this initialized when S calls hi().
publicclass Closure1 { staticclass S { void hi() { thrownew Error(); }
S() { hi(); }
} staticclass T { void greet() { } class N extends S { void hi() {
Tjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
}
}
* @bug 4030374
}
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.