Skip to content

@ManagementContextConfiguration is meta-annotated with @Configuration(proxyBeanMethods=false) which does not disable proxying #23301

@dsyer

Description

@dsyer

Some of the @ManagementContextConfiguration classes are explicitly marked as proxyBeanMethods = false and some are not (e.g. WebMvcEndpointChildContextConfiguration). It seems like Spring doesn't recognize this in a meta-annotation, so it's probably a bug not to declare it explicitly:

		Class<WebMvcEndpointChildContextConfiguration> type = WebMvcEndpointChildContextConfiguration.class;
		String name = Configuration.class.getName();
		System.err.println(new SimpleMetadataReaderFactory().getMetadataReader(type.getName()).getAnnotationMetadata()
				.getAllAnnotationAttributes(name).get("proxyBeanMethods"));
		System.err.println(new SimpleMetadataReaderFactory().getMetadataReader(type.getName()).getAnnotationMetadata()
				.getAnnotationAttributes(name).get("proxyBeanMethods"));
		System.err.println(
				AnnotatedElementUtils.getMergedAnnotationAttributes(type, name, true, true).get("proxyBeanMethods"));
		System.err.println(
				AnnotatedElementUtils.findMergedAnnotationAttributes(type, name, true, true).get("proxyBeanMethods"));

prints

[false]
true
true
true

The code path in Spring is the second one (I think), via ConfigurationClassUtils.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions