Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Fix 'instance' being null when creating a new item.
- Loading branch information
1 parent
9a6a9f7
commit 2ce0bde
Showing
3 changed files
with
50 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/main/java/hudson/plugins/release/ReleaseWrapperHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* | ||
*/ | ||
package hudson.plugins.release; | ||
|
||
import hudson.Functions; | ||
import hudson.model.AbstractProject; | ||
import hudson.model.Descriptor; | ||
import hudson.tasks.Builder; | ||
import hudson.tasks.Publisher; | ||
import java.util.LinkedList; | ||
import java.util.List; | ||
|
||
/** | ||
* Helper class | ||
*/ | ||
public class ReleaseWrapperHelper | ||
{ | ||
/** Retrieve a list of all build steps including publishers and builders | ||
* | ||
* @param project The project | ||
* @return A list of descriptor's for both publishers and builders | ||
*/ | ||
static public List<Descriptor> getBuildSteps(AbstractProject<?,?> project) | ||
{ | ||
List<Descriptor<Publisher>> publishers = Functions.getPublisherDescriptors(project); | ||
List<Descriptor<Builder>> builders = Functions.getBuilderDescriptors(project); | ||
|
||
List<Descriptor> descriptors = new LinkedList<Descriptor>(); | ||
descriptors.addAll(publishers); | ||
descriptors.addAll(builders); | ||
|
||
return descriptors; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters