Skip to content

Commit 1f9bb9c

Browse files
authored
Configure errorprone's ClassInitializationDeadlock (#7021)
This ensures we do not introduce new cases of this issue by failing the build when they are detected by ErrorProne. It suppresses the warning on the existing cases we are aware of while we separately decide what to do about them. See gh-6998 Signed-off-by: Emanuel Trandafir <emanueltrandafir1993@gmail.com>
1 parent 71abbe2 commit 1f9bb9c

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ subprojects {
9898
"BadImport",
9999
"CatchAndPrintStackTrace",
100100
"ClassCanBeStatic",
101+
"ClassInitializationDeadlock",
101102
"CollectionUndefinedEquality",
102103
"DefaultCharset",
103104
"DoNotCallSuggester",

micrometer-observation/src/main/java/io/micrometer/observation/Observation.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public interface Observation extends ObservationView {
5252
* No-op observation. Do not use it to check if an Observation is no-op, use
5353
* {@code observation.isNoop()} instead.
5454
*/
55+
@SuppressWarnings("ClassInitializationDeadlock")
5556
Observation NOOP = NoopObservation.INSTANCE;
5657

5758
/**
@@ -837,6 +838,7 @@ interface Scope extends AutoCloseable {
837838
/**
838839
* No-op scope.
839840
*/
841+
@SuppressWarnings("ClassInitializationDeadlock")
840842
Scope NOOP = NoopObservation.NoopScope.INSTANCE;
841843

842844
/**

micrometer-observation/src/main/java/io/micrometer/observation/ObservationRegistry.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ static ObservationRegistry create() {
4545
/**
4646
* No-op implementation of {@link ObservationRegistry}.
4747
*/
48+
@SuppressWarnings("ClassInitializationDeadlock")
4849
ObservationRegistry NOOP = new NoopObservationRegistry();
4950

5051
/**

0 commit comments

Comments
 (0)