Skip to content

Commit

Permalink
Implementation of TouK#113 Plugin Facility for Sputnik Processors
Browse files Browse the repository at this point in the history
Fixed code style issues
  • Loading branch information
sertic committed Jan 31, 2016
1 parent 3273b26 commit 8b41fce
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 40 deletions.
12 changes: 6 additions & 6 deletions src/main/java/pl/touk/sputnik/engine/ProcessorBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ public class ProcessorBuilder {
public static List<ReviewProcessor> buildProcessors(Configuration configuration) {
List<ReviewProcessor> processors = new ArrayList<>();

ServiceLoader<ReviewProcessorFactory> theLoader = ServiceLoader.load(ReviewProcessorFactory.class);
Iterator<ReviewProcessorFactory> theIterator = theLoader.iterator();
while (theIterator.hasNext()) {
ReviewProcessorFactory theFactory = theIterator.next();
if (theFactory.isEnabled(configuration)) {
processors.add(theFactory.create(configuration));
ServiceLoader<ReviewProcessorFactory> loader = ServiceLoader.load(ReviewProcessorFactory.class);
Iterator<ReviewProcessorFactory> iterator = loader.iterator();
while (iterator.hasNext()) {
ReviewProcessorFactory factory = iterator.next();
if (factory.isEnabled(configuration)) {
processors.add(factory.create(configuration));
}
}
return processors;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

public interface ReviewProcessorFactory<T extends ReviewProcessor> {

boolean isEnabled(Configuration aConfiguration);
boolean isEnabled(Configuration configuration);

T create(Configuration aConfiguration);
T create(Configuration configuration);
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
public class CheckstyleReviewProcessorFactory implements ReviewProcessorFactory<CheckstyleProcessor> {

@Override
public boolean isEnabled(Configuration aConfiguration) {
return Boolean.valueOf(aConfiguration.getProperty(GeneralOption.CHECKSTYLE_ENABLED));
public boolean isEnabled(Configuration configuration) {
return Boolean.valueOf(configuration.getProperty(GeneralOption.CHECKSTYLE_ENABLED));
}

@Override
public CheckstyleProcessor create(Configuration aConfiguration) {
return new CheckstyleProcessor(aConfiguration);
public CheckstyleProcessor create(Configuration configuration) {
return new CheckstyleProcessor(configuration);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
public class NodeCardReviewProcessorFactory implements ReviewProcessorFactory<CodeNarcProcessor> {

@Override
public boolean isEnabled(Configuration aConfiguration) {
return Boolean.valueOf(aConfiguration.getProperty(GeneralOption.CODE_NARC_ENABLED));
public boolean isEnabled(Configuration configuration) {
return Boolean.valueOf(configuration.getProperty(GeneralOption.CODE_NARC_ENABLED));
}

@Override
public CodeNarcProcessor create(Configuration aConfiguration) {
return new CodeNarcProcessor(aConfiguration);
public CodeNarcProcessor create(Configuration configuration) {
return new CodeNarcProcessor(configuration);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
public class FindbugsReviewProcessorFactory implements ReviewProcessorFactory<FindBugsProcessor> {

@Override
public boolean isEnabled(Configuration aConfiguration) {
return Boolean.valueOf(aConfiguration.getProperty(GeneralOption.FINDBUGS_ENABLED));
public boolean isEnabled(Configuration configuration) {
return Boolean.valueOf(configuration.getProperty(GeneralOption.FINDBUGS_ENABLED));
}

@Override
public FindBugsProcessor create(Configuration aConfiguration) {
return new FindBugsProcessor(aConfiguration);
public FindBugsProcessor create(Configuration configuration) {
return new FindBugsProcessor(configuration);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
public class JsHintReviewProcessorFactory implements ReviewProcessorFactory<JsHintProcessor> {

@Override
public boolean isEnabled(Configuration aConfiguration) {
return Boolean.valueOf(aConfiguration.getProperty(GeneralOption.JSHINT_ENABLED));
public boolean isEnabled(Configuration configuration) {
return Boolean.valueOf(configuration.getProperty(GeneralOption.JSHINT_ENABLED));
}

@Override
public JsHintProcessor create(Configuration aConfiguration) {
return new JsHintProcessor(aConfiguration);
public JsHintProcessor create(Configuration configuration) {
return new JsHintProcessor(configuration);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
public class JsLintReviewProcessorFactory implements ReviewProcessorFactory<JsLintProcessor> {

@Override
public boolean isEnabled(Configuration aConfiguration) {
return Boolean.valueOf(aConfiguration.getProperty(GeneralOption.JSLINT_ENABLED));
public boolean isEnabled(Configuration configuration) {
return Boolean.valueOf(configuration.getProperty(GeneralOption.JSLINT_ENABLED));
}

@Override
public JsLintProcessor create(Configuration aConfiguration) {
return new JsLintProcessor(aConfiguration);
public JsLintProcessor create(Configuration configuration) {
return new JsLintProcessor(configuration);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
public class PmdReviewProcessorFactory implements ReviewProcessorFactory<PmdProcessor> {

@Override
public boolean isEnabled(Configuration aConfiguration) {
return Boolean.valueOf(aConfiguration.getProperty(GeneralOption.PMD_ENABLED));
public boolean isEnabled(Configuration configuration) {
return Boolean.valueOf(configuration.getProperty(GeneralOption.PMD_ENABLED));
}

@Override
public PmdProcessor create(Configuration aConfiguration) {
return new PmdProcessor(aConfiguration);
public PmdProcessor create(Configuration configuration) {
return new PmdProcessor(configuration);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
public class ScalastyleReviewProcessorFactory implements ReviewProcessorFactory<ScalastyleProcessor> {

@Override
public boolean isEnabled(Configuration aConfiguration) {
return Boolean.valueOf(aConfiguration.getProperty(GeneralOption.SCALASTYLE_ENABLED));
public boolean isEnabled(Configuration configuration) {
return Boolean.valueOf(configuration.getProperty(GeneralOption.SCALASTYLE_ENABLED));
}

@Override
public ScalastyleProcessor create(Configuration aConfiguration) {
return new ScalastyleProcessor(aConfiguration);
public ScalastyleProcessor create(Configuration configuration) {
return new ScalastyleProcessor(configuration);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
public class SonarReviewProcessorFactory implements ReviewProcessorFactory<SonarProcessor> {

@Override
public boolean isEnabled(Configuration aConfiguration) {
return Boolean.valueOf(aConfiguration.getProperty(GeneralOption.SONAR_ENABLED));
public boolean isEnabled(Configuration configuration) {
return Boolean.valueOf(configuration.getProperty(GeneralOption.SONAR_ENABLED));
}

@Override
public SonarProcessor create(Configuration aConfiguration) {
return new SonarProcessor(aConfiguration);
public SonarProcessor create(Configuration configuration) {
return new SonarProcessor(configuration);
}
}

0 comments on commit 8b41fce

Please sign in to comment.