Skip to content

Commit a2b7efa

Browse files
committed
[Do not Review] PR raised for to check spotbugs report
1 parent 51ad671 commit a2b7efa

3 files changed

Lines changed: 18 additions & 1 deletion

File tree

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1058,7 +1058,7 @@
10581058
</plugin>
10591059
</plugins>
10601060
</pluginManagement>
1061-
1061+
<!-- Do not review: Added for checking the precommits with jdk17 after merge-->
10621062
<plugins>
10631063
<plugin>
10641064
<groupId>org.apache.maven.plugins</groupId>

tez-api/src/main/java/org/apache/tez/client/AMConfiguration.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,12 @@ LocalResource getBinaryConfLR() {
8787
return binaryConfLRsrc;
8888
}
8989

90+
// do not review. spotbugs should catch this.
91+
private final Object lock1 = new Object();
92+
public void doNothing() {
93+
synchronized (lock1) {
94+
// SpotBugs: empty synchronized block
95+
}
96+
}
97+
9098
}

tez-common/src/main/java/org/apache/tez/util/FastNumberFormat.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,15 @@ public StringBuilder format(long source, StringBuilder sb) {
5050
}
5151

5252
public String format(long source) {
53+
divideSafely(1);
5354
return format(source, new StringBuilder()).toString();
5455
}
56+
public void divideSafely(int denominator) {
57+
if (denominator != 0) {
58+
int x = 10 / denominator;
59+
System.out.println("Result: " + x);
60+
} else {
61+
System.out.println("Cannot divide by zero.");
62+
}
63+
}
5564
}

0 commit comments

Comments
 (0)