| Warning | ||
|---|---|---|
| ||
This page was created to report about the changes in syntax when we switched to a new parser back in 2004. So some of the points below are not necessarily representative of what Groovy supports nowadays. Please take the notes below with a grain of salt! |
Here is a checklist of changes you'll need to make to a Groovy classic codebase to ensure compatibility with the new Groovy JSR syntax.
...
| Code Block |
|---|
int result = 5.intdiv(3) // JSR |
JDK5 for loop not supported
Groovy already supports a fair number of looping mechanisms, and in Classic, both for (... : ...) and for (... in ...) were supported. For the moment, only the for (... in ...) notation is allowed.
| Code Block |
|---|
for (e : myList) { } // not allowed anymore
for (Element e : myList) { } // not allowed anymore
for (e in myList) { } // JSR
for (Element e in myList) { } // JSR
|
Exclusive range
The operator for creating ranges with the upper bound excluded from the range has changed.
...