Bug 318173

Summary: [Net] Move core.net to Java 5.0
Product: [Eclipse Project] Platform Reporter: Pawel Pogorzelski <pawel.pogorzelski1>
Component: TeamAssignee: Platform Team Inbox <platform-team-inbox>
Status: ASSIGNED --- QA Contact:
Severity: enhancement    
Priority: P3 CC: hanriseldon, kazm, Mike_Wilson, peter, pwebster, ruediger.herrmann, Szymon.Brandys, wojciech.galanciak
Version: 3.6   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 312224, 312228, 291717    

Description Pawel Pogorzelski CLA 2010-06-28 09:03:22 EDT
Java 5.0 introduces a set of APIs in java.net package. Not consuming these in core.net results in poor integration with in build Java proxy support. It also makes hard/impossible providing fixes to some of the problems.

One problem is described on bug 312228, comments 3 and 4. The new methods added in Java 5.0 are needed to complete the fix. If these methods can't be consumed a plain hack (which doesn't work in all the cases) is required.

Bug 312224 is another example. If Java 5.0 is consumed, core.net could register a custom ProxySelector allowing for proxy settings per connection.

Another set of problem arises when a third party code register a ProxySelector via setDefault method. In this case clients of core.net's IProxyService obtain different values than clients consuming proxies indirectly via connection handlers.
Comment 1 Wojciech Galanciak CLA 2010-08-30 09:56:47 EDT
I have made investigation around ProxySelector provided in Java 1.5. I have tried to find out if it is possible to replace the whole native code from Eclipse and get information about native settings through ProxySelector.select method instead. This is another aspect which has not been mentioned by Pawel. 

There are couple things that work correctly:
- Getting information about proxy servers for a given URI - it covers main function of IProxyService.select.
- Support for getting proxy setting in Windows (tested) and Gnome/Linux (not tested yet).
- Support for native PAC settings.
- Support for native bypass settings.

Unfortunately there are some problems. Some of them have quite easy workarounds:
- Getting all proxy servers for all protocols (preference page). Workaround is to get proxy server for each of them separately.
- ProxySelector.select firstly takes system properties for the particular protocol. If they are not set, it takes native settings. Workaround is to store values for all system properties related to proxy (or only for certain protocol) before call ProxySelector.select , unset them, call ProxySelector.select and set them again.

For now I have found one problem which does not have a solution or workaroud:
- Getting information about bypasses.

The last problem shows that it is not possible to remove whole native code but it can help reduce it significantly.