History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: GROOVY-2776
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Danno Ferrin
Reporter: Sergey Bondarenko
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
groovy

"println" in new console window prints in the oldest one

Created: 24/Apr/08 08:36 AM   Updated: 25/Apr/08 04:06 AM
Component/s: None
Affects Version/s: None
Fix Version/s: 1.6-beta-1, 1.5.7

Time Tracking:
Not Specified


 Description  « Hide
When I open new window of Groovy Console and execute "println" in it,
everything is printed in the first opened window.

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Jim White - 24/Apr/08 09:37 PM - edited
The change for this has been applied to 1.5.x so this issue should be changed to reflect that.

The change for this issue is <http://fisheye.codehaus.org/changelog/groovy/trunk/groovy/groovy-core?cs=12064>.

I suspect that there is problem in the change.

This:

    void exit(EventObject evt = null) {
        if (askToSaveFile()) {
            frame.hide()
            frame.dispose()
            FindReplaceUtility.dispose()
        }

        systemOutInterceptor.stop()
    }

Changed to:

    void exit(EventObject evt = null) {
        if (askToSaveFile()) {
            frame.hide()
            frame.dispose()
            FindReplaceUtility.dispose()
            consoleControllers.remove(this)
            if (!consoleControllers) {
                systemOutInterceptor.stop()
            }
        }

    }

It probably was meant to be:

    void exit(EventObject evt = null) {
        if (askToSaveFile()) {
            frame.hide()
            frame.dispose()
            FindReplaceUtility.dispose()
        }
        consoleControllers.remove(this)
        if (!consoleControllers) {
             systemOutInterceptor.stop()
        }
    }

Danno Ferrin - 24/Apr/08 10:03 PM
The return value is wether we should continue closing the window.

If the file didn't need to get saved the dialog is not shown and the function returns true.
If the file needs saving there are three options: yes/no/cancel. Yes returns true if the file save suceeds, no returns true, and cancel returns false. So the return value is "really close?"

So really two bugs were fixed, because a canceled close would close the system out but not the window.