Skip to content

Commit 218ba44

Browse files
perwramdemarkiluwatar
authored andcommitted
Upgrade of maven plugins (iluwatar#951)
* Upgrade maven plugins * Upgrade maven plugins Some general code cleanup was necessary due to upgrade of PMD and checkstyle. Also needed to add Junit 4 as a dependency due to Mockito.timout issue found here: mockito/mockito#152
1 parent 05d0f0b commit 218ba44

File tree

19 files changed

+63
-84
lines changed

19 files changed

+63
-84
lines changed

async-method-invocation/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,10 @@
4343
<artifactId>mockito-core</artifactId>
4444
<scope>test</scope>
4545
</dependency>
46+
<dependency>
47+
<groupId>junit</groupId>
48+
<artifactId>junit</artifactId>
49+
<scope>test</scope>
50+
</dependency>
4651
</dependencies>
4752
</project>

bytecode/src/main/java/com/iluwatar/bytecode/Instruction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ public enum Instruction {
2929

3030
LITERAL(1),
3131
SET_HEALTH(2),
32-
SET_WISDOM (3),
32+
SET_WISDOM(3),
3333
SET_AGILITY(4),
3434
PLAY_SOUND(5),
3535
SPAWN_PARTICLES(6),
3636
GET_HEALTH(7),
3737
GET_AGILITY(8),
3838
GET_WISDOM(9),
3939
ADD(10),
40-
DIVIDE (11);
40+
DIVIDE(11);
4141

4242
private int value;
4343

caching/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565
<plugin>
6666
<groupId>org.apache.maven.plugins</groupId>
6767
<artifactId>maven-surefire-plugin</artifactId>
68-
<version>2.19</version>
6968
<configuration>
7069
<skipTests>false</skipTests>
7170
</configuration>

caching/src/main/java/com/iluwatar/caching/CachingPolicy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public enum CachingPolicy {
3232

3333
private String policy;
3434

35-
private CachingPolicy(String policy) {
35+
CachingPolicy(String policy) {
3636
this.policy = policy;
3737
}
3838

commander/src/main/java/com/iluwatar/commander/Commander.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -239,12 +239,12 @@ private void updateQueue(QueueTask qt) throws InterruptedException {
239239
//since payment time is lesser than queuetime it would have already failed..additional check not needed
240240
LOG.trace("Order " + qt.order.id + ": Queue time for order over, failed..");
241241
return;
242-
} else if ((qt.taskType.equals(TaskType.Payment) && !qt.order.paid.equals(PaymentStatus.Trying))
243-
|| (qt.taskType.equals(TaskType.Messaging) && ((qt.messageType == 1
244-
&& !qt.order.messageSent.equals(MessageSent.NoneSent))
242+
} else if (qt.taskType.equals(TaskType.Payment) && !qt.order.paid.equals(PaymentStatus.Trying)
243+
|| qt.taskType.equals(TaskType.Messaging) && (qt.messageType == 1
244+
&& !qt.order.messageSent.equals(MessageSent.NoneSent)
245245
|| qt.order.messageSent.equals(MessageSent.PaymentFail)
246-
|| qt.order.messageSent.equals(MessageSent.PaymentSuccessful)))
247-
|| (qt.taskType.equals(TaskType.EmployeeDb) && qt.order.addedToEmployeeHandle)) {
246+
|| qt.order.messageSent.equals(MessageSent.PaymentSuccessful))
247+
|| qt.taskType.equals(TaskType.EmployeeDb) && qt.order.addedToEmployeeHandle) {
248248
LOG.trace("Order " + qt.order.id + ": Not queueing task since task already done..");
249249
return;
250250
}
@@ -576,8 +576,8 @@ private void doTasksInQueue() throws Exception {
576576
|| qt.order.messageSent.equals(MessageSent.PaymentSuccessful)) {
577577
tryDequeue();
578578
LOG.trace("Order " + qt.order.id + ": This messaging task already done, dequeue..");
579-
} else if ((qt.messageType == 1 && (!qt.order.messageSent.equals(MessageSent.NoneSent)
580-
|| !qt.order.paid.equals(PaymentStatus.Trying)))) {
579+
} else if (qt.messageType == 1 && (!qt.order.messageSent.equals(MessageSent.NoneSent)
580+
|| !qt.order.paid.equals(PaymentStatus.Trying))) {
581581
tryDequeue();
582582
LOG.trace("Order " + qt.order.id + ": This messaging task does not need to be done, dequeue..");
583583
} else if (qt.messageType == 0) {
@@ -606,8 +606,7 @@ private void doTasksInQueue() throws Exception {
606606
} else {
607607
Thread.sleep(queueTaskTime / 3);
608608
tryDoingTasksInQueue();
609-
}
610-
return;
609+
}
611610
}
612611

613612
}

commander/src/main/java/com/iluwatar/commander/queue/Queue.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,15 @@ T dequeue() throws IsEmptyException {
8383
Node temp = front;
8484
front = front.next;
8585
size = size - 1;
86-
return ((T) temp.value);
86+
return (T) temp.value;
8787
}
8888
}
8989

9090
T peek() throws IsEmptyException {
9191
if (isEmpty()) {
9292
throw new IsEmptyException();
9393
} else {
94-
return ((T)front.value);
94+
return (T)front.value;
9595
}
9696
}
9797
}

double-checked-locking/src/main/java/com/iluwatar/doublechecked/locking/App.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ public static void main(String[] args) {
5555
ExecutorService executorService = Executors.newFixedThreadPool(3);
5656
for (int i = 0; i < 3; i++) {
5757
executorService.execute(() -> {
58-
while (inventory.addItem(new Item())) {};
58+
while (inventory.addItem(new Item())) {
59+
LOGGER.info("Adding another item");
60+
}
5961
});
6062
}
6163

event-asynchronous/src/main/java/com/iluwatar/event/asynchronous/Event.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public final void removeListener(final ThreadCompleteListener listener) {
9797
this.eventListener = null;
9898
}
9999

100-
private final void completed() {
100+
private void completed() {
101101
if (eventListener != null) {
102102
eventListener.completedEventHandler(eventId);
103103
}

exclude-pmd.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@
2424
com.iluwatar.servicelayer.common.BaseEntity=UnusedPrivateField
2525
com.iluwatar.doublechecked.locking.App=EmptyStatementNotInLoop,EmptyWhileStmt
2626
com.iluwatar.doublechecked.locking.InventoryTest=EmptyStatementNotInLoop,EmptyWhileStmt
27+
domainapp.dom.modules.simple.QSimpleObject=UnusedFormalParameter

flux/src/main/java/com/iluwatar/flux/action/Content.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public enum Content {
3434

3535
private String title;
3636

37-
private Content(String title) {
37+
Content(String title) {
3838
this.title = title;
3939
}
4040

0 commit comments

Comments
 (0)