| Summary: | BasicProgram with parameters compiles properly, but generates bad Java | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Will Smythe <smythew> |
| Component: | EDT | Assignee: | 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: | |||
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");
}
}
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. I have added a simple validation check so that callable programs are flagged as not supported in this release (in ProgramValidator) *** Bug 363500 has been marked as a duplicate of this bug. *** This bug was fixed in 0.7 |
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