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

(-)org/openide/text/PositionRef.java (-6 / +7 lines)
Lines 132-138 Link Here
132
    public Position getPosition() throws IOException {
132
    public Position getPosition() throws IOException {
133
        if (manager.getCloneableEditorSupport ().getDocument() == null)
133
        if (manager.getCloneableEditorSupport ().getDocument() == null)
134
            manager.getCloneableEditorSupport ().openDocument ();
134
            manager.getCloneableEditorSupport ().openDocument ();
135
        synchronized (manager.getCloneableEditorSupport ().getLock ()) {
135
        //synchronized (manager.getCloneableEditorSupport ().getLock ()) {
136
        synchronized(manager) {
136
            Manager.PositionKind p = (Manager.PositionKind)kind;
137
            Manager.PositionKind p = (Manager.PositionKind)kind;
137
            return p.pos;
138
            return p.pos;
138
        }
139
        }
Lines 232-238 Link Here
232
233
233
        /** Converts all positions into document one.
234
        /** Converts all positions into document one.
234
        */
235
        */
235
        void documentOpened (StyledDocument doc) {
236
        synchronized void documentOpened (StyledDocument doc) {
236
            this.doc = doc;
237
            this.doc = doc;
237
238
238
            ListIterator it = positions.listIterator();
239
            ListIterator it = positions.listIterator();
Lines 250-256 Link Here
250
        /** Closes the document and switch all positionRefs to the offset (int)
251
        /** Closes the document and switch all positionRefs to the offset (int)
251
        * holding status (Position objects willbe forgotten.
252
        * holding status (Position objects willbe forgotten.
252
        */
253
        */
253
        void documentClosed () {
254
        synchronized void documentClosed () {
254
            Iterator it = ((Collection)positions.clone ()).iterator();
255
            Iterator it = ((Collection)positions.clone ()).iterator();
255
            while (it.hasNext()) {
256
            while (it.hasNext()) {
256
                WeakReference ref = (WeakReference) it.next();
257
                WeakReference ref = (WeakReference) it.next();
Lines 266-273 Link Here
266
        }
267
        }
267
268
268
        /** Adds the position to this manager. */
269
        /** Adds the position to this manager. */
269
        Kind addPosition(PositionRef pos) {
270
        synchronized Kind addPosition(PositionRef pos) {
270
            synchronized (getCloneableEditorSupport ().getLock ()) {
271
            //synchronized (getCloneableEditorSupport ().getLock ()) {
271
                positions.add(new WeakReference(pos));
272
                positions.add(new WeakReference(pos));
272
273
273
                if (doc != null) {
274
                if (doc != null) {
Lines 276-282 Link Here
276
                    return pos.kind;
277
                    return pos.kind;
277
                }
278
                }
278
279
279
            }
280
            //}
280
        }
281
        }
281
282
282
        //
283
        //

Return to bug 12557