# HG changeset patch # User simonis # Date 1399542363 -7200 # Node ID 6c9c0f5b07e0909c5e4400e5bdc55d34b6b12596 # Parent deacebd7905a17c68eb7609ce2142caf9afb685e 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 diff -r deacebd7905a -r 6c9c0f5b07e0 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; } }