Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 255814 - [Net] Wrong methods and types used in org.eclipse.core.net
Summary: [Net] Wrong methods and types used in org.eclipse.core.net
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Team (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5 M5   Edit
Assignee: Pawel Pogorzelski CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 257109
Blocks: 255836
  Show dependency tree
 
Reported: 2008-11-19 10:46 EST by Olivier Thomann CLA
Modified: 2009-06-02 06:58 EDT (History)
2 users (show)

See Also:


Attachments
Fix v01 (637 bytes, patch)
2008-11-21 05:28 EST, Szymon Brandys CLA
no flags Details | Diff
Patch_v02 (6.49 KB, patch)
2008-12-12 08:19 EST, Pawel Pogorzelski CLA
no flags Details | Diff
Patch_v03 (13.47 KB, patch)
2008-12-15 12:04 EST, Pawel Pogorzelski CLA
pawel.pogorzelski1: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Thomann CLA 2008-11-19 10:46:10 EST
That bundle is supposed to be Foundation 1.0 compliant according to the 3.4
plan. Maybe this has changed for 3.5.
The EEs defined for this project are:
Bundle-RequiredExecutionEnvironment: J2SE-1.4,
 CDC-1.0/Foundation-1.0,
 J2SE-1.3

And for the compilation, pde.build ends up taking the first execution environment which is 1.4. If pde.build would take the latest execution environment it would not compile.

The bundle execution environment should be changed to 1.4 or some methods calls and type references should be removed.

In the list of problems, there are major ones:
- references to java.net.URI and its fields or methods. (added in 1.4) 
- references to java.lang.String.split(String) (added in 1.4) 
- references to java.net.Proxy (added in 1.5) 
- references to java.util.regex.Pattern and its methods (added in 1.4) 
- references to java.util.regex.Matcher and its methods (added in 1.4) 
- references to java.lang.CharSequence (added in 1.4)

The references to java.net.Proxy is properly handled as it is retrieved using a Class.forName(String) call. So this one could be ignored.

Here are the problems reported by the new validation tool from api tooling:
The type java.net.URI referenced in org.eclipse.core.internal.net.AbstractProxyProvider is not defined in bundle's required execution environment: J2SE-1.3
The method java.net.URI.getHost() referenced in org.eclipse.core.internal.net.AbstractProxyProvider is not defined in bundle's required execution environment: J2SE-1.3
The type java.net.URI referenced in org.eclipse.core.internal.net.AbstractProxyProvider is not defined in bundle's required execution environment: J2SE-1.3
The type java.net.URI referenced in org.eclipse.core.internal.net.ProxyManager is not defined in bundle's required execution environment: J2SE-1.3
The type java.net.URI referenced in org.eclipse.core.internal.net.ProxyManager is not defined in bundle's required execution environment: J2SE-1.3
The type java.net.URISyntaxException referenced in org.eclipse.core.internal.net.ProxyManager is not defined in bundle's required execution environment: J2SE-1.3
The type java.net.URISyntaxException referenced in org.eclipse.core.internal.net.ProxyManager is not defined in bundle's required execution environment: J2SE-1.3
The type java.net.URI referenced in org.eclipse.core.internal.net.ProxyManager is not defined in bundle's required execution environment: J2SE-1.3
The constructor URI(String) referenced in org.eclipse.core.internal.net.ProxyManager is not defined in bundle's required execution environment: J2SE-1.3
The type java.net.URI referenced in org.eclipse.core.internal.net.ProxyManager is not defined in bundle's required execution environment: J2SE-1.3
The constructor URI(String) referenced in org.eclipse.core.internal.net.ProxyManager is not defined in bundle's required execution environment: J2SE-1.3
The type java.net.URI referenced in org.eclipse.core.internal.net.ProxyManager is not defined in bundle's required execution environment: J2SE-1.3
The method java.net.URI.getHost() referenced in org.eclipse.core.internal.net.ProxyManager is not defined in bundle's required execution environment: J2SE-1.3
The type java.net.URISyntaxException referenced in org.eclipse.core.internal.net.ProxyManager is not defined in bundle's required execution environment: J2SE-1.3
The type java.net.URI referenced in org.eclipse.core.internal.net.ProxyManager is not defined in bundle's required execution environment: J2SE-1.3
The constructor URI(String, String, String) referenced in org.eclipse.core.internal.net.ProxyManager is not defined in bundle's required execution environment: J2SE-1.3
The type java.net.URI referenced in org.eclipse.core.internal.net.ProxyManager is not defined in bundle's required execution environment: J2SE-1.3
The method java.lang.String.split(String) referenced in org.eclipse.core.internal.net.ProxyType is not defined in bundle's required execution environment: J2SE-1.3
The type java.net.Proxy referenced in org.eclipse.core.internal.net.ProxyType is not defined in bundle's required execution environment: J2SE-1.3
The type java.net.URI referenced in org.eclipse.core.internal.net.WindowsProxyProvider is not defined in bundle's required execution environment: J2SE-1.3
The type java.net.URI referenced in org.eclipse.core.internal.net.proxy.unix.UnixProxyProvider is not defined in bundle's required execution environment: J2SE-1.3
The method java.net.URI.getScheme() referenced in org.eclipse.core.internal.net.proxy.unix.UnixProxyProvider is not defined in bundle's required execution environment: J2SE-1.3
The method java.net.URI.getScheme() referenced in org.eclipse.core.internal.net.proxy.unix.UnixProxyProvider is not defined in bundle's required execution environment: J2SE-1.3
The method java.lang.String.split(String) referenced in org.eclipse.core.internal.net.proxy.unix.UnixProxyProvider is not defined in bundle's required execution environment: J2SE-1.3
The type java.net.URI referenced in org.eclipse.core.internal.net.proxy.unix.UnixProxyProvider is not defined in bundle's required execution environment: J2SE-1.3
The constructor URI(String) referenced in org.eclipse.core.internal.net.proxy.unix.UnixProxyProvider is not defined in bundle's required execution environment: J2SE-1.3
The method java.net.URI.getHost() referenced in org.eclipse.core.internal.net.proxy.unix.UnixProxyProvider is not defined in bundle's required execution environment: J2SE-1.3
The method java.net.URI.getPort() referenced in org.eclipse.core.internal.net.proxy.unix.UnixProxyProvider is not defined in bundle's required execution environment: J2SE-1.3
The method java.net.URI.getUserInfo() referenced in org.eclipse.core.internal.net.proxy.unix.UnixProxyProvider is not defined in bundle's required execution environment: J2SE-1.3
The type java.net.URI referenced in org.eclipse.core.internal.net.proxy.unix.UnixProxyProvider is not defined in bundle's required execution environment: J2SE-1.3
The type java.util.regex.Pattern referenced in org.eclipse.core.internal.net.proxy.win32.winhttp.ProxyBypass is not defined in bundle's required execution environment: J2SE-1.3
The method java.util.regex.Pattern.compile(String) referenced in org.eclipse.core.internal.net.proxy.win32.winhttp.ProxyBypass is not defined in bundle's required execution environment: J2SE-1.3
The method java.util.regex.Pattern.compile(String) referenced in org.eclipse.core.internal.net.proxy.win32.winhttp.ProxyBypass is not defined in bundle's required execution environment: J2SE-1.3
The type java.net.URI referenced in org.eclipse.core.internal.net.proxy.win32.winhttp.ProxyBypass is not defined in bundle's required execution environment: J2SE-1.3
The method java.net.URI.getHost() referenced in org.eclipse.core.internal.net.proxy.win32.winhttp.ProxyBypass is not defined in bundle's required execution environment: J2SE-1.3
The method java.util.regex.Pattern.matcher(CharSequence) referenced in org.eclipse.core.internal.net.proxy.win32.winhttp.ProxyBypass is not defined in bundle's required execution environment: J2SE-1.3
The method java.util.regex.Matcher.matches() referenced in org.eclipse.core.internal.net.proxy.win32.winhttp.ProxyBypass is not defined in bundle's required execution environment: J2SE-1.3
The type java.net.URI referenced in org.eclipse.core.internal.net.proxy.win32.winhttp.ProxyProviderUtil is not defined in bundle's required execution environment: J2SE-1.3
The constructor URI(String) referenced in org.eclipse.core.internal.net.proxy.win32.winhttp.ProxyProviderUtil is not defined in bundle's required execution environment: J2SE-1.3
The method java.net.URI.getHost() referenced in org.eclipse.core.internal.net.proxy.win32.winhttp.ProxyProviderUtil is not defined in bundle's required execution environment: J2SE-1.3
The method java.net.URI.getPort() referenced in org.eclipse.core.internal.net.proxy.win32.winhttp.ProxyProviderUtil is not defined in bundle's required execution environment: J2SE-1.3
The method java.net.URI.getPort() referenced in org.eclipse.core.internal.net.proxy.win32.winhttp.ProxyProviderUtil is not defined in bundle's required execution environment: J2SE-1.3
The type java.net.URI referenced in org.eclipse.core.internal.net.proxy.win32.winhttp.ProxyProviderUtil is not defined in bundle's required execution environment: J2SE-1.3
The type java.lang.CharSequence referenced in org.eclipse.core.internal.net.proxy.win32.winhttp.ProxyProviderUtil is not defined in bundle's required execution environment: J2SE-1.3
The type java.lang.CharSequence referenced in org.eclipse.core.internal.net.proxy.win32.winhttp.ProxyProviderUtil is not defined in bundle's required execution environment: J2SE-1.3
The type java.net.URI referenced in org.eclipse.core.internal.net.proxy.win32.winhttp.StaticProxyConfig is not defined in bundle's required execution environment: J2SE-1.3
The method java.net.URI.getScheme() referenced in org.eclipse.core.internal.net.proxy.win32.winhttp.StaticProxyConfig is not defined in bundle's required execution environment: J2SE-1.3
The method java.net.URI.getScheme() referenced in org.eclipse.core.internal.net.proxy.win32.winhttp.StaticProxyConfig is not defined in bundle's required execution environment: J2SE-1.3
The type java.net.URI referenced in org.eclipse.core.internal.net.proxy.win32.winhttp.WinHttpProxyProvider is not defined in bundle's required execution environment: J2SE-1.3
The type java.net.URI referenced in org.eclipse.core.internal.net.proxy.win32.winhttp.WinHttpProxyProvider is not defined in bundle's required execution environment: J2SE-1.3
The type java.net.URI referenced in org.eclipse.core.internal.net.proxy.win32.winhttp.WinHttpProxyProvider is not defined in bundle's required execution environment: J2SE-1.3
The type java.net.URI referenced in org.eclipse.core.internal.net.proxy.win32.winhttp.WinHttpProxyProvider is not defined in bundle's required execution environment: J2SE-1.3
The type java.net.URI referenced in org.eclipse.core.internal.net.proxy.win32.winhttp.WinHttpProxyProvider is not defined in bundle's required execution environment: J2SE-1.3
The method java.net.URI.getScheme() referenced in org.eclipse.core.internal.net.proxy.win32.winhttp.WinHttpProxyProvider is not defined in bundle's required execution environment: J2SE-1.3
The method java.net.URI.getScheme() referenced in org.eclipse.core.internal.net.proxy.win32.winhttp.WinHttpProxyProvider is not defined in bundle's required execution environment: J2SE-1.3
The method java.net.URI.toString() referenced in org.eclipse.core.internal.net.proxy.win32.winhttp.WinHttpProxyProvider is not defined in bundle's required execution environment: J2SE-1.3
Comment 1 Szymon Brandys CLA 2008-11-20 12:19:56 EST
We could switch to Foundation 1.1 here. org.eclipse.core.net depends on org.eclipse.equinox.common, so the explanation from bug 255811, comment 3 is also true here.
Comment 2 Szymon Brandys CLA 2008-11-21 05:28:22 EST
Created attachment 118448 [details]
Fix v01
Comment 3 Tomasz Zarna CLA 2008-11-21 05:48:54 EST
Released to HEAD.
Comment 4 Olivier Thomann CLA 2008-11-28 12:26:13 EST
Switching to Foundation 1.1 and 1.4 doesn't fix all problems.
I still get this list of invalid references in last night build:

The method java.lang.String.split(String) referenced in org.eclipse.core.internal.net.ProxyType.convertPropertyStringToHosts(String) is not defined in bundle's required execution environment: CDC-1.1/Foundation-1.1
The method java.lang.String.split(String) referenced in org.eclipse.core.internal.net.proxy.unix.UnixProxyProvider.getNonProxiedHosts() is not defined in bundle's required execution environment: CDC-1.1/Foundation-1.1
The method java.lang.System.getenv(String) referenced in org.eclipse.core.internal.net.proxy.unix.UnixProxyProvider.getEnv(String) is not defined in bundle's required execution environment: CDC-1.1/Foundation-1.1
The type java.util.regex.Pattern referenced in org.eclipse.core.internal.net.proxy.win32.winhttp.ProxyBypass.proxyBypassPattern is not defined in bundle's required execution environment: CDC-1.1/Foundation-1.1
The method java.util.regex.Pattern.compile(String) referenced in ProxyBypass(String) is not defined in bundle's required execution environment: CDC-1.1/Foundation-1.1
The method java.util.regex.Pattern.matcher(CharSequence) referenced in org.eclipse.core.internal.net.proxy.win32.winhttp.ProxyBypass.isInBypassList(String) is not defined in bundle's required execution environment: CDC-1.1/Foundation-1.1
The method java.util.regex.Matcher.matches() referenced in org.eclipse.core.internal.net.proxy.win32.winhttp.ProxyBypass.isInBypassList(String) is not defined in bundle's required execution environment: CDC-1.1/Foundation-1.1
The method java.lang.String.split(String) referenced in org.eclipse.core.internal.net.proxy.win32.winhttp.ProxyBypass.getNonProxiedHosts() is not defined in bundle's required execution environment: CDC-1.1/Foundation-1.1 
Comment 5 Pawel Pogorzelski CLA 2008-12-02 06:49:24 EST
The call to java.lang.System.getenv(String) has been replaced in bug 257172 as it caused runtime errors. I hope I'll be able to address the rest in the near future.
Comment 6 Pawel Pogorzelski CLA 2008-12-12 08:19:40 EST
Created attachment 120315 [details]
Patch_v02
Comment 7 Pawel Pogorzelski CLA 2008-12-15 12:04:24 EST
Created attachment 120492 [details]
Patch_v03

Szymon pointed out lack of test and suggested a refactoring. This patch is changed accordingly.
Comment 8 Tomasz Zarna CLA 2008-12-16 05:56:52 EST
Latest patch from Pawel released to HEAD.