pc2ccs / pc2v9

Version 9 of the PC^2 Programming Contest Control System
Eclipse Public License 2.0
46 stars 23 forks source link

RunsTablePane showMessage() arguments are backwards #804

Open clevengr opened 1 year ago

clevengr commented 1 year ago

Describe the issue:

In class RunsTablePane, in method startAutoJudging(), there is the following code:

            // make sure the OS supports judging of all problems this judge
            // is set up to autojudge BEFORE starting autojudging.
            List<Problem> plist = autoJudgingMonitor.getOSUnsupportedAutojudgeProblemList();
            if(!plist.isEmpty()) {
                StringBuffer message =new StringBuffer();
                ... a bunch of code to construct a detailed message listing the problems which cannot be judged ...
                FrameUtilities.showMessage(this,  message.toString(), "Judging Not Supported");
                return;
            }

The second and third arguments to FrameUtilities.showMessage(...) are backwards. The method signature is

    public static void showMessage(Component component, String title, String message)

but the code above is passing the message, THEN the title. The result is a dialog with a short, uninformative message ("Judging Not Supported") and a title which is lengthy and contains details -- but is cut off by the GUI component.

To Reproduce:

Expected behavior: Since CGroups have not been enabled but the interactive contest has problems which require CGroups, and since Judge 1 is by default to configured to Auto-Judge the interactive problems, a dialog should appear giving a detailed explanation of the issue.

Actual behavior: The following very unhelpful dialog appears:

image

Environment:

Additional context: The fix for this bug is to simply swap the arguments in the call to FrameUtilities.showMessage(...) in method RunsTablePane.startAutoJudging().

clevengr commented 1 year ago

This appears to be a duplicate of Issue #751...