From 593f01332aa85e17907d8cd0ac7eb36fb7c979fd Mon Sep 17 00:00:00 2001 From: kohsuke Date: Thu, 11 Nov 2010 07:59:28 +0000 Subject: [PATCH] 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 --- core/src/main/java/hudson/model/queue/Executables.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/model/queue/Executables.java b/core/src/main/java/hudson/model/queue/Executables.java index d3a7319e8d..e8533ad5e9 100644 --- a/core/src/main/java/hudson/model/queue/Executables.java +++ b/core/src/main/java/hudson/model/queue/Executables.java @@ -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) {