Skip to content

NullPointerException thrown by ExtendedBeanInfo with IBM J9 VM [SPR-10862] #15489

@spring-projects-issues

Description

@spring-projects-issues

Setanta Mathews opened SPR-10862 and commented

Hi,

In org.springframework.beans.CachedInstrospectionResults there is the code

this.beanInfo = new ExtendedBeanInfo(Introspector.getBeanInfo(beanClass));

With IBM's J9 VM on Linux, the BeanInfo returned by Introspector.getBeanInfo can return null for calls to BeanInfo#getMethodDescriptors. For example, this will happen when beanClass is java.io.Serializable.

When this happens the following code in ExtendedBeanInfo will throw a null pointer exception:

for (MethodDescriptor md : delegate.getMethodDescriptors())

I took a look at the latest ExtendedBeanInfo and it looks like it is still prone to a null pointer exception.

Note that the Javadoc for BeanInfo#getMethodDescriptors does say that the method can return null.

Simple test, run the following with Oracle's VM and then IBM's

System.out.println(java.beans.Introspector.getBeanInfo(java.io.Serializable.class).getMethodDescriptors())

With Oracle you'll get an array object, with IBM you'll get null.


Affects: 3.1.3

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions