[
https://issues.jboss.org/browse/ELY-476?page=com.atlassian.jira.plugin.sy...
]
David Lloyd commented on ELY-476:
---------------------------------
I think it's reasonable to expect that the JVM we run on at least conforms to the JLS
(see
https://docs.oracle.com/javase/specs/jls/se7/html/jls-10.html#jls-10.7 for more
information). We should not work around completely broken JVMs.
Arrays clone() does not work in static method of interface for IBM
JDK
----------------------------------------------------------------------
Key: ELY-476
URL:
https://issues.jboss.org/browse/ELY-476
Project: WildFly Elytron
Issue Type: Bug
Affects Versions: 1.1.0.Beta4
Reporter: Ondrej Lukas
Assignee: Darran Lofthouse
Priority: Critical
It seems IBM JDK has an issue with using clone() method for arrays in static method of
interface. Using arrays clone() method causes following exception for IBM JDK:
{code}
java.lang.IllegalAccessError: Class
org/wildfly/security/password/interfaces/SaltedSimpleDigestPassword illegally accessing
"protected" member of class [B
at
org.wildfly.security.password.interfaces.SaltedSimpleDigestPassword.createRaw(SaltedSimpleDigestPassword.java:112)
...
{code}
Issue affects only direct usage of arrays clone() method from static method of
interface.
Example, calling methodWillFail() will fail with IBM JDK:
{code}
public interface SimpleInterface {
static int[] methodWillFail() {
int[] array = {1, 2};
return array.clone();
}
}
{code}
Workaround is simple. Calling static method of another class using arrays clone() works
for IBM JDK 8.
Example, calling methodWillNotFail() will pass with IBM JDK:
{code}
public interface SimpleInterface {
static int[] methodWillNotFail() {
return SimpleClass.methodOk();
}
}
public class SimpleClass {
static int[] methodOk() {
int[] array = {1, 2};
return array.clone();
}
}
{code}
Affected interfaces:
org.wildfly.security.auth.server.NameRewriter.java
org.wildfly.security.authz.RoleMapper.java
org.wildfly.security.password.interfaces.SaltedSimpleDigestPassword.java
org.wildfly.security.password.interfaces.OneTimePassword.java
org.wildfly.security.password.interfaces.BSDUnixDESCryptPassword.java
org.wildfly.security.password.interfaces.BCryptPassword.java
org.wildfly.security.password.interfaces.SimpleDigestPassword.java
org.wildfly.security.password.interfaces.DigestPassword.java
org.wildfly.security.password.interfaces.ScramDigestPassword.java
org.wildfly.security.ssl.SNIServerSSLContextSelector.java
This issue causes errors in following test cases running with IBM JDK:
org.wildfly.security.auth.KeyStoreBackedSecurityRealmTest
org.wildfly.security.auth.realm.jdbc.PasswordSupportTest
org.wildfly.security.password.impl.BCryptPasswordTest
org.wildfly.security.auth.realm.ldap.UserPasswordPasswordUtilTest
org.wildfly.security.ldap.PasswordSupportSuiteChild
org.wildfly.security.password.impl.BSDUnixDESCryptTest
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)