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

Summary: Allow access to the system Lookup
Product: platform Reporter: Svata Dedic <sdedic>
Component: LookupAssignee: Jaroslav Havlin <jhavlin>
Status: RESOLVED FIXED    
Severity: normal CC: ralphbenjamin
Priority: P1    
Version: 8.1   
Hardware: PC   
OS: Linux   
Issue Type: TASK Exception Reporter:
Bug Depends on: 250691    
Bug Blocks: 250863    
Attachments: Proposed patch
refined patch - javadoc added

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