changeset 9985:6f660f46f0f2

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
author simonis
date Thu, 08 May 2014 11:46:03 +0200
parents 75206fa5a43e
children 415e14c14558
files src/solaris/classes/sun/awt/X11GraphicsEnvironment.java
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java	Mon May 05 23:21:27 2014 -0700
+++ b/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;
                             }
                         }