Merge pull request #1411 from synopsys-arc-oss/JENKINS-19017

[FIXED JENKINS-19017] - FileParameter - Handle non-null file parameters as different values
This commit is contained in:
Oleg Nenashev committed 2014-10-19 23:28:14 +04:00
commit e80fa118aa
2 files changed
+73 -7

No files matched your search

@@ -162,7 +162,8 @@ public class FileParameterValue extends ParameterValue {
}
/**
* In practice this will always be false, since location should be unique.
* Compares file parameters (existing files will be considered as different).
* Function has been modified in order to avoid <a href="https://issues.jenkins-ci.org/browse/JENKINS-19017">JENKINS-19017</a> issue (wrong merge of builds in the queue).
*/
@Override
public boolean equals(Object obj) {
@@ -173,12 +174,13 @@ public class FileParameterValue extends ParameterValue {
if (getClass() != obj.getClass())
return false;
FileParameterValue other = (FileParameterValue) obj;
if (location == null) {
if (other.location != null)
return false;
} else if (!location.equals(other.location))
return false;
return true;
if (location == null && other.location == null)
return true; // Consider null parameters as equal
//TODO: check fingerprints or checksums to improve the behavior
// Return false even if files are equal
return false;
}
@Override