Skip to content
Permalink
Browse files

[FIXED JENKINS-18534] equals()/hashCode() for parameter value

The default implementation considers parameters with the same name
to be identical, resulting in queue items being collapsed.

With this change, different values for a parameter will result in
different builds.
  • Loading branch information...
daniel-beck committed Jun 17, 2014
1 parent 6745bfb commit 2dec2d0978ea2e309fe962be786a6c4ec92417b8
Showing with 22 additions and 0 deletions.
  1. +22 −0 src/main/java/hudson/scm/listtagsparameter/ListSubversionTagsParameterValue.java
@@ -64,6 +64,28 @@ public String resolve(String name) {
};
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof ListSubversionTagsParameterValue)) return false;
if (!super.equals(o)) return false;

ListSubversionTagsParameterValue that = (ListSubversionTagsParameterValue) o;

if (tag != null ? !tag.equals(that.tag) : that.tag != null) return false;
if (tagsDir != null ? !tagsDir.equals(that.tagsDir) : that.tagsDir != null) return false;

return true;
}

@Override
public int hashCode() {
int result = super.hashCode();
result = 31 * result + (tagsDir != null ? tagsDir.hashCode() : 0);
result = 31 * result + (tag != null ? tag.hashCode() : 0);
return result;
}

public String getTag() {
return tag;
}

0 comments on commit 2dec2d0

Please sign in to comment.
You can’t perform that action at this time.