Hi All,

Please review a cleanup of the code where wrong assertion is used when Component is an instance of BasicInternalFrameTitlePane.

Now, BasicInternalFrameTitlePane is extended from JComponent and not from JInternalFrame so it will never satisfy the if-else condition if "Component is instanceof BasicInternalFrameTitlePane", so proposed fix is to assert only if the component is not an instance of BasicInternalFrameTitlePane

diff -r d96a607e9594 src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java --- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java Tue Sep 18 18:32:03 2018 -0700 +++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java Thu Oct 04 19:53:10 2018 +0530
@@ -337,7 +337,9 @@
         } else if (comp instanceof JInternalFrame.JDesktopIcon) {
             return ((JInternalFrame.JDesktopIcon)comp).getInternalFrame();
         }
-        assert false : "cannot find the internal frame";
+       if (!(comp instanceof BasicInternalFrameTitlePane)) {
+            assert false : "cannot find the internal frame";
+       }
         return null;
     }

Regards
Prasanta

Reply via email to