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

Bug 362861

Summary: BasicProgram with parameters compiles properly, but generates bad Java
Product: z_Archived Reporter: Will Smythe <smythew>
Component: EDTAssignee: Project Inbox <edt.compiler-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jeffdouglas, jvincens, pharmon, stijn_papp
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

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