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

Transform anonymous classes sent over remoting into non anonymous classes

    • Evergreen - Milestone 1

      Issue

      The Git plugin triggers the following warnings currently:

      Attempt to (de-)serialize anonymous class org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1 in file:/evergreen/jenkins/var/plugins/git-client/WEB-INF/lib/git-client.jar; see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
      

      And

      Attempt to (de-)serialize anonymous class org.jenkinsci.plugins.gitclient.Git$1 in file:/evergreen/jenkins/var/plugins/git-client/WEB-INF/lib/git-client.jar; see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
      

      Expected

      The anonymous class should be extracted to a full blown one so that this warning (and more importantly remoting works as fine as possible) goes away.

      Thanks!

          [JENKINS-53307] Transform anonymous classes sent over remoting into non anonymous classes

          Jesse Glick added a comment -

          Note: from the NetBeans IDE you can just Ctrl-Alt-Shift-A and if possible make sure the result is static.

          Jesse Glick added a comment - Note: from the NetBeans IDE you can just Ctrl-Alt-Shift-A and if possible make sure the result is static .

          Mark Waite added a comment -

          All my attempts to find those anonymous inner classes with either Netbeans or IntelliJ have failed. I feel stupid that I can't find them inside the source files. I see the evidence in the target/classes directory that anonymous inner classes are being generated, but I just don't see them in the implementation.

          Any pointers to techniques to identify them would be much appreciated (preferably without mocking my ineptitude). I've tried finding them with Netbeans. I've tried finding them with IntelliJ. I've tried using a Java decompiler.

          Mark Waite added a comment - All my attempts to find those anonymous inner classes with either Netbeans or IntelliJ have failed. I feel stupid that I can't find them inside the source files. I see the evidence in the target/classes directory that anonymous inner classes are being generated, but I just don't see them in the implementation. Any pointers to techniques to identify them would be much appreciated (preferably without mocking my ineptitude). I've tried finding them with Netbeans. I've tried finding them with IntelliJ. I've tried using a Java decompiler.

          Jesse Glick added a comment -

          Let me see:

          git-client-plugin$ git pull && mvn compile && javap -classpath target/classes -c -private -l 'org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1'
          …
          Error: class not found: org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1
          

          batmat are you sure you are running the most recent version of git-client? I just started Evergreen and it claims to be running 2.7.0. According to the wiki the current version is 3.0.0-beta5. It is not very useful to report bugs to plugin authors about old versions, in this case from December.

          Jesse Glick added a comment - Let me see: git-client-plugin$ git pull && mvn compile && javap -classpath target/classes -c -private -l 'org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1' … Error: class not found: org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1 batmat are you sure you are running the most recent version of git-client ? I just started Evergreen and it claims to be running 2.7.0. According to the wiki the current version is 3.0.0-beta5. It is not very useful to report bugs to plugin authors about old versions, in this case from December.

          Jesse Glick added a comment -

          In fact with a little digging you can see that this was already fixed and the fix released in 3.0.0-beta4.

          Jesse Glick added a comment - In fact with a little digging you can see that this was already fixed and the fix released in 3.0.0-beta4.

          Baptiste Mathus added a comment - https://github.com/jenkins-infra/evergreen/pull/292

          Baptiste Mathus added a comment - FTR https://github.com/jenkinsci/git-client-plugin/pull/330 fix

            markewaite Mark Waite
            batmat Baptiste Mathus
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: