Browse Source

Merge pull request #11337 in DESIGN/design from release/11.0 to bugfix/11.0

* commit '9639c881cab3954e434aa59f0a6a9c52157428c1':
  REPORT-83628 数据脱敏配置功能存在整段文本,但key被拆分为多部分组合,需要调整——设计器部分 【问题原因】国际组同学提的bug 【改动思路】按照国际组同学的要求,拆分key以方便翻译 【review建议】
  Revert "KERNEL-12978 fix: 适配CBB改动"
  REPORT-80693 数据脱敏远程设计下的性能问题 漏了代码,补充下
  REPORT-80693 数据脱敏远程设计下的性能问题 变量名写错了,改一下
  REPORT-80693 数据脱敏远程设计下的性能问题 【问题原因】rt 【改动思路】再改一版远程下的性能问题 1. 之前的SwingWorker提前到父容器页面,只查询一次数据库,此后面板与子面板均复用 2. 增加Loading页面,避免卡UI的误会 3. 修改规则管理器DesensitizationRuleManager中的接口方法,倒逼调用者使用一次性的查询;以及相应调用接口方法适配 【review建议】
  REPORT-89249 fix: 设计器启动FineAnalyzer需要注入Instrumentation
bugfix/11.0
superman 2 years ago
parent
commit
315b06e02b
  1. 3
      designer-base/src/main/java/com/fr/design/actions/file/LocalePane.java
  2. 3
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  3. 2
      designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java
  4. 14
      designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java
  5. 6
      designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleEditPane.java
  6. 11
      designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRulePane.java
  7. 78
      designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java
  8. 97
      designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTablePane.java
  9. 3
      designer-base/src/main/java/com/fr/design/record/analyzer/DesignerAnalyzerActivator.java
  10. 2
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/DesensitizationCellPane.java

3
designer-base/src/main/java/com/fr/design/actions/file/LocalePane.java

