Skip to content

Commit d67a38c

Browse files
committed
Fix checkstyle / formatting
1 parent 214b5b0 commit d67a38c

File tree

9 files changed

+788
-804
lines changed

9 files changed

+788
-804
lines changed

net.sourceforge.pmd.eclipse.plugin/src/main/java/net/sourceforge/pmd/eclipse/runtime/cmd/BaseVisitor.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
import org.eclipse.ui.IWorkingSet;
4848
import org.eclipse.ui.ResourceWorkingSetFilter;
4949

50-
import name.herlin.command.Timer;
5150
import net.sourceforge.pmd.PMD;
5251
import net.sourceforge.pmd.PMDConfiguration;
5352
import net.sourceforge.pmd.PMDException;
@@ -79,6 +78,8 @@
7978
import net.sourceforge.pmd.util.datasource.DataSource;
8079
import net.sourceforge.pmd.util.datasource.ReaderDataSource;
8180

81+
import name.herlin.command.Timer;
82+
8283
/**
8384
* Factor some useful features for visitors
8485
*
@@ -224,7 +225,7 @@ public RuleSets getRuleSets() {
224225
* @return
225226
*/
226227
public RuleSet getRuleSet() {
227-
return this.ruleSets.getAllRuleSets()[0];
228+
return this.ruleSets.getAllRuleSets()[0];
228229
}
229230

230231
/**
@@ -234,7 +235,7 @@ public RuleSet getRuleSet() {
234235
* @param ruleSet
235236
*/
236237
public void setRuleSet(RuleSet ruleSet) {
237-
this.ruleSets = new RuleSets(ruleSet);
238+
this.ruleSets = new RuleSets(ruleSet);
238239
}
239240

