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)

Thanks for pointing this out. Indeed, isConsistent() returns false for all
openables but compilation units.
I guess these are left-over from the time the Java model was designed.

Anyway I cleanup the code so that makeConsistent(...) doesn't do anything
by default. Note we cannot
remove it from IOpenable as this would be a breaking API change.

Jerome

jdt-core-dev-bounces@xxxxxxxxxxx wrote on 10/11/2005 03:39:45 AM:

> 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 ;-)
> _______________________________________________
> jdt-core-dev mailing list
> jdt-core-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/jdt-core-dev



Back to the top