Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 265839 - [Proxy] NPE from IProxyData.setHost
Summary: [Proxy] NPE from IProxyData.setHost
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Team (show other bugs)
Version: 3.3.1   Edit
Hardware: All All
: P3 minor (vote)
Target Milestone: 3.5 M6   Edit
Assignee: Pawel Pogorzelski CLA
QA Contact:
URL:
Whiteboard: hasPatch
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-23 11:28 EST by Frank Ziglar CLA
Modified: 2009-06-03 11:34 EDT (History)
1 user (show)

See Also:


Attachments
Patch_v01 (1.08 KB, patch)
2009-02-24 04:37 EST, Pawel Pogorzelski CLA
Szymon.Brandys: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Ziglar CLA 2009-02-23 11:28:02 EST
Build ID: M20080911-1700

Steps To Reproduce:
Write a plugin to interact with the platform's IProxyService. Use IProxyService.getProxyData to get an IProxyData object. Call setHost with a null parameter (as is allowed in IProxyData to specify no host): the default ProxyData implemention will throw a NullPointerException.

More information:
The documentation for org.eclipse.core.net.proxy.IProxyData.setHost states that:

"Set the host name for the proxy server of this type. If no proxy server of this type is available, the host name should be set to null."

When using a ServiceTracker to get an IProxyService, proxy data is by default implemented by org.eclipse.core.internal.net.ProxyData. ProxyData.setHost first performs a length check, resulting in a NullPointerException whenever attempting to set the host to no proxy.
Comment 1 Pawel Pogorzelski CLA 2009-02-24 04:37:58 EST
Created attachment 126528 [details]
Patch_v01
Comment 2 Tomasz Zarna CLA 2009-02-24 05:05:31 EST
Applied to HEAD, available in builds >N20090223-2000.