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

If the child class overrides a method and marks the override as final Util.isOverridden should return true

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • core
    • None

      See https://github.com/jenkinsci/jenkins/blob/2263ad03ab8aa481caa3918c8671b1d605514b15/core/src/main/java/hudson/Util.java#L1345

      What is wrong with final methods in the derived class

       

      public class Parent {
        public Object doThing() {}
      }
      
      public class Child extends Parent {
        @Override
        public final Object doThing() { ... } 
      }
      
      assert Util.isOverridden(Parent.class, Child.class, "doThing") : "Sadly this is not true for the past 4 years"

       

       

       

       

       

            Unassigned Unassigned
            stephenconnolly Stephen Connolly
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: