Skip to content

Commit

Permalink
Polishing along with backport
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoeller committed Jan 15, 2013
1 parent a321178 commit abbe1db
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -287,23 +287,23 @@ else if (canWrite(context, target, name)) {

private Method findGetterForProperty(String propertyName, Class<?> clazz, Object target) {
Method method = findGetterForProperty(propertyName, clazz, target instanceof Class);
if(method == null && target instanceof Class) {
if (method == null && target instanceof Class) {
method = findGetterForProperty(propertyName, target.getClass(), false);
}
return method;
}

private Method findSetterForProperty(String propertyName, Class<?> clazz, Object target) {
Method method = findSetterForProperty(propertyName, clazz, target instanceof Class);
if(method == null && target instanceof Class) {
if (method == null && target instanceof Class) {
method = findSetterForProperty(propertyName, target.getClass(), false);
}
return method;
}

private Field findField(String name, Class<?> clazz, Object target) {
Field field = findField(name, clazz, target instanceof Class);
if(field == null && target instanceof Class) {
if (field == null && target instanceof Class) {
field = findField(name, target.getClass(), false);
}
return field;
Expand Down Expand Up @@ -383,15 +383,17 @@ protected Field findField(String name, Class<?> clazz, boolean mustBeStatic) {
return field;
}
}
if(clazz.getSuperclass() != null) {
// We'll search superclasses and implemented interfaces explicitly,
// although it shouldn't be necessary - however, see SPR-10125.
if (clazz.getSuperclass() != null) {
Field field = findField(name, clazz.getSuperclass(), mustBeStatic);
if(field != null) {
if (field != null) {
return field;
}
}
for (Class<?> implementedInterface : clazz.getInterfaces()) {
Field field = findField(name, implementedInterface, mustBeStatic);
if(field != null) {
if (field != null) {
return field;
}
}
Expand Down

0 comments on commit abbe1db

Please sign in to comment.