From: SourceForge.net <no...@so...> - 2006-10-26 16:48:15
|
Bugs item #1585210, was opened at 2006-10-26 09:48 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=438935&aid=1585210&group_id=44253 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Interactions Group: 2: Annoying Status: Open Resolution: None Priority: 5 Private: No Submitted By: Marty Stepp (martystepp) Assigned to: Nobody/Anonymous (nobody) Summary: "Run Document's Main Method" allows non-void return type Initial Comment: This bug applies to DrJava's newest version 20061025-1556 and the preceding version 20060918-1737, on all platforms. The DrJava option to "Run Document's main Method" does not behave correctly. It incorrectly considers any static method with a name of "main" and a sole parameter of a String[] to be acceptable, regardless of whether its return type is void. For example, the following program can be compiled and executed successfully in DrJava (note the return type of double on main): public class Bad { public static double main(String[] args) { System.out.println("Hello, world!"); return 0.0; } } The reason this is a big problem is that, though our students write their programs in DrJava, we grade them at the command line by scripts. Several students have submitted programs like the above, which compile and run perfectly in their DrJava, but which do not run at all when using standard javac/java at the command line. (It gives NoSuchMethodDefError: main.) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=438935&aid=1585210&group_id=44253 |