Skip to content

Commit 531795c

Browse files
authored
suppressions and few volatile var changes to resolve spotbugs errors (#3736)
1 parent 56feb0a commit 531795c

File tree

3 files changed

+34
-2
lines changed

3 files changed

+34
-2
lines changed

client/src/main/java/io/confluent/kafka/schemaregistry/rules/DlqAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public class DlqAction implements RuleAction {
7373

7474
private Map<String, ?> configs;
7575
private String topic;
76-
private boolean autoFlush;
76+
private volatile boolean autoFlush;
7777
private List<String> redactRuleTypes;
7878
private volatile KafkaProducer<byte[], byte[]> producer;
7979

core/src/main/java/io/confluent/kafka/schemaregistry/storage/KafkaStoreReaderThread.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public class KafkaStoreReaderThread<K, V> extends ShutdownableThread {
7575
private final Condition offsetReachedThreshold;
7676
private Consumer<byte[], byte[]> consumer;
7777
private final Producer<byte[], byte[]> producer;
78-
private long offsetInSchemasTopic = -1L;
78+
private volatile long offsetInSchemasTopic = -1L;
7979
private OffsetCheckpoint checkpointFile;
8080
private Map<TopicPartition, Long> checkpointFileCache = new HashMap<>();
8181
// Noop key is only used to help reliably determine last offset; reader thread ignores

findbugs/findbugs-exclude.xml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,4 +183,36 @@ For a detailed description of findbugs bug categories, see http://findbugs.sourc
183183
<Match>
184184
<Bug pattern="THROWS_METHOD_THROWS_RUNTIMEEXCEPTION"/>
185185
</Match>
186+
187+
<!-- Static field warnings in json schema provider -->
188+
<Match>
189+
<Class name="io.confluent.kafka.schemaregistry.json.utils.MaximumCardinalityMatch"/>
190+
<Bug pattern="SS_SHOULD_BE_STATIC"/>
191+
</Match>
192+
193+
<!-- Method hiding warnings in data config classes -->
194+
<!-- This is a legitimate design pattern where child config classes provide their own baseConfigDef() -->
195+
<!-- All classes extending AbstractDataConfig follow this pattern -->
196+
<Match>
197+
<Class name="io.confluent.connect.avro.AvroDataConfig"/>
198+
<Bug pattern="HSM_HIDING_METHOD"/>
199+
</Match>
200+
201+
<Match>
202+
<Class name="io.confluent.connect.json.JsonSchemaDataConfig"/>
203+
<Bug pattern="HSM_HIDING_METHOD"/>
204+
</Match>
205+
206+
<Match>
207+
<Class name="io.confluent.connect.protobuf.ProtobufDataConfig"/>
208+
<Bug pattern="HSM_HIDING_METHOD"/>
209+
</Match>
210+
211+
<!-- Blanket exclusion for CT_CONSTRUCTOR_THROW warnings across the entire codebase -->
212+
<!-- These are legitimate design patterns where constructors can throw exceptions -->
213+
<!-- This warning was introduced in newer SpotBugs versions and affects many classes -->
214+
<Match>
215+
<Class name="~io\.confluent\..*"/>
216+
<Bug pattern="CT_CONSTRUCTOR_THROW"/>
217+
</Match>
186218
</FindBugsFilter>

0 commit comments

Comments
 (0)