455 }
456
457 @Override
458 public boolean equals(Object obj) {
459 if (this == obj) {
460 return true;
461 }
462 if (obj instanceof ProcessHandleImpl) {
463 ProcessHandleImpl other = (ProcessHandleImpl) obj;
464 return (pid == other.pid) &&
465 (startTime == other.startTime
466 || startTime == 0
467 || other.startTime == 0);
468 }
469 return false;
470 }
471
472 /**
473 * Implementation of ProcessHandle.Info.
474 * Information snapshot about a process.
475 * The attributes of a process vary by operating system and not available
476 * in all implementations. Additionally, information about other processes
477 * is limited by the operating system privileges of the process making the request.
478 * If a value is not available, either a {@code null} or {@code -1} is stored.
479 * The accessor methods return {@code null} if the value is not available.
480 */
481 static class Info implements ProcessHandle.Info {
482 static {
483 initIDs();
484 }
485
486 /**
487 * Initialization of JNI fieldIDs.
488 */
489 private static native void initIDs();
490
491 /**
492 * Fill in this Info instance with information about the native process.
493 * If values are not available the native code does not modify the field.
494 * @param pid of the native process
495 */
|
455 }
456
457 @Override
458 public boolean equals(Object obj) {
459 if (this == obj) {
460 return true;
461 }
462 if (obj instanceof ProcessHandleImpl) {
463 ProcessHandleImpl other = (ProcessHandleImpl) obj;
464 return (pid == other.pid) &&
465 (startTime == other.startTime
466 || startTime == 0
467 || other.startTime == 0);
468 }
469 return false;
470 }
471
472 /**
473 * Implementation of ProcessHandle.Info.
474 * Information snapshot about a process.
475 * The attributes of a process vary by operating system and are not available
476 * in all implementations. Additionally, information about other processes
477 * is limited by the operating system privileges of the process making the request.
478 * If a value is not available, either a {@code null} or {@code -1} is stored.
479 * The accessor methods return {@code null} if the value is not available.
480 */
481 static class Info implements ProcessHandle.Info {
482 static {
483 initIDs();
484 }
485
486 /**
487 * Initialization of JNI fieldIDs.
488 */
489 private static native void initIDs();
490
491 /**
492 * Fill in this Info instance with information about the native process.
493 * If values are not available the native code does not modify the field.
494 * @param pid of the native process
495 */
|