@ -12,7 +12,6 @@ import com.fr.design.gui.itextfield.UITextField;
import com.fr.file.filetree.FileNode;
import com.fr.general.GeneralUtils;
import com.fr.general.Inter;
import com.fr.locale.InterProviderFactory;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils;
@ -122,7 +121,7 @@ public class LocalePane extends BasicPane {
private void initPredefinedProperties() {
Map<Locale, String> supportLocaleMap = Inter.getSupportLocaleMap();
Map<Locale, String> supportLocaleMap = InterProviderFactory.getProvider().getSupportLocaleMap();
// richie:暂时去掉设计器中国际化键值对的显示
Map<String, String> map = new HashMap<>();

3
designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java

@ -46,6 +46,7 @@ import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.general.log.Log4jConfig;
import com.fr.io.attr.ImageExportAttr;
import com.fr.locale.InterProviderFactory;
import com.fr.log.FineLoggerFactory;
import com.fr.report.ReportConfigManager;
import com.fr.stable.Constants;
@ -633,7 +634,7 @@ public class PreferencePane extends BasicPane {
}
private UIDictionaryComboBox<Locale> createLanguageComboBox() {
Map<Locale, String> map = Inter.getSupportLocaleMap();
Map<Locale, String> map = InterProviderFactory.getProvider().getSupportLocaleMap();
int size = map.size();
Locale[] keys = new Locale[size];
String[] values = new String[size];

2
designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java

@ -83,7 +83,7 @@ public class TableDataPreviewDesensitizeManager implements DesensitizationManage
Collection<TableDataDesensitizationItem> desensitizationItems = ((DesensitizationTableData) tableData).getDesensitizationConfig().getDesensitizationItems();
if (DesentizationUtils.isCollectionNotEmpty(desensitizationItems)) {
// 更新规则
desensitizationItems = TableDataDesensitizeManager.getInstance().dealWithLastedRules(desensitizationItems);
desensitizationItems = TableDataDesensitizeManager.getInstance().dealWithlatestRules(desensitizationItems);
// 对脱敏配置项集合做过滤和排序处理
List<TableDataDesensitizationItem> items = desensitizationItems.stream()
.filter(item -> isAvaliableItem4Preview(item, model))

14
designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java

@ -28,6 +28,7 @@ import java.awt.Component;
import java.awt.event.ActionEvent;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
@ -48,7 +49,10 @@ public class DesensitizationRuleChoosePane extends JPanel {
private DesensitizationRuleSource currentRuleSource;
public DesensitizationRuleChoosePane() {
private Map<DesensitizationRuleSource, Map<String, DesensitizationRule>> latestRules;
public DesensitizationRuleChoosePane(Map<DesensitizationRuleSource, Map<String, DesensitizationRule>> latestRules) {
this.latestRules = latestRules;
this.cardLayout = new CardLayout();
this.setLayout(cardLayout);
serverRuleEditPane = new UITableEditorPane<>(new DesensitizationRuleChooseTableModel(this, true));
@ -76,8 +80,8 @@ public class DesensitizationRuleChoosePane extends JPanel {
* 展示当前规则
*/
private void populateDesensitizationRules() {
serverRuleEditPane.populate(DesensitizationRuleManager.getInstance().getRules(DesensitizationRuleSource.SERVER));
customRuleEditPane.populate(DesensitizationRuleManager.getInstance().getRules(DesensitizationRuleSource.CUSTOM));
serverRuleEditPane.populate(latestRules.get(DesensitizationRuleSource.SERVER).values().toArray(new DesensitizationRule[0]));
customRuleEditPane.populate(latestRules.get(DesensitizationRuleSource.CUSTOM).values().toArray(new DesensitizationRule[0]));
}
/**
@ -143,7 +147,7 @@ public class DesensitizationRuleChoosePane extends JPanel {
return DesensitizationRule.getDescription(rule);
case 3:
// 脱敏规则状态
DesensitizationRuleStatus ruleStatus = DesensitizationRuleManager.getInstance().getRuleStatus(rule);
DesensitizationRuleStatus ruleStatus = DesensitizationRuleManager.getInstance().getRuleStatus(rule, latestRules);
// 非正常状态需要标记为异常
return ruleStatus == DesensitizationRuleStatus.NORMAL ? StringUtils.EMPTY : Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Status_Abnormal");
default:
@ -192,7 +196,7 @@ public class DesensitizationRuleChoosePane extends JPanel {
* @param rule
*/
public void refreshRuleStatus(DesensitizationRule rule) {
DesensitizationRuleStatus ruleStatus = DesensitizationRuleManager.getInstance().getRuleStatus(rule);
DesensitizationRuleStatus ruleStatus = DesensitizationRuleManager.getInstance().getRuleStatus(rule, latestRules);
if (ruleStatus == DesensitizationRuleStatus.NORMAL) {
// 正常规则时,重置提示Label
this.ruleStatusLabel.setText(StringUtils.EMPTY);

6
designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleEditPane.java

@ -159,15 +159,15 @@ public class DesensitizationRuleEditPane extends BasicBeanPane<DesensitizationRu
ruleConditionPane = new JPanel(cardLayout);
// 字符替换
JPanel characterReplacePane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
UILabel retainFrontLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Desensitization_Retain_Front") + StringUtils.BLANK);
UILabel retainFrontLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Desensitization_Part_One") + StringUtils.BLANK);
retainFrontTextField = new UINumberField(5);
retainFrontTextField.addFocusListener(retainFrontListener);
UILabel retainBackLabel = new UILabel(StringUtils.BLANK + Toolkit.i18nText("Fine-Design_Report_Desensitization_Count_And_Back") + StringUtils.BLANK);
UILabel retainBackLabel = new UILabel(StringUtils.BLANK + Toolkit.i18nText("Fine-Design_Report_Desensitization_Part_Two") + StringUtils.BLANK);
retainBackTextField = new UINumberField(5);
retainBackTextField.addFocusListener(retainBackListener);
UILabel replaceLabel = new UILabel(StringUtils.BLANK + Toolkit.i18nText("Fine-Design_Report_Desensitization_Count_And_Other_Character_Replace_By") + StringUtils.BLANK);
UILabel replaceLabel = new UILabel(StringUtils.BLANK + Toolkit.i18nText("Fine-Design_Report_Desensitization_Part_Three") + StringUtils.BLANK);
firstSymbolTextField = new UITextField(10);
firstSymbolTextField.addFocusListener(firstSymbolListener);

11
designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRulePane.java

@ -9,6 +9,7 @@ import com.fr.design.layout.FRGUIPaneFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.util.Map;
/**
* 脱敏规则展示页
@ -29,13 +30,19 @@ public class DesensitizationRulePane extends BasicBeanPane<DesensitizationRule>
*/
private DesensitizationRuleChoosePane ruleChoosePane;
/**
* 最新的所有规则
*/
private Map<DesensitizationRuleSource, Map<String, DesensitizationRule>> latestRules;
/**
* 内容面板
*/
private JPanel contentPane;
public DesensitizationRulePane() {
public DesensitizationRulePane(Map<DesensitizationRuleSource, Map<String, DesensitizationRule>> latestRules) {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.latestRules = latestRules;
initPane();
}
@ -47,7 +54,7 @@ public class DesensitizationRulePane extends BasicBeanPane<DesensitizationRule>
// 规则来源选择Pane
ruleSourceChoosePane = new DesensitizationRuleSourceChoosePane(this);
// 规则选择Pane
ruleChoosePane = new DesensitizationRuleChoosePane();
ruleChoosePane = new DesensitizationRuleChoosePane(latestRules);
contentPane.add(ruleSourceChoosePane, BorderLayout.NORTH);
contentPane.add(ruleChoosePane, BorderLayout.CENTER);
}

78
designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java

@ -4,8 +4,8 @@ import com.fr.data.desensitize.base.DesensitizationTableData;
import com.fr.data.desensitize.base.TableDataDesensitizationItem;
import com.fr.data.desensitize.rule.DesensitizationRuleManager;
import com.fr.data.desensitize.rule.base.DesensitizationRule;
import com.fr.data.desensitize.rule.base.DesensitizationRuleSource;
import com.fr.data.desensitize.rule.base.DesensitizationRuleStatus;
import com.fr.design.data.datapane.preview.desensitization.TableDataPreviewDesensitizeManager;
import com.fr.design.data.datapane.preview.desensitization.view.rule.DesensitizationRulePane;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
@ -20,7 +20,6 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import org.jetbrains.annotations.Nullable;
@ -29,7 +28,6 @@ import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.SwingUtilities;
import javax.swing.SwingWorker;
import javax.swing.event.CellEditorListener;
import javax.swing.event.ChangeEvent;
import javax.swing.table.TableCellEditor;
@ -72,11 +70,16 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter<Tabl
/**
* key为用户组唯一标识id拼接value为用户组名称
*/
private final Map<String, String> roleMap = new LinkedHashMap<>();
private Map<String, String> roleMap = new LinkedHashMap<>();
/**
* 当前最新的所有规则
*/
private Map<DesensitizationRuleSource, Map<String, DesensitizationRule>> latestRules = new LinkedHashMap<>();
private Component parent;
public TableDataDesensitizationTableModel(DesensitizationTableData tableData, Component parent) {
public TableDataDesensitizationTableModel(DesensitizationTableData tableData, Component parent, List<String> columnNames, Map<String, String> roleMap, Map<DesensitizationRuleSource, Map<String, DesensitizationRule>> latestRules) {
// table相关
super(new String[]{
Toolkit.i18nText("Fine-Design_Report_Desensitization_Column"),
@ -86,6 +89,17 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter<Tabl
Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Status"),
});
this.parent = parent;
this.columnNames = columnNames;
this.roleMap = roleMap;
this.latestRules = latestRules;
initTable();
}
/**
* 初始化Table
*/
private void initTable() {
this.setColumnClass(new Class[]{
// 列名选择
ColumnNamesComboBox.class,
@ -108,31 +122,6 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter<Tabl
this.setDefaultRenderer(DesensitizationRuleStatusPane.class, new DesensitizationRuleStatusPane());
this.createTable().getColumnModel().getColumn(TableSequences.DesensitizationRuleStatus.getNum()).setMaxWidth(60);
new SwingWorker<Void, Void>() {
@Override
protected Void doInBackground() throws Exception {
// 获取当前数据集的所有列名
columnNames.addAll(TableDataPreviewDesensitizeManager.getInstance().getColumnNamesByTableData(tableData));
// 获取当前所有用户组
roleMap.putAll(TableDataPreviewDesensitizeManager.getInstance().getAllRoles());
return null;
}
@Override
protected void done() {
try {
// 更新列名选择框和生效用户组选择框
columnNamesComboBox.refresh();
effectedRolesChooser.refresh();
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e, "[Desensitization] get column names or all roles failed for {}", e.getMessage());
}
}
}.execute();
}
@Override
@ -231,14 +220,6 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter<Tabl
});
}
/**
* 查询到数据集列名后更新到下拉框中
*/
public void refresh() {
columnNameComboBox.refreshBoxItems(columnNames);
}
@Override
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
columnNameComboBox.setSelectedItem(getList().get(row).getColumnName());
@ -269,14 +250,14 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter<Tabl
private ActionListener chooseRuleListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
DesensitizationRulePane rulePane = new DesensitizationRulePane();
DesensitizationRulePane rulePane = new DesensitizationRulePane(latestRules);
TableDataDesensitizationItem desensitizationItem = getCurrentSelectBean();
int selectedRow = table.getSelectedRow();
BasicDialog ruleDialog = rulePane.showWindowWithCustomSize(SwingUtilities.getWindowAncestor(parent), new DialogActionAdapter() {
@Override
public void doOk() {
DesensitizationRule rule = rulePane.updateBean();
if (Objects.nonNull(desensitizationItem) && Objects.nonNull(rule)) {
if (Objects.nonNull(desensitizationItem) && DesensitizationRule.valid(rule)) {
desensitizationItem.setRule(rule);
desensitizationItem.setRuleName(rule.getRuleName());
// 刷新规则名称、描述、状态
@ -356,7 +337,7 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter<Tabl
private UIComboCheckBox rolesCheckBox;
EffectedRolesChooser() {
this.rolesCheckBox = new UIComboCheckBox(new String[]{}, true) {
this.rolesCheckBox = new UIComboCheckBox(roleMap.values().toArray(), true) {
@Override
protected void setLayoutAndAddComponents() {
// 使用BorderLayout,否则默认使用的FlowLayout会让整个下拉选框使用最小Size,然后TableCell这边会出现空白
@ -390,13 +371,6 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter<Tabl
});
}
/**
* 查询到所有用户组后更新到下拉框中
*/
public void refresh() {
rolesCheckBox.refreshCombo(roleMap.values().toArray());
}
@Override
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
rolesCheckBox.setSelectedValues(generateRolesCheckBoxSelectedValues(getList().get(row)));
@ -469,7 +443,7 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter<Tabl
DesensitizationRule rule = currentItem.getRule();
if (needMarkRule(rule)) {
// 非正常规则,根据规则状态展示不同提示文字
DesensitizationRuleStatus ruleStatus = DesensitizationRuleManager.getInstance().getRuleStatus(rule);
DesensitizationRuleStatus ruleStatus = DesensitizationRuleManager.getInstance().getRuleStatus(rule, latestRules);
this.ruleStatusLabel.setText(Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Status_Abnormal"));
this.ruleStatusLabel.setToolTipText(ruleStatus.getDescription());
} else {
@ -542,13 +516,13 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter<Tabl
Iterator<TableDataDesensitizationItem> iterator = items.iterator();
while (iterator.hasNext()) {
TableDataDesensitizationItem item = iterator.next();
DesensitizationRuleStatus ruleStatus = DesensitizationRuleManager.getInstance().getRuleStatus(item.getRule());
DesensitizationRuleStatus ruleStatus = DesensitizationRuleManager.getInstance().getRuleStatus(item.getRule(), latestRules);
if (ruleStatus == DesensitizationRuleStatus.REMOVED) {
// 规则被移除,则删除整条脱敏Item
iterator.remove();
} else {
// 规则被修改、禁用等,更新一下规则
item.setRule(DesensitizationRuleManager.getInstance().getLastedDesentizationRule(item.getRule()));
item.setRule(DesensitizationRuleManager.getInstance().getLastedDesentizationRule(item.getRule(), latestRules));
}
}
fireTableDataChanged();
@ -629,7 +603,7 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter<Tabl
*/
private boolean needMarkRule(DesensitizationRule rule) {
return !rule.equals(DesensitizationRule.createDefaultEmptyRule()) &&
DesensitizationRuleManager.getInstance().getRuleStatus(rule) != DesensitizationRuleStatus.NORMAL;
DesensitizationRuleManager.getInstance().getRuleStatus(rule, latestRules) != DesensitizationRuleStatus.NORMAL;
}
}

97
designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTablePane.java

@ -2,13 +2,25 @@ package com.fr.design.data.datapane.preview.desensitization.view.setting;
import com.fr.data.desensitize.base.DesensitizationTableData;
import com.fr.data.desensitize.base.TableDataDesensitizationItem;
import com.fr.data.desensitize.rule.DesensitizationRuleManager;
import com.fr.data.desensitize.rule.base.DesensitizationRule;
import com.fr.data.desensitize.rule.base.DesensitizationRuleSource;
import com.fr.design.data.datapane.preview.desensitization.TableDataPreviewDesensitizeManager;
import com.fr.design.data.tabledata.tabledatapane.loading.TipsPane;
import com.fr.design.gui.itableeditorpane.UITableEditorPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.log.FineLoggerFactory;
import javax.swing.JPanel;
import javax.swing.SwingWorker;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Component;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 脱敏字段设置页面中的Table
@ -34,6 +46,15 @@ public class TableDataDesensitizationTablePane extends JPanel {
*/
private UITableEditorPane<TableDataDesensitizationItem> editorPane;
private static final String LOADING_PANE = "loading";
private static final String CONTENT_PANE = "content";
private CardLayout card;
private JPanel loadingPane;
private JPanel contentPane;
public TableDataDesensitizationTablePane(DesensitizationTableData tableData, Component parent) {
this.tableData = tableData;
this.parent = parent;
@ -41,10 +62,65 @@ public class TableDataDesensitizationTablePane extends JPanel {
}
private void initComponent() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.editorPane = new UITableEditorPane<>(new TableDataDesensitizationTableModel(tableData, parent));
this.editorPane.setHeaderResizing(false);
this.add(editorPane, BorderLayout.CENTER);
card = new CardLayout();
this.setLayout(card);
// 初始化Loading面板
loadingPane = new TipsPane(true);
this.add(LOADING_PANE, loadingPane);
switchTo(LOADING_PANE);
// 在SwingWorker中初始化Content面板并切换
initContent();
}
/**
* 初始化内容面板
* 考虑到远程设计下的性能需要限制查询数据库的次数所以这里查一次之后子面板内复用
*/
private void initContent() {
final List<String> columnNames = new ArrayList<>();
final Map<String, String> roleMap = new LinkedHashMap<>();
final Map<DesensitizationRuleSource, Map<String, DesensitizationRule>> latestRules = new LinkedHashMap<>();
new SwingWorker<Void, Void>() {
@Override
protected Void doInBackground() throws Exception {
// 获取当前数据集的所有列名
columnNames.addAll(TableDataPreviewDesensitizeManager.getInstance().getColumnNamesByTableData(tableData));
// 获取当前所有用户组
roleMap.putAll(TableDataPreviewDesensitizeManager.getInstance().getAllRoles());
// 获取当前最新的所有规则
latestRules.putAll(DesensitizationRuleManager.getInstance().getAllRules());
return null;
}
@Override
protected void done() {
contentPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
editorPane = new UITableEditorPane<>(new TableDataDesensitizationTableModel(tableData, parent, columnNames, roleMap, latestRules));
editorPane.setHeaderResizing(false);
editorPane.populate(tableData.getDesensitizationConfig().getDesensitizationItems().toArray(new TableDataDesensitizationItem[0]));
contentPane.add(editorPane, BorderLayout.CENTER);
add(CONTENT_PANE, contentPane);
switchTo(CONTENT_PANE);
}
}.execute();
}
/**
* 切换面板
*
* @param panelName
*/
public void switchTo(String panelName) {
try {
if (panelName != null) {
card.show(this, panelName);
}
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
/**
@ -54,13 +130,22 @@ public class TableDataDesensitizationTablePane extends JPanel {
*/
public void populateDesensitizationSetting(DesensitizationTableData tableData) {
this.tableData = tableData;
editorPane.populate(tableData.getDesensitizationConfig().getDesensitizationItems().toArray(new TableDataDesensitizationItem[0]));
if (editorPane != null) {
// editorPane的初始化在SwingWorker中完成,这里做个判空
editorPane.populate(tableData.getDesensitizationConfig().getDesensitizationItems().toArray(new TableDataDesensitizationItem[0]));
}
}
/**
* 获取当前对TableData的配置脱敏规则信息
*/
public List<TableDataDesensitizationItem> updateDesensitizationSetting() {
return editorPane.update();
return editorPane == null ?
new ArrayList<>() :
editorPane.update()
.stream()
.filter(item -> TableDataDesensitizationItem.valid(item))
.collect(Collectors.toList());
}
}

3
designer-base/src/main/java/com/fr/design/record/analyzer/DesignerAnalyzerActivator.java

@ -18,6 +18,7 @@ import com.fr.event.Null;
import com.fr.intelli.metrics.Compute;
import com.fr.intelli.record.Focus;
import com.fr.intelli.record.PerformancePoint;
import com.fr.jvm.assist.FineAssist;
import com.fr.module.Activator;
import com.fr.module.extension.Prepare;
import com.fr.record.analyzer.AnalyzerConfiguration;
@ -57,7 +58,7 @@ public class DesignerAnalyzerActivator extends Activator implements Prepare {
List<AnalyzerConfiguration> backwardsConfigurations = findMutableBackwards(AnalyzerKey.KEY);
if (!CollectionUtils.isEmpty(backwardsConfigurations)) {
// 直接初始化,不添加默认值,防止和下面的冲突
FineAnalyzer.initDirectly(basicFactory, backwardsConfigurations.toArray(new AnalyzerConfiguration[0]));
FineAnalyzer.initDirectly(FineAssist.findInstrumentation(), basicFactory, backwardsConfigurations.toArray(new AnalyzerConfiguration[0]));
}
// 等页面完全打开后,再进行 retransform, 别影响了启动速度

2
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/DesensitizationCellPane.java

@ -136,7 +136,7 @@ public class DesensitizationCellPane extends BasicBeanPane {
@Override
public void actionPerformed(ActionEvent e) {
CellDesensitizationBean selectBean = model.getSelectedValue();
DesensitizationRulePane rulePane = new DesensitizationRulePane();
DesensitizationRulePane rulePane = new DesensitizationRulePane(new HashMap<>());
BasicDialog ruleDialog = rulePane.showWindowWithCustomSize(SwingUtilities.getWindowAncestor(parent), new DialogActionAdapter() {
@Override

Loading…
Cancel
Save