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 202681
Collapse All | Expand All

(-)a/cnd.source/src/org/netbeans/modules/cnd/source/CppEditorSupport.java (+1 lines)
Lines 128-133 Link Here
128
     */
128
     */
129
    public CppEditorSupport(SourceDataObject obj, Node nodeDelegate) {
129
    public CppEditorSupport(SourceDataObject obj, Node nodeDelegate) {
130
        super(obj, null, new Environment(obj));
130
        super(obj, null, new Environment(obj));
131
        new Exception("For " + obj).printStackTrace();
131
        this.ic = obj.getInstanceContent();
132
        this.ic = obj.getInstanceContent();
132
        if (nodeDelegate != null) {
133
        if (nodeDelegate != null) {
133
            this.ic.add(nodeDelegate);
134
            this.ic.add(nodeDelegate);
(-)a/cnd.source/src/org/netbeans/modules/cnd/source/CppEditorSupportProvider.java (-15 / +8 lines)
Lines 71-95 Link Here
71
    }
71
    }
72
72
73
    static class CppEditorSupportFactory implements Convertor<SourceDataObject, CppEditorSupport> {
73
    static class CppEditorSupportFactory implements Convertor<SourceDataObject, CppEditorSupport> {
74
        // FIXUP for IZ 202681, if we do not keep a reference to CppEditorSupport it will
75
        // be released and a new instance will be created due to MultiView peer deserialization
76
        private final Map<DataObject, CppEditorSupport> cache = new WeakHashMap<DataObject, CppEditorSupport>();
77
                
78
        public CppEditorSupportFactory() {
74
        public CppEditorSupportFactory() {
79
        }
75
        }
80
76
81
        @Override
77
        @Override
82
        public synchronized CppEditorSupport convert(SourceDataObject obj) {
78
        public synchronized CppEditorSupport convert(SourceDataObject obj) {
83
            CppEditorSupport res = cache.get(obj);
79
            if (obj.es != null) {
84
            if (res == null) {
80
                return obj.es;
85
                Node nodeDelegate = null;
86
                if (obj.isValid()) {
87
                    nodeDelegate = obj.getNodeDelegate();
88
                }
89
                res = new CppEditorSupport(obj, nodeDelegate);
90
                cache.put(obj, res);
91
            }
81
            }
92
            return res;
82
            Node nodeDelegate = null;
83
            if (obj.isValid()) {
84
                nodeDelegate = obj.getNodeDelegate();
85
            }
86
            return obj.es = new CppEditorSupport(obj, nodeDelegate);
93
        }
87
        }
94
88
95
        @Override
89
        @Override
Lines 107-114 Link Here
107
            return id(obj);
101
            return id(obj);
108
        }
102
        }
109
103
110
        private synchronized void notifyClosed(DataObject dobj) {
104
        private void notifyClosed(DataObject dobj) {
111
            cache.remove(dobj);
112
        }
105
        }
113
    }
106
    }
114
107
(-)a/cnd.source/src/org/netbeans/modules/cnd/source/SourceDataObject.java (+1 lines)
Lines 69-74 Link Here
69
    static final long serialVersionUID = -6788084224129713370L;
69
    static final long serialVersionUID = -6788084224129713370L;
70
    private InstanceContent ic;
70
    private InstanceContent ic;
71
    private Lookup myLookup;
71
    private Lookup myLookup;
72
    CppEditorSupport es;
72
73
73
74
74
    public SourceDataObject(FileObject pf, MultiFileLoader loader) throws DataObjectExistsException {
75
    public SourceDataObject(FileObject pf, MultiFileLoader loader) throws DataObjectExistsException {

Return to bug 202681