groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Graeme Rocher (JIRA)" <j...@apache.org>
Subject [jira] [Created] (GROOVY-7828) Created a class loader that override loadClass can calls protected methods results in VerifyError
Date Tue, 26 Apr 2016 09:59:12 GMT
Graeme Rocher created GROOVY-7828:
-------------------------------------

             Summary: Created a class loader that override loadClass can calls protected methods
results in VerifyError
                 Key: GROOVY-7828
                 URL: https://issues.apache.org/jira/browse/GROOVY-7828
             Project: Groovy
          Issue Type: Bug
    Affects Versions: 2.4.6
            Reporter: Graeme Rocher


The following script results in a VerifyError. It should fail with a compilation error since
the `loadClass` method is protected.

{code}
import groovy.transform.*

@CompileStatic
class FooClassLoader extends URLClassLoader {

        protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException
{
            try {
                return super.loadClass(name, resolve)
            } catch (ClassNotFoundException cnfe) {
                return ClassLoader.systemClassLoader.loadClass(name, resolve)
            }
        }
}

def cl = new FooClassLoader()
{code}



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

Mime
View raw message