Skip to content

Commit

Permalink
have MavenTargetLocation.equals eventually return true
Browse files Browse the repository at this point in the history
In the TargetPlatformPreferencePage, upon the Apply button, some target
definition containing some MavenTargetLocation always was rewritten to
it's .target file. This was because MavenTargetLocation.equals never
returned true for multiple reasons, starting with MavenTargetDependency
lacking an impl of equals().
Using serialize(), we can be sure to perform the equals check on any
relevant attribute, including deeply nested ones.
  • Loading branch information
haubi authored and HannesWell committed Feb 2, 2024
1 parent 60e66ff commit 9c6c79a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
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 @@ -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());
}

public boolean isIncludeSource() {
Expand Down

0 comments on commit 9c6c79a

Please sign in to comment.