Browse code

Fix: improve equals/hashcode

Thomas Fricker authored on 22/06/2017 09:26:46
Showing 1 changed files
... ...
@@ -177,13 +177,8 @@ public class SecurityContext {
177 177
 		final int prime = 31;
178 178
 		int result = 1;
179 179
 		result = prime * result + ((domainUid == null) ? 0 : domainUid.hashCode());
180
-		result = prime * result + (interactive ? 1231 : 1237);
181
-		result = prime * result + ((lang == null) ? 0 : lang.hashCode());
182
-		result = prime * result + ((memberOf == null) ? 0 : memberOf.hashCode());
183 180
 		result = prime * result + ((orgUnitsRoles == null) ? 0 : orgUnitsRoles.hashCode());
184
-		result = prime * result + ((origin == null) ? 0 : origin.hashCode());
185 181
 		result = prime * result + ((roles == null) ? 0 : roles.hashCode());
186
-		result = prime * result + ((sessionId == null) ? 0 : sessionId.hashCode());
187 182
 		result = prime * result + ((subject == null) ? 0 : subject.hashCode());
188 183
 		return result;
189 184
 	}
... ...
@@ -202,38 +197,16 @@ public class SecurityContext {
202 197
 				return false;
203 198
 		} else if (!domainUid.equals(other.domainUid))
204 199
 			return false;
205
-		if (interactive != other.interactive)
206
-			return false;
207
-		if (lang == null) {
208
-			if (other.lang != null)
209
-				return false;
210
-		} else if (!lang.equals(other.lang))
211
-			return false;
212
-		if (memberOf == null) {
213
-			if (other.memberOf != null)
214
-				return false;
215
-		} else if (!memberOf.equals(other.memberOf))
216
-			return false;
217 200
 		if (orgUnitsRoles == null) {
218 201
 			if (other.orgUnitsRoles != null)
219 202
 				return false;
220 203
 		} else if (!orgUnitsRoles.equals(other.orgUnitsRoles))
221 204
 			return false;
222
-		if (origin == null) {
223
-			if (other.origin != null)
224
-				return false;
225
-		} else if (!origin.equals(other.origin))
226
-			return false;
227 205
 		if (roles == null) {
228 206
 			if (other.roles != null)
229 207
 				return false;
230 208
 		} else if (!roles.equals(other.roles))
231 209
 			return false;
232
-		if (sessionId == null) {
233
-			if (other.sessionId != null)
234
-				return false;
235
-		} else if (!sessionId.equals(other.sessionId))
236
-			return false;
237 210
 		if (subject == null) {
238 211
 			if (other.subject != null)
239 212
 				return false;