-
Bug
-
Resolution: Fixed
-
P4
-
8u25, 9
-
b21
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8339477 | 17.0.14-oracle | Alexey Ivanov | P4 | Resolved | Fixed | b01 |
JDK-8339822 | 17.0.14 | Goetz Lindenmaier | P4 | Resolved | Fixed | b01 |
JDK-8339478 | 11.0.26-oracle | Alexey Ivanov | P4 | Resolved | Fixed | b01 |
JDK 1.8.0 Update 25
ADDITIONAL OS VERSION INFORMATION :
Windows 8.1 Pro 64 Bit
A DESCRIPTION OF THE PROBLEM :
When retrieving the properties from a bean the java.beans.Introspector does not return the properties defined by getter/setter methods implemented as default methods in an interface implemented by the bean.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Implement a default getter method in an interface. Create a class that implements the interface but does not override the default method. Now use Introspector.getBeanInfo(beanClass) to get the properties.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The result should contain the properties defined by the default methods in the interface.
ACTUAL -
The result does not contain the properties defined by the default methods in the interface.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
public class Test {
public static interface Named {
public default String getName() {
return "always the same";
}
}
public static class NamedBean implements Named {
}
public static void main(final String[] args) throws IntrospectionException {
for (final PropertyDescriptor desc : Introspector.getBeanInfo(NamedBean.class).getPropertyDescriptors()) {
System.out.println(desc.getName());
}
// prints out "class" as the only property
// should have inclided "name" too
}
}
---------- END SOURCE ----------
- backported by
-
JDK-8339477 Introspector ignores default interface methods
-
- Resolved
-
-
JDK-8339478 Introspector ignores default interface methods
-
- Resolved
-
-
JDK-8339822 Introspector ignores default interface methods
-
- Resolved
-
- causes
-
JDK-8347826 Introspector shows wrong method list after 8071693
-
- Open
-
- csr for
-
JDK-8306477 Introspector ignores default interface methods
-
- Closed
-
- duplicates
-
JDK-8139193 java.beans.Introspector misses default interface methods
-
- Closed
-
-
JDK-8182025 PropertyDescriptor ignores default methods from interfaces implemented by superclasses
-
- Closed
-
- links to
-
Commit openjdk/jdk/1e4eafb4
-
Commit(master) openjdk/jdk17u-dev/878ceeb3
-
Review openjdk/jdk/13544
-
Review(master) openjdk/jdk17u-dev/2849