Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Retaining backward compatibility since this already went into a release.

  • Loading branch information...
commit 0f08dc0cb5dd2a87f877a4ad4e07b1d5685c2de4 1 parent 08f2804
Kohsuke Kawaguchi authored
18  core/src/main/java/hudson/model/TransientBuildActionFactory.java
@@ -5,6 +5,7 @@
5 5
 import hudson.ExtensionPoint;
6 6
 import jenkins.model.Jenkins;
7 7
 import java.util.Collection;
  8
+import java.util.Collections;
8 9
 
9 10
 /**
10 11
  * Extension point for inserting transient {@link Action}s into {@link Run}s.
@@ -20,10 +21,23 @@
20 21
     /**
21 22
      * Creates actions for the given build.
22 23
      *
23  
-     * @param Build for which the action objects are requested. Never null.
  24
+     * @param target for which the action objects are requested. Never null.
24 25
      * @return Can be empty but must not be null.
25 26
      */
26  
-    public abstract Collection<? extends Action> createFor(Run target);
  27
+    public Collection<? extends Action> createFor(Run target) {
  28
+        if (target instanceof AbstractBuild)
  29
+            return createFor((AbstractBuild)target);
  30
+        else
  31
+            return Collections.emptyList();
  32
+    }
  33
+
  34
+    /**
  35
+     * @deprecated as of 1.461
  36
+     *      Override and call {@link #createFor(Run)} instead.
  37
+     */
  38
+    public Collection<? extends Action> createFor(AbstractBuild target) {
  39
+        return Collections.emptyList();
  40
+    }
27 41
 
28 42
     /**
29 43
      * Returns all the registered {@link TransientBuildActionFactory}s.

0 notes on commit 0f08dc0

Please sign in to comment.
Something went wrong with that request. Please try again.