Board index » jbuilder » Rename class: "Node already exists" error

Rename class: "Node already exists" error


2004-02-08 12:54:08 PM
jbuilder23
i try to rename my class (i.e. s to Sierra).
It doesn't rename it. And it shows me an error message, "Node already
exists"
What does this mean? The new class name doesn't exist.
So i close JBuilder and reopen it, and try the same thing again.
"Project may require compilation"
i don't care if my project may require compilation, i'm ask you how the
rename operation went!
Any ideas?
 
 

Re:Rename class: "Node already exists" error

The first error indicates that had sometime in the recent
past you did have a class Sierra in that package causing a
cache entry. Probably you deleted it (inside or outside of
JBuilder?) but some reference to it still remained.
Refactoring needs to be able to handle that situation so it
should be considered a bug. You found the right workaround
by choosing to restart JBuilder to flush the cache.
Refactoring uses dependency information created by the
compiler. It updates this information during refactoring so
you do not have to re-compile after each change.
Inconsistencies in this information causes refactoring to
fail producing a message about needing to re-compile. I
assume this is related to the initial failure where some
needed cleanup was not done to recover. Doing as suggested
by the message and re-compiling to rebuild the dependency
information should all that is needed.
"Ian Boyd"
< XXXX@XXXXX.COM >wrote
in message news: XXXX@XXXXX.COM ...
i try to rename my class (i.e. s to Sierra).
It doesn't rename it. And it shows me an error message,
"Node already
exists"
What does this mean? The new class name doesn't exist.
So i close JBuilder and reopen it, and try the same thing
again.
"Project may require compilation"
i don't care if my project may require compilation, i'm ask
you how the
rename operation went!
Any ideas?
 

Re:Rename class: "Node already exists" error

"Bill Joy" < XXXX@XXXXX.COM >wrote in message
Quote
The first error indicates that had sometime in the recent
past you did have a class Sierra in that package causing a
cache entry. Probably you deleted it (inside or outside of
JBuilder?) but some reference to it still remained.
Refactoring needs to be able to handle that situation so it
should be considered a bug.
You found the right workaround
by choosing to restart JBuilder to flush the cache.
But it doesn't fix it. i still get "Project may require compilation"
 

{smallsort}

Re:Rename class: "Node already exists" error

Restarting JBuilder will not fix that -- do a rebuild to
refresh the dependency information.
"Ian Boyd"
< XXXX@XXXXX.COM >wrote
in message news:40265e51$ XXXX@XXXXX.COM ...
"Bill Joy" < XXXX@XXXXX.COM >wrote in message
Quote
The first error indicates that had sometime in the recent
past you did have a class Sierra in that package causing a
cache entry. Probably you deleted it (inside or outside
of
JBuilder?) but some reference to it still remained.
Refactoring needs to be able to handle that situation so
it
should be considered a bug.
You found the right workaround
by choosing to restart JBuilder to flush the cache.
But it doesn't fix it. i still get "Project may require
compilation"
 

Re:Rename class: "Node already exists" error

A possiblity is that the original file is in the Project
history. You might want to to File | Reopen | Clear File
History then do another restart to see if that helps.
"Bill Joy" < XXXX@XXXXX.COM >wrote in message
Restarting JBuilder will not fix that -- do a rebuild to
refresh the dependency information.
"Ian Boyd"
< XXXX@XXXXX.COM >wrote
in message news:40265e51$ XXXX@XXXXX.COM ...
"Bill Joy" < XXXX@XXXXX.COM >wrote in message
Quote
The first error indicates that had sometime in the recent
past you did have a class Sierra in that package causing a
cache entry. Probably you deleted it (inside or outside
of
JBuilder?) but some reference to it still remained.
Refactoring needs to be able to handle that situation so
it
should be considered a bug.
You found the right workaround
by choosing to restart JBuilder to flush the cache.
But it doesn't fix it. i still get "Project may require
compilation"
 

Re:Rename class: "Node already exists" error

