Fix memory leak by removing non-functional PropertyChangeListener
[idea/community.git] / platform / lang-impl / src / com / intellij / profile / codeInspection / ui / SingleInspectionProfilePanel.java
index 72d18b5e5c1891434d9428d3cde110c1186d1f28..e2c8abe2e6c332c75d9424c53e47bb46ac7faa6f 100644 (file)
@@ -244,20 +244,7 @@ public class SingleInspectionProfilePanel extends JPanel {
         configPanelAnchor.add(additionalConfigPanel);
       }
       else {
-        final JScrollPane pane = ScrollPaneFactory.createScrollPane(additionalConfigPanel, SideBorder.NONE);
-        FocusManager.getCurrentManager().addPropertyChangeListener("focusOwner", new PropertyChangeListener() {
-          @Override
-          public void propertyChange(PropertyChangeEvent evt) {
-            if (!(evt.getNewValue() instanceof JComponent)) {
-              return;
-            }
-            final JComponent component = (JComponent)evt.getNewValue();
-            if (component.isAncestorOf(pane)) {
-              pane.scrollRectToVisible(component.getBounds());
-            }
-          }
-        });
-        configPanelAnchor.add(pane);
+        configPanelAnchor.add(ScrollPaneFactory.createScrollPane(additionalConfigPanel, SideBorder.NONE));
       }
     }
     UIUtil.setEnabled(configPanelAnchor, state.isEnabled(), true);