[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [Subclipse-dev] i created a eclipse bug report for something that with the current build doesnt work correctly any more with subclipse

From: jcompagner <jcompagner_at_gmail.com>
Date: Sun, 8 Feb 2009 01:05:56 +0100

Tracked it down (comparing it to CVS)
to this area:

final ICompilationUnit cu= woc.newWorkingCopy(storage.getName(), cpEntries,
getProgressMonitor());
....
cu.getBuffer()

That buffer is returning a different kind in SVN then in CVS

public IBuffer getBuffer() throws JavaModelException {
    if (hasBuffer()) {
        // ensure element is open
        Object info = getElementInfo();
        IBuffer buffer = getBufferManager().getBuffer(this);

with the wrong document

boils down to DocumentAdapter

private void initialize() {
        ITextFileBufferManager manager=
FileBuffers.getTextFileBufferManager();
        try {
            manager.connect(fPath, fLocationKind, new
NullProgressMonitor());
            fTextFileBuffer= manager.getTextFileBuffer(fPath,
fLocationKind);

that manager had for svn different kind of stuff as for cvs:

/
dev.eclipse.org/cvsroot/technology/org.eclipse.dltk/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/core/BufferChangedEvent.java1.2=org.eclipse.core.internal.filebuffers.FileStoreTextFileBuffer_at_daafc0
/org.tigris.subversion.subclipse.core/src/org/tigris/subversion/subclipse/core/SVNStatus.java=org.eclipse.core.internal.filebuffers.ResourceTextFileBuffer_at_9feb4d
/org.tigris.subversion.subclipse.core/src/org/tigris/subversion/subclipse/core/client/OperationManager.java=org.eclipse.core.internal.filebuffers.ResourceTextFileBuffer_at_1061088

So for CVS it has an version number (1.2) and a FileStoreTextFileBuffer
but vor SVN it has no version number anda ResourceTextFileBuffer

and now i am really closer:

this is SVN:
storage FileRevisionEditorInput$2 (id=12542)
    val$charset "Cp1252" (id=418)
    val$storage UIBaseResourceStorage (id=12543)
        baseResource BaseFile (id=12487)
            charset "Cp1252" (id=418)
            localResourceStatus LocalResourceStatus (id=12500)
            resource File (id=12547)

this is CVS:
storage FileRevisionEditorInput$2 (id=12519)
    val$charset "Cp1252" (id=418)
    val$storage CachedResourceVariant$ResourceVariantStorage
(id=12423)
        this$0 RemoteFile (id=12427)
            entry null
            executable false
            fetching false
            name "BufferChangedEvent.java" (id=10898)
            parent RemoteFolder (id=12432)
            storage CachedResourceVariant$ResourceVariantStorage
(id=12423)
            syncBytes (id=12433)
            workspaceSyncState 0

and the call to:

final IPath storagePath= storage.getFullPath();

should return for a remote resource (FileRevisionResource) and different
full path then the normal workspace file.

So i changed BaseResourceStorage.getFullPath() to this:

    public IPath getFullPath() {
        return
baseResource.getPath().append(baseResource.getLastChangedRevision().toString());
    }

and the bug is fixed.

johan

On Sat, Feb 7, 2009 at 23:50, Johan Compagner <jcompagner_at_gmail.com> wrote:

> to me more precise there are 3 of them
>
> Left (file input), Right (FileRevisionEditorInput) and the Ancestor that
> also has a FileRevisionEditorInput
>
> That is all created in TextMergeViewer.updateContent(Object ancestor,
> Object left, Object right)
> And one of the last things is:
>
> if (!isConfigured) {
> configureSourceViewer(fAncestor.getSourceViewer(), false);
> configureSourceViewer(fLeft.getSourceViewer(),
> cc.isLeftEditable() && cp.isLeftEditable(input));
> configureSourceViewer(fRight.getSourceViewer(),
> cc.isRightEditable() && cp.isRightEditable(input));
> isConfigured = true; // configure once
> }
>
> So the first configureSourceViewer is for the ancestor and that call
> causes a setContent(String) on the left (and its dirty state is set)
> because the ancestor has a FileRevisionEditorInput.
>
> its all in this piece of stack: (read from the bottom to the top)
>
> JavaMergeViewer$CompilationUnitEditorAdapter.doSetInput(IEditorInput) line:
> 551 << THAT causes a doSetInput with a FileRevisionEditorInput on the
> CompilationUnitEditorAdapter which is as ar as i know only there for the
> LEFT...
> AbstractTextEditor$19.run(IProgressMonitor) line: 3074
> ModalContext.runInCurrentThread(IRunnableWithProgress, IProgressMonitor)
> line: 464
> ModalContext.run(IRunnableWithProgress, boolean, IProgressMonitor, Display)
> line: 372
> ApplicationWindow$1.run() line: 759
> BusyIndicator.showWhile(Display, Runnable) line: 70
> WorkbenchWindow(ApplicationWindow).run(boolean, boolean,
> IRunnableWithProgress) line: 756
> WorkbenchWindow.run(boolean, boolean, IRunnableWithProgress) line: 2577
> JavaMergeViewer$CompilationUnitEditorAdapter(AbstractTextEditor).internalInit(IWorkbenchWindow,
> IEditorSite, IEditorInput) line: 3092 <<< THIS will trigger a runnable
> JavaMergeViewer$CompilationUnitEditorAdapter(AbstractTextEditor).init(IEditorSite,
> IEditorInput) line: 3119
> JavaMergeViewer.getSourceViewerConfiguration(SourceViewer, IEditorInput)
> line: 281
> JavaMergeViewer.configureTextViewer(TextViewer) line: 210
> JavaMergeViewer(TextMergeViewer).configureSourceViewer(SourceViewer,
> boolean) line: 2869 <<< CONFIGURE is called on the ancestor first
> JavaMergeViewer(TextMergeViewer).updateContent(Object, Object, Object)
> line: 2820 << ALL the left.right and ancestor stuff are created
> JavaMergeViewer(ContentMergeViewer).internalRefresh(Object) line: 737
> JavaMergeViewer(ContentMergeViewer).inputChanged(Object, Object) line:
> 637
> JavaMergeViewer(ContentViewer).setInput(Object) line: 274
> JavaMergeViewer.setInput(Object) line: 150 <<< SET input on the java
> merge viewer with a SynInfoCompareInput$MyDifNode
>
>
>
>
> this is the complete stack until dirty is set:
>
> Thread [main] (Suspended)
> JavaMergeViewer(TextMergeViewer).updateDirtyState(IEditorInput,
> IDocumentProvider, char) line: 3027
> TextMergeViewer.access$12(TextMergeViewer, IEditorInput,
> IDocumentProvider, char) line: 3023
> TextMergeViewer$ContributorInfo.elementDirtyStateChanged(Object,
> boolean) line: 990
>
> TextFileDocumentProvider$FileBufferListener.dirtyStateChanged(IFileBuffer,
> boolean) line: 287
> TextFileBufferManager$3.run() line: 711
> SafeRunner.run(ISafeRunnable) line: 37
>
> ResourceTextFileBufferManager(TextFileBufferManager).fireDirtyStateChanged(IFileBuffer,
> boolean) line: 709
> ResourceTextFileBuffer$DocumentListener.documentChanged(DocumentEvent)
> line: 77
>
> SynchronizableDocument(AbstractDocument).doFireDocumentChanged2(DocumentEvent)
> line: 739
>
> SynchronizableDocument(AbstractDocument).doFireDocumentChanged(DocumentEvent,
> boolean, IRegion) line: 712
>
> SynchronizableDocument(AbstractDocument).doFireDocumentChanged(DocumentEvent)
> line: 697
>
> SynchronizableDocument(AbstractDocument).fireDocumentChanged(DocumentEvent)
> line: 762
> SynchronizableDocument(AbstractDocument).set(String, long) line:
> 1203
> SynchronizableDocument.set(String, long) line: 223
> SynchronizableDocument(AbstractDocument).set(String) line: 1183
> SynchronizableDocument.set(String) line: 209
> DocumentAdapter$DocumentSetCommand.run() line: 127
> DocumentAdapter.run(Runnable) line: 112
> DocumentAdapter.access$1(Runnable) line: 109
> DocumentAdapter$DocumentSetCommand.set(String) line: 132
> DocumentAdapter.setContents(String) line: 495
>
> CompilationUnitDocumentProvider.createFakeCompiltationUnit(IStorageEditorInput,
> boolean) line: 1074
> CompilationUnitDocumentProvider.createFakeCompiltationUnit(Object,
> boolean) line: 1006
> CompilationUnitDocumentProvider.connect(Object) line: 1203
>
> JavaMergeViewer$CompilationUnitEditorAdapter(AbstractTextEditor).doSetInput(IEditorInput)
> line: 4089
>
> JavaMergeViewer$CompilationUnitEditorAdapter(StatusTextEditor).doSetInput(IEditorInput)
> line: 203
>
> JavaMergeViewer$CompilationUnitEditorAdapter(AbstractDecoratedTextEditor).doSetInput(IEditorInput)
> line: 1329
>
> JavaMergeViewer$CompilationUnitEditorAdapter(JavaEditor).internalDoSetInput(IEditorInput)
> line: 2552
>
> JavaMergeViewer$CompilationUnitEditorAdapter(JavaEditor).doSetInput(IEditorInput)
> line: 2539
>
> JavaMergeViewer$CompilationUnitEditorAdapter(CompilationUnitEditor).doSetInput(IEditorInput)
> line: 1359
> JavaMergeViewer$CompilationUnitEditorAdapter.doSetInput(IEditorInput)
> line: 551
> AbstractTextEditor$19.run(IProgressMonitor) line: 3074
> ModalContext.runInCurrentThread(IRunnableWithProgress,
> IProgressMonitor) line: 464
> ModalContext.run(IRunnableWithProgress, boolean, IProgressMonitor,
> Display) line: 372
> ApplicationWindow$1.run() line: 759
> BusyIndicator.showWhile(Display, Runnable) line: 70
> WorkbenchWindow(ApplicationWindow).run(boolean, boolean,
> IRunnableWithProgress) line: 756
> WorkbenchWindow.run(boolean, boolean, IRunnableWithProgress) line:
> 2577
>
> JavaMergeViewer$CompilationUnitEditorAdapter(AbstractTextEditor).internalInit(IWorkbenchWindow,
> IEditorSite, IEditorInput) line: 3092
>
> JavaMergeViewer$CompilationUnitEditorAdapter(AbstractTextEditor).init(IEditorSite,
> IEditorInput) line: 3119
> JavaMergeViewer.getSourceViewerConfiguration(SourceViewer,
> IEditorInput) line: 281
> JavaMergeViewer.configureTextViewer(TextViewer) line: 210
> JavaMergeViewer(TextMergeViewer).configureSourceViewer(SourceViewer,
> boolean) line: 2869
> JavaMergeViewer(TextMergeViewer).updateContent(Object, Object, Object)
> line: 2820
> JavaMergeViewer(ContentMergeViewer).internalRefresh(Object) line:
> 737
> JavaMergeViewer(ContentMergeViewer).inputChanged(Object, Object) line:
> 637
> JavaMergeViewer(ContentViewer).setInput(Object) line: 274
> JavaMergeViewer.setInput(Object) line: 150
> CompareEditorInput$3(CompareViewerSwitchingPane).setInput(Object) line:
> 256
>
> SyncInfoCompareInput(CompareEditorInput).internalSetContentPaneInput(Object)
> line: 840
> CompareEditorInput.access$7(CompareEditorInput, Object) line: 838
> CompareEditorInput$13.run() line: 778
> BusyIndicator.showWhile(Display, Runnable) line: 70
> SyncInfoCompareInput(CompareEditorInput).feed1(ISelection) line: 772
>
> SyncInfoCompareInput(CompareEditorInput).feedInput() line: 750
> SyncInfoCompareInput(CompareEditorInput).createContents(Composite)
> line: 573
> CompareEditor.createCompareControl() line: 447
> CompareEditor.access$6(CompareEditor) line: 416
> CompareEditor$3.run() line: 372
> UILockListener.doPendingWork() line: 155
> UISynchronizer$3.run() line: 158
> RunnableLock.run() line: 35
> UISynchronizer(Synchronizer).runAsyncMessages(boolean) line: 133
> Display.runAsyncMessages(boolean) line: 3852
> Display.readAndDispatch() line: 3473
> Workbench.runEventLoop(Window$IExceptionHandler, Display) line: 2388
>
> Workbench.runUI() line: 2352
> Workbench.access$4(Workbench) line: 2204
> Workbench$5.run() line: 499
> Realm.runWithDefault(Realm, Runnable) line: 333
> Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 492
>
> PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line:
> 149
> IDEApplication.start(IApplicationContext) line: 113
> EclipseAppHandle.run(Object) line: 194
> EclipseAppLauncher.runApplication(Object) line: 110
> EclipseAppLauncher.start(Object) line: 79
> EclipseStarter.run(Object) line: 368
> EclipseStarter.run(String[], Runnable) line: 179
> NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not
> available [native method]
> NativeMethodAccessorImpl.invoke(Object, Object[]) line: not
> available
> DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: not
> available
> Method.invoke(Object, Object...) line: not available
> Main.invokeFramework(String[], URL[]) line: 556
> Main.basicRun(String[]) line: 511
> Main.run(String[]) line: 1270
> Main.main(String[]) line: 1246
>
>
> i will also update the bug in bugzilla of eclipse because this really
> sounds like a bug somewhere in eclipse.
>
> johan
>
>

------------------------------------------------------
http://subclipse.tigris.org/ds/viewMessage.do?dsForumId=1043&dsMessageId=1121329

To unsubscribe from this discussion, e-mail: [dev-unsubscribe_at_subclipse.tigris.org].
Received on 2009-02-08 01:06:16 CET

This is an archived mail posted to the Subclipse Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.