Browse Source

线程安全问题

master
zack 7 years ago
parent
commit
ed6a4965c0
  1. 8
      designer-base/src/com/fr/design/mainframe/DesignerFrameFileDealerPane.java
  2. 12
      designer-base/src/com/fr/design/mainframe/EastRegionContainerPane.java
  3. 8
      designer-realize/src/com/fr/design/mainframe/CellElementPropertyPane.java

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

@ -53,7 +53,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
private static final String FILE = "file";
private static DesignerFrameFileDealerPane THIS;
private static volatile DesignerFrameFileDealerPane THIS;
private CardLayout card;
@ -85,7 +85,11 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
public static final DesignerFrameFileDealerPane getInstance() {
if (THIS == null) {
THIS = new DesignerFrameFileDealerPane();
synchronized (DesignerFrameFileDealerPane.class) {
if (THIS == null) {
THIS = new DesignerFrameFileDealerPane();
}
}
}
return THIS;
}

12
designer-base/src/com/fr/design/mainframe/EastRegionContainerPane.java

@ -30,7 +30,7 @@ import java.util.Map;
import java.util.Set;
public class EastRegionContainerPane extends UIEastResizableContainer {
private static EastRegionContainerPane THIS;
private static volatile EastRegionContainerPane THIS;
private Map<String, PropertyItem> propertyItemMap;
private CardLayout propertyCard;
private JPanel leftPane;
@ -84,13 +84,17 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
*/
public static EastRegionContainerPane getInstance() {
if (THIS == null) {
THIS = new EastRegionContainerPane();
THIS.setLastContainerWidth(DesignerEnvManager.getEnvManager().getLastEastRegionContainerWidth());
synchronized (EastRegionContainerPane.class) {
if (THIS == null) {
THIS = new EastRegionContainerPane();
THIS.setLastContainerWidth(DesignerEnvManager.getEnvManager().getLastEastRegionContainerWidth());
}
}
}
return THIS;
}
public EastRegionContainerPane() {
private EastRegionContainerPane() {
super();
initPropertyItemList();
defaultPane = getDefaultPane(Inter.getLocText("FR-Designer_No_Settings_Available"));

8
designer-realize/src/com/fr/design/mainframe/CellElementPropertyPane.java

@ -69,12 +69,16 @@ public class CellElementPropertyPane extends DockingView {
public synchronized static CellElementPropertyPane getInstance() {
if (singleton == null) {
singleton = new CellElementPropertyPane();
synchronized (CellElementPropertyPane.class) {
if (singleton == null) {
singleton = new CellElementPropertyPane();
}
}
}
return singleton;
}
private static CellElementPropertyPane singleton;
private static volatile CellElementPropertyPane singleton;
private CellElementEditPane cellElementEditPane;

Loading…
Cancel
Save