Class identity comparisons wherever possible
Issue: SPR-12926
This commit is contained in:
@@ -139,7 +139,7 @@ public abstract class DataAccessUtils {
|
||||
|
||||
Object result = requiredUniqueResult(results);
|
||||
if (requiredType != null && !requiredType.isInstance(result)) {
|
||||
if (String.class.equals(requiredType)) {
|
||||
if (String.class == requiredType) {
|
||||
result = result.toString();
|
||||
}
|
||||
else if (Number.class.isAssignableFrom(requiredType) && Number.class.isInstance(result)) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 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.
|
||||
@@ -116,7 +116,7 @@ public class RollbackRuleAttribute implements Serializable{
|
||||
return depth;
|
||||
}
|
||||
// If we've gone as far as we can go and haven't found it...
|
||||
if (exceptionClass.equals(Throwable.class)) {
|
||||
if (exceptionClass == Throwable.class) {
|
||||
return -1;
|
||||
}
|
||||
return getDepth(exceptionClass.getSuperclass(), depth + 1);
|
||||
|
||||
Reference in New Issue
Block a user