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

(fs) Needless instanceof check in RegistryFileTypeDetector

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P5
    • 20
    • None
    • core-libs
    • b11

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: