This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

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

(-)core.startup.base/src/org/netbeans/core/startup/layers/NbinstURLStreamHandler.java (+31 lines)
Lines 49-54 Link Here
49
import java.io.FileNotFoundException;
49
import java.io.FileNotFoundException;
50
import java.io.IOException;
50
import java.io.IOException;
51
import java.io.InputStream;
51
import java.io.InputStream;
52
import java.net.InetAddress;
53
import java.net.Proxy;
52
import java.net.URL;
54
import java.net.URL;
53
import java.net.URLConnection;
55
import java.net.URLConnection;
54
import java.net.URLStreamHandler;
56
import java.net.URLStreamHandler;
Lines 64-73 Link Here
64
@URLStreamHandlerRegistration(protocol=NbinstURLMapper.PROTOCOL)
66
@URLStreamHandlerRegistration(protocol=NbinstURLMapper.PROTOCOL)
65
public class NbinstURLStreamHandler extends URLStreamHandler {
67
public class NbinstURLStreamHandler extends URLStreamHandler {
66
68
69
    @Override
67
    protected URLConnection openConnection(URL u) throws IOException {
70
    protected URLConnection openConnection(URL u) throws IOException {
68
        return new NbinstURLConnection(u);
71
        return new NbinstURLConnection(u);
69
    }
72
    }
70
73
74
    @Override
75
    protected URLConnection openConnection(URL u, Proxy p) throws IOException {
76
        // Ignore the proxy -- passing a proxy is not a sensible operation here
77
        // implemented for completeness.
78
        return openConnection(u);
79
    }
80
81
    @Override
82
    protected synchronized InetAddress getHostAddress(URL u) {
83
        // URLStreamHandler utilizes getHostAddress to extract an InetAddress
84
        // from the supplied URL. For example in the URLStreamHandler#hashCode(URL)
85
        // and URLStreamHandler#equals(URL, URL) methods this is used and host
86
        // related functions are delegated to InetAddress.
87
        //
88
        // In case of the nbinst URLs this breaks, as the host portion of the
89
        // url is not a hostname, but a modulename.
90
        //
91
        // Returning NULL in getHostAddress causes a fallback to name based
92
        // comparison, which is the correct approach for this usecase.
93
        //
94
        // The default implementation causes potential user visible timeouts if
95
        // the network is not configured correctly:
96
        // 
97
        // https://netbeans.org/bugzilla/show_bug.cgi?id=267962
98
        //
99
        return null;
100
    }
101
71
    /** URLConnection for URL with nbinst protocol.
102
    /** URLConnection for URL with nbinst protocol.
72
     *
103
     *
73
     */
104
     */

Return to bug 267962