diff --git a/core/src/main/java/hudson/model/Actionable.java b/core/src/main/java/hudson/model/Actionable.java index 0b82207fd147f63650275ddb3bf9a8fa702bfb26..ac40307e0c1c0b013df2f51e8fcc8fa5295a51b5 100644 --- a/core/src/main/java/hudson/model/Actionable.java +++ b/core/src/main/java/hudson/model/Actionable.java @@ -38,13 +38,9 @@ public abstract class Actionable extends AbstractModelObject { } public T getAction(Class type) { - for (Action a : getActions()) { - if (type.isInstance(a)) { - @SuppressWarnings("unchecked") // type.cast() not available in JDK 1.4; XXX doesn't retro* emulate it? - T _a = (T) a; - return _a; - } - } + for (Action a : getActions()) + if (type.isInstance(a)) + return type.cast(a); return null; }