Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 104869 Details for
Bug 182935
[implementation] SynchronizedDocument should use lock object when accessing line tracker
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Fix
patch.txt (text/plain), 5.51 KB, created by
Dani Megert
on 2008-06-13 10:45:22 EDT
(
hide
)
Description:
Fix
Filename:
MIME Type:
Creator:
Dani Megert
Created:
2008-06-13 10:45:22 EDT
Size:
5.51 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.core.filebuffers >Index: src/org/eclipse/core/internal/filebuffers/SynchronizableDocument.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/SynchronizableDocument.java,v >retrieving revision 1.4 >diff -u -r1.4 SynchronizableDocument.java >--- src/org/eclipse/core/internal/filebuffers/SynchronizableDocument.java 21 Mar 2008 07:37:22 -0000 1.4 >+++ src/org/eclipse/core/internal/filebuffers/SynchronizableDocument.java 13 Jun 2008 14:43:11 -0000 >@@ -11,9 +11,14 @@ > package org.eclipse.core.internal.filebuffers; > > import org.eclipse.jface.text.BadLocationException; >+import org.eclipse.jface.text.BadPartitioningException; > import org.eclipse.jface.text.BadPositionCategoryException; > import org.eclipse.jface.text.Document; >+import org.eclipse.jface.text.DocumentRewriteSession; >+import org.eclipse.jface.text.DocumentRewriteSessionType; >+import org.eclipse.jface.text.IRegion; > import org.eclipse.jface.text.ISynchronizable; >+import org.eclipse.jface.text.ITypedRegion; > import org.eclipse.jface.text.Position; > > >@@ -70,6 +75,37 @@ > super.stopSequentialRewrite(); > } > } >+ >+ /* >+ * @see org.eclipse.jface.text.AbstractDocument#startRewriteSession(org.eclipse.jface.text.DocumentRewriteSessionType) >+ * >+ * @since 3.5 >+ */ >+ public DocumentRewriteSession startRewriteSession(DocumentRewriteSessionType sessionType) { >+ Object lockObject= getLockObject(); >+ if (lockObject == null) { >+ return super.startRewriteSession(sessionType); >+ } >+ synchronized (lockObject) { >+ return super.startRewriteSession(sessionType); >+ } >+ } >+ >+ /* >+ * @see org.eclipse.jface.text.AbstractDocument#stopRewriteSession(org.eclipse.jface.text.DocumentRewriteSession) >+ * >+ * @since 3.5 >+ */ >+ public void stopRewriteSession(DocumentRewriteSession session) { >+ Object lockObject= getLockObject(); >+ if (lockObject == null) { >+ super.stopRewriteSession(session); >+ return; >+ } >+ synchronized (lockObject) { >+ super.stopRewriteSession(session); >+ } >+ } > > /* > * @see IDocument#get() >@@ -235,4 +271,123 @@ > } > } > >+ /* >+ * @see org.eclipse.jface.text.AbstractDocument#computePartitioning(java.lang.String, int, int, boolean) >+ * >+ * @since 3.5 >+ */ >+ public ITypedRegion[] computePartitioning(String partitioning, int offset, int length, boolean includeZeroLengthPartitions) throws BadLocationException, BadPartitioningException { >+ Object lockObject= getLockObject(); >+ if (lockObject == null) { >+ return super.computePartitioning(partitioning, offset, length, includeZeroLengthPartitions); >+ } >+ synchronized (lockObject) { >+ return super.computePartitioning(partitioning, offset, length, includeZeroLengthPartitions); >+ } >+ } >+ >+ /* >+ * @see org.eclipse.jface.text.AbstractDocument#getLineDelimiter(int) >+ * >+ * @since 3.5 >+ */ >+ public String getLineDelimiter(int line) throws BadLocationException { >+ Object lockObject= getLockObject(); >+ if (lockObject == null) { >+ return super.getLineDelimiter(line); >+ } >+ synchronized (lockObject) { >+ return super.getLineDelimiter(line); >+ } >+ } >+ >+ /* >+ * @see org.eclipse.jface.text.AbstractDocument#getDefaultLineDelimiter() >+ * >+ * @since 3.5 >+ */ >+ public String getDefaultLineDelimiter() { >+ Object lockObject= getLockObject(); >+ if (lockObject == null) { >+ return super.getDefaultLineDelimiter(); >+ } >+ synchronized (lockObject) { >+ return super.getDefaultLineDelimiter(); >+ } >+ } >+ >+ /* >+ * @see org.eclipse.jface.text.AbstractDocument#getLineInformation(int) >+ * >+ * @since 3.5 >+ */ >+ public IRegion getLineInformation(int line) throws BadLocationException { >+ Object lockObject= getLockObject(); >+ if (lockObject == null) { >+ return super.getLineInformation(line); >+ } >+ synchronized (lockObject) { >+ return super.getLineInformation(line); >+ } >+ } >+ >+ /* >+ * @see org.eclipse.jface.text.AbstractDocument#getLineInformationOfOffset(int) >+ * >+ * @since 3.5 >+ */ >+ public IRegion getLineInformationOfOffset(int offset) throws BadLocationException { >+ Object lockObject= getLockObject(); >+ if (lockObject == null) { >+ return super.getLineInformationOfOffset(offset); >+ } >+ synchronized (lockObject) { >+ return super.getLineInformationOfOffset(offset); >+ } >+ } >+ >+ /* >+ * @see org.eclipse.jface.text.AbstractDocument#getLineLength(int) >+ * >+ * @since 3.5 >+ */ >+ public int getLineLength(int line) throws BadLocationException { >+ Object lockObject= getLockObject(); >+ if (lockObject == null) { >+ return super.getLineLength(line); >+ } >+ synchronized (lockObject) { >+ return super.getLineLength(line); >+ } >+ } >+ >+ /* >+ * @see org.eclipse.jface.text.AbstractDocument#getLineOffset(int) >+ * >+ * @since 3.5 >+ */ >+ public int getLineOffset(int line) throws BadLocationException { >+ Object lockObject= getLockObject(); >+ if (lockObject == null) { >+ return super.getLineOffset(line); >+ } >+ synchronized (lockObject) { >+ return super.getLineOffset(line); >+ } >+ } >+ >+ /* >+ * @see org.eclipse.jface.text.AbstractDocument#getLineOfOffset(int) >+ * >+ * @since 3.5 >+ */ >+ public int getLineOfOffset(int pos) throws BadLocationException { >+ Object lockObject= getLockObject(); >+ if (lockObject == null) { >+ return super.getLineOfOffset(pos); >+ } >+ synchronized (lockObject) { >+ return super.getLineOfOffset(pos); >+ } >+ } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 182935
: 104869