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

SystemFlavorMap getNativesForFlavor() not always returning correct mappings

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.1
    • 1.4.0, 1.4.1
    • client-libs
    • hopper
    • x86
    • windows_98, windows_xp
    • Verified

      SystemFlavorMap getNativesForFlavor() not always returning correct mappings.

      After verifying recently integrated bug 4493178, the Clipboard suite AddNative stress test is still failing on Win32 platform only.

      The AddNative stress test does the following:


      - Aquires all existing DataFlavors from the SystemFlavorMap.
      - For each of these DataFlavors, the test will create a new DataFlavor by slightly modifying the MIME type of the existing DataFlavor. For example,
      Original MimeType: "text/plain; class=java.io.Reader; charset=Unicode"
      Modified MimeType: "text/plain-TEST; class=java.io.Reader; charset=Unicode"
      - Then using addUnencodedNativeForFlavor() method, establish new mapping(s) using the same set of String natives used by the existing DataFlavor. So in most cases addUnencodedNativeForFlavor() will be called many times.
      - The test will then request back the mappings with getNativesForFlavor() method and compare to the original set(Array).

      The test is failing in 2 cases:

      1) Tests involving "text/html" DataFlavors
      With these DataFlavors, the "HTML Format" string native appears to not get assigned with addUnencodedNativeForFlavor().

      2) Tests involving "text/uri-list" DataFlavors
      With these DataFlavors, the order is not preserved from the returned natives from getNativesForFlavor().

      Below is sample output for these test cases:

      **** Original DataFlavor: text/html; class=java.io.InputStream; charset=Cp1252
      **** Modified DataFlavor: text/html-test; class=java.io.InputStream; charset=Cp1252
      ****
      ****
      **** TEST FAILS


      **** Printing original set of mappings

      *** Printing all String Natives
      *** Size = 4

      HTML Format
      UNICODE TEXT
      TEXT
      UniformResourceLocator


      **** Printing newly assigned mappings from SystemFlavorMap

      *** Printing all String Natives
      *** Size = 3

      UNICODE TEXT
      TEXT
      UniformResourceLocator

      ---------------------------------
      **** Original DataFlavor: text/uri-list; class=java.io.Reader; charset=Unicode
      **** Modified DataFlavor: text/uri-list-test; class=java.io.Reader; charset=Unicode
      ****
      ****
      **** TEST FAILS


      **** Printing original set of mappings

      *** Printing all String Natives
      *** Size = 3

      UniformResourceLocator
      UNICODE TEXT
      TEXT

      **** Printing newly assigned mappings from SystemFlavorMap

      *** Printing all String Natives
      *** Size = 3

      UNICODE TEXT
      TEXT
      UniformResourceLocator

      ----
      Steps to reproduce:
      ------------------
      The test case AddNative.java is attached to the bug report. It just needs to be compiled and run. The test generates a lot of output so it is convenient to redirect to a file.

      java AddNative >myoutput

      The test output will indicate a pass or fail for each DataFlavor. In most cases, the test will fail for many of the DataFlavors.

      Other information:
      -----------------
      - This bug was tested with build 1.4.0-beta_refresh-b81
      - The bug occurs only on Win32 platform.
      _________________________________
      The status of this bug is integrated fix. However, it still happens in Hopper B13. Verified failed.

      ###@###.### 2002-05-31
      -----------------------------------
      This bug is definitely verified.

      The test case needs to be modified in the Clipboard Test suite. You can file a bug
      against that if you want.

      Thanx and regards
      Kanishk

      ###@###.### 2002-06-03
      -------------------------------------------

            dassunw Das Das (Inactive)
            rreynagasunw Rick Reynaga (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: