Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

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

  • property keyword has been replaced with an annotation
  • local variable declarations and fields currently need to be specified with 'def' or a type. e.g.
  • float and double literals cannot start with dot. So

This is to avoid ambiguity with things like ranges (1..2) and so forth

  • no dumb expression rule, so we will catch dumb expressions (where a carriage return has broken the script). e.g.
  • markup / builders will change a little. Not sure of the syntax, but we'll have some kinda start/stop syntax to denote a markup block. Maybe a keyword, like
  • single and double quote strings can only span one line; for multiple lines use treble quotes
  • heredocs removal - they are kinda ugly anyway (smile). If you want to use them, just use treble quote instead
  • escaping of $ inside GStrings must use \$
  • assert uses comma instead of colon to delimit the two parameter form of assertion statement
  • currently for consistency in New Groovy, all blocks must commence on the same line...
  • return/break/continue to behave inside closures like these statements work in other blocks (such as the block on a for() or while() loop. More details here
  • No labels