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

Spurious warnings for provided resources that redefine a class #23

Open
pettermahlen opened this issue Jun 17, 2015 · 2 comments
Open

Comments

@pettermahlen
Copy link
Member

When using auto-value in scope provided and also using commons-lang 2.6, you get these warnings:

[WARNING] Category: FIELD NOT FOUND
[WARNING]   In artifact: com.google.auto.value:auto-value:1.0
[WARNING]     In class: org.apache.commons.lang.builder.ToStringStyle
[WARNING]       In method:  getRegistry():153
[WARNING]       Access to: org.apache.commons.lang.builder.ToStringStyle.registry
[WARNING]       Problem: Field not found: registry
[WARNING]       Found in: commons-lang:commons-lang:2.6
[WARNING]       --------
[WARNING]       In method:  <clinit>():136
[WARNING]       Access to: org.apache.commons.lang.builder.ToStringStyle.registry
[WARNING]       Problem: Field not found: registry
[WARNING]       Found in: commons-lang:commons-lang:2.6
[WARNING]       --------
[WARNING]     In class: org.apache.commons.lang.builder.HashCodeBuilder
[WARNING]       In method:  getRegistry():122
[WARNING]       Access to: org.apache.commons.lang.builder.HashCodeBuilder.registry
[WARNING]       Problem: Field not found: registry
[WARNING]       Found in: commons-lang:commons-lang:2.6
[WARNING]       --------
[WARNING]       In method:  <clinit>():105
[WARNING]       Access to: org.apache.commons.lang.builder.HashCodeBuilder.registry
[WARNING]       Problem: Field not found: registry
[WARNING]       Found in: commons-lang:commons-lang:2.6
[WARNING]       --------

Auto-value 1.0 includes unrelocated commons-lang classes.

@pettermahlen
Copy link
Member Author

For reference, updating the project in question to use auto-value 1.1 made those warnings go away. Even so, I don't think the warnings are correct.

@mattnworb
Copy link
Member

auto-value:1.0 packages commons-lang:2.4 classes in it's JAR (via a dependency on org.apache.velocity:velocity:jar:1.7), presumably so they are available to the compiler annotation processor (there is an interesting note in auto-value's pom about why some packages are relocated by the shade plugin and Apache ones are not).

The implementation of ToStringStyle.getRegistry() is different between the 2.4 and 2.6 versions of the class - the static field registry was renamed to REGISTRY (and made final).

auto-value:1.1 got smarter about relocating classes - seems like they realized the classes that should not be relocated were only Velocity classes and not commons-lang.

So I think these warnings would actually be legitimate if they referred to methods that were different between commons-lang:2.4 and commons-lang:2.6, as a project could have code that referred to 2.4-only classes that disappeared in 2.6.

But it sounds like missinglink might be using the definition of org.apache.commons.lang.builder.ToStringStyle.registry from auto-value:1.0 in some places but considering the fields of that class to be defined by the version in commons-lang:2.6 - could there be places where classes defined in multiple jars overwrite/collide data from each other within missinglink?

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

2 participants