[webbeans-issues] [JBoss JIRA] Created: (WBRI-36) build failure with Java 6.0
by Kent Tong (JIRA)
build failure with Java 6.0
---------------------------
Key: WBRI-36
URL: https://jira.jboss.org/jira/browse/WBRI-36
Project: Web Beans RI
Issue Type: Bug
Environment: SUN Java SE 1.6.0_06
Reporter: Kent Tong
It fails to build with Java 6.0:
/home/kent/webbeans/webbeans-ri/src/main/java/org/jboss/webbeans/model/SimpleComponentModel.java:[60,65] incompatible types
found : java.lang.reflect.Constructor<?>
required: java.lang.reflect.Constructor<T>
/home/kent/webbeans/webbeans-ri/src/main/java/org/jboss/webbeans/util/Reflections.java:[90,61] incompatible types
found : java.lang.reflect.Constructor<?>
required: java.lang.reflect.Constructor<T>
/home/kent/webbeans/webbeans-ri/src/main/java/org/jboss/webbeans/util/Reflections.java:[103,61] incompatible types
found : java.lang.reflect.Constructor<?>
required: java.lang.reflect.Constructor<T>
/home/kent/webbeans/webbeans-ri/src/main/java/org/jboss/webbeans/util/Reflections.java:[122,61] incompatible types
found : java.lang.reflect.Constructor<?>
required: java.lang.reflect.Constructor<T>
This is because the return type of Class<T>.getConstructors() has changed. In Java 5 it returned Constructor[] but in
Java 6 it returns Constructor<T>[].
Suggest an explicit typecast like:
for (Constructor<T> constructor : (Constructor<T>[])clazz.getConstructors()) {
...
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 9 months