Skip to content

Commit 35d6a54

Browse files
committed
Merge pull request iluwatar#391 from DevFactory/release/Useless-parentheses-around-expressions-should-be-removed-to-prevent-any-misunderstanding-fix-1
squid:UselessParenthesesCheck - Useless parentheses around expression…
2 parents f135ef6 + 046e131 commit 35d6a54

File tree

10 files changed

+13
-13
lines changed

10 files changed

+13
-13
lines changed

flux/src/main/java/com/iluwatar/flux/dispatcher/Dispatcher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,6 @@ public void menuItemSelected(MenuItem menuItem) {
7171
}
7272

7373
private void dispatchAction(Action action) {
74-
stores.stream().forEach((store) -> store.onAction(action));
74+
stores.stream().forEach(store -> store.onAction(action));
7575
}
7676
}

flux/src/main/java/com/iluwatar/flux/store/Store.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@ public void registerView(View view) {
4444
}
4545

4646
protected void notifyChange() {
47-
views.stream().forEach((view) -> view.storeChanged(this));
47+
views.stream().forEach(view -> view.storeChanged(this));
4848
}
4949
}

half-sync-half-async/src/main/java/com/iluwatar/halfsynchalfasync/App.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,6 @@ private static long ap(long i) {
143143
} catch (InterruptedException e) {
144144
System.out.println(e);
145145
}
146-
return (i) * (i + 1) / 2;
146+
return i * (i + 1) / 2;
147147
}
148148
}

layers/src/main/java/com/iluwatar/layers/CakeBakingServiceImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public CakeBakingServiceImpl() {
5454
public void bakeNewCake(CakeInfo cakeInfo) throws CakeBakingException {
5555
List<CakeTopping> allToppings = getAvailableToppingEntities();
5656
List<CakeTopping> matchingToppings =
57-
allToppings.stream().filter((t) -> t.getName().equals(cakeInfo.cakeToppingInfo.name))
57+
allToppings.stream().filter(t -> t.getName().equals(cakeInfo.cakeToppingInfo.name))
5858
.collect(Collectors.toList());
5959
if (matchingToppings.isEmpty()) {
6060
throw new CakeBakingException(String.format("Topping %s is not available",
@@ -64,7 +64,7 @@ public void bakeNewCake(CakeInfo cakeInfo) throws CakeBakingException {
6464
Set<CakeLayer> foundLayers = new HashSet<>();
6565
for (CakeLayerInfo info : cakeInfo.cakeLayerInfos) {
6666
Optional<CakeLayer> found =
67-
allLayers.stream().filter((layer) -> layer.getName().equals(info.name)).findFirst();
67+
allLayers.stream().filter(layer -> layer.getName().equals(info.name)).findFirst();
6868
if (!found.isPresent()) {
6969
throw new CakeBakingException(String.format("Layer %s is not available", info.name));
7070
} else {

layers/src/main/java/com/iluwatar/layers/CakeViewImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ public CakeViewImpl(CakeBakingService cakeBakingService) {
3636
}
3737

3838
public void render() {
39-
cakeBakingService.getAllCakes().stream().forEach((cake) -> System.out.println(cake));
39+
cakeBakingService.getAllCakes().stream().forEach(cake -> System.out.println(cake));
4040
}
4141
}

message-channel/src/main/java/com/iluwatar/message/channel/App.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public void configure() throws Exception {
6666
});
6767

6868
context.start();
69-
context.getRoutes().stream().forEach((r) -> System.out.println(r));
69+
context.getRoutes().stream().forEach(r -> System.out.println(r));
7070
context.stop();
7171
}
7272
}

publish-subscribe/src/main/java/com/iluwatar/publish/subscribe/App.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public void configure() throws Exception {
6161
});
6262
ProducerTemplate template = context.createProducerTemplate();
6363
context.start();
64-
context.getRoutes().stream().forEach((r) -> System.out.println(r));
64+
context.getRoutes().stream().forEach(r -> System.out.println(r));
6565
template.sendBody("direct:origin", "Hello from origin");
6666
context.stop();
6767
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public void handleChannelRead(AbstractNioChannel channel, Object readObject, Sel
4747
* received is a ByteBuffer (from TCP channel) or a DatagramPacket (from UDP channel).
4848
*/
4949
if (readObject instanceof ByteBuffer) {
50-
doLogging(((ByteBuffer) readObject));
50+
doLogging((ByteBuffer) readObject);
5151
sendReply(channel, key);
5252
} else if (readObject instanceof DatagramPacket) {
5353
DatagramPacket datagram = (DatagramPacket) readObject;

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ public int hashCode() {
9797
final int prime = 31;
9898
int result = 1;
9999
result = prime * result + age;
100-
result = prime * result + ((id == null) ? 0 : id.hashCode());
101-
result = prime * result + ((name == null) ? 0 : name.hashCode());
102-
result = prime * result + ((surname == null) ? 0 : surname.hashCode());
100+
result = prime * result + (id == null ? 0 : id.hashCode());
101+
result = prime * result + (name == null ? 0 : name.hashCode());
102+
result = prime * result + (surname == null ? 0 : surname.hashCode());
103103
return result;
104104
}
105105

step-builder/src/main/java/com/iluwatar/stepbuilder/Character.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public String toString() {
9797
.append(name)
9898
.append(" armed with a ")
9999
.append(weapon != null ? weapon : spell != null ? spell : "with nothing")
100-
.append(abilities != null ? (" and wielding " + abilities + " abilities") : "")
100+
.append(abilities != null ? " and wielding " + abilities + " abilities" : "")
101101
.append('.');
102102
return sb.toString();
103103
}

0 commit comments

Comments
 (0)