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.

Bug 166782 - Easier interaction between Lookup and System Filesystem
Summary: Easier interaction between Lookup and System Filesystem
Alias: None
Product: platform
Classification: Unclassified
Component: Lookup (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Jaroslav Tulach
: 194703 (view as bug list)
Depends on:
Reported: 2009-06-09 12:55 UTC by Jaroslav Tulach
Modified: 2011-01-31 21:20 UTC (History)
2 users (show)

See Also:
Exception Reporter:

The changes in openide.util and openide.filesystems (15.99 KB, patch)
2009-06-09 13:00 UTC, Jaroslav Tulach
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2009-06-09 12:55:18 UTC
In standalone environments (tests and when using NetBeans JARs without runtime container) it is not particularly easy 
to convince Lookup.getDefault() to include some folder from system file system. This needs a lot of coding and is 
tricky as the calls during initialization like to cause stack overflow.

It is desirable to have more easier way to integrate Lookup.getDefault() with SFS when both these JARs are on 

Ideally things could start to work automatically, just by including these JARs on classpath. The Services folder from 
SFS would then become part of Lookup.getDefault() automatically. However I am afraid that this might be incompatible 
change. Given my 6.7 release struggle with changing MockLookup.setLookup to also include content of Services folder, 
which rendered horribly incompatible, I am not sure we want to risk that again.

That is why I am proposing to define new property "org.openide.util.Lookup.paths" that anyone can set to "Services" 
and get the standard (in NetBeans Runtime Container) integration between Lookup.getDefault() and SFS.
Comment 1 Jaroslav Tulach 2009-06-09 13:00:00 UTC
Created attachment 83352 [details]
The changes in openide.util and openide.filesystems
Comment 2 Jesse Glick 2009-06-09 18:18:05 UTC
[JG01] Typo: "propert"

[JG02] Suggest named constant in rather than a magical system property name defined in arch.xml where no one
will be looking for it. Or better yet,

public static void includeConfigPaths(String... paths) throws IllegalStateException;

which would be easier to use and have the benefit of throwing an exception if you accidentally called it after
Lookup.getDefault() (or this same method) had already been called.
Comment 3 Jaroslav Tulach 2009-06-10 12:04:01 UTC
Re. JG02: We can add such field or method anytime later if found necessary. Right now, when vast majority of the 
Lookup users need just Lookup.getDefault() and does not care about here in proposed functionality (as it works from 
them in NetBeans by default), it is not wise to distract them.

Re. JG01: Thanks, I'll fix it.
Comment 4 Jaroslav Tulach 2009-06-18 11:12:27 UTC
I will address JG01 and integrate tomorrow.
Comment 5 Jaroslav Tulach 2009-06-19 15:14:28 UTC
Comment 6 Quality Engineering 2009-06-20 08:10:30 UTC
Integrated into 'main-golden', will be available in build *200906200201* on (upload may still be in progress)
User: Jaroslav Tulach <>
Log: #166782: org.openide.util.Lookup.paths property
Comment 7 Jesse Glick 2011-01-31 21:20:18 UTC
*** Bug 194703 has been marked as a duplicate of this bug. ***