Issue Details (XML | Word | Printable)

Key: GROOVY-1947
Type: Bug Bug
Status: Closed Closed
Resolution: Duplicate
Priority: Critical Critical
Assignee: Paul King
Reporter: Marc Palmer
Votes: 0
Watchers: 0
Operations

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

Empty case block before default prevents default block from executing

Created: 20/Jun/07 08:44 AM   Updated: 28/Jun/07 06:15 AM
Component/s: None
Affects Version/s: 1.1-beta-1
Fix Version/s: 1.1-beta-2

Time Tracking:
Not Specified


 Description  « Hide
Example where second assert fails in Groovy console 1.1-beta1:
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"

If the empty "testEnotions" case is removed, the assert works.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Paul King added a comment - 28/Jun/07 06:15 AM
Duplicate of GROOVY-1949