Summary: | VM bug prevents valid Java code to be executed on VM < 1.3.1 | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Olivier Thomann <Olivier_Thomann> |
Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | ||
Version: | 2.0 | ||
Target Milestone: | 2.0.1 | ||
Hardware: | PC | ||
OS: | Windows 2000 | ||
Whiteboard: |
Description
Olivier Thomann
2002-07-12 14:45:34 EDT
Yes, I think we want to work-around the VM bug for such targets. Proposed fix from Olivier: if (needSwitch) { int max = localKeysCopy[caseCount - 1]; int min = localKeysCopy[0]; if ((long) (caseCount * 2.5) > ((long) max - (long) min)) { if (max > 0x7FFF0000 && currentScope.environment ().options.complianceLevel < CompilerOptions.JDK1_4) { // we need a special case // see http://dev.eclipse.org/bugs/show_bug.cgi?id=21557 codeStream.lookupswitch(defaultLabel, constants, sortedIndexes, caseLabels); } else { codeStream.tableswitch( defaultLabel, min, max, constants, sortedIndexes, caseLabels); } } else { codeStream.lookupswitch(defaultLabel, constants, sortedIndexes, caseLabels); } codeStream.updateLastRecordedEndPC(codeStream.position); } Integrated, fixed. Verified. Verified Verified in 2.1 M1 |