Skip to content

Commit

Permalink
fix: PMD warnings with new version (#936)
Browse files Browse the repository at this point in the history
* chore(deps): update dependency org.apache.maven.plugins:maven-pmd-plugin to v3.22.0

* removed redundancy from eventdetails, SuppressWarnings in OpenfeatureAPI and Client

Signed-off-by: DBlanchard88 <davidblanchard88@gmail.com>

* Update src/main/java/dev/openfeature/sdk/OpenFeatureClient.java

Signed-off-by: Todd Baert <todd.baert@dynatrace.com>

---------

Signed-off-by: DBlanchard88 <davidblanchard88@gmail.com>
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Todd Baert <todd.baert@dynatrace.com>
  • Loading branch information
3 people authored May 15, 2024
1 parent 0844c8f commit 1a46aea
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.21.2</version>
<version>3.22.0</version>
<executions>
<execution>
<id>run-pmd</id>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/dev/openfeature/sdk/EventDetails.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ public class EventDetails extends ProviderEventDetails {
private String providerName;

static EventDetails fromProviderEventDetails(ProviderEventDetails providerEventDetails, String providerName) {
return EventDetails.fromProviderEventDetails(providerEventDetails, providerName, null);
return fromProviderEventDetails(providerEventDetails, providerName, null);
}

static EventDetails fromProviderEventDetails(
ProviderEventDetails providerEventDetails,
String providerName,
String clientName) {
return EventDetails.builder()
return builder()
.clientName(clientName)
.providerName(providerName)
.flagsChanged(providerEventDetails.getFlagsChanged())
Expand Down
1 change: 1 addition & 0 deletions src/main/java/dev/openfeature/sdk/OpenFeatureAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* Configuration here will be shared across all {@link Client}s.
*/
@Slf4j
@SuppressWarnings("PMD.UnusedLocalVariable")
public class OpenFeatureAPI implements EventBus<OpenFeatureAPI> {
// package-private multi-read/single-write lock
static AutoCloseableReentrantReadWriteLock lock = new AutoCloseableReentrantReadWriteLock();
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/dev/openfeature/sdk/OpenFeatureClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
* {@inheritDoc}
*/
@Slf4j
@SuppressWarnings({ "PMD.DataflowAnomalyAnalysis", "PMD.BeanMembersShouldSerialize", "unchecked", "rawtypes" })
@SuppressWarnings({ "PMD.DataflowAnomalyAnalysis", "PMD.BeanMembersShouldSerialize",
"PMD.UnusedLocalVariable", "unchecked", "rawtypes" })
public class OpenFeatureClient implements Client {

private final OpenFeatureAPI openfeatureApi;
Expand Down

0 comments on commit 1a46aea

Please sign in to comment.