squid:S2325 - private methods that don't access instance data should be static
This commit is contained in:
parent
c580b61df3
commit
3791a80978
@ -60,7 +60,7 @@ public class DwarvenGoldmineFacade {
|
||||
makeActions(workers, DwarvenMineWorker.Action.GO_HOME, DwarvenMineWorker.Action.GO_TO_SLEEP);
|
||||
}
|
||||
|
||||
private void makeActions(Collection<DwarvenMineWorker> workers,
|
||||
private static void makeActions(Collection<DwarvenMineWorker> workers,
|
||||
DwarvenMineWorker.Action... actions) {
|
||||
for (DwarvenMineWorker worker : workers) {
|
||||
worker.action(actions);
|
||||
|
@ -44,7 +44,7 @@ public class FrontController {
|
||||
}
|
||||
}
|
||||
|
||||
private Class getCommandClass(String request) {
|
||||
private static Class getCommandClass(String request) {
|
||||
Class result;
|
||||
try {
|
||||
result = Class.forName("com.iluwatar.front.controller." + request + "Command");
|
||||
|
@ -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()));
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ public class ReaderWriterLock implements ReadWriteLock {
|
||||
return globalMutex.isEmpty();
|
||||
}
|
||||
|
||||
private void waitUninterruptibly(Object o) {
|
||||
private static void waitUninterruptibly(Object o) {
|
||||
try {
|
||||
o.wait();
|
||||
} catch (InterruptedException e) {
|
||||
|
@ -76,7 +76,7 @@ public class AppConfig {
|
||||
/**
|
||||
* Properties for Jpa
|
||||
*/
|
||||
private Properties jpaProperties() {
|
||||
private static Properties jpaProperties() {
|
||||
Properties properties = new Properties();
|
||||
properties.setProperty("hibernate.dialect", "org.hibernate.dialect.H2Dialect");
|
||||
properties.setProperty("hibernate.hbm2ddl.auto", "create-drop");
|
||||
|
Loading…
x
Reference in New Issue
Block a user