Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Piggott2011-03-08 22:16:47 +0000
committerMatthew Piggott2011-03-08 22:16:47 +0000
commit8fb0d7d4b8744ee65822a473f1c60c064c1c2921 (patch)
tree22b294e40932f22450f7a34f6ec1f7e977623695 /org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/exclude
parentc411ed9d8a1767b830174ce2f2f09a32a40e1892 (diff)
downloadm2e-core-8fb0d7d4b8744ee65822a473f1c60c064c1c2921.tar.gz
m2e-core-8fb0d7d4b8744ee65822a473f1c60c064c1c2921.tar.xz
m2e-core-8fb0d7d4b8744ee65822a473f1c60c064c1c2921.zip
bug 337565 - Remove Dependency when operating on descendants
Diffstat (limited to 'org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/exclude')
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/exclude/ExcludeArtifactRefactoring.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/exclude/ExcludeArtifactRefactoring.java b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/exclude/ExcludeArtifactRefactoring.java
index 4e84a93a..4ed428aa 100644
--- a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/exclude/ExcludeArtifactRefactoring.java
+++ b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/exclude/ExcludeArtifactRefactoring.java
@@ -141,13 +141,12 @@ public class ExcludeArtifactRefactoring extends Refactoring {
// Below exclusion point - pull up dependency to exclusion point
for(MavenProject project : getDescendants()) {
visitor = locate(project, monitor.newChild(1));
+ List<Operation> operations = new ArrayList<Operation>();
for(Entry<Dependency, Set<ArtifactKey>> entry : visitor.getSourceMap().entrySet()) {
locatedKeys.addAll(entry.getValue());
Dependency dependency = entry.getKey();
- if(contains(entry.getValue(), dependency)) {
- changes.add(PomHelper.createChange(getFile(project), new RemoveDependencyOperation(dependency),
- NLS.bind(Messages.ExcludeArtifactRefactoring_removeDependency, toString(dependency))));
- } else {
+ operations.add(new RemoveDependencyOperation(dependency));
+ if(!contains(entry.getValue(), dependency)) {
CompositeChange change = new CompositeChange(Messages.ExcludeArtifactRefactoring_moveDependency);
change.add(PomHelper.createChange(getFile(project), new RemoveDependencyOperation(dependency),
NLS.bind(Messages.ExcludeArtifactRefactoring_removeDependency, toString(dependency))));
@@ -157,6 +156,10 @@ public class ExcludeArtifactRefactoring extends Refactoring {
}
}
}
+ if(operations.size() > 0) {
+ changes.add(PomHelper.createChange(getFile(project),
+ new CompoundOperation(operations.toArray(new Operation[operations.size()])), "Exclude Artifact"));
+ }
}
// Above exclusion - Add dep to exclusionPoint

Back to the top