remove dangerous instance of double-checked locking
@@ -45,17 +45,13 @@ public class ArrowBuilder {
* Get the panel where all arrows are being drawn.
* @return
*/
- public JPanel getArrowsManagerPanel() {
- if (arrowsManagerPanel == null) {
- synchronized (ArrowBuilder.class) {
+ public synchronized JPanel getArrowsManagerPanel() {
if (arrowsManagerPanel == null) {
arrowsManagerPanel = new JPanel();
arrowsManagerPanel.setVisible(true);
arrowsManagerPanel.setOpaque(false);
arrowsManagerPanel.setLayout(null);
}
- }
- }
return arrowsManagerPanel;
}
