Community
Participate
Working Groups
When calling CProjectDescriptionManager.getInstance().getProjectDescription(p, GET_IF_LOADDED) the description is actually loaded. The following line in XmlProjectDescriptionStorage cause this behavior (when the project description has not been loaded 'checkExternalModification' returns true): // If the description is already loaded and has been modified... load |= checkExternalModification();
Interesting find. This prompts the question: what should we do if the caller has GET_IF_LOADED but the read-only description cache is out of date w.r.t. the backing store?
(In reply to comment #1) > Interesting find. > > This prompts the question: what should we do if the caller has GET_IF_LOADED > but the read-only description cache is out of date w.r.t. the backing store? Tough question, I'd say it should not load the description. The reason why one would use GET_IF_LOADED is to make a quick check whether there is a project description available ready for use. For my specific use case it would also work if it gets loaded in that case.
Created attachment 173219 [details] fix
Looks good to me. checkExternalModification() explicitly invalidates the read-only desc. This change will ensure the description is only reloaded if the API caller wants it to be.
Fixed in 8.0 > 20100702.
*** cdt cvs genie on behalf of mschorn *** Bug 318463: Project Description is loaded although using flag GET_IF_LOADDED [*] XmlProjectDescriptionStorage.java 1.9 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt-core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml/XmlProjectDescriptionStorage.java?root=Tools_Project&r1=1.8&r2=1.9