Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MavenTargetLocation equals comparison never returns true #1649

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion org.eclipse.m2e.pde.target/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: M2E PDE Integration
Bundle-SymbolicName: org.eclipse.m2e.pde.target;singleton:=true
Bundle-Version: 2.0.500.qualifier
Bundle-Version: 2.0.600.qualifier
Automatic-Module-Name: org.eclipse.m2e.pde.target
Bundle-RequiredExecutionEnvironment: JavaSE-17
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.27.0,4.0.0)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ public String getLocation(boolean resolve) throws CoreException {

@Override
public int hashCode() {
return Objects.hash(roots, dependencyScopes, failedArtifacts, metadataMode);
return serialize().hashCode();
}

@Override
Expand All @@ -523,9 +523,8 @@ public boolean equals(Object obj) {
return true;
}
return obj instanceof MavenTargetLocation other //
&& Objects.equals(roots, other.roots)//
&& Objects.equals(dependencyScopes, other.dependencyScopes)
&& Objects.equals(failedArtifacts, other.failedArtifacts);
// check each and every relevant attribute, including nested ones
&& serialize().equals(other.serialize());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If equals is changed, hashCode() should be adjusted in the same way.

}

public boolean isIncludeSource() {
Expand Down