mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-10-08 18:41:37 +00:00
Polish "Fix self-referential parentId in MappingsEndpoint"
See gh-50373
This commit is contained in:
+3
-2
@@ -29,6 +29,7 @@ import org.springframework.context.ApplicationContext;
|
||||
* {@link Endpoint @Endpoint} to expose HTTP request mappings.
|
||||
*
|
||||
* @author Andy Wilkinson
|
||||
* @author Lee JiWon
|
||||
* @since 2.0.0
|
||||
*/
|
||||
@Endpoint(id = "mappings")
|
||||
@@ -58,8 +59,8 @@ public class MappingsEndpoint {
|
||||
Map<String, Object> mappings = new HashMap<>();
|
||||
this.descriptionProviders.forEach(
|
||||
(provider) -> mappings.put(provider.getMappingName(), provider.describeMappings(applicationContext)));
|
||||
return new ContextMappingsDescriptor(mappings,
|
||||
(applicationContext.getParent() != null) ? applicationContext.getParent().getId() : null);
|
||||
ApplicationContext parent = applicationContext.getParent();
|
||||
return new ContextMappingsDescriptor(mappings, (parent != null) ? parent.getId() : null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user