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

Bug 354291

Summary: Generation errors on set-values block to initialize an array of delegates
Product: z_Archived Reporter: Kathy Carroll <carrollk>
Component: EDTAssignee: Project Inbox <edt.compiler-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jeffdouglas, jqian, pharmon
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Kathy Carroll CLA 2011-08-09 15:05:52 EDT
code at the bottom gets these errors for both Java and JS generation:

Multiple markers at this line
 - IWN.JavaGen.9998.e 0/0 Exception occurred: java.lang.RuntimeException: 
	 java.lang.reflect.InvocationTargetException
 - IWN.JavaGen.9999.e 0/0 Stack Trace: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException

=============================

library tester {}
	function runTests()
		// not ok
		runTestMtds runTestMethod[] = [EBoolean003.runTestConversions02, EBoolean003.runTestConversions03];
	end
	function runtTests2()
		// ok
		runTestMtds runTestMethod[2];
		runTestMtds[1] = EBoolean003.runTestConversions02;
		runTestMtds[2] = EBoolean003.runTestConversions03;
	end
	
end

delegate runTestMethod()	
end

==================================

package explore;

// basic library
library EBoolean003 {}
	// Function Declarations
	function runTestConversions02()
	end
	
	function runTestConversions03()
	end
	
end
Comment 1 Jeff Douglas CLA 2011-08-09 17:00:25 EDT
This seems to be Paul's problem.

Caused by: java.lang.NullPointerException
	at org.eclipse.edt.mof.egl.impl.ArrayLiteralImpl.getType(ArrayLiteralImpl.java:51)
	at org.eclipse.edt.mof.egl.utils.IRUtils$PartsReferencedResolver.visit(IRUtils.java:239)
	... 69 more
Comment 2 Paul Harmon CLA 2011-08-17 09:43:23 EDT
I have fixed the NPE with a change to ArrayLiteralImpl.

If a function is used as the element in an array literal, the code now sets the type for the array to EGLAny.
Comment 3 Kathy Carroll CLA 2011-08-17 10:41:24 EDT
Verified
Comment 4 Lisa Lasher CLA 2011-10-11 16:00:48 EDT
Closing this defect.