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

CPS-transformed overloaded methods don't route properly

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • workflow-cps-plugin
    • None

      (opened in workflow-cps-plugin component since there isn't one for groovy-cps)

      If you have two overloaded methods where the parameter for one is a superclass of the other, with the child class overloaded method casting to the superclass and calling the superclass overloaded method, and then you call the overloaded method with an instance of the child class as the parameter, you end up in a StackOverflowError, with the child class overloaded method called over and over.

      i.e.,

      public String bar(List<String> l) {
          return bar((Iterable)l)
      }
      
      public String bar(Iterable<String> l) {
          return "iterable"
      }
       
      List<String> s = ["a", "b"]
      
      bar(s) == "iterable"
      

      will never complete. Adding the @NonCPS annotation to the bar methods makes it work.

          [JENKINS-44280] CPS-transformed overloaded methods don't route properly

            Unassigned Unassigned
            abayer Andrew Bayer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: