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 250873 - Allow access to the system Lookup
Summary: Allow access to the system Lookup
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Lookup (show other bugs)
Version: 8.1
Hardware: PC Linux
: P1 normal (vote)
Assignee: Jaroslav Havlin
URL:
Keywords:
Depends on: 250691
Blocks: 250863
  Show dependency tree
 
Reported: 2015-03-03 15:40 UTC by Svata Dedic
Modified: 2015-03-07 08:40 UTC (History)
1 user (show)

See Also:
Issue Type: TASK
Exception Reporter:


Attachments
Proposed patch (3.39 KB, patch)
2015-03-03 15:40 UTC, Svata Dedic
Details | Diff
refined patch - javadoc added (4.80 KB, patch)
2015-03-04 08:09 UTC, Svata Dedic
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Svata Dedic 2015-03-03 15:40:46 UTC
Created attachment 152373 [details]
Proposed patch

It's impossible to reach the Only Global Default Lookup during Lookups.executeWith - in case one really needs to be independent of context switches. 

I propose a slight change to the Lookups.executeWith - see the attached patch. The system would remember the default Lookup, then use it whenever Lookup.executeWith() is called with null argument - the behaviour for such situation is currently undefined and would result in a NPE.
Comment 1 Ondrej Vrabec 2015-03-04 08:02:15 UTC
Looks like a simple change i am able to understand. Can you just note the fact about the global lookup in javadoc for Lookups.executeWith?
Comment 2 Svata Dedic 2015-03-04 08:09:24 UTC
Created attachment 152386 [details]
refined patch - javadoc added

OV-1 (javadoc) added.
Comment 3 Tomas Zezula 2015-03-05 09:12:37 UTC
I agree with patch.
Comment 4 Jaroslav Havlin 2015-03-05 09:20:50 UTC
The patch seems fine to me.
Comment 5 Ondrej Vrabec 2015-03-05 09:22:02 UTC
... i agree, too
Comment 6 Svata Dedic 2015-03-05 12:21:57 UTC
Will be implemented in jet-main#74aad6bdd167. Testcase added as jet-main#749204d0e21f
Comment 7 Quality Engineering 2015-03-07 08:40:27 UTC
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/74aad6bdd167
User: Svata Dedic <sdedic@netbeans.org>
Log: #250873: Lookups.executeWith() behaviour defined for null argument