Skip to content

Commit 372a8fe

Browse files
committed
TEMP: add mock-violations file to validate annotations (REVERT BEFORE MERGE)
1 parent fcc8f3d commit 372a8fe

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2026 Avaloq Group AG
3+
*
4+
* MOCK FILE — DO NOT MERGE.
5+
* Introduces 1 PMD + 1 Checkstyle + 1 SpotBugs violation each to validate that the
6+
* static-analysis job's Python annotation step renders inline PR annotations.
7+
* This file MUST be reverted before this PR is marked ready for review.
8+
*******************************************************************************/
9+
package com.avaloq.tools.ddk;
10+
11+
@SuppressWarnings("PMD.SystemPrintln")
12+
public class MockViolations {
13+
14+
// PMD: EmptyCatchBlock — empty catch block (errorprone.xml category, in the project ruleset)
15+
public void pmdViolation() {
16+
try {
17+
Class.forName("Foo");
18+
} catch (Exception e) {
19+
}
20+
}
21+
22+
// Checkstyle: EmptyCatchBlock — same body as above; both PMD and Checkstyle should fire on the
23+
// empty catch block. Using a distinct method so the two annotations land on different lines.
24+
public void checkstyleViolation() {
25+
try {
26+
Class.forName("Bar");
27+
} catch (Exception e) {
28+
}
29+
}
30+
31+
// SpotBugs: DM_DEFAULT_ENCODING — String#getBytes() without an explicit charset.
32+
public byte[] spotbugsViolation(final String s) {
33+
return s.getBytes();
34+
}
35+
36+
}

0 commit comments

Comments
 (0)