XStream
  1. XStream
  2. XSTR-497

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

          People

          • Assignee:
            Jörg Schaible
            Reporter:
            Marcin Kierus
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: