Skip to content

Commit

Permalink
Fix PMD violations fixes, fixes issue cerner#122
Browse files Browse the repository at this point in the history
  • Loading branch information
Sairam Vudatha committed Oct 3, 2019
1 parent e20e629 commit 7e46826
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.cerner.beadledom.guice.BindingAnnotations;

import com.cerner.beadledom.jackson.JacksonModule;
import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
import com.google.inject.AbstractModule;

import java.lang.annotation.Annotation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import java.io.IOException;
import java.io.Reader;
import java.util.Properties;
import org.apache.commons.configuration2.Configuration;
import org.apache.commons.configuration2.FileBasedConfiguration;
import org.apache.commons.configuration2.XMLConfiguration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ protected void configure() {

//This is to provide a default binding for HealthDependency,
// so that services with no HealthDependency bindings can start
Multibinder<HealthDependency> healthDependencyModuleBinder = Multibinder.newSetBinder(binder(),
HealthDependency.class);
Multibinder.newSetBinder(binder(), HealthDependency.class);

Multibinder<Module> jacksonModuleBinder = Multibinder.newSetBinder(binder(), Module.class);
jacksonModuleBinder.addBinding().to(Jdk8Module.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,13 @@ public class JacksonModule extends AbstractModule {
protected void configure() {

// Empty multibindings for dependencies
Multibinder<Module> jacksonModuleBinder = Multibinder.newSetBinder(binder(), Module.class);
Multibinder.newSetBinder(binder(), Module.class);

Multibinder<SerializationFeatureFlag> serializationFeatureBinder = Multibinder
.newSetBinder(binder(), SerializationFeatureFlag.class);
Multibinder<DeserializationFeatureFlag> deserializationFeatureBinder = Multibinder
.newSetBinder(binder(), DeserializationFeatureFlag.class);
Multibinder<JsonGeneratorFeatureFlag> jsonGeneratorFeatureBinder = Multibinder
.newSetBinder(binder(), JsonGeneratorFeatureFlag.class);
Multibinder<JsonParserFeatureFlag> jsonParserFeatureBinder = Multibinder
.newSetBinder(binder(), JsonParserFeatureFlag.class);
Multibinder<MapperFeatureFlag> mapperFeatureBinder = Multibinder
.newSetBinder(binder(), MapperFeatureFlag.class);
Multibinder.newSetBinder(binder(), SerializationFeatureFlag.class);
Multibinder.newSetBinder(binder(), DeserializationFeatureFlag.class);
Multibinder.newSetBinder(binder(), JsonGeneratorFeatureFlag.class);
Multibinder.newSetBinder(binder(), JsonParserFeatureFlag.class);
Multibinder.newSetBinder(binder(), MapperFeatureFlag.class);

/**
* MultibindingsScanner will scan all modules for methods with the annotations @ProvidesIntoMap,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.cerner.beadledom.jaxrs;

import com.cerner.beadledom.jaxrs.provider.CorrelationIdFilter;
import com.cerner.beadledom.jaxrs.provider.ForwardedHeaderFilter;
import com.google.inject.AbstractModule;
import javax.inject.Singleton;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ private boolean hasNext() {
return false;
}

boolean moreResults = totalResults != null && (currentOffset + currentLimit < totalResults);
boolean moreResults = totalResults != null && currentOffset + currentLimit < totalResults;

if (totalResults == null) {
return hasMore != null && hasMore;
Expand Down
3 changes: 1 addition & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -784,8 +784,7 @@
<artifactId>maven-pmd-plugin</artifactId>
<configuration>
<targetJdk>${java.version}</targetJdk>
<!-- TODO: Flip this to true once violations are evaluated or fixed -->
<failOnViolation>false</failOnViolation>
<failOnViolation>true</failOnViolation>
</configuration>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,13 @@
import com.google.common.collect.ImmutableSet;
import java.io.InputStream;
import java.util.Set;
import java.util.regex.Pattern;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext;
import javax.ws.rs.core.StreamingOutput;
import javax.ws.rs.core.UriInfo;

Expand Down

0 comments on commit 7e46826

Please sign in to comment.