Class identity comparisons wherever possible (and further polishing)
Issue: SPR-12926
This commit is contained in:
@@ -184,7 +184,7 @@ public class DataBinder implements PropertyEditorRegistry, TypeConverter {
|
||||
* @param objectName the name of the target object
|
||||
*/
|
||||
public DataBinder(Object target, String objectName) {
|
||||
if (target != null && target.getClass().equals(javaUtilOptionalClass)) {
|
||||
if (target != null && target.getClass() == javaUtilOptionalClass) {
|
||||
this.target = OptionalUnwrapper.unwrap(target);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -78,7 +78,7 @@ public class ObjectError extends DefaultMessageSourceResolvable {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(getClass().equals(other.getClass())) || !super.equals(other)) {
|
||||
if (getClass() != other.getClass() || !super.equals(other)) {
|
||||
return false;
|
||||
}
|
||||
ObjectError otherError = (ObjectError) other;
|
||||
|
||||
Reference in New Issue
Block a user