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

RenderingHints.Key() is problematic to subclass and causes serious applet bugs

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 1.4.0
    • 1.2.2, 1.3.0
    • client-libs
    • None
    • 2d
    • beta
    • generic
    • generic

      RenderingHints.Key() keeps it's own list of used Identity values, but
      gives users no way of figuring out which values are used and which aren't
      other than to try to construct one and catch the exception.

      This is particularly serious when working with applets. JAI creates
      4 or 5 RnederingHint.Keys when it's loaded. If the JAI class gets loaded twice (which happens if a user hits the reload button), JAI tries to register the hints a second time. This throws an ExceptioninInitializerError which prevents the JAI class from being loaded (effectively killing any applet using JAI). Ideally, we could query the RenderingHints.Key
      class to find out if the JAI hints were already registered and access them if
      they were, but the table is private so we can't get at it. As it is we
      may have to either generate random Identity values which is ugly because the hint identities will vary in different runs (and between a server and a client without some sort of negotiation).

      What we need is:
      RenderingHints.Key.isIdentityUsed() and
      RenderingHints.Key.getKeyByIdentity()

      Alternatively, a null RenderingHints() constructor would allow us to create
      a RenderingHintsJAI class that managed its own ID's. In any event,
      we need this addressed in order to ever get JAI running in an applet.

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: