Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 359363

Summary: Unreachable code in generated Java code
Product: z_Archived Reporter: pf yu <pfyu>
Component: EDTAssignee: Project Inbox <edt.javagen-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: critical    
Priority: P3 CC: jqian, mheitz, pfyu, svihovec
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description pf yu CLA 2011-09-29 04:26:28 EDT
Build Identifier: 201109282102

The generated Java code looks like this:
		try {
			throw new TypeCastException();
			AnyBoxedObject<java.lang.String> eze$Temp13;
			eze$Temp13 = EAny.ezeWrap("Exception is thrown, should not run this statement.");
			eze_Lib_org_eclipse_edt_eunit_runtime_LogResult().failed(eze$Temp13);
		}
		catch (TypeCastException ex) {
			AnyBoxedObject<java.lang.String> eze$Temp14;
			eze$Temp14 = EAny.ezeWrap("Catch exception");
			eze_Lib_org_eclipse_edt_eunit_runtime_LogResult().passed(eze$Temp14);
		}

So it will cause Unreachable code.

Reproducible: Always

Steps to Reproduce:
1. Check out project "org.eclipse.edt.eunit.test" from kan-cvs.
2. Add java generator to the project.
3. Clean the whole workspace.
4. The errors exist in the following java files:
fvt.basestatements.TestExceptionHandlingLib
fvt.basestatements.TestExitStatementLib
Comment 1 Matt Heitz CLA 2011-09-29 08:55:18 EDT
This is a duplicate of 358951, which is not going to be fixed in EDT 0.7.  In fact we may decide never to prevent this from happening.  You should comment out the variation in the testcase, and don't count it as a failure.

*** This bug has been marked as a duplicate of bug 358951 ***