Skip to content

Commit a9cc5bc

Browse files
committed
fix pmd useutilityclass, refactor example class modifiers
1 parent 10a0662 commit a9cc5bc

File tree

4 files changed

+6
-11
lines changed

4 files changed

+6
-11
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ final class AuthenticationExample {
1515
private static final String PRIVATE_KEY_PATH = "/path/to/private_key.pem";
1616
private static final String SERVICE_ACCOUNT_MAIL = "name-1234@sa.stackit.cloud";
1717

18-
@SuppressWarnings({"PMD.CyclomaticComplexity", "PMD.NPathComplexity", "PMD.SystemPrintln"})
19-
public static void main(String[] args) {
18+
@SuppressWarnings({"PMD.CyclomaticComplexity", "PMD.NPathComplexity", "PMD.SystemPrintln", "PMD.UseUtilityClass"})
19+
public static void main(String[] args) throws IOException {
2020
/* OPTION 1: setting the paths to service account key (and private key) as configuration */
2121
try {
2222
ResourceManagerApi api =
@@ -126,6 +126,4 @@ public static void main(String[] args) {
126126
throw new IllegalStateException(e);
127127
}
128128
}
129-
130-
private AuthenticationExample() {}
131129
}

examples/custom-http-client/src/main/java/cloud/stackit/sdk/customhttpclient/examples/CustomHttpClientExample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* */
2424
final class CustomHttpClientExample {
2525

26-
@SuppressWarnings("PMD.SystemPrintln")
26+
@SuppressWarnings({"PMD.SystemPrintln", "PMD.UseUtilityClass"})
2727
public static void main(String[] args) throws IOException {
2828
// Credentials are read from the credentialsFile in `~/.stackit/credentials.json` or the env
2929
// STACKIT_SERVICE_ACCOUNT_KEY_PATH / STACKIT_SERVICE_ACCOUNT_KEY

examples/iaas/src/main/java/cloud/stackit/sdk/iaas/examples/IaaSExample.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ final class IaaSExample {
1717
"PMD.CognitiveComplexity",
1818
"PMD.NPathComplexity",
1919
"PMD.NcssCount",
20-
"PMD.SystemPrintln"
20+
"PMD.SystemPrintln",
21+
"PMD.UseUtilityClass"
2122
})
2223
public static void main(String[] args) throws IOException {
2324
/*
@@ -290,6 +291,4 @@ public static void main(String[] args) throws IOException {
290291
throw new IllegalStateException(e);
291292
}
292293
}
293-
294-
private IaaSExample() {}
295294
}

examples/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/examples/ResourcemanagerExample.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
final class ResourcemanagerExample {
2121

22-
@SuppressWarnings({"PMD.NPathComplexity", "PMD.SystemPrintln"})
22+
@SuppressWarnings({"PMD.NPathComplexity", "PMD.SystemPrintln", "PMD.UseUtilityClass"})
2323
public static void main(String[] args) throws IOException {
2424
// Credentials are read from the credentialsFile in `~/.stackit/credentials.json` or the env
2525
// STACKIT_SERVICE_ACCOUNT_KEY_PATH / STACKIT_SERVICE_ACCOUNT_KEY
@@ -113,6 +113,4 @@ public static void main(String[] args) throws IOException {
113113
throw new IllegalStateException(e);
114114
}
115115
}
116-
117-
private ResourcemanagerExample() {}
118116
}

0 commit comments

Comments
 (0)