Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Refactor package

1 view
Skip to first unread message

Michael

unread,
Jul 11, 2005, 3:30:24 PM7/11/05
to
Hi,

After refactoring a package:
In my renamelist there a only the files which are renamed.
How can I find out that the whole package was renamed?

Not in CVS but in other VCS it makes sense to rename the directory.


Thanks.


Bill Joy

unread,
Jul 15, 2005, 10:12:13 PM7/15/05
to
The rename list only records files. There is no direct way to know if this
is due to a package rename using the VCSRenameNotifier -- if you need to
know this, then you will probably have to either compare the repository to
the workspace or else use the refactoring history.


"Michael" <mm...@web.de> wrote in message
news:42d2c8cf$1...@newsgroups.borland.com...

MIchael

unread,
Jul 21, 2005, 9:07:22 AM7/21/05
to
Hi,

could you tell me more about using the refactoring history.

I coundnt find s.th. about that in the docs.
Is there a class like VCSRenameNotifier?
How can I use these information.

Or do I have to check the XML file by myself? That woundnt be so nice!

Thanks.


"Bill Joy" <wc...@pacbell.net> schrieb im Newsbeitrag
news:42d86cfb$1...@newsgroups.borland.com...

Bill Joy

unread,
Jul 21, 2005, 8:57:16 PM7/21/05
to
I am not familiar with this area myself. My best guess is that you would do
something like:

RefactorHistoryCache cache = RefactorHistoryCache.instance(jbProject);
RenameClassWrapper wrapper = cache.findRefactoringForClass(oldClassName);
if (wrapper != null) {
String newClassName = getNewClassName();
}

You can convert an Url into a class name (untested code):

if (url.getFileExtension().equals("java")) {
Url[] urls = jbProject.getPaths().getSourcePath();
for (int i = 0; i < urls.length; i++) {
if (urls[i].isParentOf(url)) {
String path = urls[i].getRelativePath(url).replace('/', '.');
int j = path.lastIndexOf(".java");
String className = path.substring(0, j);
}
}
}


"MIchael" <mi...@web.de> wrote in message
news:42df...@newsgroups.borland.com...

0 new messages