[prev in list] [next in list] [prev in thread] [next in thread] 

List:       groovy-user
Subject:    Re: [groovy-user] type error with variable arguments (indy groovy 2.1.7)
From:       Anthony Bargnesi <abargnesi () gmail ! com>
Date:       2013-09-27 17:41:38
Message-ID: CAH6n4UL18XZ4nJWV6GU6y0D+3CkMwNaH0NbgnUpOad1O+q92MA () mail ! gmail ! com
[Download RAW message or body]

Jochen,

Thanks for investigating.  I indeed found the jvm bug report:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8019184

I've also confirmed that it's working on jdk 1.8 developer previous fwiw.

Thanks!
Anthony Bargnesi


On Fri, Sep 27, 2013 at 9:57 AM, Jochen Theodorou <blackdrag@gmx.org> wrote:

> Am 19.09.2013 21:39, schrieb Anthony Bargnesi:
> 
> > Hi folks,
> > 
> > I hit a type error with java 1.7.0_40/groovy 2.1.7 (indy).  The code
> > sample is this gist \
> > <https://gist.github.com/**abargnesi/6628656<https://gist.github.com/abargnesi/6628656>
> > 
> > > .
> > 
> > 
> > The stacktrace is:
> > 
> > Caught: java.lang.**IllegalArgumentException: target and fallback types
> > must match:
> > (Object,Object,Object,Object,**Object,Object,Object,Object,**
> > Object)Object
> > != (Class,int,Class,Class,Class,**Class,Class,Class,Class)Object
> > java.lang.**IllegalArgumentException: target and fallback types must
> > match:
> > (Object,Object,Object,Object,**Object,Object,Object,Object,**
> > Object)Object
> > != (Class,int,Class,Class,Class,**Class,Class,Class,Class)Object
> > at varargs_indy.run(varargs_indy.**groovy:19)
> > 
> > I don't receive this exception with the non-indy version.
> > 
> 
> it is from the invokedynamic stuff, so no wonder there is no such problem
> in the non-indy version... I just found out, 7u25 does not give an error
> here.
> 
> 
> Even stranger  if when you remove the last Class argument like so:
> > 
> > getRefs(1, ServiceA.class, ServiceB.class, ServiceC.class,
> > ServiceD.class, ServiceE.class, ServiceF.class)
> > 
> > then it compiles and runs without error.
> > 
> 
> that speaks imho again for a jvm bug... since invokedynamic I am a bit
> fast with that... but this one looks like a clear bug in
> MethodHandles#catchException to me. I have to ask John Rose & Co.
> 
> 
> Also if I remove the first Integer type argument from the signature and
> > call it like:
> > 
> > getRefs(ServiceA.class, ServiceB.class, ServiceC.class, ServiceD.class,
> > ServiceE.class, ServiceF.class, ServiceG.class)
> > 
> > this it also compiles without error.
> > 
> 
> It seems the bug is related to the number of arguments.
> 
> bye blackdrag
> 
> 
> --
> Jochen "blackdrag" Theodorou - Groovy Project Tech Lead
> blog: http://blackdragsview.**blogspot.com/<http://blackdragsview.blogspot.com/>
> german groovy discussion newsgroup: de.comp.lang.misc
> For Groovy programming sources visit http://groovy-lang.org
> 
> 
> ------------------------------**------------------------------**---------
> To unsubscribe from this list, please visit:
> 
> http://xircles.codehaus.org/**manage_email<http://xircles.codehaus.org/manage_email>
>  
> 
> 


[Attachment #3 (text/html)]

<div dir="ltr"><div>Jochen,<br><br>Thanks for investigating.  I indeed found the jvm \
bug report:<br><br><a \
href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8019184">http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8019184</a><br>
 <br>I&#39;ve also confirmed that it&#39;s working on jdk 1.8 developer previous \
fwiw.<br><br></div>Thanks!<br><div>Anthony Bargnesi<br></div></div><div \
class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Sep 27, 2013 at 9:57 AM, \
Jochen Theodorou <span dir="ltr">&lt;<a href="mailto:blackdrag@gmx.org" \
target="_blank">blackdrag@gmx.org</a>&gt;</span> wrote:<br> <blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">Am 19.09.2013 21:39, schrieb Anthony Bargnesi:<br> \
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div class="im"> Hi folks,<br>
<br>
I hit a type error with java 1.7.0_40/groovy 2.1.7 (indy).  The code<br></div>
sample is this gist &lt;<a href="https://gist.github.com/abargnesi/6628656" \
target="_blank">https://gist.github.com/<u></u>abargnesi/6628656</a>&gt;.<div \
class="im"><br> <br>
The stacktrace is:<br>
<br>
Caught: java.lang.<u></u>IllegalArgumentException: target and fallback types<br>
must match:<br>
(Object,Object,Object,Object,<u></u>Object,Object,Object,Object,<u></u>Object)Object<br>
                
!= (Class,int,Class,Class,Class,<u></u>Class,Class,Class,Class)Object<br>
java.lang.<u></u>IllegalArgumentException: target and fallback types must<br>
match:<br>
(Object,Object,Object,Object,<u></u>Object,Object,Object,Object,<u></u>Object)Object<br>
                
!= (Class,int,Class,Class,Class,<u></u>Class,Class,Class,Class)Object<br>
         at varargs_indy.run(varargs_indy.<u></u>groovy:19)<br>
<br>
I don&#39;t receive this exception with the non-indy version.<br>
</div></blockquote>
<br>
it is from the invokedynamic stuff, so no wonder there is no such problem in the \
non-indy version... I just found out, 7u25 does not give an error here.<div \
class="im"><br> <br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"> Even stranger  if when you remove the last Class argument \
like so:<br> <br>
getRefs(1, ServiceA.class, ServiceB.class, ServiceC.class,<br>
ServiceD.class, ServiceE.class, ServiceF.class)<br>
<br>
then it compiles and runs without error.<br>
</blockquote>
<br></div>
that speaks imho again for a jvm bug... since invokedynamic I am a bit fast with \
that... but this one looks like a clear bug in MethodHandles#catchException to me. I \
have to ask John Rose &amp; Co.<div class="im"><br> <br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"> Also if I remove the first Integer type argument from the \
signature and<br> call it like:<br>
<br>
getRefs(ServiceA.class, ServiceB.class, ServiceC.class, ServiceD.class,<br>
ServiceE.class, ServiceF.class, ServiceG.class)<br>
<br>
this it also compiles without error.<br>
</blockquote>
<br></div>
It seems the bug is related to the number of arguments.<br>
<br>
bye blackdrag<div class="HOEnZb"><div class="h5"><br>
<br>
-- <br>
Jochen &quot;blackdrag&quot; Theodorou - Groovy Project Tech Lead<br>
blog: <a href="http://blackdragsview.blogspot.com/" \
target="_blank">http://blackdragsview.<u></u>blogspot.com/</a><br> german groovy \
discussion newsgroup: de.comp.lang.misc<br> For Groovy programming sources visit <a \
href="http://groovy-lang.org" target="_blank">http://groovy-lang.org</a><br> <br>
<br>
------------------------------<u></u>------------------------------<u></u>---------<br>
 To unsubscribe from this list, please visit:<br>
<br>
   <a href="http://xircles.codehaus.org/manage_email" \
target="_blank">http://xircles.codehaus.org/<u></u>manage_email</a><br> <br>
<br>
</div></div></blockquote></div><br></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic