Bug 398841 - Initialization of global fields that use @Resource annotation is missing
Summary: Initialization of global fields that use @Resource annotation is missing
Status: NEW
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: 2013-01-22 15:35 EST by Paul Harmon CLA
Modified: 2017-02-23 14:07 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Harmon CLA 2013-01-22 15:35:10 EST
Using the @Resource annotation should initialize the a variable, but this does not seem to be working for global variables. It works fine for local function variables. Here is a testcase the demonstrates this problem:


program pgm1
	
	
 	dsGlobal SQLDataSource? {@Resource{uri = "binding:DerbyConnection"}};

	function main()
 		dsLocal SQLDataSource? {@Resource{uri = "binding:DerbyConnection"}};
		if (dsGlobal == null)
			syslib.writeStdout("Gloal was null");
			else
			syslib.writeStdout("Global NOT null");
		end
		if (dsLocal == null)
			syslib.writeStdout("Local was null");
			else
			syslib.writeStdout("Local NOT null");
		end
	end
	
end