Skip to content
Snippets Groups Projects
Commit 7a8115a3 authored by Thomas Oster's avatar Thomas Oster
Browse files

hashCode and equals improvements

parent 71f36e80
No related branches found
No related tags found
No related merge requests found
...@@ -86,6 +86,10 @@ public abstract class DitheringAlgorithm extends TimeIntensiveOperation implemen ...@@ -86,6 +86,10 @@ public abstract class DitheringAlgorithm extends TimeIntensiveOperation implemen
@Override @Override
public boolean equals(Object o) public boolean equals(Object o)
{ {
if (this == o)
{
return true;
}
if (o == null || !getClass().equals(o.getClass())) if (o == null || !getClass().equals(o.getClass()))
{ {
return false; return false;
...@@ -111,8 +115,10 @@ public abstract class DitheringAlgorithm extends TimeIntensiveOperation implemen ...@@ -111,8 +115,10 @@ public abstract class DitheringAlgorithm extends TimeIntensiveOperation implemen
@Override @Override
public int hashCode() { public int hashCode() {
int hash = 7; int hash = 7;
hash += this.getClass().hashCode();
for (String key : this.getPropertyKeys()) for (String key : this.getPropertyKeys())
{ {
hash += key.hashCode();
hash += this.getProperty(key).hashCode(); hash += this.getProperty(key).hashCode();
} }
return hash; return hash;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment