public static int pid(@Nonnull Process proc) {
            try {
                if (JAVA8_PID_FIELD != null) {
                    return JAVA8_PID_FIELD.getInt(proc);
                } else {
                    long pid = (long)JAVA9_PID_METHOD.invoke(proc);
                    if (pid > Integer.MAX_VALUE) {
                        throw new IllegalAccessError("Java 9+ support error (JENKINS-53799). PID is out of Jenkins API bounds: " + pid);
                    }
                    return (int)pid;
                }
            } catch (IllegalAccessException | InvocationTargetException e) { // impossible
                IllegalAccessError x = new IllegalAccessError();
                x.initCause(e);
                throw x;
            }
        }
public static int pid ( @ Nonnull Process proc ) { try { if ( JAVA8_PID_FIELD != null ) { return JAVA8_PID_FIELD . getInt ( proc ) ; } else { long pid = ( long ) JAVA9_PID_METHOD . invoke ( proc ) ; if ( pid > Integer . MAX_VALUE ) { throw new IllegalAccessError ( "Java 9+ support error (JENKINS-53799). PID is out of Jenkins API bounds: " + pid ) ; } return ( int ) pid ; } } catch ( IllegalAccessException | InvocationTargetException e ) { IllegalAccessError x = new IllegalAccessError ( ) ; x . initCause ( e ) ; throw x ; } }
TODO: We ideally need to update ProcessTree APIs to Support Long (JENKINS-53799).