Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Problems with Rename Refactoring and IFileBufferListener/IDocumentListener/IPositionUpdater
Problems with Rename Refactoring and IFileBufferListener/IDocumentListener/IPositionUpdater [message #323496] Sat, 22 December 2007 17:04 Go to next message
Eclipse UserFriend
Originally posted by: eclipsenews-9999-exp.sblk.de

Hi all, I am seeing a strange phenomenon.

I am using an IFileBufferListener to register an IDocumentListener and a
IPositionUpdater for every Java file opened (I need to update/keep track
of custom Positions).
This works perfectly for all files which are affected by a rename
refactoring, but not for the renamed file itself.

The registered IPositionUpdater never receives any DocumentEvents for
the change of the class name/package declaration in the renamed file.

I am seeing a call to
IFileBufferListener.bufferDisposed(IFileBuffer)
followed by a call to
IFileBufferListener.bufferCreated(IFileBuffer)

At the time the old buffer is disposed, the underlying file store still
contains the original class name. Once the buffer is recreated, it
already contains the new class name.

Is this an intended behaviour? And is there any way I can get my
IPositionUpdater implementation to "see" those changes?
Is there maybe an even earlier place where I could register
IDocumentListeners and IPositionUpdaters for a newly opened Document?

Thanks a lot.

Greetings.
Hans Meyer
Re: Problems with Rename Refactoring and IFileBufferListener/IDocumentListener/IPositionUpdater [message #323539 is a reply to message #323496] Thu, 27 December 2007 03:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipsenews-9999-exp.sblk.de

Just as a followup.

It seems as if the rename refactoring is not making use of the file buffers?
I.e. when renaming a Java class which is not open in any editor and
which is not referenced in any other Java class, there is no observable
use of file buffers at all (a registered IFileBufferListener is never
called).

Greetings
Hans Meyer
Sometimes a move, sometimes a deletion+addition? [message #323540 is a reply to message #323539] Thu, 27 December 2007 05:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipsenews-9999-exp.sblk.de

Just noticed another strange behaviour.

When using the JDT rename refactoring the corresponding
ResourceChangeEvent sometimes lists the modified resources as moved and
sometimes as removed and added (without IResourceDelta.MOVED_TO or
IResourceDelta.MOVED_FROM in IResourceDelta.getFlags()).

A registered IFileBufferListener will also sometimes see a call to
underlyingFileMoved(IFileBuffer, IPath) and at other times a call to
underlyingFileDeleted(IFileBuffer).

I haven't been able to figure out exactly when the different ways of
notification happen. Is there any reason for this behaviour?
Is the expected behaviour specified somewhere?

Greetings
Hans Meyer

PS: sorry for the multiple posts
Re: Sometimes a move, sometimes a deletion+addition? [message #323559 is a reply to message #323540] Fri, 28 December 2007 14:26 Go to previous message
Eclipse UserFriend
Originally posted by: eclipsenews-9999-exp.sblk.de

FYI,

I've added two new bug reports for these issues.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=213984
https://bugs.eclipse.org/bugs/show_bug.cgi?id=213991

Greetings
Hans Meyer
Previous Topic:TextCellEditor and DialogCellEditor...
Next Topic:Trademark logo in JFace HeaderFont can't be displayed on Windows vista
Goto Forum:
  


Current Time: Wed Aug 13 21:03:47 EDT 2025

Powered by FUDForum. Page generated in 0.05442 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top