240241
/**

net.sourceforge.pmd.eclipse.plugin/src/main/java/net/sourceforge/pmd/eclipse/runtime/cmd/ReviewCodeCmd.java

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@
7171
import org.eclipse.ui.IWorkbenchWindow;
7272
import org.eclipse.ui.PlatformUI;
7373

74-
import name.herlin.command.CommandException;
75-
import name.herlin.command.Timer;
7674
import net.sourceforge.pmd.Rule;
7775
import net.sourceforge.pmd.RuleSet;
7876
import net.sourceforge.pmd.RuleSets;
@@ -85,6 +83,8 @@
8583
import net.sourceforge.pmd.eclipse.ui.actions.RuleSetUtil;
8684
import net.sourceforge.pmd.util.StringUtil;
8785

86+
import name.herlin.command.CommandException;
87+
import name.herlin.command.Timer;
8888

8989
/**
9090
* This command executes the PMD engine on a specified resource
@@ -615,33 +615,33 @@ private void processResourceDelta() throws CommandException {
615615

616616
RuleSets ruleSets = properties.getProjectRuleSets();
617617

618-
// PMDEngine pmdEngine = getPmdEngineForProject(project);
619-
int targetCount = countDeltaElement(resourceDelta);
620-
// Could add a property that lets us set the max number to analyze
621-
if (properties.isFullBuildEnabled() || isUserInitiated() || targetCount <= MAXIMUM_RESOURCE_COUNT) {
622-
setStepCount(targetCount);
623-
LOG.debug("Visiting delta of resource " + resource.getName() + " : " + getStepCount());
624-
625-
DeltaVisitor visitor = new DeltaVisitor();
626-
visitor.setMonitor(getMonitor());
627-
visitor.setRuleSets(ruleSets);
628-
// visitor.setPmdEngine(pmdEngine);
629-
visitor.setAccumulator(markersByFile);
630-
visitor.setUseTaskMarker(taskMarker);
631-
visitor.setProjectProperties(properties);
632-
resourceDelta.accept(visitor);
633-
634-
ruleCount = ruleSets.getAllRules().size();
635-
fileCount += visitor.getProcessedFilesCount();
636-
pmdDuration += visitor.getActualPmdDuration();
637-
} else {
638-
String message = "Skipping resourceDelta " + resource.getName()
639-
+ " because of fullBuildEnabled flag and " + "targetCount is " + targetCount
640-
+ ". This is more than " + MAXIMUM_RESOURCE_COUNT + "."
641-
+ " If you want to execute PMD, please check \"Full build enabled\" in the project settings";
642-
PMDPlugin.getDefault().logInformation(message);
643-
LOG.debug(message);
644-
}
618+
// PMDEngine pmdEngine = getPmdEngineForProject(project);
619+
int targetCount = countDeltaElement(resourceDelta);
620+
// Could add a property that lets us set the max number to analyze
621+
if (properties.isFullBuildEnabled() || isUserInitiated() || targetCount <= MAXIMUM_RESOURCE_COUNT) {
622+
setStepCount(targetCount);
623+
LOG.debug("Visiting delta of resource " + resource.getName() + " : " + getStepCount());
624+
625+
DeltaVisitor visitor = new DeltaVisitor();
626+
visitor.setMonitor(getMonitor());
627+
visitor.setRuleSets(ruleSets);
628+
// visitor.setPmdEngine(pmdEngine);
629+
visitor.setAccumulator(markersByFile);
630+
visitor.setUseTaskMarker(taskMarker);
631+
visitor.setProjectProperties(properties);
632+
resourceDelta.accept(visitor);
633+
634+
ruleCount = ruleSets.getAllRules().size();
635+
fileCount += visitor.getProcessedFilesCount();
636+
pmdDuration += visitor.getActualPmdDuration();
637+
} else {
638+
String message = "Skipping resourceDelta " + resource.getName()
639+
+ " because of fullBuildEnabled flag and " + "targetCount is " + targetCount
640+
+ ". This is more than " + MAXIMUM_RESOURCE_COUNT + "."
641+
+ " If you want to execute PMD, please check \"Full build enabled\" in the project settings";
642+
PMDPlugin.getDefault().logInformation(message);
643+
LOG.debug(message);
644+
}
645645
} catch (PropertiesException e) {
646646
throw new CommandException(e);
647647
} catch (CoreException e) {

net.sourceforge.pmd.eclipse.plugin/src/main/java/net/sourceforge/pmd/eclipse/runtime/preferences/impl/PreferencesManagerImpl.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -641,16 +641,14 @@ private void updateConfiguredProjects(RuleSet updatedRuleSet) {
641641
RuleSets projectRuleSet = properties.getProjectRuleSets();
642642
RuleSets newProjectRuleSet = new RuleSets();
643643
if (projectRuleSet != null) {
644-
projectRuleSet.getAllRules().addAll(getNewRules(updatedRuleSet));
645-
for(RuleSet rs : projectRuleSet.getAllRuleSets()) {
646-
rs = RuleSetUtil.setExcludePatterns(rs,
647-
updatedRuleSet.getExcludePatterns());
648-
rs = RuleSetUtil.setIncludePatterns(rs,
649-
updatedRuleSet.getIncludePatterns());
650-
newProjectRuleSet.addRuleSet(rs);
651-
}
652-
properties.setProjectRuleSets(newProjectRuleSet);
653-
properties.sync();
644+
projectRuleSet.getAllRules().addAll(getNewRules(updatedRuleSet));
645+
for (RuleSet rs : projectRuleSet.getAllRuleSets()) {
646+
RuleSet modified = RuleSetUtil.setExcludePatterns(rs, updatedRuleSet.getExcludePatterns());
647+
modified = RuleSetUtil.setIncludePatterns(modified, updatedRuleSet.getIncludePatterns());
648+
newProjectRuleSet.addRuleSet(modified);
649+
}
650+
properties.setProjectRuleSets(newProjectRuleSet);
651+
properties.sync();
654652
}
655653
} catch (PropertiesException e) {
656654
PMDPlugin.getDefault().logError("Unable to add new rules for project: " + project, e);

0 commit comments

Comments
 (0)