XStream

getMungedConstructor in Sun14ReflectionProvider is unsafe

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.3
  • Fix Version/s: 1.3.1
  • Component/s: Core
  • Labels:
    None
  • JDK version and platform:
    Sun 1.4.2_08 for Linux

Description

Under unfavorable circumstances method getMungedConstructor in Sun14ReflectionProvider class might return null, what leads to NullPointerException in method newInstance. It occurs when GC has cleared the WeakReference just before "return (Constructor) ref.get();". See stack trace below:

...
Caused by: java.lang.NullPointerException
at com.thoughtworks.xstream.converters.reflection.Sun14ReflectionProvider.newInstance(Sun14ReflectionProvider.java:74)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.instantiateNewInstance(AbstractReflectionConverter.java:2
79)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:149)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:81)
... 49 more

Issue Links

Activity

Hide
Joerg Schaible added a comment -

Fixed in the head revision. Thanks for report.

Show
Joerg Schaible added a comment - Fixed in the head revision. Thanks for report.
Hide
Joerg Schaible added a comment -

Set correct fix version.

Show
Joerg Schaible added a comment - Set correct fix version.
Hide
Joerg Schaible added a comment -

Fixed for upcoming release.

Show
Joerg Schaible added a comment - Fixed for upcoming release.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: