Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 354944 - Generated Java has unreachable code
Summary: Generated Java has unreachable code
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-17 08:24 EDT by Kathy Carroll CLA
Modified: 2017-02-23 14:19 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kathy Carroll CLA 2011-08-17 08:24:51 EDT
package explore;

// basic library
library Tester  {}
	function executeLibTest(testName String) returns (MultiStatus)
		testMethods String[] = "runTestType01", "runTestType02"];
		runTestMtds runTestMethod[];
		return (runMultiTest(testMethods, runTestMtds, testName));
	end
	
	function runMultiTest(testMethods String[], runTestMtd runTestMethod[], testName String) returns (MultiStatus)
		ms MultiStatus;		
		return (ms);							
	end	
end
Record MultiStatus
	//these values accumulate the aggregate outcome, without 
	//requiring the individual outcomes be stored
	testCnt int;
	expectedCnt int;
end
delegate runTestMethod()	
end
Comment 1 Matt Heitz CLA 2011-08-18 13:52:31 EDT
This is actually a problem with the code expansion utility.  It inserts a line of code after the return statement for each inout and out parameter.  The return statement should be last.

The same kind of problem could happen with throw and transfer statements.  We don't support transfer in 0.7, so feel free to handle that one later.
Comment 2 Kathy Carroll CLA 2011-09-15 14:29:26 EDT
Problem still happens with install build 201109150902.

If make runMultiTest's testName paramater an in parameter, generated Java is OK.
Comment 3 Jeff Douglas CLA 2011-09-24 14:28:33 EDT
fixed
Comment 4 Kathy Carroll CLA 2011-09-26 09:13:26 EDT
201109242101
Comment 5 Lisa Lasher CLA 2011-10-11 16:19:42 EDT
Closing this defect.