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 57542
Collapse All | Expand All

(-)IDESettings.java (-2 / +20 lines)
Lines 129-134 Link Here
129
        super.initialize ();
129
        super.initialize ();
130
        System.setProperty (KEY_PROXY_HOST, getProxyHost ());
130
        System.setProperty (KEY_PROXY_HOST, getProxyHost ());
131
        System.setProperty (KEY_PROXY_PORT, getProxyPort ());
131
        System.setProperty (KEY_PROXY_PORT, getProxyPort ());
132
        System.setProperty (KEY_NON_PROXY_HOSTS, getDefaultNonProxyHosts());
132
        putProperty(PROP_WWWBROWSER, "", false);
133
        putProperty(PROP_WWWBROWSER, "", false);
133
    }
134
    }
134
            
135
            
Lines 272-277 Link Here
272
            }
273
            }
273
            System.setProperty (KEY_PROXY_HOST, getProxyHost ());
274
            System.setProperty (KEY_PROXY_HOST, getProxyHost ());
274
            System.setProperty (KEY_PROXY_PORT, getProxyPort ());
275
            System.setProperty (KEY_PROXY_PORT, getProxyPort ());
276
            System.setProperty (KEY_NON_PROXY_HOSTS, getDefaultNonProxyHosts());
275
        }
277
        }
276
    }
278
    }
277
279
Lines 530-540 Link Here
530
     * @return sensible default for non-proxy hosts, including 'localhost'
532
     * @return sensible default for non-proxy hosts, including 'localhost'
531
     */
533
     */
532
    private String getDefaultNonProxyHosts() {
534
    private String getDefaultNonProxyHosts() {
533
        String nonProxy = "localhost"; // NOI18N
535
        String nonProxy = "localhost|127.0.0.1"; // NOI18N
536
        String localhost = ""; // NOI18N
534
        try {
537
        try {
535
            String localhost = InetAddress.getLocalHost().getHostName();
538
            localhost = InetAddress.getLocalHost().getHostName();
536
            if (!localhost.equals("localhost")) { // NOI18N
539
            if (!localhost.equals("localhost")) { // NOI18N
537
                nonProxy = nonProxy + "|" + localhost; // NOI18N
540
                nonProxy = nonProxy + "|" + localhost; // NOI18N
541
            } else {
542
                // Avoid this error when hostname == localhost:
543
                // Error in http.nonProxyHosts system property:  sun.misc.REException: localhost is a duplicate
544
            }
545
        }
546
        catch (UnknownHostException e) {
547
            // OK. Sometimes a hostname is assigned by DNS, but a computer
548
            // is later pulled off the network. It may then produce a bogus
549
            // name for itself which can't actually be resolved. Normally
550
            // "localhost" is aliased to 127.0.0.1 anyway.
551
        }
552
        try {
553
            String localhost2 = InetAddress.getLocalHost().getCanonicalHostName();
554
            if (!localhost2.equals("localhost") && !localhost2.equals(localhost)) { // NOI18N
555
                nonProxy = nonProxy + "|" + localhost2; // NOI18N
538
            } else {
556
            } else {
539
                // Avoid this error when hostname == localhost:
557
                // Avoid this error when hostname == localhost:
540
                // Error in http.nonProxyHosts system property:  sun.misc.REException: localhost is a duplicate
558
                // Error in http.nonProxyHosts system property:  sun.misc.REException: localhost is a duplicate

Return to bug 57542