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 committed Jan 24, 2024
1 parent 1b6a28d commit 6d1ca3b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion org.eclipse.m2e.pde.feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<feature
id="org.eclipse.m2e.pde.feature"
label="%featureName"
version="2.3.0.qualifier"
version="2.3.1.qualifier"
provider-name="%providerName"
plugin="org.eclipse.m2e.core"
license-feature="org.eclipse.license"
Expand Down
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.501.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 6d1ca3b

Please sign in to comment.