(fs) Needless instanceof check in RegistryFileTypeDetector

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P5
    • 20
    • Affects Version/s: None
    • Component/s: core-libs
    • b11

      Type of file parameter is known to be Path. And instanceof only checks if it's null or not.

       public String implProbeContentType(Path file) throws IOException {
           if (!(file instanceof Path))
               return null;

      Before implProbeContentType method is called, parameter is checked for null in sun.nio.fs.AbstractFileTypeDetector#probeContentType. It means null check is redundant too.

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

              Created:
              Updated:
              Resolved: