Bug 248781 - [compiler] unreachable code in org.eclipse.jdt.internal.compiler.impl.CompilerOptions.optionKeyFromIrritant(long)
Summary: [compiler] unreachable code in org.eclipse.jdt.internal.compiler.impl.Compile...
Status: VERIFIED DUPLICATE of bug 245973
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.5 M3   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-26 16:32 EDT by Simon Goldsmith CLA
Modified: 2008-10-28 13:09 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.