Quote
Do a rebuild to refresh the dependency information.
i've tried "Making" the project.
i've tried "Building" the project
Quote
A possiblity is that the original file is in the Project
history. You might want to to File | Reopen | Clear File
History then do another restart to see if that helps.
Nope.
What is JBuilder trying to tell me? It says
Errors: Project may require compilation
It seems to be skipping the part where it tells me what the error is - and
jumping to suggesting a solution that doesn't work (and it foreshadow's as
much by saying "may - cause we have no clue")
So, any idea what the problem is?
Is the "Errors" on the refactoring tab indicating an error while it tried to
refactor?
Or an error that prevented it from refactoring in the first place?
Or is the Borland refactoring code exceptional, and it was caught by a
generic exception handler?
Or is it because of an excessive amount of compile errors?
Or because it doesn't have enough memory to refactor all 26 classes?
Or because it can't refactor a project with 26 classes open at once?
 

Re:Rename class: "Node already exists" error

Have you done a complete rebuild? Yes, compilation errors
(other than warnings) will prevent Refactoring. The number
of classes or open files are not be a problem.
"Ian Boyd"
< XXXX@XXXXX.COM >wrote
in message news:4026c2ca$ XXXX@XXXXX.COM ...
Quote
Do a rebuild to refresh the dependency information.
i've tried "Making" the project.
i've tried "Building" the project
Quote
A possiblity is that the original file is in the Project
history. You might want to to File | Reopen | Clear File
History then do another restart to see if that helps.
Nope.
What is JBuilder trying to tell me? It says
Errors: Project may require compilation
It seems to be skipping the part where it tells me what the
error is - and
jumping to suggesting a solution that doesn't work (and it
foreshadow's as
much by saying "may - cause we have no clue")
So, any idea what the problem is?
Is the "Errors" on the refactoring tab indicating an error
while it tried to
refactor?
Or an error that prevented it from refactoring in the first
place?
Or is the Borland refactoring code exceptional, and it was
caught by a
generic exception handler?
Or is it because of an excessive amount of compile errors?
Or because it doesn't have enough memory to refactor all 26
classes?
Or because it can't refactor a project with 26 classes open
at once?
 

Re:Rename class: "Node already exists" error

Quote
Have you done a complete rebuild? Yes, compilation errors
(other than warnings) will prevent Refactoring. The number
of classes or open files are not be a problem.
Well that must be my problem (sometimes). i have errors.
If i keep about 3 class files open, i can rename a class (even with errors).
But i have 26 classes, all with errors.
 

Re:Rename class: "Node already exists" error

"Ian Boyd" < XXXX@XXXXX.COM >wrote in
message news:4026f94f$ XXXX@XXXXX.COM ...
Quote
Well that must be my problem (sometimes). i have errors.
That's the problem. You need to fix the errors. If you think about
what refactoring is doing, it makes sense. To rename a class or method,
JBuilder needs to go through your entire project and find any references
to the renamed class or method. If it can't compile your code, then it
can't figure out if that code refers to the renamed item.
--
Gillmer J. Derge (TeamB)
 

Re:Rename class: "Node already exists" error

Gillmer J. Derge (TeamB) wrote:
Quote
"Ian Boyd" < XXXX@XXXXX.COM >wrote in
message news:4026f94f$ XXXX@XXXXX.COM ...

>Well that must be my problem (sometimes). i have errors.


That's the problem. You need to fix the errors. If you think about
what refactoring is doing, it makes sense. To rename a class or method,
JBuilder needs to go through your entire project and find any references
to the renamed class or method. If it can't compile your code, then it
can't figure out if that code refers to the renamed item.

... or this may be a reproducable bug:
1. Create a class ("Foo").
2. Recompile project.
3. Delete Foo.java using JB
4. Recompile project
5. Try renaming another class to Foo -->"Node already exists"
 

Re:Rename class: "Node already exists" error

"MattS" < XXXX@XXXXX.COM >wrote in message
Quote
... or this may be a reproducable bug:
1. Create a class ("Foo").
2. Recompile project.
3. Delete Foo.java using JB
4. Recompile project
5. Try renaming another class to Foo -->"Node already exists"
Bill Joy already mentioned that the "Node already exists" issue is a
bug. I'm talking about the "Project may require recompilation" message.
Your project needs to compile without errors before refactoring can
work.
--
Gillmer J. Derge (TeamB)
 

Re:Rename class: "Node already exists" error

Quote
You need to fix the errors.
If i have few_er_ units open, but STILL have errors, it can refactor okay.
Quote
If you think about what refactoring is doing, it makes sense.
So no, it doesn't.