This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 124040
Collapse All | Expand All

(-)xml/core/src/org/netbeans/modules/xml/core/wizard/XMLWizardIterator.java (-4 / +8 lines)
Lines 52-57 Link Here
52
import java.io.File;
52
import java.io.File;
53
import java.util.Set;
53
import java.util.Set;
54
import java.io.IOException;
54
import java.io.IOException;
55
import java.lang.ref.Reference;
56
import java.lang.ref.WeakReference;
55
import java.net.URL;
57
import java.net.URL;
56
import java.text.DateFormat;
58
import java.text.DateFormat;
57
import java.util.Date;
59
import java.util.Date;
Lines 110-116 Link Here
110
    
112
    
111
    /** Singleton instance of JavaWizardIterator, should it be ever needed.
113
    /** Singleton instance of JavaWizardIterator, should it be ever needed.
112
     */
114
     */
113
    private static XMLWizardIterator instance;
115
    private static Reference<XMLWizardIterator> instance;
114
116
115
    private transient Map listenersMap = new HashMap(2);
117
    private transient Map listenersMap = new HashMap(2);
116
    private transient String[] beforeSteps;
118
    private transient String[] beforeSteps;
Lines 121-130 Link Here
121
     * for constructing the instance from filesystem.attributes.
123
     * for constructing the instance from filesystem.attributes.
122
     */
124
     */
123
    public static synchronized XMLWizardIterator singleton() {
125
    public static synchronized XMLWizardIterator singleton() {
124
        if (instance == null) {
126
        XMLWizardIterator it = instance == null ? null : instance.get();
125
            instance = new XMLWizardIterator();
127
        if (it == null) {
128
            it = new XMLWizardIterator();
129
            instance = new WeakReference<XMLWizardIterator>(it);
126
        }
130
        }
127
        return instance;
131
        return it;
128
    }
132
    }
129
133
130
    public void initialize(TemplateWizard templateWizard) {
134
    public void initialize(TemplateWizard templateWizard) {

Return to bug 124040