Bug 576296 - Fine-tune spotbugs settings
Summary: Fine-tune spotbugs settings
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: Releng (show other bugs)
Version: 6.0   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: 6.0   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-27 16:49 EDT by Thomas Wolf CLA
Modified: 2021-09-29 16:36 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wolf CLA 2021-09-27 16:49:42 EDT
Spotbugs produces way too many spurious reports about EI_EXPOSE_REP and EI_EXPOSE_REP2 since version 4.3.0.[1]

They are not helpful at all; I'd even say a report like [2] is a plain false positive.

With the bump to BREE Java 11 we also upgraded the spotbugs version to the newest. Apparently that was a bit over-eager. An upgrade is needed, the formerly used spotbugs 3.1.2 uses a groovy version that performs illegal reflective accesses that are forbidden in later Java versions.

I see two possible ways to rectify this:

1. suppress reporting for EI_EXPOSE_REP and EI_EXPOSE_REP2 completely.
2. downgrade to spotbugs 4.2.3. (Last version before 4.3.0.)

(1) has the disadvantage that it'll also suppress valid reports, but the ones we  had about arrays have never been dealt with in years, and don't need to be dealt with since the usages are maybe not good style, but are perfectly fine otherwise in the EGit/JGit context.

(2) has the disadvantage that we can't upgrade beyond 4.2.3 until issue 1601 is really fixed, and if we have to upgrade all the same for whatever reason, we'll run into the same problem again.

[1] https://github.com/spotbugs/spotbugs/issues/1601
[2] https://ci.eclipse.org/egit/job/egit.gerrit/2323/spotbugs/type.-543698987/moduleName.-1810974105/packageName.-2092940729/fileName.-2074298336/source.cc4a0111-a1eb-41d2-9adf-749bf9acecc7/#56
Comment 1 Andrey Loskutov CLA 2021-09-27 16:55:55 EDT
I've commented on the spotbugs issue, but I wasn't heard, so I would now simply disable this detector, it is useless because of many false positives.

https://github.com/spotbugs/spotbugs/pull/1551#issuecomment-857001232
Comment 2 Eclipse Genie CLA 2021-09-28 03:41:50 EDT
New Gerrit change created: https://git.eclipse.org/r/c/egit/egit/+/185884