Bug 166782 - Easier interaction between Lookup and System Filesystem
Easier interaction between Lookup and System Filesystem
Status: RESOLVED FIXED
Product: platform
Classification: Unclassified
Component: Lookup
6.x
All All
: P1 (vote)
: 6.x
Assigned To: Jaroslav Tulach
issues@platform
: API_REVIEW_FAST
: 194703 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-06-09 12:55 UTC by Jaroslav Tulach
Modified: 2011-01-31 21:20 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
:


Attachments
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 
classpath.

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 Lookup.java 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
core-main#818470e34c19
Comment 6 Quality Engineering 2009-06-20 08:10:30 UTC
Integrated into 'main-golden', will be available in build *200906200201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/818470e34c19
User: Jaroslav Tulach <jtulach@netbeans.org>
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. ***


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo