-
Notifications
You must be signed in to change notification settings - Fork 292
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace deprecated EP API buildDescriptionFromChecker with BugChecker…
…#buildDescription (#447) This PR replaces calls to the deprecated static `BugChecker.buildDescriptionFromChecker` method with calls to `BugChecker#buildDescription`, which was made public in google/error-prone@3ffb9ba and available in 2.4.0 and up. This is necessary to use NullAway with Error Prone 2.5.0 and up, as google/error-prone@704e8a1 removed `BugChecker.buildDescriptionFromChecker` in favour of `BugChecker#buildDescription`. Attempting to use NullAway 0.8.0 with Error Prone 2.5.1 results in errors such as the following (preceeding stack trace from [`gradle-errorprone-plugin`](https://github.com/tbroyer/gradle-errorprone-plugin/) omitted for brevity): ``` Caused by: java.lang.NoSuchMethodError: 'com.google.errorprone.matchers.Description$Builder com.google.errorprone.BugCheckerInfo.buildDescriptionFromChecker(com.sun.source.tree.Tree, com.google.errorprone.bugpatterns.BugChecker)' at com.uber.nullaway.handlers.ContractHandler.reportMatch(ContractHandler.java:231) at com.uber.nullaway.handlers.ContractHandler.onDataflowVisitMethodInvocation(ContractHandler.java:130) at com.uber.nullaway.handlers.CompositeHandler.onDataflowVisitMethodInvocation(CompositeHandler.java:191) at com.uber.nullaway.dataflow.AccessPathNullnessPropagation.visitMethodInvocation(AccessPathNullnessPropagation.java:867) at com.uber.nullaway.dataflow.AccessPathNullnessPropagation.visitMethodInvocation(AccessPathNullnessPropagation.java:138) at shadow.checkerframework.dataflow.cfg.node.MethodInvocationNode.accept(MethodInvocationNode.java:76) at shadow.checkerframework.dataflow.analysis.Analysis.callTransferFunction(Analysis.java:408) at shadow.checkerframework.dataflow.analysis.Analysis.performAnalysisBlock(Analysis.java:234) at shadow.checkerframework.dataflow.analysis.Analysis.performAnalysis(Analysis.java:187) at com.uber.nullaway.dataflow.DataFlow$1.load(DataFlow.java:87) at com.uber.nullaway.dataflow.DataFlow$1.load(DataFlow.java:78) at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3529) at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2278) at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2155) at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2045) ... 219 more ``` This change unfortunately requires bumping the minimum required version of Error Prone up to 2.4.0, so I've also amended the README.md in light of this.
- Loading branch information
Showing
7 changed files
with
12 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters