Skip to content
Snippets Groups Projects
Forked from Dhina17 / platform_frameworks_base
Source project has a limited visibility.
  • Jihoon Kang's avatar
    ec4e94e1
    Add overriding method of a default method to signature files · ec4e94e1
    Jihoon Kang authored
    Currently, the signature file elides overrides of a default method,
    as they are not essential for the compilation of the stubs.
    However, in some scenarios, the overrides of a default method may be
    essential for the compilation of the reverse dependency of the stubs.
    In the scenario seen below:
    ```
    // API
    interface ApiInterface {
        public default void bar() {};
    }
    class ApiClass implements AnotherParentInterface{
        public void bar() {}
    }
    
    // App depending on the API
    interface AppInterface {
        public void bar();
    }
    public class AppClass extends ApiClass implements AppInterface {
    }
    ```
    Removal of `ApiClass.bar()` will lead to not overriding an abstract method
    `AppInterface.bar()` compilation error in `AppClass`.
    Therefore, this change adds the overrides of a default method to the
    signature files.
    
    Test: checkapi
    Bug: 299366704
    Change-Id: I212bd9aa895088fa9de33c7e3521453dea30c350
    ec4e94e1
    History
    Add overriding method of a default method to signature files
    Jihoon Kang authored
    Currently, the signature file elides overrides of a default method,
    as they are not essential for the compilation of the stubs.
    However, in some scenarios, the overrides of a default method may be
    essential for the compilation of the reverse dependency of the stubs.
    In the scenario seen below:
    ```
    // API
    interface ApiInterface {
        public default void bar() {};
    }
    class ApiClass implements AnotherParentInterface{
        public void bar() {}
    }
    
    // App depending on the API
    interface AppInterface {
        public void bar();
    }
    public class AppClass extends ApiClass implements AppInterface {
    }
    ```
    Removal of `ApiClass.bar()` will lead to not overriding an abstract method
    `AppInterface.bar()` compilation error in `AppClass`.
    Therefore, this change adds the overrides of a default method to the
    signature files.
    
    Test: checkapi
    Bug: 299366704
    Change-Id: I212bd9aa895088fa9de33c7e3521453dea30c350
Code owners
Assign users and groups as approvers for specific file changes. Learn more.