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

Bug 357422

Summary: Static external type function ignoring packageName property
Product: z_Archived Reporter: Justin Spadea <jspadea>
Component: EDTAssignee: Matt Heitz <mheitz>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: mheitz
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Justin Spadea CLA 2011-09-12 17:37:31 EDT
externalType Class type JavaObject{packageName = "java.lang"}
	 static function forName(name string in) returns(Class);
end

package pkg;
program prog
	function main()
		c Class? = Class.forName("my.test");
	end
end



Generates:

		Class c = null;
		String eze$Temp1 = Constants.EMPTY_STRING;
		eze$Temp1 = "my.test";
		c = pkg.Class.forName(eze$Temp1);

It's using the EGL package instead of the value from packageName.
Comment 1 Matt Heitz CLA 2011-09-14 13:37:38 EDT
Fixed with a change to ExternalTypeTemplates.  When accessing static functions and fields, we'll pay attention to @packageName and @externalName on the ET.

Note, at the moment there's a separate bug in the generator which prevents your testcase from generating clean code.  To work around it, put the declaration and initialization of variable 'c' in different statements.
Comment 2 Justin Spadea CLA 2011-09-15 11:09:03 EDT
Verified