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

JDesktopPane's remove(Component) should check componentOrderCheckingEnabled

    XMLWordPrintable

Details

    Description

      FULL PRODUCT VERSION :
      java version "1.7.0_40"
      Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
      Java HotSpot(TM) Client VM (build 24.0-b56, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.1.7601]

      A DESCRIPTION OF THE PROBLEM :
      With update 40, the following code was added to JDesktopPane:

          @Override
          public void remove(Component comp) {
              super.remove(comp);
              updateFramesCache();
          }

      I think I understand why it was added, but I believe it is not correct. It should not call updateFramesCache if the property componentOrderCheckingEnabled is set to false. This is how it works the JDesktopPanes other add and remove methods:

      remove(int)
      removeAll()
      addImpl(...)

      This is causing an issue in our MDI application when the user hits ctrl-F6 to go to the next frame. We subclass the DefaultDesktopManager and in our activeFrame code, we have code that eventually calls JDesktopPane's remove(Component method. This code reorders the "framesCache" which means Ctrl-F6 does not visit all frames.



      REGRESSION. Last worked in version 7u25

      ADDITIONAL REGRESSION INFORMATION:
      The problem was introduced in update 40 and is still there in update 45.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Using highly customized application so difficult to reproduce in standalone code.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Do not call updateFramesCache() unless the property componentOrderCheckingEnabled is false.
      ACTUAL -
      Calling updateFramesCache() even when the property componentOrderCheckingEnabled is false.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      I would love to give you a small sample application demonstrating this, but we have special handling in our MDI application so it is difficult to do. If you really need it, then i can spend more time trying to create one. My first attempts were not successful.
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Override the JDesktopPane's remove(Component) method and copy the Containers code into it. This is very ugly.

      Attachments

        Issue Links

          Activity

            People

              psadhukhan Prasanta Sadhukhan
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: