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

Bug 357665

Summary: Compile error on generated code for declaration with initializer
Product: z_Archived Reporter: Matt Heitz <mheitz>
Component: EDTAssignee: Project Inbox <edt.javagen-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jeffdouglas, jqian
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Matt Heitz CLA 2011-09-14 13:45:51 EDT
I'm using the latest code from CVS.

The testcase below has two cases that ought to be generated the same way.  However, in the second case the code for the temporary string variable is inserted in the middle of c2's declaration, causing a Java syntax error.


package x;

program StaticET
    function main()
    	try
	        c1 Class?;
	        c1 = Class.forName("my.test");
		/*
		Class c1 = null;
		java.lang.String eze$Temp1 = Constants.EMPTY_STRING;
		eze$Temp1 = "my.test";
		c1 = Class.forName(eze$Temp1);
		*/


	        c2 Class? = Class.forName("my.test");
		/*
		Class java.lang.String eze$Temp2 = Constants.EMPTY_STRING;
		eze$Temp2 = "my.test";
		c2 = Class.forName(eze$Temp2);
		*/
        end
    end
end

externalType Class type JavaObject{packageName = "java.lang"}
     static function forName(name string in) returns(Class);
end
Comment 1 Jeff Douglas CLA 2011-09-14 20:09:20 EDT
*** Bug 357676 has been marked as a duplicate of this bug. ***
Comment 2 Jeff Douglas CLA 2011-09-14 20:12:18 EDT
fixed
Comment 3 Matt Heitz CLA 2011-09-15 09:53:38 EDT
Verified.