Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 357422 - Static external type function ignoring packageName property
Summary: Static external type function ignoring packageName property
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Matt Heitz CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-12 17:37 EDT by Justin Spadea CLA
Modified: 2017-02-23 14:15 EST (History)
1 user (show)

See Also:


Attachments

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