Skip to content

Commit

Permalink
Use pattern variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
baldersheim committed Apr 5, 2024
1 parent afc48db commit ac74f41
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,7 @@ protected Object newInstance() {
}

private Object initId(Object component) {
if (component instanceof AbstractComponent) {
AbstractComponent abstractComponent = (AbstractComponent) component;
if (component instanceof AbstractComponent abstractComponent) {
if (abstractComponent.hasInitializedId() && !abstractComponent.getId().equals(componentId())) {
throw new IllegalStateException(
"Component with id '" + componentId() + "' is trying to set its component id explicitly: '" + abstractComponent.getId() + "'. " +
Expand Down Expand Up @@ -199,8 +198,7 @@ public int hashCode() {

@Override
public boolean equals(Object other) {
if (other instanceof ComponentNode) {
ComponentNode that = (ComponentNode) other;
if (other instanceof ComponentNode that) {
return super.equals(that) && equalEdges(Arrays.asList(this.arguments), Arrays.asList(that.arguments)) && this.usedConfigs().equals(that.usedConfigs());
} else {
return false;
Expand Down

0 comments on commit ac74f41

Please sign in to comment.