-
Bug
-
Resolution: Fixed
-
P3
-
6, 6u10, 6u14, 6u15
-
b15
-
generic, x86
-
generic, linux, windows_xp, windows_vista
-
Verified
J2SE Version (please include all output from java -version flag):
java version "1.6.0-beta2"
Java(TM) SE Runtime Environment (build 1.6.0-beta2-b81)
Java HotSpot(TM) Client VM (build 1.6.0-beta2-b81, mixed mode, sharing)
Does this problem occur on J2SE 1.4.x or 5.0.x ? Yes / No (pick one)
5 and 6
Bug Description:
Bean introspection does not correctly calculate types of inherited properties that are typed as a
type parameter of a generic superclass.
Steps to Reproduce (be specific):
Compile and run these files
Expected results
================
Bean Super
Class class, R
int count, RW
Object reference, RW
Bean Sub2
Class class, R
int count, RW
String reference, RW
Bean Sub
Class class, R
int count, RW
Integer reference, RW
Actual results Mustang
======================
Bean Super
Class class, R
int count, RW
Object reference, RW
Bean Sub2
Class class, R
int count, RW
Object reference, RW
Bean Sub
Class class, R
int count, RW
Object reference, RW
Impact
======
The incorrect typing normally has little impact because if you are using the introspector the
methods are called reflectively, and you need to cast down to the correct type fromMethod.invoke()
anyway, so the error is not normally apparent. If you were using a gui tool to wire up beans,
the tool could exhibit problems resulting from the incorrect types. YOu may also break type safety.
At work we are running 1.5.0_06 and Sub reported reference as Readonly,(presumably because the
setter in Super was a different type. However I cannot reproduce this here at home on 1.5.0_03).
That is how we first noticed it because JSF was reporting that our bean property was readonly and
not letting us write to it. That occured on 2 different machines.
java version "1.6.0-beta2"
Java(TM) SE Runtime Environment (build 1.6.0-beta2-b81)
Java HotSpot(TM) Client VM (build 1.6.0-beta2-b81, mixed mode, sharing)
Does this problem occur on J2SE 1.4.x or 5.0.x ? Yes / No (pick one)
5 and 6
Bug Description:
Bean introspection does not correctly calculate types of inherited properties that are typed as a
type parameter of a generic superclass.
Steps to Reproduce (be specific):
Compile and run these files
Expected results
================
Bean Super
Class class, R
int count, RW
Object reference, RW
Bean Sub2
Class class, R
int count, RW
String reference, RW
Bean Sub
Class class, R
int count, RW
Integer reference, RW
Actual results Mustang
======================
Bean Super
Class class, R
int count, RW
Object reference, RW
Bean Sub2
Class class, R
int count, RW
Object reference, RW
Bean Sub
Class class, R
int count, RW
Object reference, RW
Impact
======
The incorrect typing normally has little impact because if you are using the introspector the
methods are called reflectively, and you need to cast down to the correct type fromMethod.invoke()
anyway, so the error is not normally apparent. If you were using a gui tool to wire up beans,
the tool could exhibit problems resulting from the incorrect types. YOu may also break type safety.
At work we are running 1.5.0_06 and Sub reported reference as Readonly,(presumably because the
setter in Super was a different type. However I cannot reproduce this here at home on 1.5.0_03).
That is how we first noticed it because JSF was reporting that our bean property was readonly and
not letting us write to it. That occured on 2 different machines.
- duplicates
-
JDK-6707230 BeanInfo with covariant method
- Closed
-
JDK-6852569 Introspector.getBeanInfo ignores write method if read method is overridden
- Closed
-
JDK-6969251 Inconsistent return values from PropertyDescriptor.getWriteMethod()
- Closed
- relates to
-
JDK-6473468 RFE: PropertyDescriptor should support getGenericPropertyType() method
- Open
-
JDK-6582164 JavaBeans tests should be open source
- Resolved
-
JDK-8061418 Add reification of generic type parameters to the Java programming language
- Closed
(1 relates to)