Don’t use Java 7 API in EmbeddedMongoAutoConfiguration

Closes gh-4630
This commit is contained in:
Andy Wilkinson 2015-12-04 15:26:58 +00:00
parent c58ebae419
commit 91674b2c94
1 changed files with 3 additions and 1 deletions

View File

@ -157,7 +157,9 @@ public class EmbeddedMongoAutoConfiguration {
private InetAddress getHost() throws UnknownHostException {
if (this.properties.getHost() == null) {
return InetAddress.getLoopbackAddress();
return InetAddress.getByAddress(Network.localhostIsIPv6()
? new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 }
: new byte[] { 127, 0, 0, 1 });
}
return InetAddress.getByName(this.properties.getHost());
}