Update netty-build to the latest version
From this commit, checkstyle considers an unnecessary empty line as a violation.
This commit is contained in:
parent
85c570505b
commit
9c0b2ad75c
@ -101,7 +101,6 @@ public class FileServer {
|
|||||||
ctx.write(file + " " + file.length() + "\n");
|
ctx.write(file + " " + file.length() + "\n");
|
||||||
ctx.sendFile(new DefaultFileRegion(new FileInputStream(file).getChannel(), 0, file.length()));
|
ctx.sendFile(new DefaultFileRegion(new FileInputStream(file).getChannel(), 0, file.length()));
|
||||||
ctx.write("\n");
|
ctx.write("\n");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
ctx.write("File not found: " + file + "\n");
|
ctx.write("File not found: " + file + "\n");
|
||||||
}
|
}
|
||||||
|
2
pom.xml
2
pom.xml
@ -330,7 +330,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>${project.groupId}</groupId>
|
<groupId>${project.groupId}</groupId>
|
||||||
<artifactId>netty-build</artifactId>
|
<artifactId>netty-build</artifactId>
|
||||||
<version>12</version>
|
<version>13</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
@ -393,8 +393,6 @@ public abstract class AbstractChannel extends DefaultAttributeMap implements Cha
|
|||||||
return strVal;
|
return strVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected abstract class AbstractUnsafe implements Unsafe {
|
protected abstract class AbstractUnsafe implements Unsafe {
|
||||||
|
|
||||||
private final class FlushTask {
|
private final class FlushTask {
|
||||||
@ -446,11 +444,9 @@ public abstract class AbstractChannel extends DefaultAttributeMap implements Cha
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// nothing pending try to send the fileRegion now!
|
// nothing pending try to send the fileRegion now!
|
||||||
sendFile0(region, future);
|
sendFile0(region, future);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
eventLoop().execute(new Runnable() {
|
eventLoop().execute(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
@ -736,7 +732,6 @@ public abstract class AbstractChannel extends DefaultAttributeMap implements Cha
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
flushNotifierAndFlush(future);
|
flushNotifierAndFlush(future);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
eventLoop().execute(new Runnable() {
|
eventLoop().execute(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -278,6 +278,5 @@ public interface Channel extends AttributeMap, ChannelOutboundInvoker, ChannelPr
|
|||||||
void resumeRead();
|
void resumeRead();
|
||||||
|
|
||||||
void sendFile(FileRegion region, ChannelFuture future);
|
void sendFile(FileRegion region, ChannelFuture future);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -565,7 +565,6 @@ public class AioSocketChannel extends AbstractAioChannel implements SocketChanne
|
|||||||
@Override
|
@Override
|
||||||
public void completed(Integer result, Object attachment) {
|
public void completed(Integer result, Object attachment) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
if (result == 0) {
|
if (result == 0) {
|
||||||
javaChannel().write(src, null, this);
|
javaChannel().write(src, null, this);
|
||||||
return;
|
return;
|
||||||
|
@ -109,7 +109,6 @@ abstract class AbstractNioByteChannel extends AbstractNioChannel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doFlushByteBuffer(ByteBuf buf) throws Exception {
|
protected void doFlushByteBuffer(ByteBuf buf) throws Exception {
|
||||||
if (!buf.readable()) {
|
if (!buf.readable()) {
|
||||||
@ -131,7 +130,6 @@ abstract class AbstractNioByteChannel extends AbstractNioChannel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doFlushFileRegion(final FileRegion region, final ChannelFuture future) throws Exception {
|
protected void doFlushFileRegion(final FileRegion region, final ChannelFuture future) throws Exception {
|
||||||
if (javaChannel() instanceof WritableByteChannel) {
|
if (javaChannel() instanceof WritableByteChannel) {
|
||||||
|
@ -128,7 +128,6 @@ public final class NioEventLoop extends SingleThreadEventLoop {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void executeWhenWritable(AbstractNioChannel channel, NioTask<? extends SelectableChannel> task) {
|
void executeWhenWritable(AbstractNioChannel channel, NioTask<? extends SelectableChannel> task) {
|
||||||
if (channel == null) {
|
if (channel == null) {
|
||||||
throw new NullPointerException("channel");
|
throw new NullPointerException("channel");
|
||||||
@ -141,7 +140,6 @@ public final class NioEventLoop extends SingleThreadEventLoop {
|
|||||||
SelectionKey key = channel.selectionKey();
|
SelectionKey key = channel.selectionKey();
|
||||||
channel.writableTasks.offer((NioTask<SelectableChannel>) task);
|
channel.writableTasks.offer((NioTask<SelectableChannel>) task);
|
||||||
key.interestOps(key.interestOps() | SelectionKey.OP_WRITE);
|
key.interestOps(key.interestOps() | SelectionKey.OP_WRITE);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a new selector and "transfer" all channels from the old
|
// Create a new selector and "transfer" all channels from the old
|
||||||
|
@ -253,6 +253,5 @@ public class OioSocketChannel extends AbstractOioByteChannel
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user