8042416: X11GraphicsEnvironment.isDisplayLocal() throws NoSuchElementException if DISPLAY host has more IP addresses than a local interface
authorsimonis
Thu, 08 May 2014 11:46:03 +0200
changeset 24553 6c9c0f5b07e0
parent 24552 deacebd7905a
child 24554 55edf9459457
8042416: X11GraphicsEnvironment.isDisplayLocal() throws NoSuchElementException if DISPLAY host has more IP addresses than a local interface Reviewed-by: anthony, azvegint Contributed-by: matthia.braun@sap.com
jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java
--- a/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java	Mon May 05 23:21:27 2014 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java	Thu May 08 11:46:03 2014 +0200
@@ -277,8 +277,9 @@
                 for (; interfaces.hasMoreElements();) {
                     locals = interfaces.nextElement().getInetAddresses();
                     for (; locals.hasMoreElements();) {
+                        final InetAddress localAddr = locals.nextElement();
                         for (int i = 0; i < remAddr.length; i++) {
-                            if (locals.nextElement().equals(remAddr[i])) {
+                            if (localAddr.equals(remAddr[i])) {
                                 return Boolean.TRUE;
                             }
                         }