Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8272780

ServerNotifForwarder.removeNotificationListener() incorrect exception handling

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P5 P5
    • 24
    • 18
    • core-svc
    • None


      Reported on serviceability-dev:
      https://mail.openjdk.java.net/pipermail/serviceability-dev/2021-August/038964.html


      jdk/src/java.management/share/classes/com/sun/jmx/remote/internal/ServerNotifForwarder.java

      ..contains a method: removeNotificationListener(ObjectName name, Integer[] listenerIDs)

      ..which looks like it intends to keep the first Exception thrown, and throw that after the loop, but not to stop the loop attempting all removeNotificationListener() calls.

      So it would make sense to assign the caught Exception to re, only if re IS null, but the condition looks wrong, so currently this method never throws an Exception. It has been like this forever.

            kevinw Kevin Walls
            kevinw Kevin Walls
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: