提交 593f0133 编写于 作者: K kohsuke

class might not be public even when a method can be.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@36833 71c3de6d-444a-0410-be80-ed276b4c234a
上级 ca61e0e1
......@@ -26,6 +26,7 @@ package hudson.model.queue;
import hudson.model.Queue.Executable;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
/**
* Convenience methods around {@link Executable}.
......@@ -41,7 +42,9 @@ public class Executables {
return _getParentOf(e);
} catch (AbstractMethodError _) {
try {
return (SubTask)e.getClass().getMethod("getParent").invoke(e);
Method m = e.getClass().getMethod("getParent");
m.setAccessible(true);
return (SubTask) m.invoke(e);
} catch (IllegalAccessException x) {
throw (Error)new IllegalAccessError().initCause(x);
} catch (NoSuchMethodException x) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册