Re: Re: project conversion questions

Peter Wisnovsky <[email protected]> Wed, 30 Jul 2003 21:56:14 -0700
Newsgroups gmane.comp.java.netbeans.modules.projects.devel
Message-ID <[email protected]>
 > I don't think so. Adding accessors for each containing host or included 
 > facet of SourceElement is not a great idea, IMHO; but since the Project 
 > is alraedy present in the APIs (CE.forName), there might be a helper 
 > function.
 > 
 > Why don't you use SourceElement.getCookie(ProjectMember.class) ?

How would I have known that there is such an object in the cookie
list? I tried looking in the debugger but the navigating a weak
reference table in the debugger is slow going.

 > If the 
 > SourceElement was extracted from a project-aware node, it should have 
 > that cookie. Only if your action originates from a project-free node, 
 > then you have to use Project.findAll() to find out the project.
 > 
 > If there's no such cookie, please file a bug -- there should be one, as 
 > there's the DataObject cookie.

Hmm...this confuses me. How do I know what cookies I should expect to
find in an object? Your first statement suggests it will usually be
there, but sometimes may not be. Does this mean I have to always
program defensively for the possibility that cookie might not be
there? At least with interfaces I know there is a contract.

Peter