Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 359363 - Unreachable code in generated Java code
Summary: Unreachable code in generated Java code
Status: CLOSED DUPLICATE of bug 358951
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 critical (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-29 04:26 EDT by pf yu CLA
Modified: 2017-02-23 14:17 EST (History)
4 users (show)

See Also:


Attachments

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