Browse Source

REPORT-74376 clone下map

release/11.0
WeiYanglu 2 years ago
parent
commit
3f7f32e086
  1. 6
      designer-base/src/main/java/com/fr/design/mainframe/simple/SimpleDesignerConfig.java

6
designer-base/src/main/java/com/fr/design/mainframe/simple/SimpleDesignerConfig.java

@ -31,7 +31,7 @@ public class SimpleDesignerConfig implements XMLable {
private String name = ""; private String name = "";
private final Map<String, String> content = new HashMap<>(); private HashMap<String, String> content = new HashMap<>();
public void addAttr(String key, String value) { public void addAttr(String key, String value) {
content.put(key, value); content.put(key, value);
@ -57,7 +57,9 @@ public class SimpleDesignerConfig implements XMLable {
@Override @Override
public Object clone() throws CloneNotSupportedException { public Object clone() throws CloneNotSupportedException {
return super.clone(); SimpleDesignerConfig cloned = (SimpleDesignerConfig) super.clone();
cloned.content = new HashMap<>(content);
return cloned;
} }
public String getName() { public String getName() {

Loading…
Cancel
Save