Skip to content

Commit 4163dc7

Browse files
authored
[Error Prone] Fix Slf4j formatting errors and enable Slf4jFormatShouldBeConst check (#37771)
* Fix Slf4j formatting errors in sdks/java/io/google-cloud-platform * enable Slf4jFormatShouldBeConst * Resolving Slf4jFormatShouldBeConst violations * revert log format due to usage in tests * remove duplicate check
1 parent 48935a8 commit 4163dc7

175 files changed

Lines changed: 437 additions & 504 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1532,7 +1532,6 @@ class BeamModulePlugin implements Plugin<Project> {
15321532
def disabledChecks = [
15331533
// TODO(https://github.com/apache/beam/issues/20955): Enable errorprone checks
15341534
"AutoValueImmutableFields",
1535-
"AutoValueImmutableFields",
15361535
"AutoValueSubclassLeaked",
15371536
"BigDecimalEquals",
15381537
"ComparableType",
@@ -1550,7 +1549,6 @@ class BeamModulePlugin implements Plugin<Project> {
15501549
"MixedMutabilityReturnType",
15511550
"PreferJavaTimeOverload",
15521551
"NonCanonicalType",
1553-
"Slf4jFormatShouldBeConst",
15541552
"Slf4jSignOnlyFormat",
15551553
"ThreadPriorityCheck",
15561554
"TimeUnitConversionChecker",

examples/java/sql/src/main/java/org/apache/beam/examples/SchemaTransformExample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public LogOutput(String prefix) {
102102

103103
@ProcessElement
104104
public void processElement(ProcessContext c) throws Exception {
105-
LOG.info(prefix + c.element());
105+
LOG.info("{}{}", prefix, c.element());
106106
c.output(c.element());
107107
}
108108
}

examples/java/sql/src/main/java/org/apache/beam/examples/SqlTransformExample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public LogOutput(String prefix) {
9696

9797
@ProcessElement
9898
public void processElement(ProcessContext c) throws Exception {
99-
LOG.info(prefix + c.element());
99+
LOG.info("{}{}", prefix, c.element());
100100
c.output(c.element());
101101
}
102102
}

examples/java/src/main/java/org/apache/beam/examples/ApproximateQuantilesExample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public LogOutput(String prefix) {
7171

7272
@ProcessElement
7373
public void processElement(ProcessContext c) throws Exception {
74-
LOG.info(prefix + c.element());
74+
LOG.info("{}{}", prefix, c.element());
7575
c.output(c.element());
7676
}
7777
}

examples/java/src/main/java/org/apache/beam/examples/CoCombineTransformExample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ public LogOutput(String prefix) {
211211

212212
@ProcessElement
213213
public void processElement(ProcessContext c) throws Exception {
214-
LOG.info(prefix + c.element());
214+
LOG.info("{}{}", prefix, c.element());
215215
c.output(c.element());
216216
}
217217
}

examples/java/src/main/java/org/apache/beam/examples/CoGroupByKeyExample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public LogOutput(String prefix) {
8585

8686
@ProcessElement
8787
public void processElement(ProcessContext c) throws Exception {
88-
LOG.info(prefix + c.element());
88+
LOG.info("{}{}", prefix, c.element());
8989
c.output(c.element());
9090
}
9191
}

examples/java/src/main/java/org/apache/beam/examples/CombineExample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public LogOutput(String prefix) {
6969

7070
@ProcessElement
7171
public void processElement(ProcessContext c) throws Exception {
72-
LOG.info(prefix + c.element());
72+
LOG.info("{}{}", prefix, c.element());
7373
c.output(c.element());
7474
}
7575
}

examples/java/src/main/java/org/apache/beam/examples/CountExample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public LogOutput(String prefix) {
6464

6565
@ProcessElement
6666
public void processElement(ProcessContext c) throws Exception {
67-
LOG.info(prefix + c.element());
67+
LOG.info("{}{}", prefix, c.element());
6868
c.output(c.element());
6969
}
7070
}

examples/java/src/main/java/org/apache/beam/examples/CountPerKeyExample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public LogOutput(String prefix) {
6868

6969
@ProcessElement
7070
public void processElement(ProcessContext c) throws Exception {
71-
LOG.info(prefix + c.element());
71+
LOG.info("{}{}", prefix, c.element());
7272
c.output(c.element());
7373
}
7474
}

examples/java/src/main/java/org/apache/beam/examples/CreateExample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public LogOutput(String prefix) {
8080

8181
@ProcessElement
8282
public void processElement(ProcessContext c) throws Exception {
83-
LOG.info(prefix + c.element());
83+
LOG.info("{}{}", prefix, c.element());
8484
c.output(c.element());
8585
}
8686
}

0 commit comments

Comments
 (0)