groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From OC <...@ocs.cz>
Subject Followup: java.lang.IllegalArgumentException, Groovy 2.4.7, _might_ be caused by Java 8
Date Sun, 30 Jul 2017 21:26:55 GMT
Hi there again,

On 30. 7. 2017, at 21:16, ocs@ocs.cz wrote:
> I have got the following code (part of a big project):
> ===
> class AuctionTable extends SecureComponent {
>    public AuctionTable(WOContext context) {
>        super(context)
>        showClosedAuctions=... some expression ... // the fail line 8, see please below
> ... ...
>    }    
>    boolean showClosedAuctions
> ... ...
> ===

it looks like an explicit type-cast, i.e.,

===
...
showClosedAuctions=(boolean)... some expression ...
...
===

did help and it does not throw anymore. Weird. Shouldn't it be superfluous in this case?

Anyway, for the moment it seems it is resolved, althougth I regret to admit I do not understand
the mechanism which caused the problem nor the one which fixed it at all.

Thanks,
OC

> which works without a glitch on my old computer (Java 1.7.0_13 / Mac OS X 10.8.5). Alas,
it reliably fails with my new one (Java 1.8.0_45 / Mac OS X 10.12.5) this way:
> 
> ===
> ...
> Caused by: java.lang.IllegalArgumentException
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:497)
> 	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
> 	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
> 	at groovy.lang.MetaClassImpl.setProperty(MetaClassImpl.java:2705)
> 	at groovy.lang.ExpandoMetaClass.setProperty(ExpandoMetaClass.java:1185)
> 	at groovy.lang.MetaClassImpl.setProperty(MetaClassImpl.java:3747)
> 	at components.sharedcode.OCSComponent.setProperty(OCSComponent.groovy)
> 	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.setGroovyObjectProperty(ScriptBytecodeAdapter.java:532)
> 	at components.sharedparts.AuctionTable.<init>(AuctionTable.groovy:8)
> ===
> 
> Does it make any sense? Can anybody here see the culprit and suggest a fix?
> 
> Thanks a lot,
> OC
> 


Mime
View raw message