[ 
https://issues.apache.org/jira/browse/GROOVY-7989?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15635313#comment-15635313
 ] 

Paul King commented on GROOVY-7989:
-----------------------------------

This seems to be already fixed on the master branch (targeted for 2.5) but not 
the 2_4_X branch.

> VerifyError when calling protected method #clone()
> --------------------------------------------------
>
>                 Key: GROOVY-7989
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7989
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static compilation
>    Affects Versions: 2.4.5, 2.4.7
>         Environment: Ubuntu Precise
> x86_64 arch
> Java 1.8.0_91
>            Reporter: Nick Stokoe
>
> Running this demo code reproduces the error:
> {code}
> import groovy.transform.CompileStatic
> @CompileStatic
> class Foo {
>       static {
>         List list = []
>         list.clone()
>       }
> }
> {code}
> This works when @CompileStatic is off, but when it is on, the compiler 
> throws. It seems suspiciously low level - yes, Map#clone is protected and 
> therefore inaccessible in this context, but obviously one would want 
> something more user-friendly than this, not least because it doesn't indicate 
> *where* the error is, so finding it can be tricky:
> {code}
> Caught: java.lang.VerifyError: (class: Foo, method: <clinit> signature: ()V) 
> Bad access to protected data
> java.lang.VerifyError: (class: Foo, method: <clinit> signature: ()V) Bad 
> access to protected data
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to