diff --git a/designer-base/src/com/fr/design/mainframe/DesignerFrameFileDealerPane.java b/designer-base/src/com/fr/design/mainframe/DesignerFrameFileDealerPane.java index c35e7e359..fddf359c5 100644 --- a/designer-base/src/com/fr/design/mainframe/DesignerFrameFileDealerPane.java +++ b/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; @@ -81,11 +81,15 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt selectedOperation.refresh(); } - + public static final DesignerFrameFileDealerPane getInstance() { - + if (THIS == null) { - THIS = new DesignerFrameFileDealerPane(); + synchronized (DesignerFrameFileDealerPane.class) { + if (THIS == null) { + THIS = new DesignerFrameFileDealerPane(); + } + } } return THIS; } diff --git a/designer-base/src/com/fr/design/mainframe/EastRegionContainerPane.java b/designer-base/src/com/fr/design/mainframe/EastRegionContainerPane.java index ef8729ddc..0adf8785c 100644 --- a/designer-base/src/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/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 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")); diff --git a/designer-realize/src/com/fr/design/mainframe/CellElementPropertyPane.java b/designer-realize/src/com/fr/design/mainframe/CellElementPropertyPane.java index 68b1134f7..f87ff4a83 100644 --- a/designer-realize/src/com/fr/design/mainframe/CellElementPropertyPane.java +++ b/designer-realize/src/com/fr/design/mainframe/CellElementPropertyPane.java @@ -65,16 +65,20 @@ 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;