Skip to content

Commit

Permalink
PMD fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
AB-xdev committed Jun 28, 2024
1 parent 844c588 commit ed48f4c
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 2 deletions.
3 changes: 3 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@
<rulesets>
<ruleset>.config/pmd/ruleset.xml</ruleset>
</rulesets>
<excludes>
<exclude>**/entities/**/*_.java</exclude>
</excludes>
</configuration>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public <T> T runWithTransaction(final Supplier<T> supplier)
});
}

@SuppressWarnings("PMD.PreserveStackTrace")
private Object createProxiedDAO(final Class<?> fieldType, final EntityManager em, final Object original)
{
// java.lang.reflect.Proxy only proxies interfaces and doesn't work here!
Expand Down Expand Up @@ -124,6 +125,7 @@ private Object createProxiedDAO(final Class<?> fieldType, final EntityManager em
}
}

@SuppressWarnings("PMD.PreserveStackTrace")
private Object createDAO(final Class<?> fieldType, final EntityManager em)
{
try
Expand Down
6 changes: 6 additions & 0 deletions tci-advanced-demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>software.xdev</groupId>
<artifactId>tci-base-root</artifactId>
<version>1.0.2-SNAPSHOT</version>
</parent>

<groupId>software.xdev.tci.demo</groupId>
<artifactId>tci-advanced-demo</artifactId>
<version>1.0.2-SNAPSHOT</version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protected boolean shouldRetrieveUserInfo(final OidcUserRequest userRequest)
}

@Override
public OidcUser loadUser(final OidcUserRequest req) throws OAuth2AuthenticationException
public OidcUser loadUser(final OidcUserRequest req)
{
final OidcUser oidcUser = super.loadUser(req);

Expand Down
3 changes: 3 additions & 0 deletions tci-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,9 @@
<rulesets>
<ruleset>../.config/pmd/ruleset.xml</ruleset>
</rulesets>
<excludes>
<exclude>**/entities/**/*_.java</exclude>
</excludes>
</configuration>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public void scrape()
.map(parts -> {
final String startCPU = "cpu=\"";
final String cpu = parts[0].substring(parts[0].indexOf(startCPU) + startCPU.length());
final int cpuIndex = Integer.parseInt(cpu.substring(0, cpu.indexOf("\"")));
final int cpuIndex = Integer.parseInt(cpu.substring(0, cpu.indexOf('\"')));
final double idleSec = Double.parseDouble(parts[1]);

return Map.entry(cpuIndex, idleSec);
Expand Down

0 comments on commit ed48f4c

Please sign in to comment.