Skip to content

Commit

Permalink
mask negative bits to prevent negative projectIds (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
shlomomdahan authored Nov 8, 2024
1 parent f2ceaf6 commit 7da034a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ private BuildForm(ItemGroup context, final PipelineBuild pipelineBuild, final Co
}
id = hashCode();
final AbstractProject<?, ?> project = pipelineBuild.getProject();
projectId = project.getFullName().hashCode();
projectId = project.getFullName().hashCode() & 0x7FFFFFFF;
final ParametersDefinitionProperty params = project.getProperty(ParametersDefinitionProperty.class);
final ArrayList<String> paramList = new ArrayList<String>();
if (params != null && params.getParameterDefinitionNames() != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public boolean equals(final Object obj) {
}

public int getId() {
return name.hashCode();
return name.hashCode() & 0x7FFFFFFF;
}

/**
Expand Down

0 comments on commit 7da034a

Please sign in to comment.