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

(jrtfs) Unnecessary null check in JrtPath.getAttributes

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P5 P5
    • 21
    • None
    • tools
    • b05

      jdk.internal.jrtfs.JrtFileSystem#getFileAttributes never return 'null'. But in JrtPath.getAttributes its result is checked for null:

          final JrtFileAttributes getAttributes(LinkOption... options) throws IOException {
              JrtFileAttributes zfas = jrtfs.getFileAttributes(this, options);
              if (zfas == null) {
                  throw new NoSuchFileException(toString());
              }
              return zfas;
          }

      We can simplify and speed up code a bit.

            aturbanov Andrey Turbanov
            aturbanov Andrey Turbanov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: