CachedIntrospectionResults explicitly introspects implemented interfaces (for Java 8 default methods)
Issue: SPR-14198
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -61,6 +61,14 @@ public class BeanWrapperTests extends AbstractPropertyAccessorTests {
|
||||
assertTrue("Set name to tom", target.getName().equals("tom"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void aliasedSetterThroughDefaultMethod() {
|
||||
GetterBean target = new GetterBean();
|
||||
BeanWrapper accessor = createAccessor(target);
|
||||
accessor.setPropertyValue("aliasedName", "tom");
|
||||
assertTrue("Set name to tom", target.getAliasedName().equals("tom"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void setValidAndInvalidPropertyValuesShouldContainExceptionDetails() {
|
||||
TestBean target = new TestBean();
|
||||
@@ -196,7 +204,24 @@ public class BeanWrapperTests extends AbstractPropertyAccessorTests {
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private static class GetterBean {
|
||||
private interface AliasedProperty {
|
||||
|
||||
default void setAliasedName(String name) {
|
||||
setName(name);
|
||||
}
|
||||
|
||||
default String getAliasedName() {
|
||||
return getName();
|
||||
}
|
||||
|
||||
void setName(String name);
|
||||
|
||||
String getName();
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private static class GetterBean implements AliasedProperty {
|
||||
|
||||
private String name;
|
||||
|
||||
@@ -212,6 +237,7 @@ public class BeanWrapperTests extends AbstractPropertyAccessorTests {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private static class IntelliBean {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user