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

[JENKINS-49994] Infrastructure for warning about serialization of anonymous inner classes #259

Merged
merged 2 commits into from Mar 8, 2018

Conversation

@jglick
Copy link
Member

commented Mar 7, 2018

…on of anonymous inner classes and their ilk.
} else {
// May not call methods like Class#isAnonymousClass synchronously, since these can in turn trigger remote class loading.
try {
channel.executor.submit((Runnable) () -> doCheck(clazz));

This comment has been minimized.

Copy link
@jglick

jglick Mar 7, 2018

Author Member

Having this ExecutorService be passed to check would be cleaner, but I did not see a reasonable way to do that—a ton of other APIs would have to be modified to thread this parameter in. The use of Channel.current() suffices for our purposes.

}
if (doWarn) {
if (codeSource == null) {
// TODO create jenkins.io/redirect

This comment has been minimized.

Copy link
@jglick
LOGGER.warning("Attempt to (de-)serialize " + kind + " class " + name + "; see: https://jenkins.io/redirect/serialization-of-anonymous-classes/");
} else {
// most easily tracked back to source using javap -classpath <location> -l '<name>'
LOGGER.warning("Attempt to (de-)serialize " + kind + " class " + name + " in " + codeSource + "; see: https://jenkins.io/redirect/serialization-of-anonymous-classes/");

This comment has been minimized.

Copy link
@jglick

jglick Mar 7, 2018

Author Member

example format:

Attempt to (de-)serialize anonymous class hudson.remoting.ClassFilterTest$3 in file:/…/remoting/target/test-classes/; see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
@rysteboe

This comment has been minimized.

Copy link
Contributor

commented Mar 8, 2018

Err, missed the CI failures. Investigating.

@rysteboe

This comment has been minimized.

Copy link
Contributor

commented Mar 8, 2018

Tests pass, the build failure looks like it's unrelated.

@rysteboe rysteboe merged commit 3a42b1e into jenkinsci:master Mar 8, 2018
1 check failed
1 check failed
continuous-integration/jenkins/pr-head This commit cannot be built
Details
@jglick jglick deleted the jglick:anonymous-warning-JENKINS-49994 branch Mar 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.