Don't enforce JZlibDecoder on JDK7+, close #4707

Motivation:

`JdkZlibDecoder` is available since Netty 4.0.8 and works with JDK7+.
However, `io.netty.noJdkZlibDecoder` System prop evaluation always defaults to
true, causing Netty to always use JZLib when decompressing on the
client side when the property insn't explictly set to `false`.

Modifications:

Default to `false` instead of `true` when JDK7+.

Result:

JZLib optional as expected on JDK7+.
This commit is contained in:
Stephane Landelle 2016-01-14 18:59:35 +01:00 committed by Norman Maurer
parent 8b123a5546
commit f7c83c8565

View File

@ -33,7 +33,8 @@ public final class ZlibCodecFactory {
private static final boolean noJdkZlibEncoder; private static final boolean noJdkZlibEncoder;
static { static {
noJdkZlibDecoder = SystemPropertyUtil.getBoolean("io.netty.noJdkZlibDecoder", true); noJdkZlibDecoder = SystemPropertyUtil.getBoolean("io.netty.noJdkZlibDecoder",
PlatformDependent.javaVersion() < 7);
logger.debug("-Dio.netty.noJdkZlibDecoder: {}", noJdkZlibDecoder); logger.debug("-Dio.netty.noJdkZlibDecoder: {}", noJdkZlibDecoder);
noJdkZlibEncoder = SystemPropertyUtil.getBoolean("io.netty.noJdkZlibEncoder", false); noJdkZlibEncoder = SystemPropertyUtil.getBoolean("io.netty.noJdkZlibEncoder", false);