squid:UselessParenthesesCheck - Useless parentheses around expressions should be removed to prevent any misunderstanding
This commit is contained in:
parent
ab19c47415
commit
046e131119
@ -71,6 +71,6 @@ public final class Dispatcher {
|
||||
}
|
||||
|
||||
private void dispatchAction(Action action) {
|
||||
stores.stream().forEach((store) -> store.onAction(action));
|
||||
stores.stream().forEach(store -> store.onAction(action));
|
||||
}
|
||||
}
|
||||
|
@ -44,6 +44,6 @@ public abstract class Store {
|
||||
}
|
||||
|
||||
protected void notifyChange() {
|
||||
views.stream().forEach((view) -> view.storeChanged(this));
|
||||
views.stream().forEach(view -> view.storeChanged(this));
|
||||
}
|
||||
}
|
||||
|
@ -143,6 +143,6 @@ public class App {
|
||||
} catch (InterruptedException e) {
|
||||
System.out.println(e);
|
||||
}
|
||||
return (i) * (i + 1) / 2;
|
||||
return i * (i + 1) / 2;
|
||||
}
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ public class CakeBakingServiceImpl implements CakeBakingService {
|
||||
public void bakeNewCake(CakeInfo cakeInfo) throws CakeBakingException {
|
||||
List<CakeTopping> allToppings = getAvailableToppingEntities();
|
||||
List<CakeTopping> matchingToppings =
|
||||
allToppings.stream().filter((t) -> t.getName().equals(cakeInfo.cakeToppingInfo.name))
|
||||
allToppings.stream().filter(t -> t.getName().equals(cakeInfo.cakeToppingInfo.name))
|
||||
.collect(Collectors.toList());
|
||||
if (matchingToppings.isEmpty()) {
|
||||
throw new CakeBakingException(String.format("Topping %s is not available",
|
||||
@ -64,7 +64,7 @@ public class CakeBakingServiceImpl implements CakeBakingService {
|
||||
Set<CakeLayer> foundLayers = new HashSet<>();
|
||||
for (CakeLayerInfo info : cakeInfo.cakeLayerInfos) {
|
||||
Optional<CakeLayer> found =
|
||||
allLayers.stream().filter((layer) -> layer.getName().equals(info.name)).findFirst();
|
||||
allLayers.stream().filter(layer -> layer.getName().equals(info.name)).findFirst();
|
||||
if (!found.isPresent()) {
|
||||
throw new CakeBakingException(String.format("Layer %s is not available", info.name));
|
||||
} else {
|
||||
|
@ -36,6 +36,6 @@ public class CakeViewImpl implements View {
|
||||
}
|
||||
|
||||
public void render() {
|
||||
cakeBakingService.getAllCakes().stream().forEach((cake) -> System.out.println(cake));
|
||||
cakeBakingService.getAllCakes().stream().forEach(cake -> System.out.println(cake));
|
||||
}
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ public class App {
|
||||
});
|
||||
|
||||
context.start();
|
||||
context.getRoutes().stream().forEach((r) -> System.out.println(r));
|
||||
context.getRoutes().stream().forEach(r -> System.out.println(r));
|
||||
context.stop();
|
||||
}
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ public class App {
|
||||
});
|
||||
ProducerTemplate template = context.createProducerTemplate();
|
||||
context.start();
|
||||
context.getRoutes().stream().forEach((r) -> System.out.println(r));
|
||||
context.getRoutes().stream().forEach(r -> System.out.println(r));
|
||||
template.sendBody("direct:origin", "Hello from origin");
|
||||
context.stop();
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ public class LoggingHandler implements ChannelHandler {
|
||||
* received is a ByteBuffer (from TCP channel) or a DatagramPacket (from UDP channel).
|
||||
*/
|
||||
if (readObject instanceof ByteBuffer) {
|
||||
doLogging(((ByteBuffer) readObject));
|
||||
doLogging((ByteBuffer) readObject);
|
||||
sendReply(channel, key);
|
||||
} else if (readObject instanceof DatagramPacket) {
|
||||
DatagramPacket datagram = (DatagramPacket) readObject;
|
||||
|
@ -97,9 +97,9 @@ public class Person {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + age;
|
||||
result = prime * result + ((id == null) ? 0 : id.hashCode());
|
||||
result = prime * result + ((name == null) ? 0 : name.hashCode());
|
||||
result = prime * result + ((surname == null) ? 0 : surname.hashCode());
|
||||
result = prime * result + (id == null ? 0 : id.hashCode());
|
||||
result = prime * result + (name == null ? 0 : name.hashCode());
|
||||
result = prime * result + (surname == null ? 0 : surname.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -97,7 +97,7 @@ public class Character {
|
||||
.append(name)
|
||||
.append(" armed with a ")
|
||||
.append(weapon != null ? weapon : spell != null ? spell : "with nothing")
|
||||
.append(abilities != null ? (" and wielding " + abilities + " abilities") : "")
|
||||
.append(abilities != null ? " and wielding " + abilities + " abilities" : "")
|
||||
.append('.');
|
||||
return sb.toString();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user