-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathspotbugs-exclude.xml
More file actions
60 lines (56 loc) · 2.55 KB
/
Copy pathspotbugs-exclude.xml
File metadata and controls
60 lines (56 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?xml version="1.0" encoding="UTF-8"?>
<!--
SPDX-FileCopyrightText: 2014-2026 Bernard Ladenthin <bernard.ladenthin@gmail.com>
SPDX-License-Identifier: Apache-2.0
-->
<FindBugsFilter
xmlns="https://github.com/spotbugs/filter/3.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://github.com/spotbugs/filter/3.0.0 https://raw.githubusercontent.com/spotbugs/spotbugs/4.8.6/spotbugs/etc/findbugsfilter.xsd">
<!--
getOutputStream() / getInputStream() intentionally expose the
SBOutputStream / SBInputStream fields - those streams ARE the
public API of StreamBuffer.
-->
<Match>
<Class name="net.ladenthin.streambuffer.StreamBuffer"/>
<Or>
<Method name="getOutputStream"/>
<Method name="getInputStream"/>
</Or>
<Bug pattern="EI_EXPOSE_REP"/>
</Match>
<!--
bufferLock is private final - its reference cannot be replaced.
The synthetic access$N bridge is a Java 8 compiler artifact: the
private inner classes SBInputStream and SBOutputStream access the
private field directly, and javac emits a package-private static
accessor to make that legal at bytecode level. No other class in
net.ladenthin.streambuffer exists to call that accessor.
The jcstress ConcurrentWriteRace tests confirm the synchronization
protocol is sound; this is a false positive.
-->
<Match>
<Class name="net.ladenthin.streambuffer.StreamBuffer"/>
<Method name="toString"/>
<Bug pattern="USO_UNSAFE_ACCESSIBLE_OBJECT_SYNCHRONIZATION"/>
</Match>
<!--
trim() drains the buffer into a temporary ArrayDeque before
consolidating it back. SpotBugs PSC_PRESIZE_COLLECTIONS suggests
passing an initial capacity hint, but a tight bound here would
require ceil(availableBytes / maxAllocationSize) over two volatile
long fields. That arithmetic produces equivalent mutants (ArrayDeque
tolerates any non-negative initial capacity, so the capacity hint
is unobservable through tests) and would break the package's 100 %
PIT mutation threshold. trim() is also not a hot path - it runs at
most once per maxBufferElements writes (default 100), so the
ArrayDeque default growth 16-32-64 is negligible against the
surrounding I/O.
-->
<Match>
<Class name="net.ladenthin.streambuffer.StreamBuffer"/>
<Method name="trim"/>
<Bug pattern="PSC_PRESIZE_COLLECTIONS"/>
</Match>
</FindBugsFilter>