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:
private static String truncate(String input, int maxLength) {
BOOM!
You have to close the IDE, possibly kill it.
Consider this class:
Now change the
truncate(...)declaration by adding thestatickeyword and hit Ctrl+S:BOOM!
You have to close the IDE, possibly kill it.