code: public static @Nonnull SubTask getParentOf(@Nonnull Executable e) 
              throws Error, RuntimeException {
          try {
              return e.getParent();
          } catch (AbstractMethodError ignored) { // will fallback to a private implementation
              try {
                  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) {
                  throw (Error)new NoSuchMethodError().initCause(x);
              } catch (InvocationTargetException x) {
                  Throwable y = x.getTargetException();
                  if (y instanceof Error)     throw (Error)y;
                  if (y instanceof RuntimeException)     throw (RuntimeException)y;
                  throw new Error(x);
              }
          }
      }
docs: Due to the return type change in {@link Executable} in 1.377, the caller needs a special precaution now.
  @param e Executable
  @return Discovered subtask