Issue Details (XML | Word | Printable)

Key: GROOVY-1949
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Paul King
Reporter: Chris vanBuskirk
Votes: 0
Watchers: 1
Operations

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

Problem With Stacked Cases In Switch Statements

Created: 22/Jun/07 02:01 PM   Updated: 26/Sep/07 08:21 PM
Component/s: None
Affects Version/s: 1.1-beta-1
Fix Version/s: 1.1-beta-2

Time Tracking:
Not Specified

Environment: groovy console 1.1 beta

Testcase included: yes


 Description  « Hide
MARC PALMER REPORTS:
--------------------------------------
Hi,

I found this funny behaviour yesterday, want to confirm it is incorrect behaviour before JIRA'ing.

Exhibit A, run in groovy console 1.1 beta:

def getServerURL(env) { 
        def serverURL 
        switch (env) { 
                case "remoteTestAnyware" : 
                        serverURL = "http://mail.anyware.co.uk:999" 
                        break; 
                case "testSeb" : 
                        serverURL = "http://192.168.1.64:8080" 
                        break; 
                case "testEnotions" : 
                default: 
                        serverURL = "http://localhost:8080" 
                        break; 
        } 
        return serverURL 
} 

assert getServerURL('remoteTestAnyware') == "http://mail.anyware.co.uk:999"
assert getServerURL('development') == "http://localhost:8080"


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Paul King added a comment - 22/Jun/07 07:15 PM
Should be fixed in HEAD

Paul King added a comment - 26/Sep/07 08:21 PM
No further feedback, assuming fixed