Search code examples
intellij-idea

Library source does not match the bytecode for class


No idea what's wrong here.. I removed all files I had from the local maven repository and let it download everything from scratch but I can't get rid of this error:

enter image description here

Why am I seeing this and how can I get rid of it?


[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ wordvectors ---
[INFO] masterthesis.code:wordvectors:jar:1.0-SNAPSHOT
[INFO] +- org.apache.spark:spark-core_2.10:jar:1.6.0:compile
[INFO] |  \- org.apache.hadoop:hadoop-client:jar:2.2.0:compile
[INFO] |     \- org.apache.hadoop:hadoop-common:jar:2.2.0:compile
[INFO] |        \- commons-configuration:commons-configuration:jar:1.6:compile
[INFO] |           \- (commons-collections:commons-collections:jar:3.2.1:compile - omitted for conflict with 20040616)
[INFO] \- org.deeplearning4j:deeplearning4j-ui:jar:0.4-rc3.8:compile
[INFO]    \- org.deeplearning4j:deeplearning4j-nlp:jar:0.4-rc3.8:compile
[INFO]       \- it.unimi.dsi:dsiutils:jar:2.2.2:compile
[INFO]          \- commons-collections:commons-collections:jar:20040616:compile

Solution

  • There's nothing wrong with IDEA, nor your dependencies or local maven caches, it's correctly identifying the mismatch.

    Here's how to check:

    • Open class in question
    • Click "Show diff"
    • Choose "Ignore whitespaces and empty lines"

    diff screenshot

    You can clearly see (ignoring JavaDoc and FQCNs) that the class file has extra checks included for the @NonNull annotated arguments. The import says lombok.NonNull, and the documentation shows this transformation will happen.

    I guess the best course of action is either to ignore this warning or ask the project's maintainers to build the sources.jar from the lombok-processed source code if that's possible. I think they'll need to employ delomboking and this Maven plugin, but never built lombok code myself.