mozilla-mobile / gradle-apilint

Gradle Plugin that tracks the API of an Android library and helps maintain backward compatibility.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Override of a non-visible method is not displayed

agi opened this issue · comments

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 {
   }