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

Binary uncompatible changes in FilterBuilder class #392

Open
rulle-io opened this issue Apr 4, 2022 · 0 comments
Open

Binary uncompatible changes in FilterBuilder class #392

rulle-io opened this issue Apr 4, 2022 · 0 comments

Comments

@rulle-io
Copy link

rulle-io commented Apr 4, 2022

We have a code piece like (new FilterBuilder().includePackage("XXX")).

It suddenly started to fail at runtime (after upgrade org.reflections:reflections:jar:0.9.12 => 0.10.2)

Caused by: java.lang.NoSuchMethodError:
'org.reflections.util.FilterBuilder org.reflections.util.FilterBuilder.includePackage(java.lang.String[])'

It turned out that public interface in FilterBuilder was changed here:

-public FilterBuilder includePackage(final String... prefixes)
+public FilterBuilder includePackage(String value)

-- Old one

public FilterBuilder includePackage(final String... prefixes) {

-- New one

public FilterBuilder includePackage(String value) {

This change is problematic in so many different ways: :)

  1. You usually never just delete a public method in a public library without a proper deprecation cycle.
  2. Changing parameter from java.lang.String[] to String will make compilation work for some use-cases, and not for others.
  3. It breaks the binary compatibility.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant