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
9e3c3b73
Commit
9e3c3b73
authored
Apr 28, 2021
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.4.x'
parents
ad968a26
d98fe36b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
10 deletions
+12
-10
IncrementalBuildMetadataGenerationTests.java
...ionprocessor/IncrementalBuildMetadataGenerationTests.java
+2
-0
Metadata.java
...mework/boot/configurationprocessor/metadata/Metadata.java
+10
-10
No files found.
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/IncrementalBuildMetadataGenerationTests.java
View file @
9e3c3b73
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
package
org
.
springframework
.
boot
.
configurationprocessor
;
package
org
.
springframework
.
boot
.
configurationprocessor
;
import
org.junit.jupiter.api.Disabled
;
import
org.junit.jupiter.api.Test
;
import
org.junit.jupiter.api.Test
;
import
org.springframework.boot.configurationprocessor.metadata.ConfigurationMetadata
;
import
org.springframework.boot.configurationprocessor.metadata.ConfigurationMetadata
;
...
@@ -73,6 +74,7 @@ class IncrementalBuildMetadataGenerationTests extends AbstractMetadataGeneration
...
@@ -73,6 +74,7 @@ class IncrementalBuildMetadataGenerationTests extends AbstractMetadataGeneration
}
}
@Test
@Test
@Disabled
(
"gh-26271"
)
void
incrementalBuildTypeRenamed
()
throws
Exception
{
void
incrementalBuildTypeRenamed
()
throws
Exception
{
TestProject
project
=
new
TestProject
(
this
.
tempDir
,
FooProperties
.
class
,
BarProperties
.
class
);
TestProject
project
=
new
TestProject
(
this
.
tempDir
,
FooProperties
.
class
,
BarProperties
.
class
);
ConfigurationMetadata
metadata
=
project
.
fullBuild
();
ConfigurationMetadata
metadata
=
project
.
fullBuild
();
...
...
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/metadata/Metadata.java
View file @
9e3c3b73
/*
/*
* Copyright 2012-202
0
the original author or authors.
* Copyright 2012-202
1
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -20,6 +20,7 @@ import java.util.ArrayList;
...
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
org.assertj.core.api.Condition
;
import
org.assertj.core.api.Condition
;
import
org.hamcrest.collection.IsMapContaining
;
import
org.hamcrest.collection.IsMapContaining
;
...
@@ -132,7 +133,7 @@ public final class Metadata {
...
@@ -132,7 +133,7 @@ public final class Metadata {
@Override
@Override
public
boolean
matches
(
ConfigurationMetadata
value
)
{
public
boolean
matches
(
ConfigurationMetadata
value
)
{
ItemMetadata
itemMetadata
=
getItemWithName
(
value
,
this
.
name
);
ItemMetadata
itemMetadata
=
findItem
(
value
,
this
.
name
);
if
(
itemMetadata
==
null
)
{
if
(
itemMetadata
==
null
)
{
return
false
;
return
false
;
}
}
...
@@ -208,15 +209,14 @@ public final class Metadata {
...
@@ -208,15 +209,14 @@ public final class Metadata {
this
.
description
,
this
.
defaultValue
,
null
);
this
.
description
,
this
.
defaultValue
,
null
);
}
}
private
ItemMetadata
getItemWithName
(
ConfigurationMetadata
metadata
,
String
name
)
{
private
ItemMetadata
findItem
(
ConfigurationMetadata
metadata
,
String
name
)
{
ItemMetadata
result
=
null
;
List
<
ItemMetadata
>
candidates
=
metadata
.
getItems
().
stream
()
for
(
ItemMetadata
item
:
metadata
.
getItems
())
{
.
filter
((
item
)
->
item
.
isOfItemType
(
this
.
itemType
)
&&
name
.
equals
(
item
.
getName
()))
if
(
item
.
isOfItemType
(
this
.
itemType
)
&&
name
.
equals
(
item
.
getName
()))
{
.
collect
(
Collectors
.
toList
());
Assert
.
state
(
result
==
null
,
()
->
"Duplicate item found for "
+
name
);
if
(
candidates
.
size
()
>
1
)
{
result
=
item
;
throw
new
IllegalStateException
(
"More that one metadata item with name '"
+
name
+
"': "
+
candidates
);
}
}
}
return
result
;
return
(
candidates
.
size
()
==
1
)
?
candidates
.
get
(
0
)
:
null
;
}
}
}
}
...
...
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