Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
*******************************************************************************/
package org.eclipse.swt.graphics;

import java.util.*;

import org.eclipse.swt.widgets.*;

/**
Expand Down Expand Up @@ -53,19 +51,12 @@ public Monitor getMonitor() {

@Override
public boolean equals(Object object) {
if (this == object) {
return true;
}
if (!super.equals(object)) {
return false;
}
MonitorAwarePoint other = (MonitorAwarePoint) object;
return Objects.equals(this.monitor, other.monitor);
return super.equals(object);
}

@Override
public int hashCode() {
return Objects.hash(super.hashCode(), monitor);
return super.hashCode();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
*******************************************************************************/
package org.eclipse.swt.graphics;

import java.util.*;

import org.eclipse.swt.widgets.*;

/**
Expand Down Expand Up @@ -55,19 +53,12 @@ public Monitor getMonitor() {

@Override
public boolean equals(Object object) {
if (this == object) {
return true;
}
if (!super.equals(object)) {
return false;
}
MonitorAwareRectangle other = (MonitorAwareRectangle) object;
return Objects.equals(this.monitor, other.monitor);
return super.equals(object);
}

@Override
public int hashCode() {
return Objects.hash(super.hashCode(), monitor);
return super.hashCode();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,9 @@ public boolean equals (Object object) {
if (object == this) {
return true;
}
if (object.getClass() != this.getClass()) {
if (!(object instanceof Point other)) {
return false;
}
Point other = (Point) object;
return (other.x == this.x) && (other.y == this.y);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,9 @@ public boolean equals(Object object) {
if (object == this) {
return true;
}
if (object.getClass() != this.getClass()) {
if (!(object instanceof Rectangle other)) {
return false;
}
Rectangle other = (Rectangle) object;
return (other.x == this.x) && (other.y == this.y) && (other.width == this.width) && (other.height == this.height);
}

Expand Down
Loading