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

javadoc for getContentType doesn't match actual behavior

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.0fcs
    • alpha
    • other-libs
    • None
    • 1.0fcs
    • generic
    • solaris_2.6
    • Verified

        FileDataSource:
        Javadoc for getContentType():
            /**
             * This method returns the MIME type of the data in the for of a
             * string. The semantics of this call are to first search the
             * per instance MIME Types registry and then check the system default
             * registry returning the result of the first successful query.
             *
             * @return the MIME Type
             */

        Actually, this lies. The per instance FileTypeMap if any, is queried, and the result
        returned. There's no code that falls through to the system default registry when a
        instance regitry is provided. In fact,
        the api for FileTypeMap.getContentType doesn't encompass the idea of an 'unsucsessful'
        query, since it returns 'application/octet-stream' when no mapping is available.

        I assume that it's the documentation that should be corrected.

        (While your're at it, note: "...in the for of a string.")

              duke J. Duke
              duke J. Duke
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: