Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: PMD warnings with new version #936

Merged
merged 5 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
6 changes: 4 additions & 2 deletions 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 Expand Up @@ -107,7 +108,8 @@ private <T> FlagEvaluationDetails<T> evaluateFlag(FlagValueType type, String key
FeatureProvider provider;

try {
// openfeatureApi.getProvider() must be called once to maintain a consistent reference
// openfeatureApi.getProvider() must be called once to maintain a consistent
// reference
toddbaert marked this conversation as resolved.
Show resolved Hide resolved
provider = openfeatureApi.getProvider(this.name);

mergedHooks = ObjectUtils.merge(provider.getProviderHooks(), flagOptions.getHooks(), clientHooks,
Expand Down
Loading