[FIXED HUDSON-6779] When a MavenModuleSetBuild is deleted, delete its contained

module builds too.. this avoids orphaned module builds that then get looked at
in determining the overall result for the prior ModuleSetBuild.. possibly
mysteriously changing the displayed result for that prior build, with no visual
indication as to why (this part just fixed in r32410.. build page will now list
all module builds, so you can see/delete the orphaned module build).


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@32411 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
mindless committed 2010-07-01 02:05:00 +00:00
1 parent 5ce25186a1
commit 09ffe933d1
2 files changed
+27 -6

No files matched your search

@@ -1,7 +1,8 @@
/*
* The MIT License
*
* Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Red Hat, Inc., Victor Glushenkov
* Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi,
* Red Hat, Inc., Victor Glushenkov, Alan Harder
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -236,6 +237,15 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
return r;
}
@Override
public synchronized void delete() throws IOException {
super.delete();
// Delete all contained module builds too
for (List<MavenBuild> list : getModuleBuilds().values())
for (MavenBuild build : list)
build.delete();
}
@Override
public Object getDynamic(String token, StaplerRequest req, StaplerResponse rsp) {
// map corresponding module build under this object
@@ -248,6 +258,8 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
/**
* Computes the latest module builds that correspond to this build.
* (when indivudual modules are built, a new ModuleSetBuild is not created,
* but rather the new module build falls under the previous ModuleSetBuild)
*/
public Map<MavenModule,MavenBuild> getModuleLastBuilds() {
Collection<MavenModule> mods = getParent().getModules();