Skip to content

Commit

Permalink
resolver codenarc issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Echavarria committed Sep 16, 2024
1 parent 2be7f4a commit 0a82354
Showing 1 changed file with 12 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ import org.jenkinsci.plugins.workflow.flow.FlowExecutionOwner
*/
class FileSystemCacheKey {

private static final int MULTIPLIER = 31

FlowExecutionOwner owner
SCM scm
SCMSource scmSource
Expand Down Expand Up @@ -88,26 +90,13 @@ class FileSystemCacheKey {

FileSystemCacheKey that = (FileSystemCacheKey) o

if (owner != that.owner) {
return false
}
if (scm != that.scm) {
return false
}
if (scmHead != that.scmHead) {
return false
}
if (scmRevision != that.scmRevision) {
return false
}
if (scmSource != that.scmSource) {
return false
}

return true
return owner == that.owner &&
scm == that.scm &&
scmHead == that.scmHead &&
scmRevision == that.scmRevision &&
scmSource == that.scmSource;
}


/**
* Generates a hash code for this FileSystemCacheKey instance.
* The hash code is computed based on the {@code owner}, {@code scm}, {@code scmSource},
Expand All @@ -122,10 +111,11 @@ class FileSystemCacheKey {
int hashCode() {
int result
result = (owner != null ? owner.hashCode() : 0)
result = 31 * result + (scm != null ? scm.hashCode() : 0)
result = 31 * result + (scmSource != null ? scmSource.hashCode() : 0)
result = 31 * result + (scmHead != null ? scmHead.hashCode() : 0)
result = 31 * result + (scmRevision != null ? scmRevision.hashCode() : 0)
result = MULTIPLIER * result + (scm != null ? scm.hashCode() : 0)
result = MULTIPLIER * result + (scmSource != null ? scmSource.hashCode() : 0)
result = MULTIPLIER * result + (scmHead != null ? scmHead.hashCode() : 0)
result = MULTIPLIER * result + (scmRevision != null ? scmRevision.hashCode() : 0)
return result
}

}

0 comments on commit 0a82354

Please sign in to comment.