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

(fc) Remove dead code in sun.nio.ch.FileChannelImpl::implCloseChannel

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 21
    • 21
    • core-libs
    • b16
    • generic
    • generic

      The method implCloseChannel contains an if-block

              if (parent != null) {
                  // [...]
              } else if (closer != null) {
                  // [...]
              } else {
                  // [...]
              }

      but the closer and parent instance variables are final and closer is non-null if and only if parent is null, hence the else branch is unreachable.

            bpb Brian Burkhalter
            bpb Brian Burkhalter
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: