Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-5769

RobustReflectionConverter is not used in some cases

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Done
    • Component/s: core
    • Labels:
      None
    • Similar Issues:

      Description

      There are a few cases where XStream internally passes its default instance of ReflectionConverter to other converter instances. When these converters drill down into their fields, they do not use RobustReflectionConverter and the overall conversion becomes subject to the same failures that RobustReflectionConverter was created to avoid. Here is a list of converters that are passed the default ReflectionConverter in XStream 1.3.1:

      ThrowableConverter
      RegexPatternConverter
      SerializableConverter
      LookAndFeelConverter
      SelfStreamingInstanceChecker

      In our case, the fact that the ThrowableConverter was not calling RobustReflectionConvert combined with an error in class member munging described in JENKINS-5768 to cause our build.xml deserializable to fail, cause the build in question to not be loaded into memory on startup.

        Attachments

          Activity

          Hide
          mindless Alan Harder added a comment -

          Waiting on Kohsuke to release XStream 1.3.1-hudson-6 so I can commit the fix.

          Show
          mindless Alan Harder added a comment - Waiting on Kohsuke to release XStream 1.3.1-hudson-6 so I can commit the fix.
          Hide
          mdillon mdillon added a comment -

          I noticed in the diff that you changed the pom.xml from 1.3.1-hudson-2 to 1.3.1-hudson-6. Did you happen to check whether the sources in github were otherwise up-to-date with 1.3.1-hudson-5 first?

          Show
          mdillon mdillon added a comment - I noticed in the diff that you changed the pom.xml from 1.3.1-hudson-2 to 1.3.1-hudson-6. Did you happen to check whether the sources in github were otherwise up-to-date with 1.3.1-hudson-5 first?
          Hide
          mindless Alan Harder added a comment -

          Yes, I first committed to the "master" branch and noticed the same thing.. looked around and found the "patched" branch which had -hudson-5. Got the commit merged over there before Kohsuke did the release. Thanks for checking

          Show
          mindless Alan Harder added a comment - Yes, I first committed to the "master" branch and noticed the same thing.. looked around and found the "patched" branch which had -hudson-5. Got the commit merged over there before Kohsuke did the release. Thanks for checking
          Hide
          mindless Alan Harder added a comment -
          r28141 | mindless | 2010-03-02 10:55:42 -0800 (Tue, 02 Mar 2010) | 8 lines
          Changed paths:
             M /trunk/hudson/main/core/pom.xml
             M /trunk/hudson/main/core/src/main/java/hudson/util/XStream2.java
             M /trunk/hudson/main/core/src/test/java/hudson/util/XStream2Test.java
             M /trunk/www/changelog.html
          
          [FIXED JENKINS-5769] Update to XStream 1.3.1-hudson-6 where I added 
          protected Converter createDefaultConverter().  This allows a subclass
          to override the default converter (was hardcoded to ReflectionConverter)
          which is also given to the constructor of a few other converters,
          most notably ThrowableConverter.  Override this method in XStream2 to
          provide a RobustReflectionConverter so missing fields in classes
          extending Throwable are handled properly.
          
          Show
          mindless Alan Harder added a comment - r28141 | mindless | 2010-03-02 10:55:42 -0800 (Tue, 02 Mar 2010) | 8 lines Changed paths: M /trunk/hudson/main/core/pom.xml M /trunk/hudson/main/core/src/main/java/hudson/util/XStream2.java M /trunk/hudson/main/core/src/test/java/hudson/util/XStream2Test.java M /trunk/www/changelog.html [FIXED JENKINS-5769] Update to XStream 1.3.1-hudson-6 where I added protected Converter createDefaultConverter(). This allows a subclass to override the default converter (was hardcoded to ReflectionConverter) which is also given to the constructor of a few other converters, most notably ThrowableConverter. Override this method in XStream2 to provide a RobustReflectionConverter so missing fields in classes extending Throwable are handled properly.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in hudson
          User: : mindless
          Path:
          trunk/hudson/main/core/pom.xml
          trunk/hudson/main/core/src/main/java/hudson/util/XStream2.java
          trunk/hudson/main/core/src/test/java/hudson/util/XStream2Test.java
          trunk/www/changelog.html
          http://jenkins-ci.org/commit/28141
          Log:
          [FIXED JENKINS-5769] Update to XStream 1.3.1-hudson-6 where I added
          protected Converter createDefaultConverter(). This allows a subclass
          to override the default converter (was hardcoded to ReflectionConverter)
          which is also given to the constructor of a few other converters,
          most notably ThrowableConverter. Override this method in XStream2 to
          provide a RobustReflectionConverter so missing fields in classes
          extending Throwable are handled properly.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : mindless Path: trunk/hudson/main/core/pom.xml trunk/hudson/main/core/src/main/java/hudson/util/XStream2.java trunk/hudson/main/core/src/test/java/hudson/util/XStream2Test.java trunk/www/changelog.html http://jenkins-ci.org/commit/28141 Log: [FIXED JENKINS-5769] Update to XStream 1.3.1-hudson-6 where I added protected Converter createDefaultConverter(). This allows a subclass to override the default converter (was hardcoded to ReflectionConverter) which is also given to the constructor of a few other converters, most notably ThrowableConverter. Override this method in XStream2 to provide a RobustReflectionConverter so missing fields in classes extending Throwable are handled properly.

            People

            • Assignee:
              mindless Alan Harder
              Reporter:
              md5 Mike Dillon
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: