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.
Created attachment 152212 [details] Proposed patch The org.openide.filesystems.Repository holds the default Filesystem, which is used not only to register services, but also to hold user configuration. If multiple users would use the same NetBeans instance, it becomes difficult to separate their configurations. We can separate their services using special Lookups and Lookup.executeWith, but we do not have similar feature for their configuration - and NetBeans techniques to access cfg (FileUtil.getConfigFile, NbPreferences) fully depend on the default FileSystem to be 'private' to the executing user. Therefore I propose an API change, which would: a/ allow to create more Repositories b/ allow to pick up the "correct" Repository instance from FileUtil.getConfigRoot() c/ separate implementation of layers to allow construction in a different environment than standard NB distribution. A few notes explaining the patch: * the core.startup.base contains impl of layered filesystem and NbPreferences. A LayerFactory SPI was defined, so that core.startup can bind the layered Filesystems to a correct location using e.g. system properties. Different implementations/bindings are made possible for different platform needs. * RecognizeInstanceFiles and MetaInfServicesLookup contains a defect, their Lookup.Items do not prevent reentrant object creation: it's possible to recursively create an object, and the Lookup remembers a different object than it is potentially remembered by other code. The diff changes implementation so that the *first* (innermost) creation is remembered and returned from the outer lookup() queries. * Some calls to FileUtil.getConfig* was replaced by FileUtil.getSystemConfig* to access the shared configuration / services.
Created attachment 152240 [details] Revised patch Revised patch - added version number/dependency changes automatic dependency injection during build; IO API, Intent API, Progress Swing and Core Base turned to autoloads (commit-validation complaints)
The patch seem good to me.
Feature committed as jet-main#04a063e2b4f3 Simple unit test added.
Integrated into 'main-silver', will be available in build *201503070001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/04a063e2b4f3 User: Svata Dedic <sdedic@netbeans.org> Log: #250691: Allowed creation of local Repositories