do not try to show "can be final" when it should be hidden (EA-26324 - NPE: VariableInplaceIntroducer.getComponent)

This commit is contained in:
anna
2011-03-25 13:06:44 +01:00
parent a754956157
commit 29d15047e3
2 changed files with 6 additions and 2 deletions
@@ -187,7 +187,9 @@ class InplaceIntroduceParameterPopup extends IntroduceParameterSettingsUI {
final JPanel wrapper = new JPanel(new BorderLayout());
wrapper.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
wrapper.add(myCanBeFinal, BorderLayout.NORTH);
if (myCanBeFinal != null) {
wrapper.add(myCanBeFinal, BorderLayout.NORTH);
}
panel.add(wrapper, BorderLayout.SOUTH);
return panel;
@@ -235,7 +235,9 @@ public class VariableInplaceIntroducer extends VariableInplaceRenamer {
titlePanel.setText(IntroduceVariableBase.REFACTORING_NAME);
panel.add(titlePanel, new GridBagConstraints(0, 0, 1, 1, 1, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
panel.add(myCanBeFinal, new GridBagConstraints(0, 1, 1, 1, 1, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
if (myCanBeFinal != null) {
panel.add(myCanBeFinal, new GridBagConstraints(0, 1, 1, 1, 1, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
}
panel.add(Box.createVerticalBox(), new GridBagConstraints(0, 2, 1, 1, 1, 1, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(0,0,0,0), 0,0));