[
https://jira.jboss.org/jira/browse/WBRI-36?page=com.atlassian.jira.plugin...
]
Kent Tong commented on WBRI-36:
-------------------------------
Sorry, in Java 6, it returns Constructor<?>[], not Constructor<T>[], but the
suggestion remains valid.
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
Original Estimate: 15 minutes
Remaining Estimate: 15 minutes
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