-
Bug
-
Resolution: Done
-
Major
-
2.0.5.SP1
-
None
-
Linux x86_64, Weblogic 12c with JDK12
Error message is:
>>>>
java.lang.AssertionError
at org.jboss.cdi.tck.tests.implementation.simple.resource.env.EnvInjectionTest.testResourceBeanTypes(EnvInjectionTest.java:83)
<<<<
The case fails in bean types counting:
>>>>
package org.jboss.cdi.tck.tests.implementation.simple.resource.env;
...
public class EnvInjectionTest extends AbstractTest {
...
public void testResourceBeanTypes() {
@SuppressWarnings("serial")
Bean<String> greeting = getBeans(String.class, new AnnotationLiteral<Greeting>() {
}).iterator().next();
assert greeting.getTypes().size() == 5; # Line83, assertionError occurs here
assert rawTypeSetMatches(greeting.getTypes(), String.class, Object.class, Serializable.class, Comparable.class,
CharSequence.class);
}
}
<<<<
The reason of the issue should be:
Before JDK12, class java.lang.String in JavaDoc looks like:
Class String
java.lang.Object
java.lang.String
All Implemented Interfaces:
Serializable, CharSequence, Comparable<String>
But it changed in JDK12:
Class String
java.lang.Object
java.lang.String
All Implemented Interfaces:
Serializable, CharSequence, Comparable<String>, Constable, ConstantDesc
So with JDK12, "greeting.getTypes().size()" is 7 instead of 5, which causes the assertion. Could we add tolerance mechanic for this?
Thanks.
-X.O.