Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 354887 - Java Generation is invoking constructor that doesn't exist on delegate assignment statement
Summary: Java Generation is invoking constructor that doesn't exist on delegate assign...
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 blocker (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-16 15:55 EDT by Kathy Carroll CLA
Modified: 2017-02-23 14:14 EST (History)
1 user (show)

See Also:


Attachments
Archived file of Project (25.08 KB, application/x-zip-compressed)
2011-09-08 10:33 EDT, Kathy Carroll CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kathy Carroll CLA 2011-08-16 15:55:32 EDT
These two problems look similar.  

1.  Delegate variable declaration and initialization procudes invalid Java.

======= EGL code ===
library User  {}
	function invokeTheTest()
		exeLibTestMtd executeLibTestMethod = executeLibTest;
	end
	function executeLibTest(testName String) returns (MultiStatus)
		multi MultiStatus;
		return (multi);
	end	
end
Record MultiStatus
	testCnt int;
	firstFailedTestName String;
end
delegate executeLibTestMethod(testName String) returns (MultiStatus)
end
==============  Java code ============
	public void invokeTheTest() {
		org.eclipse.edt.javart.Delegate exeLibTestMtd = new org.eclipse.edt.javart.Delegate();
		exeLibTestMtd = new org.eclipse.edt.javart.Delegate("executeLibTest", this, String.class);
	}

======== Compile Error =================
The constructor Delegate() is undefined

2.  External Type without an empty constructor

=========  EGL Code ======

handler CreateResultFile 
	function createFile(fileDirectory String in, fullFileName String in, fileContent String in)
		myfile File  = new File(fileDirectory);
		createdDirs boolean = myfile.mkdirs();
		if(createdDirs)
			syslib.writeStdOut("directories created");			
		end					
	end	
end

ExternalType File type JavaObject {packageName = "java.io"}
	 constructor (pathname String In);
	 function getAbsolutePath() returns (String);
	 function createNewFile() returns (boolean);
	 function mkdirs() returns (boolean);
	 function exists() returns (boolean);
end

=========  Java code =====
	public void createFile(String fileDirectory, String fullFileName, String fileContent) {
		File myfile = new File();
		myfile = new File(fileDirectory);
		boolean createdDirs = false;
		createdDirs = myfile.mkdirs();
		if (createdDirs) {
			String eze$Temp2 = Constants.EMPTY_STRING;
			eze$Temp2 = "directories created";
			SysLib.writeStdout(eze$Temp2);
		}
	}

============  Compile Error ===========
The constructor File() is undefined
Comment 1 Kathy Carroll CLA 2011-08-17 08:21:52 EDT
Problem two has been resolved.  Still getting the issue with the Delegate constructor
Comment 2 Matt Heitz CLA 2011-08-17 23:33:36 EDT
I changed FunctionTemplate to put in the proper type (AnyBoxedObject) for Out and Inout parameters when we make a Delegate object.
Comment 3 Kathy Carroll CLA 2011-08-18 12:01:59 EDT
verified
Comment 4 Kathy Carroll CLA 2011-09-08 10:33:12 EDT
Created attachment 202998 [details]
Archived file of Project
Comment 5 Lisa Lasher CLA 2011-10-11 16:09:21 EDT
Closing this defect.