Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
b463acb1
Commit
b463acb1
authored
Sep 02, 2019
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.1.x'
Closes gh-18093
parents
20b6656b
edcaee37
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
1 deletion
+51
-1
PropertyDescriptor.java
...ework/boot/configurationprocessor/PropertyDescriptor.java
+1
-1
ConfigurationMetadataAnnotationProcessorTests.java
...cessor/ConfigurationMetadataAnnotationProcessorTests.java
+10
-0
DeprecatedFieldSingleProperty.java
...igurationsample/simple/DeprecatedFieldSingleProperty.java
+40
-0
No files found.
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/PropertyDescriptor.java
View file @
b463acb1
...
...
@@ -101,7 +101,7 @@ abstract class PropertyDescriptor<S extends Element> {
protected
ItemDeprecation
resolveItemDeprecation
(
MetadataGenerationEnvironment
environment
)
{
boolean
deprecated
=
environment
.
isDeprecated
(
getGetter
())
||
environment
.
isDeprecated
(
getSetter
())
||
environment
.
isDeprecated
(
getFactoryMethod
());
||
environment
.
isDeprecated
(
getF
ield
())
||
environment
.
isDeprecated
(
getF
actoryMethod
());
return
deprecated
?
environment
.
resolveItemDeprecation
(
getGetter
())
:
null
;
}
...
...
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessorTests.java
View file @
b463acb1
...
...
@@ -21,6 +21,7 @@ import org.junit.jupiter.api.Test;
import
org.springframework.boot.configurationprocessor.metadata.ConfigurationMetadata
;
import
org.springframework.boot.configurationprocessor.metadata.Metadata
;
import
org.springframework.boot.configurationsample.simple.ClassWithNestedProperties
;
import
org.springframework.boot.configurationsample.simple.DeprecatedFieldSingleProperty
;
import
org.springframework.boot.configurationsample.simple.DeprecatedSingleProperty
;
import
org.springframework.boot.configurationsample.simple.DescriptionProperties
;
import
org.springframework.boot.configurationsample.simple.HierarchicalProperties
;
...
...
@@ -167,6 +168,15 @@ class ConfigurationMetadataAnnotationProcessorTests extends AbstractMetadataGene
.
withDeprecation
(
"renamed"
,
"singledeprecated.new-name"
));
}
@Test
void
singleDeprecatedFieldProperty
()
{
Class
<?>
type
=
DeprecatedFieldSingleProperty
.
class
;
ConfigurationMetadata
metadata
=
compile
(
type
);
assertThat
(
metadata
).
has
(
Metadata
.
withGroup
(
"singlefielddeprecated"
).
fromSource
(
type
));
assertThat
(
metadata
).
has
(
Metadata
.
withProperty
(
"singlefielddeprecated.name"
,
String
.
class
).
fromSource
(
type
)
.
withDeprecation
(
null
,
null
));
}
@Test
void
deprecatedOnUnrelatedSetter
()
{
Class
<?>
type
=
DeprecatedUnrelatedMethodPojo
.
class
;
...
...
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/simple/DeprecatedFieldSingleProperty.java
0 → 100644
View file @
b463acb1
/*
* Copyright 2012-2019 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.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
configurationsample
.
simple
;
import
org.springframework.boot.configurationsample.ConfigurationProperties
;
/**
* Configuration properties with a single deprecated element.
*
* @author Andy Wilkinson
*/
@ConfigurationProperties
(
"singlefielddeprecated"
)
public
class
DeprecatedFieldSingleProperty
{
@Deprecated
private
String
name
;
public
String
getName
()
{
return
this
.
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment