提交 31cd525a 编写于 作者: K kohsuke

retroweaver didn't support Class.cast() but retrotranslator does.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@2009 71c3de6d-444a-0410-be80-ed276b4c234a
上级 ac7b10b2
......@@ -38,13 +38,9 @@ public abstract class Actionable extends AbstractModelObject {
}
public <T extends Action> T getAction(Class<T> 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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册