Skip to content

Instantly share code, notes, and snippets.

@berdario
Last active September 12, 2016 22:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save berdario/4eb5499aa6098c867c1056d5011f0be4 to your computer and use it in GitHub Desktop.
Save berdario/4eb5499aa6098c867c1056d5011f0be4 to your computer and use it in GitHub Desktop.
package foo
class Bar {
static final map = foo
static final foo = [1,2,3]
}
package foo
class Foo {
static final bar = Bar.map
static final foobar = Bar.foo
}
// Groovy won't track dependencies across files... that is, Bar has a bug and you can fix it by reordering the static final attributes
// When reloading/reimporting the code, you'll see the correct/updated values in Bar
// But even if you manually reimport Foo, you'll still see the previous value (Foo.bar == null) if Foo.groovy hasn't been modified
// the only way to realize it, was to kill the application, and restart it (which on some Grails applications can take more than 2 minutes )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment