Skip to content

Commit 6c84fb7

Browse files
chore: bump com.github.spotbugs:spotbugs-maven-plugin from 4.8.4.0 to 4.9.3.2 (#2010)
* chore: bump com.github.spotbugs:spotbugs-maven-plugin Bumps [com.github.spotbugs:spotbugs-maven-plugin](https://github.com/spotbugs/spotbugs-maven-plugin) from 4.8.4.0 to 4.9.3.2. - [Release notes](https://github.com/spotbugs/spotbugs-maven-plugin/releases) - [Commits](spotbugs/spotbugs-maven-plugin@spotbugs-maven-plugin-4.8.4.0...spotbugs-maven-plugin-4.9.3.2) --- updated-dependencies: - dependency-name: com.github.spotbugs:spotbugs-maven-plugin dependency-version: 4.9.3.2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * Make raiseOnEmptyMetrics an AtomicBoolean. --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Philipp Page <[email protected]> Co-authored-by: Philipp Page <[email protected]>
1 parent 58e09cb commit 6c84fb7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@
591591
<plugin>
592592
<groupId>com.github.spotbugs</groupId>
593593
<artifactId>spotbugs-maven-plugin</artifactId>
594-
<version>4.8.4.0</version>
594+
<version>4.9.3.2</version>
595595
<executions>
596596
<execution>
597597
<id>test</id>

powertools-metrics/src/main/java/software/amazon/lambda/powertools/metrics/internal/EmfMetricsLogger.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public class EmfMetricsLogger implements Metrics {
5050

5151
private final software.amazon.cloudwatchlogs.emf.logger.MetricsLogger emfLogger;
5252
private final EnvironmentProvider environmentProvider;
53-
private boolean raiseOnEmptyMetrics = false;
53+
private AtomicBoolean raiseOnEmptyMetrics = new AtomicBoolean(false);
5454
private String namespace;
5555
private Map<String, String> defaultDimensions = new HashMap<>();
5656
private final AtomicBoolean hasMetrics = new AtomicBoolean(false);
@@ -133,7 +133,7 @@ public void setNamespace(String namespace) {
133133

134134
@Override
135135
public void setRaiseOnEmptyMetrics(boolean raiseOnEmptyMetrics) {
136-
this.raiseOnEmptyMetrics = raiseOnEmptyMetrics;
136+
this.raiseOnEmptyMetrics.set(raiseOnEmptyMetrics);
137137
}
138138

139139
@Override
@@ -159,7 +159,7 @@ public void flush() {
159159
Validator.validateNamespace(namespace);
160160

161161
if (!hasMetrics.get()) {
162-
if (raiseOnEmptyMetrics) {
162+
if (raiseOnEmptyMetrics.get()) {
163163
throw new IllegalStateException("No metrics were emitted");
164164
} else {
165165
LOGGER.warn("No metrics were emitted");

0 commit comments

Comments
 (0)