Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix anonymous class serialization warnings #69

Merged
merged 2 commits into from
Sep 4, 2019

Conversation

darxriggs
Copy link
Contributor

@darxriggs darxriggs commented Sep 3, 2019

The warnings from org.jenkinsci.remoting.util.AnonymousClassWarnings have been:

"Attempt to (de-)serialize anonymous class org.jenkinsci.plugins.configfiles.GlobalConfigFiles$1 ..."
"Attempt to (de-)serialize anonymous class org.jenkinsci.plugins.configfiles.folder.FolderConfigFileProperty$1 ..."

See https://wiki.jenkins.io/display/JENKINS/Serialization+of+anonymous+classes for more details on this topic.

There have already been other attempts to fix these warnings in c95c3dd and d6616d7. It was reported in JENKINS-53399 that XStream backward compatibility was broken. Therefore they have been reverted in fab4484.

This change also keeps XStream backward compatibility.

CC @jsoref

The config files for the new test have been set up as similar as
possible to the existing one, only ids differ. The existing test
was cleaned a bit.
Anonymous inner classes are replaced by a dedicated comparator class.

NOTE: Also introducing classes to keep XStream backward compatibility.
This was missed in the previous attempt in commit 2366eae.

The warnings from org.jenkinsci.remoting.util.AnonymousClassWarnings have been:
> "Attempt to (de-)serialize anonymous class org.jenkinsci.plugins.configfiles.GlobalConfigFiles$1 ..."
> "Attempt to (de-)serialize anonymous class org.jenkinsci.plugins.configfiles.folder.FolderConfigFileProperty$1 ..."
see: https://wiki.jenkins.io/display/JENKINS/Serialization+of+anonymous+classes
@imod imod self-requested a review September 4, 2019 05:34
Copy link
Member

@imod imod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice - thanks!

@imod imod merged commit 0eaab89 into jenkinsci:master Sep 4, 2019
@darxriggs darxriggs deleted the fix-anonymous-class-warning branch September 4, 2019 06:28
@darxriggs
Copy link
Contributor Author

@imod can you prepare a new release containing this?

@darxriggs
Copy link
Contributor Author

@imod Sorry to bother you again, could you release this?

@imod
Copy link
Member

imod commented Dec 25, 2019

@darxriggs done - sorry for the delay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants