taken from #187186
------ Comment #6 From elishae 2010-06-07 04:39:28 (-) [reply] -------
Though there seems to be a bug here.. To me, the root cause seems to be some
As per my understanding, Proxy Selector should NOT* return a Proxy for the uris
listed in 'No Proxy Hosts' text box. (Correct me if i'm wrong)
Here, the URI I'm trying to connect is an intranet URI and as such does NOT
require a proxy to connect to.
CVS update works fine *as long as* I dont set up the proxy (manual proxy).
These are my observations:
1. After setting up the proxy, the CVS update stops working.
2. Resetting the settings to use NO PROXY does not help either.
3. Recreating the user-dir solves the issue.
So, to me it looks like the code that sets the proxy settings is goofed up some
how. Please verify.
------- Comment #7 From elishae 2010-06-07 05:31:00 (-) [reply] -------
After Examining the Code of NbProxySelector.java, I *guess* that the problem
At Line 279:
dontUseProxy = host.startsWith(start) && host.endsWith(end);
instead, it should be
dontUseProxy = host.startsWith(start) || host.endsWith(end);
For, a non-proxy-host pattern:
*.x matches host.endsWith(end) [but not with host.startsWith]
x.* matches host.startsWith(start) [but not with host.endsWith]
As this seems to be a global problem with proxy settings, I strongly suggest
that, it should be considered a candidate for pushing in 6.9 Release build.
Thanks for a hint, I'll look on.
Raising the priority as P2.
This bug disables* Netbeans from talking to intranet sites, which are not served by proxy. (So, IMHO, this is a candidate for P2)
One Available Workaround is : to mention the 'exact' host name of the target host in the non-proxy pattern. When there is no '*' in the pattern, this bug would not appear.
elishae, your hint breaks a unit test (located in <netbeans-sources>/o.n.core/test/unit/src/org/netbeans/core/DontUseProxyTest.java). Could you look at the test and suggest your test-case for that test? That test fails (after your hint was applied) because www.dummynetbeans.org is regarded as non-proxy host in the case of pattern *.netbeans.org is for non-proxy hosts. Thank you
Ah.. got the issue:
When * is the first character, start is empty string.
When * is the last character, end is empty string.
earlier code was working for www.dummynetbeans.org because the end did not match, whereas start was always matching..
Instead, the logic should be updated to compare start only when * is not first character. and compare end only when * is not last chararcter
As said earlier, Replace line 279 with below code. And it should satisfy all the test cases.
//Compare left of * if and only if * is not first character in token
final boolean compareStart = start > 0;
//Compare right of * if and only if * is not the last character in token
final boolean compareEnd = star < token.length();
dontUseProxy = (compareStart && host.startsWith(start)) || (compareEnd && host.endsWith(end));
oops, typo: fix the code as ..
boolean compareStart = star > 0; // not first character
boolean compareEnd = star < (token.length() - 1); // not last character
dontUseProxy = (compareStart && host.startsWith(start)) || (compareEnd &&
Thank you for revisited hint, it works now. Please, verify if it works correctly once it will be part of Dev build of NetBeans in a few days. Thanks
Integrated into 'main-golden', will be available in build *201006110001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
User: Jiri Rechtacek <email@example.com>
Log: #187278: "No Proxy Hosts" not regarded
Please verify bugfix for this bug, so it can be included in release691 repository.
Transplanted into release691 #d82b0fdff64e