tags:

views:

27

answers:

1

I'm working in Java and implementing a basic tree (yes, for homework, but hear me out!). I discovered that I made an error and had an iterator class inherit from an iterator superclass, where both needed an internal reference to the same node in the tree. Now every time I reference the node in the subclass and make a change, I have to make the same change in the superclass, or they will be out of sync.

I don't have many classes in the package and I could do it by hand; however, I wondered if Eclipse has the ability to remove references when a class is deleted from a package. I've done something similar before and I don't think it does automatically, so perhaps the answer is simply no; however, it would be nice. Hoping that some SO wisdom can help here.

+1  A: 

I don't see how it could remove references automatically, to be honest - if you're using a variable of that type, it would have to remove all the code using that variable, which is clearly going to affect how things work.

You can just delete the class and fix up the compiler errors though :)

Jon Skeet
Makes sense. It does some fun "magic" with the metadata, so I thought that might be a possibility, but I see what you mean.
Feanor
Also, I'm thoroughly thrilled that my question was answered by Jon Skeet himself (cue geekout). Thanks Jon! :D
Feanor
@Feanor: You'd be so disappointed if you met me in person :)
Jon Skeet