Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 362861 - BasicProgram with parameters compiles properly, but generates bad Java
Summary: BasicProgram with parameters compiles properly, but generates bad Java
Status: CLOSED FIXED
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:
: 363500 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-11-03 23:40 EDT by Will Smythe CLA
Modified: 2017-02-23 14:15 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Will Smythe CLA 2011-11-03 23:40:41 EDT
The following code compiles properly:

program MyFirstProgram  type BasicProgram (param1 String) {}
		
	function main()
		syslib.writestdout("hey " + param1 + "!");
	end
	
end

But an error exists in the generated Java:
param1 cannot be resolved to a variable
Comment 1 stijn papp CLA 2011-11-08 03:59:08 EST
had the same problem yesterday. 

The thing is that the Java generated doesn't seem to have a parameter comming in. 

package server;
import org.eclipse.edt.javart.resources.*;
import org.eclipse.edt.javart.*;
import org.eclipse.edt.runtime.java.eglx.lang.EAny;
import org.eclipse.edt.runtime.java.eglx.lang.EString;
import java.lang.String;
@SuppressWarnings("unused")
@javax.xml.bind.annotation.XmlRootElement(name="progtest")
public class progtest extends ProgramBase {
	private static final long serialVersionUID = 10L;
	@org.eclipse.edt.javart.json.Json(name="variableName",   clazz=EString.class, asOptions={})
	public String variableName;
	
	public static void main(String... ezeargs) throws Exception {
		StartupInfo info = new StartupInfo( "progtest", "server/progtest.properties", ezeargs );
		RunUnit ru = new JSERunUnit( info );
		org.eclipse.edt.javart.Runtime.setStaticRunUnit( ru );
		ru.start( new progtest() );
		ru.exit();
	}
	public progtest() {
		super();
		ezeInitialize();
	}
	public void ezeInitialize() {
		variableName = "";
	}
	public void main() {
		help = ((help) + "me");
	}
}
Comment 2 Jeff Douglas CLA 2011-11-10 08:59:24 EST
According to Matt and Tim, EDT is not going to support called programs (with or without parameters), that any programs invoked via the call statement will be external. Instead EDT programs will be "called" through a service.

This makes this defect invalid.

I am sending it over to the compiler to validate it out.
Comment 3 Paul Harmon CLA 2011-11-14 10:53:54 EST
I have added a simple validation check so that callable programs are flagged as not supported in this release (in ProgramValidator)
Comment 4 Jeff Douglas CLA 2011-11-14 13:17:48 EST
*** Bug 363500 has been marked as a duplicate of this bug. ***
Comment 5 Lisa Lasher CLA 2012-04-04 22:18:21 EDT
This bug was fixed in 0.7