[jboss-jira] [JBoss JIRA] Commented: (JASSIST-142) Javassist throws a CannotCompileException on the org.codehaus.groovy.runtime.ArrayUtil class

Robert Elliot (JIRA) jira-events at lists.jboss.org
Tue May 24 02:54:00 EDT 2011


    [ https://issues.jboss.org/browse/JASSIST-142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12603843#comment-12603843 ] 

Robert Elliot commented on JASSIST-142:
---------------------------------------

Yes, exactly - the cause of the CannotCompileException is IOException("too much data").

As I read the code it is imposing a limit on the size of the input stream of 8 * 4096 = 32KB, whereas as I understand it from here http://java.sun.com/docs/books/jvms/second_edition/html/ClassFile.doc.html#9279 the class file can be 64KB in length (probably more, as it's only the code_length attribute that's restricted to 65536, but I can't claim to have understood the spec well enough to know what that implies).


> Javassist throws a CannotCompileException on the org.codehaus.groovy.runtime.ArrayUtil class
> --------------------------------------------------------------------------------------------
>
>                 Key: JASSIST-142
>                 URL: https://issues.jboss.org/browse/JASSIST-142
>             Project: Javassist
>          Issue Type: Bug
>    Affects Versions: 3.14.0.GA
>         Environment: N/A
>            Reporter: Robert Elliot
>            Assignee: Shigeru Chiba
>
> With Groovy 1.7.5 on the classpath the following snippet throws a CannotCompileException:
> {noformat}ClassPool classPool = new ClassPool();
> classPool.appendSystemPath();
> CtClass ctClass = classPool.get("org.codehaus.groovy.runtime.ArrayUtil");
> ctClass.toBytecode();{noformat}
> This is currently preventing me using PowerMock in a test case written in Groovy, which seems a shame.  It appears to be due to an artificial limit imposed in ClassPoolTail.copyStream(InputStream, OutputStream).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list