From a7d9819a05900da8ea0a809b772d5542f28da8ae Mon Sep 17 00:00:00 2001 From: Onur Kayabasi Date: Fri, 17 Jan 2025 08:30:54 +0100 Subject: [PATCH] Formatting fixed --- .../sdk/logs/export/BatchLogRecordProcessorBuilder.java | 7 +++++-- .../sdk/logs/export/BatchLogRecordProcessorTest.java | 9 +++++++-- .../sdk/trace/export/BatchSpanProcessorBuilder.java | 7 +++++-- .../sdk/trace/export/BatchSpanProcessorTest.java | 7 ++++++- 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/sdk/logs/src/main/java/io/opentelemetry/sdk/logs/export/BatchLogRecordProcessorBuilder.java b/sdk/logs/src/main/java/io/opentelemetry/sdk/logs/export/BatchLogRecordProcessorBuilder.java index 9810a3af230..32cfdebf934 100644 --- a/sdk/logs/src/main/java/io/opentelemetry/sdk/logs/export/BatchLogRecordProcessorBuilder.java +++ b/sdk/logs/src/main/java/io/opentelemetry/sdk/logs/export/BatchLogRecordProcessorBuilder.java @@ -148,10 +148,13 @@ int getMaxExportBatchSize() { * {@code logRecordExporter}. * * @return a new {@link BatchLogRecordProcessor}. - * @throws IllegalArgumentException if {@code maxExportBatchSize} is greater than {@code maxQueueSize}. + * @throws IllegalArgumentException if {@code maxExportBatchSize} is greater than {@code + * maxQueueSize}. */ public BatchLogRecordProcessor build() { - checkArgument(maxExportBatchSize <= maxQueueSize, "maxExportBatchSize must be smaller or equal to maxQueueSize."); + checkArgument( + maxExportBatchSize <= maxQueueSize, + "maxExportBatchSize must be smaller or equal to maxQueueSize."); return new BatchLogRecordProcessor( logRecordExporter, meterProvider, diff --git a/sdk/logs/src/test/java/io/opentelemetry/sdk/logs/export/BatchLogRecordProcessorTest.java b/sdk/logs/src/test/java/io/opentelemetry/sdk/logs/export/BatchLogRecordProcessorTest.java index 97e5b117d63..930142aa741 100644 --- a/sdk/logs/src/test/java/io/opentelemetry/sdk/logs/export/BatchLogRecordProcessorTest.java +++ b/sdk/logs/src/test/java/io/opentelemetry/sdk/logs/export/BatchLogRecordProcessorTest.java @@ -111,11 +111,16 @@ void builderInvalidConfig() { () -> BatchLogRecordProcessor.builder(mockLogRecordExporter).setExporterTimeout(null)) .isInstanceOf(NullPointerException.class) .hasMessage("timeout"); - assertThatThrownBy(() -> BatchLogRecordProcessor.builder(mockLogRecordExporter).setMaxQueueSize(0)) + assertThatThrownBy( + () -> BatchLogRecordProcessor.builder(mockLogRecordExporter).setMaxQueueSize(0)) .isInstanceOf(IllegalArgumentException.class) .hasMessage("maxQueueSize must be positive."); assertThatThrownBy( - () -> BatchLogRecordProcessor.builder(mockLogRecordExporter).setMaxQueueSize(1).setMaxExportBatchSize(2).build()) + () -> + BatchLogRecordProcessor.builder(mockLogRecordExporter) + .setMaxQueueSize(1) + .setMaxExportBatchSize(2) + .build()) .isInstanceOf(IllegalArgumentException.class) .hasMessage("maxExportBatchSize must be smaller or equal to maxQueueSize."); } diff --git a/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/export/BatchSpanProcessorBuilder.java b/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/export/BatchSpanProcessorBuilder.java index b0365d3a1b3..a89e33fec79 100644 --- a/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/export/BatchSpanProcessorBuilder.java +++ b/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/export/BatchSpanProcessorBuilder.java @@ -156,10 +156,13 @@ int getMaxExportBatchSize() { * forwards them to the given {@code spanExporter}. * * @return a new {@link BatchSpanProcessor}. - * @throws IllegalArgumentException if {@code maxExportBatchSize} is greater than {@code maxQueueSize}. + * @throws IllegalArgumentException if {@code maxExportBatchSize} is greater than {@code + * maxQueueSize}. */ public BatchSpanProcessor build() { - checkArgument(maxExportBatchSize <= maxQueueSize, "maxExportBatchSize must be smaller or equal to maxQueueSize."); + checkArgument( + maxExportBatchSize <= maxQueueSize, + "maxExportBatchSize must be smaller or equal to maxQueueSize."); return new BatchSpanProcessor( spanExporter, exportUnsampledSpans, diff --git a/sdk/trace/src/test/java/io/opentelemetry/sdk/trace/export/BatchSpanProcessorTest.java b/sdk/trace/src/test/java/io/opentelemetry/sdk/trace/export/BatchSpanProcessorTest.java index d6a31a050a4..1638cd27044 100644 --- a/sdk/trace/src/test/java/io/opentelemetry/sdk/trace/export/BatchSpanProcessorTest.java +++ b/sdk/trace/src/test/java/io/opentelemetry/sdk/trace/export/BatchSpanProcessorTest.java @@ -124,7 +124,12 @@ void builderInvalidConfig() { assertThatThrownBy(() -> BatchSpanProcessor.builder(mockSpanExporter).setMaxQueueSize(0)) .isInstanceOf(IllegalArgumentException.class) .hasMessage("maxQueueSize must be positive."); - assertThatThrownBy(() -> BatchSpanProcessor.builder(mockSpanExporter).setMaxQueueSize(1).setMaxExportBatchSize(2).build()) + assertThatThrownBy( + () -> + BatchSpanProcessor.builder(mockSpanExporter) + .setMaxQueueSize(1) + .setMaxExportBatchSize(2) + .build()) .isInstanceOf(IllegalArgumentException.class) .hasMessage("maxExportBatchSize must be smaller or equal to maxQueueSize."); }