Require Java8 as minimum (#8739)
Motivation: While we are not yet quite sure if we want to require Java11 as minimum we are at least sure we want to use java8 as minimum. Modifications: Change minimum version to java8 and update some tests which failed compilation after this change. Result: Use Java8 as minimum and be able to use Java8 features.
This commit is contained in:
parent
26744b852b
commit
4a82d107d2
@ -15,6 +15,7 @@
|
||||
*/
|
||||
package io.netty.handler.codec.http.websocketx;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import io.netty.channel.embedded.EmbeddedChannel;
|
||||
import io.netty.handler.codec.http.DefaultFullHttpRequest;
|
||||
@ -70,7 +71,7 @@ public class WebSocketServerHandshaker00Test {
|
||||
}
|
||||
|
||||
EmbeddedChannel ch2 = new EmbeddedChannel(new HttpResponseDecoder());
|
||||
ch2.writeInbound(ch.readOutbound());
|
||||
ch2.writeInbound((ByteBuf) ch.readOutbound());
|
||||
HttpResponse res = ch2.readInbound();
|
||||
|
||||
Assert.assertEquals("ws://example.com/chat", res.headers().get(HttpHeaderNames.SEC_WEBSOCKET_LOCATION));
|
||||
|
@ -33,7 +33,7 @@ final class Socks4CommonTestUtils {
|
||||
out = new EmbeddedChannel(Socks4ServerEncoder.INSTANCE);
|
||||
}
|
||||
out.writeOutbound(msg);
|
||||
embedder.writeInbound(out.readOutbound());
|
||||
embedder.writeInbound((Object) out.readOutbound());
|
||||
out.finish();
|
||||
}
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ public class ByteToMessageCodecTest {
|
||||
assertTrue(ch.writeInbound(buffer));
|
||||
ch.pipeline().remove(codec);
|
||||
assertTrue(ch.finish());
|
||||
assertEquals(1, ch.readInbound());
|
||||
assertEquals(1, (int) ch.readInbound());
|
||||
|
||||
ByteBuf buf = (ByteBuf) ch.readInbound();
|
||||
assertEquals(Unpooled.wrappedBuffer(new byte[]{'0'}), buf);
|
||||
|
@ -86,8 +86,8 @@ public class FlushConsolidationHandlerTest {
|
||||
channel.flush();
|
||||
channel.runPendingTasks();
|
||||
assertEquals(3, flushCount.get());
|
||||
assertEquals(1L, channel.readOutbound());
|
||||
assertEquals(2L, channel.readOutbound());
|
||||
assertEquals(1L, (long) channel.readOutbound());
|
||||
assertEquals(2L, (long) channel.readOutbound());
|
||||
assertNull(channel.readOutbound());
|
||||
assertFalse(channel.finish());
|
||||
}
|
||||
@ -102,7 +102,7 @@ public class FlushConsolidationHandlerTest {
|
||||
assertNull(channel.readOutbound());
|
||||
channel.close();
|
||||
assertEquals(1, flushCount.get());
|
||||
assertEquals(1L, channel.readOutbound());
|
||||
assertEquals(1L, (long) channel.readOutbound());
|
||||
assertNull(channel.readOutbound());
|
||||
assertFalse(channel.finish());
|
||||
}
|
||||
@ -117,7 +117,7 @@ public class FlushConsolidationHandlerTest {
|
||||
assertNull(channel.readOutbound());
|
||||
channel.disconnect();
|
||||
assertEquals(1, flushCount.get());
|
||||
assertEquals(1L, channel.readOutbound());
|
||||
assertEquals(1L, (long) channel.readOutbound());
|
||||
assertNull(channel.readOutbound());
|
||||
assertFalse(channel.finish());
|
||||
}
|
||||
@ -132,7 +132,7 @@ public class FlushConsolidationHandlerTest {
|
||||
assertNull(channel.readOutbound());
|
||||
channel.pipeline().fireExceptionCaught(new IllegalStateException());
|
||||
assertEquals(1, flushCount.get());
|
||||
assertEquals(1L, channel.readOutbound());
|
||||
assertEquals(1L, (long) channel.readOutbound());
|
||||
assertNull(channel.readOutbound());
|
||||
channel.finish();
|
||||
}
|
||||
@ -147,7 +147,7 @@ public class FlushConsolidationHandlerTest {
|
||||
assertNull(channel.readOutbound());
|
||||
channel.pipeline().remove(FlushConsolidationHandler.class);
|
||||
assertEquals(1, flushCount.get());
|
||||
assertEquals(1L, channel.readOutbound());
|
||||
assertEquals(1L, (long) channel.readOutbound());
|
||||
assertNull(channel.readOutbound());
|
||||
assertFalse(channel.finish());
|
||||
}
|
||||
|
@ -223,7 +223,7 @@ public class ChunkedWriteHandlerTest {
|
||||
ch.writeAndFlush(input).syncUninterruptibly();
|
||||
assertTrue(ch.finish());
|
||||
|
||||
assertEquals(0, ch.readOutbound());
|
||||
assertEquals(0, (int) ch.readOutbound());
|
||||
assertNull(ch.readOutbound());
|
||||
}
|
||||
|
||||
|
70
pom.xml
70
pom.xml
@ -82,9 +82,6 @@
|
||||
<enforcer.plugin.version>3.0.0-M1</enforcer.plugin.version>
|
||||
<!-- 1.4.x does not work in Java10+ -->
|
||||
<jboss.marshalling.version>2.0.5.Final</jboss.marshalling.version>
|
||||
<!-- This is the minimum supported by Java12 -->
|
||||
<maven.compiler.source>1.7</maven.compiler.source>
|
||||
<maven.compiler.target>1.7</maven.compiler.target>
|
||||
<!-- pax-exam does not work on latest Java12 EA 22 build -->
|
||||
<skipOsgiTestsuite>true</skipOsgiTestsuite>
|
||||
</properties>
|
||||
@ -104,9 +101,6 @@
|
||||
<enforcer.plugin.version>3.0.0-M1</enforcer.plugin.version>
|
||||
<!-- 1.4.x does not work in Java10+ -->
|
||||
<jboss.marshalling.version>2.0.5.Final</jboss.marshalling.version>
|
||||
<!-- This is the minimum supported by Java12 -->
|
||||
<maven.compiler.source>1.7</maven.compiler.source>
|
||||
<maven.compiler.target>1.7</maven.compiler.target>
|
||||
<!-- pax-exam does not work on latest Java12 EA 22 build -->
|
||||
<skipOsgiTestsuite>true</skipOsgiTestsuite>
|
||||
</properties>
|
||||
@ -248,8 +242,8 @@
|
||||
</profiles>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>1.6</maven.compiler.source>
|
||||
<maven.compiler.target>1.6</maven.compiler.target>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<netty.dev.tools.directory>${project.build.directory}/dev-tools</netty.dev.tools.directory>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
@ -724,27 +718,14 @@
|
||||
<configuration>
|
||||
<signature>
|
||||
<groupId>org.codehaus.mojo.signature</groupId>
|
||||
<artifactId>java16</artifactId>
|
||||
<version>1.1</version>
|
||||
<artifactId>java18</artifactId>
|
||||
<version>1.0</version>
|
||||
</signature>
|
||||
<ignores>
|
||||
<ignore>sun.misc.Unsafe</ignore>
|
||||
<ignore>sun.misc.Cleaner</ignore>
|
||||
<ignore>sun.nio.ch.DirectBuffer</ignore>
|
||||
|
||||
<ignore>java.util.zip.Deflater</ignore>
|
||||
|
||||
<!-- Used for NIO -->
|
||||
<ignore>java.nio.channels.DatagramChannel</ignore>
|
||||
<ignore>java.nio.channels.MembershipKey</ignore>
|
||||
<ignore>java.nio.channels.ServerSocketChannel</ignore>
|
||||
<ignore>java.nio.channels.SocketChannel</ignore>
|
||||
<ignore>java.net.StandardProtocolFamily</ignore>
|
||||
<ignore>java.nio.channels.spi.SelectorProvider</ignore>
|
||||
<ignore>java.net.SocketOption</ignore>
|
||||
<ignore>java.net.StandardSocketOptions</ignore>
|
||||
<ignore>java.nio.channels.NetworkChannel</ignore>
|
||||
|
||||
<!-- Self-signed certificate generation -->
|
||||
<ignore>sun.security.x509.AlgorithmId</ignore>
|
||||
<ignore>sun.security.x509.CertificateAlgorithmId</ignore>
|
||||
@ -757,49 +738,6 @@
|
||||
<ignore>sun.security.x509.X500Name</ignore>
|
||||
<ignore>sun.security.x509.X509CertInfo</ignore>
|
||||
<ignore>sun.security.x509.X509CertImpl</ignore>
|
||||
|
||||
<!-- SSLSession implementation -->
|
||||
<ignore>javax.net.ssl.SSLEngine</ignore>
|
||||
<ignore>javax.net.ssl.ExtendedSSLSession</ignore>
|
||||
<ignore>javax.net.ssl.X509ExtendedTrustManager</ignore>
|
||||
<ignore>javax.net.ssl.SSLParameters</ignore>
|
||||
<ignore>javax.net.ssl.SNIServerName</ignore>
|
||||
<ignore>javax.net.ssl.SNIHostName</ignore>
|
||||
<ignore>javax.net.ssl.SNIMatcher</ignore>
|
||||
<ignore>java.security.AlgorithmConstraints</ignore>
|
||||
<ignore>java.security.cert.CertificateRevokedException</ignore>
|
||||
<ignore>java.security.cert.CertPathValidatorException</ignore>
|
||||
<ignore>java.security.cert.CertPathValidatorException$Reason</ignore>
|
||||
<ignore>java.security.cert.CertPathValidatorException$BasicReason</ignore>
|
||||
|
||||
<ignore>java.util.concurrent.ConcurrentLinkedDeque</ignore>
|
||||
<ignore>java.util.concurrent.ThreadLocalRandom</ignore>
|
||||
|
||||
<!-- Compression -->
|
||||
<ignore>java.util.zip.CRC32</ignore>
|
||||
<ignore>java.util.zip.Adler32</ignore>
|
||||
|
||||
<!-- NioDatagramChannel implementation -->
|
||||
<ignore>java.net.ProtocolFamily</ignore>
|
||||
|
||||
<!-- JDK 9 -->
|
||||
<ignore>java.nio.ByteBuffer</ignore>
|
||||
<ignore>java.nio.CharBuffer</ignore>
|
||||
|
||||
<!-- JDK 8 -->
|
||||
<ignore>java.util.concurrent.atomic.LongAdder</ignore>
|
||||
<ignore>java.util.function.BiFunction</ignore>
|
||||
<ignore>java.security.cert.X509Certificate</ignore>
|
||||
|
||||
<!-- Resolver -->
|
||||
<ignore>java.net.InetAddress</ignore>
|
||||
|
||||
<!-- NoexecVolumeDetector -->
|
||||
<ignore>java.nio.file.attribute.PosixFilePermission</ignore>
|
||||
<ignore>java.nio.file.Files</ignore>
|
||||
<ignore>java.nio.file.LinkOption</ignore>
|
||||
<ignore>java.nio.file.Path</ignore>
|
||||
<ignore>java.io.File</ignore>
|
||||
</ignores>
|
||||
<annotations>
|
||||
<annotation>io.netty.util.internal.SuppressJava6Requirement</annotation>
|
||||
|
@ -259,9 +259,9 @@ public class PendingWriteQueueTest {
|
||||
assertTrue(promise3.isDone());
|
||||
assertTrue(promise3.isSuccess());
|
||||
assertTrue(channel.finish());
|
||||
assertEquals(1L, channel.readOutbound());
|
||||
assertEquals(2L, channel.readOutbound());
|
||||
assertEquals(3L, channel.readOutbound());
|
||||
assertEquals(1L, (long) channel.readOutbound());
|
||||
assertEquals(2L, (long) channel.readOutbound());
|
||||
assertEquals(3L, (long) channel.readOutbound());
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -284,8 +284,8 @@ public class PendingWriteQueueTest {
|
||||
assertTrue(channel.finish());
|
||||
assertTrue(promise.isDone());
|
||||
assertTrue(promise.isSuccess());
|
||||
assertEquals(1L, channel.readOutbound());
|
||||
assertEquals(2L, channel.readOutbound());
|
||||
assertEquals(1L, (long) channel.readOutbound());
|
||||
assertEquals(2L, (long) channel.readOutbound());
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -354,8 +354,8 @@ public class PendingWriteQueueTest {
|
||||
assertTrue(promise2.isSuccess());
|
||||
assertTrue(channel.finish());
|
||||
|
||||
assertEquals(1L, channel.readOutbound());
|
||||
assertEquals(2L, channel.readOutbound());
|
||||
assertEquals(1L, (long) channel.readOutbound());
|
||||
assertEquals(2L, (long) channel.readOutbound());
|
||||
assertNull(channel.readOutbound());
|
||||
assertNull(channel.readInbound());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user