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
--- 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;
}
}