fix: redundant RCN false positive to build SpotBugs with Java 11#1248
Merged
Conversation
As a workaround for #996, skip the compilation for Bug1169.java in soitbugsTestCases project.
danielfn
reviewed
Aug 7, 2020
Member
Author
|
Found that not #996 but #259 is the root cause. Problem is that the java compiler adds redundant null-check in the generated code: |
|
Kudos, SonarCloud Quality Gate passed!
|
|
Will this fix the false positives with https://github.com/spotbugs/spotbugs/issues?q=RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE |
Member
Author
|
@mattnelson |
Member
Author
|
@spotbugs/everyone please review this PR when you have time. Thanks in advance! |
Contributor
|
LGTM |
jscancella
approved these changes
Aug 25, 2020
wreulicke
approved these changes
Aug 27, 2020
baingshot
added a commit
to NoXml/EDATECH
that referenced
this pull request
Oct 13, 2020
baingshot
added a commit
to NoXml/EDATECH
that referenced
this pull request
Oct 14, 2020
* #62 Добавил зависимости, пропертиз и файлы для базы * #62 Добавил схему и данные для БД * #62 Исправил схему БД * #62 .yml вместо .properties * #62 Добавил Jpa репозиторий для базы + Dao объект для слоя репозитория * #62 Исправил тест для EntityController с учётом новой реализации репозитория + добавил тестовый класс для записи в базу значений * #62 Поднял версию SpotBugs, тем самым исправил баг для DbAwareTest (spotbugs/spotbugs#1248) * #62 Понизил покрытие jacoco * #62 Исправил замечания * #62 Добавил везде где нужно @nonnull * #62 Исправил сообщение в DbAwareTest * #62 Добавил везде где нужно @nonnull* * #62 Добавил везде где нужно @nonnull**
10 tasks
asfgit
pushed a commit
to apache/accumulo
that referenced
this pull request
Apr 28, 2023
Issue was fixed in spotbugs/spotbugs#1248
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To reproduce bugs with recent Java and its compilers, it's nice to make this project ready to build with them.
Java 14 is the latest version, but 11 is the latest LTS so this PR uses Java 11 to build SpotBugs. refs #1244.
Gradle uses
--releaseoption to make sure the version of.classfiles are Java 8, so this change won't affect users.At this moment we won't introduce
module-info.javabecause some of our submodules provide the same package and it's not supported by JPMS.Fix for RCN false positive
To pass the build with Java 11, this PR fixes #259 and #756 by ignoring
RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUEnext to the end of try-block which catchesjava/lang/Throwable. See 7700cfc for detail.This will fix reported false positives, but introduce false negatives in the following case, because we have no way to judge the bytecode to handle exception is generated by
javacor not.I hope this false negative is acceptable to us. The redundant null check itself has less impact on runtime, I believe.