File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
opengrok-indexer/src/main/java/org/opengrok/indexer/history Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -231,6 +231,14 @@ private int getHashCode(Object o) {
231
231
return o .hashCode ();
232
232
}
233
233
234
+ private static String stripMessage (String message ) {
235
+ if (message == null ) {
236
+ return null ;
237
+ }
238
+
239
+ return message .stripLeading ().stripTrailing ();
240
+ }
241
+
234
242
@ Override
235
243
public boolean equals (Object o ) {
236
244
if (this == o ) {
@@ -243,11 +251,11 @@ public boolean equals(Object o) {
243
251
244
252
String thisMessage = this .getMessage ();
245
253
if (thisMessage != null ) {
246
- thisMessage = thisMessage . stripLeading (). stripTrailing ( );
254
+ thisMessage = stripMessage ( thisMessage );
247
255
}
248
256
String thatMessage = that .getMessage ();
249
257
if (thatMessage != null ) {
250
- thatMessage = thatMessage . stripLeading (). stripTrailing ( );
258
+ thatMessage = stripMessage ( thatMessage );
251
259
}
252
260
253
261
return checkEquals (this .getAuthor (), that .getAuthor ()) &&
@@ -261,6 +269,6 @@ public boolean equals(Object o) {
261
269
@ Override
262
270
public int hashCode () {
263
271
return getHashCode (getAuthor ()) + getHashCode (getRevision ()) + getHashCode (getDate ()) +
264
- getHashCode (getMessage ()) + getHashCode (getFiles ()) + getHashCode (getTags ());
272
+ getHashCode (stripMessage ( getMessage () )) + getHashCode (getFiles ()) + getHashCode (getTags ());
265
273
}
266
274
}
You can’t perform that action at this time.
0 commit comments