Skip to content

Commit c1f8862

Browse files
committed
fix pmd systemprintln, guardlogstatement
1 parent 26134b3 commit c1f8862

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

examples/authentication/src/main/java/cloud/stackit/sdk/authentication/examples/AuthenticationExample.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ public static void main(String[] args) {
5757
serviceAccountKeyContent.append(myReader.nextLine());
5858
}
5959
} catch (FileNotFoundException e) {
60-
System.err.println("File not found: " + serviceAccountKeyPath);
60+
if (LOGGER.isLoggable(Level.SEVERE)) {
61+
LOGGER.severe("File not found: " + serviceAccountKeyPath);
62+
}
6163
return;
6264
}
6365

@@ -70,7 +72,9 @@ public static void main(String[] args) {
7072
privateKeyContent.append(myReader.nextLine());
7173
}
7274
} catch (FileNotFoundException e) {
73-
System.err.println("File not found: " + privateKeyPath);
75+
if (LOGGER.isLoggable(Level.SEVERE)) {
76+
LOGGER.severe("File not found: " + privateKeyPath);
77+
}
7478
return;
7579
}
7680

0 commit comments

Comments
 (0)