Browse Source

REPORT-40458 【回归】设计器重启以后会卡住,面板除了菜单栏其他都动不了

【问题原因】editingTemplate没有判空,当时自己测试发现是不会出现null情况的,这个问题是因为安装了一个新引擎插件后,插件那边某个方法可能会在setCurrentEditingTemplate之前,调用checkCombineUp方法,此时getCurrentEditingTemplate会拿到null值,然后出现npe
【改动思路】增加判空
feature/big-screen
Yvan 4 years ago
parent
commit
0336b6a964
  1. 1
      designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java
  2. 2
      designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPasswordFieldWithFixedLength.java
  3. 8
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java
  4. 1
      designer-form/src/main/java/com/fr/design/mainframe/TopXCreators.java

1
designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java

@ -8,6 +8,7 @@ import com.fr.design.border.UITitledBorder;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ipasswordfield.UIPassWordField;
import com.fr.design.gui.ipasswordfield.UIPasswordFieldWithFixedLength;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.gui.ilable.ActionLabel;

2
designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPasswordFieldWithFixedLength.java

@ -77,7 +77,7 @@ public class UIPasswordFieldWithFixedLength extends UIPassWordField {
if (clearPassword) {
UIPasswordFieldWithFixedLength.this.setText(StringUtils.EMPTY);
UIPasswordFieldWithFixedLength.this.clearPassword = false;
UIPasswordFieldWithFixedLength.this.updateUI();
//UIPasswordFieldWithFixedLength.this.updateUI();
}
}
});

8
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java

@ -746,10 +746,12 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
*/
public void checkCombineUp(boolean flag, ArrayList<String> al) {
//Yvan: 检查当前是否为WORK_SHEET状态,因为只有WORK_SHEET中含有格式刷组件,此时是不需要进行checkComponentsByNames的
if (HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getMenuState() == DesignState.WORK_SHEET) {
return;
JTemplate<?, ?> jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (jTemplate != null) {
if (jTemplate.getMenuState() != DesignState.WORK_SHEET) {
combineUp.checkComponentsByNames(flag, al);
}
}
combineUp.checkComponentsByNames(flag, al);
}
/**

1
designer-form/src/main/java/com/fr/design/mainframe/TopXCreators.java

@ -78,5 +78,6 @@ public class TopXCreators extends JComponent {
TopXCreator topXCreator = (TopXCreator) getComponent(i);
topXCreator.resizeTopXCreator();
}
//repaint();
}
}

Loading…
Cancel
Save