Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

classes that implement an interface but are missing required methods are not caught by missinglink #22

Open
mattnworb opened this issue Jun 16, 2015 · 1 comment

Comments

@mattnworb
Copy link
Member

Inspired by another real-world case of shooting myself in the foot:

  • library A contains an interface (Metrics)
  • library B contains an implementation of that interface (FooMetrics)
  • an update to library A adds a new method to the interface

If a project using A and B is updated to use the new version of A, but the version of B in pom.xml is not changed, then an AbstractMethodError is thrown at runtime if Metrics.newMethod() is called on a reference to FooMetrics.

I don't think missinglink:0.1.0 is capable of catching this because the bytecode would contain method call instructions that point to Metrics and not FooMetrics. missinglink would not know that there exists an implementation of Metrics on the classpath (and that it is used) that does not implement that new method.

Not sure if it will be feasible for missinglink to detect this but wanted to write it down while the details are fresh.

@pettermahlen
Copy link
Member

I think one of the system tests is designed to provoke this error.

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

No branches or pull requests

2 participants