Skip to content

Commit 3791a80

Browse files
author
Mohammed Ezzat
committed
squid:S2325 - private methods that don't access instance data should be static
1 parent c580b61 commit 3791a80

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

facade/src/main/java/com/iluwatar/facade/DwarvenGoldmineFacade.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public void endDay() {
6060
makeActions(workers, DwarvenMineWorker.Action.GO_HOME, DwarvenMineWorker.Action.GO_TO_SLEEP);
6161
}
6262

63-
private void makeActions(Collection<DwarvenMineWorker> workers,
63+
private static void makeActions(Collection<DwarvenMineWorker> workers,
6464
DwarvenMineWorker.Action... actions) {
6565
for (DwarvenMineWorker worker : workers) {
6666
worker.action(actions);

front-controller/src/main/java/com/iluwatar/front/controller/FrontController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ private Command getCommand(String request) {
4444
}
4545
}
4646

47-
private Class getCommandClass(String request) {
47+
private static Class getCommandClass(String request) {
4848
Class result;
4949
try {
5050
result = Class.forName("com.iluwatar.front.controller." + request + "Command");

reactor/src/main/java/com/iluwatar/reactor/app/LoggingHandler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public void handleChannelRead(AbstractNioChannel channel, Object readObject, Sel
5858
}
5959
}
6060

61-
private void sendReply(AbstractNioChannel channel, DatagramPacket incomingPacket, SelectionKey key) {
61+
private static void sendReply(AbstractNioChannel channel, DatagramPacket incomingPacket, SelectionKey key) {
6262
/*
6363
* Create a reply acknowledgement datagram packet setting the receiver to the sender of incoming
6464
* message.
@@ -69,12 +69,12 @@ private void sendReply(AbstractNioChannel channel, DatagramPacket incomingPacket
6969
channel.write(replyPacket, key);
7070
}
7171

72-
private void sendReply(AbstractNioChannel channel, SelectionKey key) {
72+
private static void sendReply(AbstractNioChannel channel, SelectionKey key) {
7373
ByteBuffer buffer = ByteBuffer.wrap(ACK);
7474
channel.write(buffer, key);
7575
}
7676

77-
private void doLogging(ByteBuffer data) {
77+
private static void doLogging(ByteBuffer data) {
7878
// assuming UTF-8 :(
7979
System.out.println(new String(data.array(), 0, data.limit()));
8080
}

reactor/src/main/java/com/iluwatar/reactor/framework/NioReactor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ private void processKey(SelectionKey key) throws IOException {
186186
}
187187
}
188188

189-
private void onChannelWritable(SelectionKey key) throws IOException {
189+
private static void onChannelWritable(SelectionKey key) throws IOException {
190190
AbstractNioChannel channel = (AbstractNioChannel) key.attachment();
191191
channel.flush(key);
192192
}

reader-writer-lock/src/main/java/com/iluwatar/reader/writer/lock/ReaderWriterLock.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ private boolean isLockFree() {
8989
return globalMutex.isEmpty();
9090
}
9191

92-
private void waitUninterruptibly(Object o) {
92+
private static void waitUninterruptibly(Object o) {
9393
try {
9494
o.wait();
9595
} catch (InterruptedException e) {

repository/src/main/java/com/iluwatar/repository/AppConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
7676
/**
7777
* Properties for Jpa
7878
*/
79-
private Properties jpaProperties() {
79+
private static Properties jpaProperties() {
8080
Properties properties = new Properties();
8181
properties.setProperty("hibernate.dialect", "org.hibernate.dialect.H2Dialect");
8282
properties.setProperty("hibernate.hbm2ddl.auto", "create-drop");

0 commit comments

Comments
 (0)