fix: address SonarQube reliability issues
Some checks failed
CI / cleanup-branch (push) Has been skipped
CI / build (push) Failing after 39s
CI / docker (push) Has been skipped
CI / deploy (push) Has been skipped
CI / deploy-feature (push) Has been skipped

- ElkDiagramRenderer.getElkRoot(): add null guard to prevent NPE
  when node is null (SQ java:S2259)
- WriteBuffer: add offerOrWarn() that logs when buffer is full instead
  of silently dropping data. ChunkAccumulator now uses this method
  so ingestion backpressure is visible in logs (SQ java:S899)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-04-01 10:55:31 +02:00
parent d4dbfa7ae6
commit e50c9fa60d
3 changed files with 13 additions and 2 deletions

View File

@@ -110,8 +110,8 @@ public class StorageBeanConfig {
WriteBuffer<ChunkAccumulator.ProcessorBatch> processorBatchBuffer,
DiagramStore diagramStore) {
return new ChunkAccumulator(
executionBuffer::offer,
processorBatchBuffer::offer,
executionBuffer::offerOrWarn,
processorBatchBuffer::offerOrWarn,
diagramStore,
java.time.Duration.ofMinutes(5));
}

View File

@@ -884,6 +884,7 @@ public class ElkDiagramRenderer implements DiagramRenderer {
}
private ElkNode getElkRoot(ElkNode node) {
if (node == null) return null;
ElkNode current = node;
while (current.getParent() != null) {
current = current.getParent();