This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
There could be methods useful as SPI for ContextSettings based beans: - create proxy/merge context (as it is done for ProjectObject.getContext()): public Context createContext(Context[] delegates, Context writable); the second argument could be useful for both deciding where the change goes and making the context read-only if null. - provide an empty context (/dev/null): public Context createEmpty() if current ProxyContext.Empty implementation is used, then it could just return that shared instance. - provide a memory-implemented Context: public Context createMemoryContext(); given that the returned Context also implements Map interface. Alternatively one could pass a Map to the function and the Context would be built around the Map.
The last requirement is already supported, just create ContextSettings passing null in its constructor.
An empty JNDI Context is provided by o.n.spi.projects.Contexts.EMPTY. I've exposed it through the field instead of using factory method because field allows checking whether some context is an EMPTY one or not.
Random (posted elsewhere): ContextSettings shouldn't accept null when constructed and provide in-memory storage, rather the Contexts.memoryContext() factory method should exist allowing to create in-memory implementation of JNDI Context. This will simplify ContextSettings implementation which is now a sort of schizophreny.
implemented a merged context helper. projects/core/src/org/netbeans/api/projects/settings/Contexts.java; new revision: 1.1.2.7; previous revision: 1.1.2.6
I filed the only remaining part as a separate issue: 28680 (this is getting pretty messy). Closing this one (on behalf of implementers: Jan and Vita).