@@ -56,24 +56,24 @@ class BrokenHttpLinksCheckerSpec extends Specification {
56
56
// Custom method to register the DNS resolver
57
57
private void registerCustomDnsResolver () {
58
58
try {
59
- Field implField = InetAddress . class. getDeclaredField(" impl" );
60
- implField. setAccessible(true );
61
- Object currentImpl = implField. get(null );
59
+ Field implField = InetAddress . class. getDeclaredField(" impl" )
60
+ implField. setAccessible(true )
61
+ Object currentImpl = implField. get(null )
62
62
63
63
Proxy newImpl = (Proxy ) Proxy . newProxyInstance(
64
64
currentImpl. getClass(). getClassLoader(),
65
65
currentImpl. getClass(). getInterfaces(),
66
66
(proxy, method, args) -> {
67
67
if (" lookupAllHostAddr" . equals(method. getName()) && args. length == 1 && args[0 ] instanceof String ) {
68
- return customHostNameResolver. resolve((String ) args[0 ]);
68
+ return customHostNameResolver. resolve((String ) args[0 ])
69
69
}
70
- return method. invoke(currentImpl, args);
70
+ return method. invoke(currentImpl, args)
71
71
}
72
- );
72
+ )
73
73
74
- implField. set(null , newImpl);
74
+ implField. set(null , newImpl)
75
75
} catch (Exception e) {
76
- throw new RuntimeException (" Failed to register custom DNS resolver" , e);
76
+ throw new RuntimeException (" Failed to register custom DNS resolver" , e)
77
77
}
78
78
}
79
79
0 commit comments