View | Details | Raw Unified | Return to bug 255981
Collapse All | Expand All

(-)src/org/eclipse/core/tests/net/NetTest.java (+20 lines)
Lines 365-368 Link Here
365
		assertEquals(data4.length, 0);
365
		assertEquals(data4.length, 0);
366
	}
366
	}
367
367
368
	public void testBug255981() throws CoreException, URISyntaxException {
369
		setDataTest(IProxyData.HTTP_PROXY_TYPE);
370
		setDataTest(IProxyData.HTTPS_PROXY_TYPE);
371
		setDataTest(IProxyData.SOCKS_PROXY_TYPE);
372
373
		this.getProxyManager().setProxiesEnabled(false);
374
375
		IProxyData data = this.getProxyManager().getProxyDataForHost(
376
				"randomhost.com", IProxyData.HTTP_PROXY_TYPE);
377
		assertNull(data);
378
379
		IProxyData[] data2 = this.getProxyManager().select(
380
				new URI("http://randomhost.com"));
381
		assertEquals(data2.length, 0);
382
383
		IProxyData data3[] = this.getProxyManager().getProxyDataForHost(
384
				"http://randomhost.com");
385
		assertEquals(data3.length, 0);
386
	}
387
368
}
388
}
(-)src/org/eclipse/core/internal/net/ProxyManager.java (+6 lines)
Lines 300-305 Link Here
300
300
301
	public IProxyData[] getProxyDataForHost(String host) {
301
	public IProxyData[] getProxyDataForHost(String host) {
302
		checkMigrated();
302
		checkMigrated();
303
		if (!internalIsProxiesEnabled()) {
304
			return new IProxyData[0];
305
		}
303
		URI uri = tryGetURI(host);
306
		URI uri = tryGetURI(host);
304
		if (uri == null) {
307
		if (uri == null) {
305
			return new IProxyData[0];
308
			return new IProxyData[0];
Lines 352-357 Link Here
352
	 */
355
	 */
353
	public IProxyData getProxyDataForHost(String host, String type) {
356
	public IProxyData getProxyDataForHost(String host, String type) {
354
		checkMigrated();
357
		checkMigrated();
358
		if (!internalIsProxiesEnabled()) {
359
			return null;
360
		}
355
		if (hasSystemProxies() && isSystemProxiesEnabled())
361
		if (hasSystemProxies() && isSystemProxiesEnabled())
356
			try {
362
			try {
357
				URI uri = new URI(type, "//" + host, null); //$NON-NLS-1$
363
				URI uri = new URI(type, "//" + host, null); //$NON-NLS-1$

Return to bug 255981