We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider this class:
package test64 import groovy.transform.CompileDynamic import groovy.transform.CompileStatic @CompileStatic class Test64 { @CompileDynamic static enum ShippingAddressSynchType { ACCOUNTING { @Override void synch(Test64 customer) { truncate('foo', 2) } }; void synch(Test64 customer) { } private String truncate(String input, int maxLength) { if(!input) return input if(input.length() > maxLength) input = input[0..maxLength - 1] return input } } }
Now change the truncate(...) declaration by adding the static keyword and hit Ctrl+S:
truncate(...)
static
private static String truncate(String input, int maxLength) {
BOOM! You have to close the IDE, possibly kill it.
The text was updated successfully, but these errors were encountered:
See also what happens with Groovy without the static keyword: https://issues.apache.org/jira/browse/GROOVY-9523 https://issues.apache.org/jira/browse/GROOVY-9524
Adding static seems to work fine with Groovy itself, but because of this Greclipse issue it crashes my IDE.
Sorry, something went wrong.
Quick observation, you can write truncate like this. Not important, just a suggestion.
truncate
private static String truncate(String input, int maxLength) { if (input && input.length() > maxLength) input = input[0..<maxLength] return input }
Fix for #1099: don't re-visit static method in enum init body
322867e
ready to test
Works with 3.8.0.v202004242058-e1912, thank you!
eric-milles
No branches or pull requests
Consider this class:
Now change the
truncate(...)
declaration by adding thestatic
keyword and hit Ctrl+S:BOOM!
You have to close the IDE, possibly kill it.
The text was updated successfully, but these errors were encountered: