Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMickael Istria2018-11-15 08:54:15 -0500
committerMickael Istria2018-11-15 09:20:37 -0500
commitf69fa0086effca3438f750cba9ce6660b8d0c067 (patch)
treed94cb5b2c3e7009beccf8c9918c08e4687174c12
parent9d607fe93389fca4925446d5134961ee0a269227 (diff)
downloadm2e-core-f69fa0086effca3438f750cba9ce6660b8d0c067.tar.gz
m2e-core-f69fa0086effca3438f750cba9ce6660b8d0c067.tar.xz
m2e-core-f69fa0086effca3438f750cba9ce6660b8d0c067.zip
Bug 515668 - [Preliminary] ResolverConfiguration equals/hashCode
Change-Id: Icdf37d3ac708a6292c9fb4878300caa4286e3828 Signed-off-by: Mickael Istria <mistria@redhat.com>
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/ResolverConfiguration.java26
1 files changed, 25 insertions, 1 deletions
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/ResolverConfiguration.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/ResolverConfiguration.java
index 41a176f0..5256770a 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/ResolverConfiguration.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/ResolverConfiguration.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008-2010 Sonatype, Inc.
+ * Copyright (c) 2008-2018 Sonatype, Inc. and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* Sonatype, Inc. - initial API and implementation
+ * Mickael Istria (Red Hat Inc.) - equals/hashCode
*******************************************************************************/
package org.eclipse.m2e.core.project;
@@ -14,6 +15,7 @@ package org.eclipse.m2e.core.project;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
+import java.util.Objects;
import java.util.Properties;
@@ -117,4 +119,26 @@ public class ResolverConfiguration implements Serializable {
this.lifecycleMappingId = lifecycleMappingId;
}
+ @Override
+ public boolean equals(Object obj) {
+ if(this == obj) {
+ return true;
+ }
+ if(obj == null) {
+ return false;
+ }
+ if(obj.getClass() != this.getClass()) {
+ return false;
+ }
+ ResolverConfiguration other = (ResolverConfiguration) obj;
+ return this.resolveWorkspaceProjects == other.resolveWorkspaceProjects
+ && Objects.equals(this.selectedProfiles, other.selectedProfiles)
+ && Objects.equals(this.lifecycleMappingId, other.lifecycleMappingId)
+ && Objects.equals(this.properties, other.properties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(resolveWorkspaceProjects, selectedProfiles, lifecycleMappingId, properties);
+ }
}

Back to the top