mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Merge branch '2.3.x'
Closes gh-23970
This commit is contained in:
commit
5642dc6d13
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2020 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.
|
||||
@ -74,7 +74,7 @@ class TypeElementMembers {
|
||||
private void processMethod(ExecutableElement method) {
|
||||
if (isPublic(method)) {
|
||||
String name = method.getSimpleName().toString();
|
||||
if (isGetter(method) && !this.publicGetters.containsKey(name)) {
|
||||
if (isGetter(method) && !this.publicGetters.containsKey(getAccessorName(name))) {
|
||||
this.publicGetters.put(getAccessorName(name), method);
|
||||
}
|
||||
else if (isSetter(method)) {
|
||||
|
@ -76,6 +76,10 @@ class PropertyDescriptorResolverTests {
|
||||
PropertyDescriptorResolver resolver = new PropertyDescriptorResolver(metadataEnv);
|
||||
assertThat(resolver.resolve(type, null).map(PropertyDescriptor::getName)).containsExactly("third",
|
||||
"second", "first");
|
||||
assertThat(resolver.resolve(type, null).map(
|
||||
(descriptor) -> descriptor.getGetter().getEnclosingElement().getSimpleName().toString()))
|
||||
.containsExactly("HierarchicalProperties", "HierarchicalPropertiesParent",
|
||||
"HierarchicalPropertiesParent");
|
||||
assertThat(resolver.resolve(type, null)
|
||||
.map((descriptor) -> descriptor.resolveItemMetadata("test", metadataEnv))
|
||||
.map(ItemMetadata::getDefaultValue)).containsExactly("three", "two", "one");
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2020 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.
|
||||
@ -33,7 +33,8 @@ public abstract class HierarchicalPropertiesParent extends HierarchicalPropertie
|
||||
this.second = second;
|
||||
}
|
||||
|
||||
// Useless override
|
||||
// Overridden properties should belong to this class, not
|
||||
// HierarchicalPropertiesGrandparent
|
||||
|
||||
@Override
|
||||
public String getFirst() {
|
||||
|
Loading…
Reference in New Issue
Block a user