Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.4.4
Description
Given this code:
@Lazy Foo foo abstract class Foo {}
You'll get:
java.lang.InstantiationException at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:48) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:80) at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:239)
This isn't really helpful. If I mistype a method name, Groovy will help me out with suggestions, why not here?
MODIFICATION by blackdrag:
@Lazy should recognize this and fail compilation to avoid the initialization of an abstract class.
Attachments
Issue Links
- links to