// BootstrapMethodError expected in each test case below. publicclass BadBSMUseTest { publicstaticvoid main(String args[]) throws Throwable { // 1. Test a CONSTANT_Dynamic_info's bootstrap_method_attr_index points // at a BSM meant for a CONSTANT_InvokeDynamic_info
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("CondyUsesIndyBSM");
OutputAnalyzer oa = new OutputAnalyzer(pb.start());
oa.shouldContain("In Indybsm target CallSite method foo");
oa.shouldContain("BootstrapMethodError: bootstrap method initialization exception");
oa.shouldHaveExitValue(1);
// 2. Test a CONSTANT_InvokeDynamic_info's bootstrap_method_attr_index points // at a BSM meant for a CONSTANT_Dynamic_info
pb = ProcessTools.createJavaProcessBuilder("IndyUsesCondyBSM");
oa = new OutputAnalyzer(pb.start());
oa.shouldContain("In Condybsm");
oa.shouldContain("BootstrapMethodError: bootstrap method initialization exception");
oa.shouldHaveExitValue(1);
}
}
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.