|
71 | 71 | import org.eclipse.ui.IWorkbenchWindow; |
72 | 72 | import org.eclipse.ui.PlatformUI; |
73 | 73 |
|
74 | | -import name.herlin.command.CommandException; |
75 | | -import name.herlin.command.Timer; |
76 | 74 | import net.sourceforge.pmd.Rule; |
77 | 75 | import net.sourceforge.pmd.RuleSet; |
78 | 76 | import net.sourceforge.pmd.RuleSets; |
|
85 | 83 | import net.sourceforge.pmd.eclipse.ui.actions.RuleSetUtil; |
86 | 84 | import net.sourceforge.pmd.util.StringUtil; |
87 | 85 |
|
| 86 | +import name.herlin.command.CommandException; |
| 87 | +import name.herlin.command.Timer; |
88 | 88 |
|
89 | 89 | /** |
90 | 90 | * This command executes the PMD engine on a specified resource |
@@ -615,33 +615,33 @@ private void processResourceDelta() throws CommandException { |
615 | 615 |
|
616 | 616 | RuleSets ruleSets = properties.getProjectRuleSets(); |
617 | 617 |
|
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 | + } |
645 | 645 | } catch (PropertiesException e) { |
646 | 646 | throw new CommandException(e); |
647 | 647 | } catch (CoreException e) { |
|
0 commit comments