mozilla-mobile / gradle-apilint

Gradle Plugin that tracks the API of an Android library and helps maintain backward compatibility.
Mozilla Public License 2.0
8 stars 9 forks source link

Override of a non-visible method is not displayed #95

Closed agi closed 2 years ago

agi commented 2 years ago

Just noticed there's a regression in 0.5 where an overridden method that upgrades visibility is missed in the api.txt:

Test case:

class TestClass {
    public  class TestPackageProtected {
        private TestPackageProtected() {}
        // This shouldn't appear in the API
        /* package */ void testPackageProtected();
    }

    public static class TestOverrideNonVisibleApi extends TestPackageProtected {
        private TestOverrideNonVisibleApi() {}
        // This should appear in the API
        @Override
        public void testPackageProtected();
    }
 }

Which results in:

   public static class TestClass.TestOverrideNonVisibleApi extends TestClass.TestPackageProtected {
   }

   public static class TestClass.TestPackageProtected {
   }

instead of the expected

   public static class TestClass.TestOverrideNonVisibleApi extends TestClass.TestPackageProtected {
     method public void testPackageProtected();
   }

   public static class TestClass.TestPackageProtected {
   }