build(spotbugs): 제외 목록이 이 repo 클래스만 말하게 다듬는다
pr / ci (pull_request) Successful in 3m58s

템플릿 제외 목록에서 메시징 줄을 골라 옮기면서, 묶음 Match의 주석이
템플릿 클래스(HttpClientProfileFactory, NotificationJsonMapper,
@RequiresPermission 등)를 계속 부른다. 이 repo에 없는 클래스를 읽고
제외 이유를 판단하게 된다. 템플릿의 생성 소스 제외(generated 폴더)도
빠졌다.

주석을 메시징 클래스만 말하게 고치고, 생성 소스 제외 Match를
템플릿과 같이 되살렸다. 클래스를 고르는 Match는 바뀌지 않았다.

위험: 생성 소스 제외는 지금 생성 소스가 없어 아무것도 빼지 않는다.

검증: 이 PR의 pr workflow(./gradlew ci, SpotBugs main·test 포함).
This commit is contained in:
DongHyeonka
2026-11-08 16:34:02 +09:00
parent d2bacc609b
commit 31c517888a
2 changed files with 21 additions and 26 deletions
+2 -3
View File
@@ -68,9 +68,8 @@
<Method name="~lambda\$.*"/>
</Match>
<!-- DM_GC: both tests are about what garbage collection does — a gauge that must survive a
collection instead of decaying to NaN through a weak reference, and a retained-set bound
measured between two collections. System.gc() is the request they exist to make. -->
<!-- DM_GC: the test is about what garbage collection does — a retained-set bound measured
between two collections. System.gc() is the request it exists to make. -->
<Match>
<Bug pattern="DM_GC"/>
<Or>
+19 -23
View File
@@ -11,6 +11,11 @@
-->
<FindBugsFilter>
<!-- Generated sources (annotation processors): exclude from analysis. -->
<Match>
<Source name="~.*[\\/]generated[\\/].*"/>
</Match>
<!-- The messaging codec retention test measures whether a round trip retains per-message state.
Measuring retained memory requires forcing a collection first and again at the end;
without it the "after" reading is dominated by garbage that simply had not been collected
@@ -40,7 +45,7 @@
<!-- EI_EXPOSE_REP / EI_EXPOSE_REP2, pattern 1 of 4 — references that are not values.
SpotBugs calls any field "mutable" whose type has a set/add/remove/delete/write-shaped
method, and asks for a copy whenever one is stored from a parameter or returned. For a
field that holds a collaborator (a port, a repository, an EntityManager, a MeterRegistry,
field that holds a collaborator (a port, a repository, a MeterRegistry,
an executor, a template, a settings bean), a handle (a channel, a future, a reflected
Method, an exception kept as a cause) or a nested setter-bound settings object, sharing the
reference is the design: constructor injection stores collaborators, and a copy would be a
@@ -98,11 +103,9 @@
JavaBeans are mutable by contract (a public setter opens more than the getter does), and
the constructor-bound records listed here have no invariant of their own: each is read
once at startup by the factory that compiles it into the runtime type, and that factory
copies (HttpClientProfileFactory and DynamicTargetAutoConfiguration Set.copyOf every list;
MessagingConfigurationCompiler copies into DestinationAccessPolicy and SchemaPolicy;
RedisRuntimeAutoConfiguration validates and maps; FileserverStartupValidator reads the
ancestors once). A settings record that validates a collection in its own constructor
copies it there instead (FileserverPlatformSettings.Security). -->
copies (MessagingConfigurationCompiler copies into DestinationAccessPolicy and
SchemaPolicy). A settings record that validates a collection in its own constructor copies
it there instead. -->
<Match>
<Bug pattern="EI_EXPOSE_REP,EI_EXPOSE_REP2"/>
<Or>
@@ -138,13 +141,9 @@
A final class cannot be attacked this way, and every class that could be made final was.
These three groups must stay subclassable. -->
<!-- CT group 1 — CGLIB proxies. @RequiresPermission is enforced by a method-security advisor,
and Spring Boot proxies with CGLIB, which subclasses the bean
(RequiresPermissionProxyabilityTest fails the build if such a class is final). The
Annotation matcher covers every class annotated at class level, including ones added
later. A class that annotates only some methods is proxied all the same but is not matched
here; name it when one appears. A @Configuration class is CGLIB-subclassed for its @Bean
methods for the same reason. -->
<!-- CT group 1 — CGLIB proxies. A @Configuration class is CGLIB-subclassed for its @Bean
methods, so it must stay subclassable. The Annotation matcher covers every class annotated
at class level, including ones added later. -->
<Match>
<Bug pattern="CT_CONSTRUCTOR_THROW"/>
<Or>
@@ -155,9 +154,8 @@
<!-- FindSecBugs REDOS, one Match per constructor or static initialiser. Every pattern flagged
is "segment (separator segment)*" where the separator is a character the segment class
cannot contain ('.', '-', ';', or a class of those), so each input splits exactly one way
and backtracking is linear, not exponential. The application-core and messaging values
also check the length (at most 64-256 characters) before the pattern runs; JsonPathName and SafeSortField
match developer-declared paths; the SNS host comes from a URI host. -->
and backtracking is linear, not exponential. The values also check the length (at most
64-256 characters) before the pattern runs. -->
<Match>
<Bug pattern="REDOS"/>
<Or>
@@ -174,11 +172,10 @@
<Method name="~lambda\$transition(WithNextAttempt)?\$\d+"/>
</Match>
<!-- PREDICTABLE_RANDOM: log sampling (SamplingTurboFilter.decide) and retry jitter
(BackoffCalculator's default source, HttpClientProfileAutoConfiguration.jitterRandom) only
need spread, not unpredictability; nothing security-relevant is derived from any of these
values. Knowing the next jitter tells a caller when a retry lands, which the retry policy
already bounds. SecureRandom would read as a security requirement that is not there. -->
<!-- PREDICTABLE_RANDOM: retry jitter (BackoffCalculator's default source) only needs spread,
not unpredictability; nothing security-relevant is derived from it. Knowing the next jitter
tells a caller when a retry lands, which the retry policy already bounds. SecureRandom
would read as a security requirement that is not there. -->
<Match>
<Bug pattern="PREDICTABLE_RANDOM"/>
<Or>
@@ -186,8 +183,7 @@
</Or>
</Match>
<!-- MS_EXPOSE_REP on a static that is already immutable: a Jackson 3 ObjectMapper cannot be
reconfigured after build() (NotificationJsonMapper), and CertifiedEvidence.RECORDED is a
<!-- MS_EXPOSE_REP on a static that is already immutable: CertifiedEvidence.RECORDED is a
Stream.toList() result. -->
<Match>
<Bug pattern="MS_EXPOSE_REP"/>