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

@ -60,7 +60,7 @@ public class DwarvenGoldmineFacade {
makeActions(workers, DwarvenMineWorker.Action.GO_HOME, DwarvenMineWorker.Action.GO_TO_SLEEP); 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) { DwarvenMineWorker.Action... actions) {
for (DwarvenMineWorker worker : workers) { for (DwarvenMineWorker worker : workers) {
worker.action(actions); worker.action(actions);

View File

@ -44,7 +44,7 @@ public class FrontController {
} }
} }
private Class getCommandClass(String request) { private static Class getCommandClass(String request) {
Class result; Class result;
try { try {
result = Class.forName("com.iluwatar.front.controller." + request + "Command"); result = Class.forName("com.iluwatar.front.controller." + request + "Command");

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

View File

@ -89,7 +89,7 @@ public class ReaderWriterLock implements ReadWriteLock {
return globalMutex.isEmpty(); return globalMutex.isEmpty();
} }
private void waitUninterruptibly(Object o) { private static void waitUninterruptibly(Object o) {
try { try {
o.wait(); o.wait();
} catch (InterruptedException e) { } catch (InterruptedException e) {

View File

@ -76,7 +76,7 @@ public class AppConfig {
/** /**
* Properties for Jpa * Properties for Jpa
*/ */
private Properties jpaProperties() { private static Properties jpaProperties() {
Properties properties = new Properties(); Properties properties = new Properties();
properties.setProperty("hibernate.dialect", "org.hibernate.dialect.H2Dialect"); properties.setProperty("hibernate.dialect", "org.hibernate.dialect.H2Dialect");
properties.setProperty("hibernate.hbm2ddl.auto", "create-drop"); properties.setProperty("hibernate.hbm2ddl.auto", "create-drop");