Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jdt-core-dev] Openable.makeConsistent(IProgressMonitor monitor)

Hi Kai,

I just joined this list, so perhaps this answer is already out-dated:

> Now I'm a little bit confused about the function
> "makeConsistent" in the class "Openable". It calls the function
> "openWhenClosed(Object info, IProgressMonitor monitor)" and passes a
> HashMap through the parameter "info" to it, [...]
Hm, the line
	HashMap newElements = manager.getTemporaryCache();
looks like a copy-paste error to me as it appears within makeConsistent AND
openWhenClosed (where it's passed correctly to generateInfos()).

> [...] and there is a type cast to 
> "OpenableElementInfo" what should throw a TypCastException IMHO. 
The only explanation I can see for this not causing a ClassCastExceptions is:
makeConsistent is never invoked on any other Openable but CompilationUnit.
(Call hierarchy seems to confirm this).
CompilationUnit overrides makeConsistent with bug-free code.
Ie., the questionable method Openable.makeConsistent is in fact dead-code.
Could that be?

Question: is makeConsistent really needed in IOpenable?
Else it should probably be deleted from IOpenable and Openable.
This would however entail some follow-up changes, I can see at
least one more candidate: save() (dead code, too?)

regards
Stephan

PS: wow, those parameters typed "Object" are quite something ;-)


Back to the top