From 1a8b3fba9421461869d65318470b3432b62c1f9b Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Fri, 8 Mar 2019 15:59:11 +0100 Subject: [PATCH] Configuration classes can opt into lite mode (proxyBeanMethods=false) Closes gh-22461 --- .../context/annotation/Configuration.java | 34 ++++++++++++++++--- .../annotation/ConfigurationClassUtils.java | 34 ++++--------------- .../ConfigurationClassPostProcessorTests.java | 32 +++++++++++++---- 3 files changed, 61 insertions(+), 39 deletions(-) diff --git a/spring-context/src/main/java/org/springframework/context/annotation/Configuration.java b/spring-context/src/main/java/org/springframework/context/annotation/Configuration.java index abdd2a44e312..7d8546cdad17 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/Configuration.java +++ b/spring-context/src/main/java/org/springframework/context/annotation/Configuration.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-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. @@ -344,9 +344,9 @@ * *

By default, {@code @Bean} methods will be eagerly instantiated at container * bootstrap time. To avoid this, {@code @Configuration} may be used in conjunction with - * the {@link Lazy @Lazy} annotation to indicate that all {@code @Bean} methods declared within - * the class are by default lazily initialized. Note that {@code @Lazy} may be used on - * individual {@code @Bean} methods as well. + * the {@link Lazy @Lazy} annotation to indicate that all {@code @Bean} methods declared + * within the class are by default lazily initialized. Note that {@code @Lazy} may be used + * on individual {@code @Bean} methods as well. * *

Testing support for {@code @Configuration} classes

* @@ -391,7 +391,9 @@ *