squid:S2325 - private methods that don't access instance data should be static

This commit is contained in:
Mohammed Ezzat
2016-02-22 19:15:51 +02:00
parent c580b61df3
commit 3791a80978
6 changed files with 8 additions and 8 deletions

View File

@ -58,7 +58,7 @@ public class LoggingHandler implements ChannelHandler {
}
}
private void sendReply(AbstractNioChannel channel, DatagramPacket incomingPacket, SelectionKey key) {
private static void sendReply(AbstractNioChannel channel, DatagramPacket incomingPacket, SelectionKey key) {
/*
* Create a reply acknowledgement datagram packet setting the receiver to the sender of incoming
* message.
@ -69,12 +69,12 @@ public class LoggingHandler implements ChannelHandler {
channel.write(replyPacket, key);
}
private void sendReply(AbstractNioChannel channel, SelectionKey key) {
private static void sendReply(AbstractNioChannel channel, SelectionKey key) {
ByteBuffer buffer = ByteBuffer.wrap(ACK);
channel.write(buffer, key);
}
private void doLogging(ByteBuffer data) {
private static void doLogging(ByteBuffer data) {
// assuming UTF-8 :(
System.out.println(new String(data.array(), 0, data.limit()));
}

View File

@ -186,7 +186,7 @@ public class NioReactor {
}
}
private void onChannelWritable(SelectionKey key) throws IOException {
private static void onChannelWritable(SelectionKey key) throws IOException {
AbstractNioChannel channel = (AbstractNioChannel) key.attachment();
channel.flush(key);
}