Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 357665 - Compile error on generated code for declaration with initializer
Summary: Compile error on generated code for declaration with initializer
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:
: 357676 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-09-14 13:45 EDT by Matt Heitz CLA
Modified: 2017-02-23 14:15 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 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.