Skip to content

Commit

Permalink
Merge pull request #2217 from Pandrex247/Fix-NoSuchElementException-O…
Browse files Browse the repository at this point in the history
…n-Log-Statement

Fix NoSuchElementException on Log Statement
  • Loading branch information
Pandrex247 authored Dec 19, 2017
2 parents e964d94 + b1cbb4a commit 38a842c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
5 changes: 0 additions & 5 deletions appserver/tests/quicklook/quicklook_summary.txt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import java.net.SocketException;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.NoSuchElementException;
import java.util.logging.Level;
import org.glassfish.api.admin.ServerEnvironment;
import java.util.logging.Logger;
Expand Down Expand Up @@ -125,7 +126,15 @@ private void findAppropriateInterfaces() {
Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
while (interfaces.hasMoreElements()) {
NetworkInterface intf = interfaces.nextElement();
logger.log(Level.FINE, "Found Network Interface {0} Address {1}", new Object[]{intf.getName(), intf.getInetAddresses().nextElement()});
try {
logger.log(Level.FINE, "Found Network Interface {0} Address {1}", new Object[]{intf.getName(),
intf.getInetAddresses().nextElement()});
} catch (NoSuchElementException nsee) {
logger.log(Level.FINER, "Could not obtain address information for Network Interface: "
+ intf.getName(), nsee);
logger.log(Level.FINE, "Found Network Interface {0}", intf.getName());
}

if (!intf.isLoopback() && !intf.getName().contains("docker0")) {
logger.log(Level.FINE, "Adding interface {0} as a possible interface", intf.getName());
possibleInterfaces.add(intf);
Expand Down

0 comments on commit 38a842c

Please sign in to comment.