Bug 248781

Summary: [compiler] unreachable code in org.eclipse.jdt.internal.compiler.impl.CompilerOptions.optionKeyFromIrritant(long)
Product: [Eclipse Project] JDT Reporter: Simon Goldsmith <sgoldsmith>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.4.1   
Target Milestone: 3.5 M3   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Simon Goldsmith CLA 2008-09-26 16:32:31 EDT
Build ID: jdt 3.4.1 release

Steps To Reproduce:
1. call org.eclipse.jdt.internal.compiler.impl.CompilerOptions.optionKeyFromIrritant(long)
with FinalParameterBound as its argument.
2.  It ought to return an option.  Instead it returns null because the following code is unreachable (see below).



More information:
	public static String optionKeyFromIrritant(long irritant) {
		// keep in sync with warningTokens and warningTokenToIrritant
		int irritantInt = (int) irritant; // results in negative int for longs >= 0x80000000
		if (irritantInt == irritant) { // fails  for FinalParameterBound because the negative int is promoted to a negative long
			switch (irritantInt) {
				// ...
				case (int) FinalParameterBound : // unreachable
					return OPTION_ReportFinalParameterBound;
			}
Comment 1 Kent Johnson CLA 2008-09-30 15:03:37 EDT

*** This bug has been marked as a duplicate of bug 245973 ***
Comment 2 Kent Johnson CLA 2008-10-28 13:09:55 EDT
Verified for 3.5M3 using I20081026-2000 build.