Skip to content

Commit

Permalink
Release XLT 6.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jowerner committed Mar 24, 2022
2 parents ebb666a + 07012cd commit f7e55d4
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 7 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.xceptance</groupId>
<artifactId>xlt</artifactId>
<version>6.1.0</version>
<version>6.1.1</version>
<packaging>jar</packaging>

<name>XLT</name>
Expand Down Expand Up @@ -257,7 +257,7 @@
<dependency>
<groupId>dnsjava</groupId>
<artifactId>dnsjava</artifactId>
<version>2.1.9</version>
<version>3.5.0</version>
</dependency>
<dependency>
<groupId>com.caucho</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import java.io.File;
import java.net.URL;
import java.util.Map;

import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.ObjectUtils;
Expand Down Expand Up @@ -362,7 +363,7 @@ private static ChromeDriverService modifyService(ChromeDriverService service, fi
// HACK: we can access the service's environment settings via reflection only

// read the environment settings
final ImmutableMap<String, String> environment = ReflectionUtils.readField(ChromeDriverService.class, service,
final Map<String, String> environment = ReflectionUtils.readField(ChromeDriverService.class, service,
FIELD_NAME_ENVIRONMENT);

// create the new environment settings including the DISPLAY variable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import java.io.File;
import java.net.URL;
import java.util.Map;

import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.ObjectUtils;
Expand Down Expand Up @@ -416,7 +417,7 @@ private static DriverService modifyService(final DriverService service, final bo
*/

// read the environment settings
final ImmutableMap<String, String> environment = ReflectionUtils.readField(DriverService.class, service,
final Map<String, String> environment = ReflectionUtils.readField(DriverService.class, service,
FIELD_NAME_ENVIRONMENT);

// create the new environment settings including the DISPLAY variable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.time.Duration;

import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.xbill.DNS.AAAARecord;
import org.xbill.DNS.ARecord;
Expand Down Expand Up @@ -69,7 +69,7 @@ class DnsJavaHostNameResolver implements HostNameResolver
final String[] serverAddresses = StringUtils.split(dnsServers, "\t ,;");
resolver = (serverAddresses.length == 0) ? new ExtendedResolver() : new ExtendedResolver(serverAddresses);

resolver.setTimeout(timeoutSeconds);
resolver.setTimeout(Duration.ofSeconds(timeoutSeconds));

if (ednsVersion >= 0)
{
Expand Down Expand Up @@ -132,7 +132,7 @@ private Record[] lookupRecordsByHostName(final String name) throws UnknownHostEx
final Record[] a = createNewLookup(name, Type.A).run();
final Record[] aaaa = createNewLookup(name, Type.AAAA).run();

final Record[] merged = ArrayUtils.addAll(a, aaaa);
final Record[] merged = concatRecordArrays(a, aaaa);
if (merged == null)
{
throw new UnknownHostException("Unknown host: " + name);
Expand All @@ -146,6 +146,43 @@ private Record[] lookupRecordsByHostName(final String name) throws UnknownHostEx
}
}

/**
* Concatenates the given {@link Record} arrays, handling <code>null</code> arrays sensibly.
*
* @param a
* the A records (may be <code>null</code>)
* @param aaaa
* the AAAA records (may be <code>null</code>)
* @return <code>null</code> if both input arrays were <code>null</code>, a result {@link Record} array otherwise
*/
private Record[] concatRecordArrays(final Record[] a, final Record[] aaaa)
{
/*
* Replaces "ArrayUtils.addAll(a, aaaa)" which cannot handle arrays of different sub-types, i.e. ARecord[] and
* AAAARecord[].
*/

final Record[] combined;

if (a == null)
{
combined = aaaa;
}
else if (aaaa == null)
{
combined = a;
}
else
{
combined = new Record[a.length + aaaa.length];

System.arraycopy(a, 0, combined, 0, a.length);
System.arraycopy(aaaa, 0, combined, a.length, aaaa.length);
}

return combined;
}

/**
* Creates a new {@link Lookup} instance for the given host name and query type and customizes it a bit.
*/
Expand Down

0 comments on commit f7e55d4

Please sign in to comment.