(fs) Remove dead code from UnixUserDefinedFileAttributeView.write(...)

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Withdrawn
    • Priority: P4
    • None
    • Affects Version/s: None
    • Component/s: core-libs
    • None

      While discussing JDK-8264110, we came to the conclusion that ByteBuffers are either DirectByteBuffers or HeapByteBuffers [1]. ByteBuffer has a package-private constructor and might be a candidate for sealed classes eventually.

      In other words: If we can be sure not to deal with a DirectByteBuffer, we can assert to have a HeapByteBuffer which always has a backing array. Therefore the distinction in [2] is superfluous and can be removed (or get replaced by a corresponding `assert`).

      [1]: https://github.com/openjdk/jdk/pull/3217#discussion_r602733761
      [2]: https://github.com/openjdk/jdk/blob/4e74de4b2eec611b49ee8defae1ab06351280008/src/java.base/unix/classes/sun/nio/fs/UnixUserDefinedFileAttributeView.java#L247-L258

            Assignee:
            Unassigned
            Reporter:
            Sebastian Stenzel
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: