Sitelet https://github.com/revapi/revapi/issues/304
Skip to content

Sealed interfaces/classes #304

Description

@wi11dey

Hi folks, thanks so much for making Revapi! Has been a very useful tool.

Recently we started sealing some of our internally used interfaces, after which I added a method to one of the now-sealed interfaces + implemented it in the only permitted implementation. Sealing the interface didn't cause revapi to complain about source incompatibility, however when I added methods to the now-sealed interface, it told me

java.method.addedToInterface: Method was added to an interface.

...

SOURCE: BREAKING, BINARY: NON_BREAKING, SEMANTIC: POTENTIALLY_BREAKING

I would have expected that the sealing could have been registered as a source break, since anyone currently implementing the interface in other projects would no longer be permitted to do so. However, it shouldn't be a break to add methods to an already sealed interface as long as the sealing continues all the way down the hierarchy to a final class, which I think can be statically checked.

Am I correct in the above reasoning? If so, would a contribution be welcome to implement this, and where should I look to do so? Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions