spotify / missinglink

Build time tool for detecting link problems in java projects
Apache License 2.0
144 stars 27 forks source link

add java.lang.invoke.VarHandle to ClassLoader.BLACKLIST #177

Closed mattnworb closed 3 years ago

mattnworb commented 3 years ago

since all of its methods are annotated with @HotSpotIntrinsicCandidate, which means the methods do not actually appear in the .class file.

I have not added a unit test here since the project still builds with source=1.8, target=1.8 in the compiler configuration (and also builds in CI on Github with Java 8 as one of the java versions to build with). The VarHandle class was added in JDK9 and does not appear in 8, so to add a test of class that references VarHandle I'd have to either resort to some reflection trickery or drop support in the project for building with target=8, which I don't want to do at this time.

I also considered adding logic to exclude all calls to methods annotated with @HotSpotIntrinsicCandidate from missinglink's analysis/warnings, but this would adding information about a method's annotations to missinglink's data model (e..g in DeclaredMethod) which does not exist today.

codecov[bot] commented 3 years ago

Codecov Report

Merging #177 (0317a60) into master (c6cb554) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #177   +/-   ##
=========================================
  Coverage     85.10%   85.10%           
  Complexity      227      227           
=========================================
  Files            23       23           
  Lines           846      846           
  Branches        100      100           
=========================================
  Hits            720      720           
  Misses           90       90           
  Partials         36       36           
Impacted Files Coverage Δ
...main/java/com/spotify/missinglink/ClassLoader.java 93.49% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c6cb554...0317a60. Read the comment docs.