Fixed - JDK 1.6 compatibility for 2.x base line. #1719

pull/1730/head
Nikita Koksharov 6 years ago
parent a71460624e
commit 52685c144d

@ -20,7 +20,7 @@
<maven.test.skip>true</maven.test.skip>
<source.version>1.6</source.version>
<test.source.version>1.8</test.source.version>
<release.version>7</release.version>
<release.version>6</release.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

@ -17,6 +17,7 @@ package org.redisson.client.handler;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Method;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
@ -155,7 +156,13 @@ public class RedisChannelInitializer extends ChannelInitializer<Channel> {
SSLParameters sslParams = new SSLParameters();
if (config.isSslEnableEndpointIdentification()) {
sslParams.setEndpointIdentificationAlgorithm("HTTPS");
// TODO remove for JDK 1.7+
try {
Method method = sslParams.getClass().getDeclaredMethod("setEndpointIdentificationAlgorithm", String.class);
method.invoke(sslParams, "HTTPS");
} catch (Exception e) {
throw new SSLException(e);
}
} else {
if (config.getSslTruststore() == null) {
sslContextBuilder.trustManager(InsecureTrustManagerFactory.INSTANCE);

@ -45,7 +45,7 @@ public class PendingResultDecoder implements MultiDecoder<Object> {
for (List<String> mapping : customerParts) {
consumerNames.put(mapping.get(0), Long.valueOf(mapping.get(1)));
}
return new PendingResult((long)parts.get(0), convertor.convert(parts.get(1)), convertor.convert(parts.get(2)), consumerNames);
return new PendingResult((Long)parts.get(0), convertor.convert(parts.get(1)), convertor.convert(parts.get(2)), consumerNames);
}
}

Loading…
Cancel
Save