File tree Expand file tree Collapse file tree 5 files changed +14
-20
lines changed
spring-context/src/main/java/org/springframework
spring-test/src/main/java/org/springframework/test/context Expand file tree Collapse file tree 5 files changed +14
-20
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ public String[] getCodes() {
106
106
* the last one in the codes array.
107
107
*/
108
108
public String getCode () {
109
- return (this .codes != null && this .codes .length > 0 ) ? this .codes [this .codes .length - 1 ] : null ;
109
+ return (this .codes != null && this .codes .length > 0 ? this .codes [this .codes .length - 1 ] : null ) ;
110
110
}
111
111
112
112
@ Override
@@ -153,9 +153,9 @@ public boolean equals(Object other) {
153
153
return false ;
154
154
}
155
155
MessageSourceResolvable otherResolvable = (MessageSourceResolvable ) other ;
156
- return ObjectUtils .nullSafeEquals (getCodes (), otherResolvable .getCodes ()) &&
156
+ return ( ObjectUtils .nullSafeEquals (getCodes (), otherResolvable .getCodes ()) &&
157
157
ObjectUtils .nullSafeEquals (getArguments (), otherResolvable .getArguments ()) &&
158
- ObjectUtils .nullSafeEquals (getDefaultMessage (), otherResolvable .getDefaultMessage ());
158
+ ObjectUtils .nullSafeEquals (getDefaultMessage (), otherResolvable .getDefaultMessage ())) ;
159
159
}
160
160
161
161
@ Override
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2012 the original author or authors.
2
+ * Copyright 2002-2016 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -112,9 +112,9 @@ public boolean equals(Object other) {
112
112
return false ;
113
113
}
114
114
FieldError otherError = (FieldError ) other ;
115
- return getField ().equals (otherError .getField ()) &&
115
+ return ( getField ().equals (otherError .getField ()) &&
116
116
ObjectUtils .nullSafeEquals (getRejectedValue (), otherError .getRejectedValue ()) &&
117
- isBindingFailure () == otherError .isBindingFailure ();
117
+ isBindingFailure () == otherError .isBindingFailure ()) ;
118
118
}
119
119
120
120
@ Override
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2015 the original author or authors.
2
+ * Copyright 2002-2016 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -78,7 +78,7 @@ public boolean equals(Object other) {
78
78
if (this == other ) {
79
79
return true ;
80
80
}
81
- if (getClass () != other . getClass () || !super .equals (other )) {
81
+ if (other == null || other . getClass () != getClass () || !super .equals (other )) {
82
82
return false ;
83
83
}
84
84
ObjectError otherError = (ObjectError ) other ;
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2015 the original author or authors.
2
+ * Copyright 2002-2016 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -401,7 +401,7 @@ public boolean equals(Object other) {
401
401
if (this == other ) {
402
402
return true ;
403
403
}
404
- if (!( other instanceof MergedContextConfiguration )) {
404
+ if (other == null || other . getClass () != getClass ( )) {
405
405
return false ;
406
406
}
407
407
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2014 the original author or authors.
2
+ * Copyright 2002-2016 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -161,14 +161,8 @@ public String getResourceBasePath() {
161
161
*/
162
162
@ Override
163
163
public boolean equals (Object other ) {
164
- if (this == other ) {
165
- return true ;
166
- }
167
- if (!(other instanceof WebMergedContextConfiguration )) {
168
- return false ;
169
- }
170
- WebMergedContextConfiguration otherConfig = (WebMergedContextConfiguration ) other ;
171
- return super .equals (otherConfig ) && this .getResourceBasePath ().equals (otherConfig .getResourceBasePath ());
164
+ return (this == other || (super .equals (other ) &&
165
+ this .resourceBasePath .equals (((WebMergedContextConfiguration ) other ).resourceBasePath )));
172
166
}
173
167
174
168
/**
@@ -178,7 +172,7 @@ public boolean equals(Object other) {
178
172
*/
179
173
@ Override
180
174
public int hashCode () {
181
- return 31 * super .hashCode () + this .resourceBasePath .hashCode ();
175
+ return super .hashCode () * 31 + this .resourceBasePath .hashCode ();
182
176
}
183
177
184
178
/**
You can’t perform that action at this time.
0 commit comments