when running the code below
i’m getting compilation error:
java: ..\JavaClass.java:8: cannot find symbol
symbol : method add(java.math.BigDecimal)
location: class BigDecimalDelegated
it seems like the stub of the groovy class created for the java compiler does not contain the delegated methods.
any idea?
consider this classes:
class BigDecimalDelegated //groovy class
{
@Delegate BigDecimal delegated;
String data;
}
import org.junit.Test;
import java.math.BigDecimal;
public class JavaClass //java class
{
@Test
public void temp()throws Exception
{
new BigDecimalDelegated().add(BigDecimal.TEN);
}
}
Groovy compiler used in IDEA’s external build doesn’t support this, see https://issues.apache.org/jira/browse/GROOVY-4647
You can either use @Delegate classes from Groovy code only, or switch off external build in Settings | Compiler to use the old build mechanism.