Apply fallback in case of any exception coming out of createClass
Closes gh-34423
This commit is contained in:
parent
d0ceefedc6
commit
93134fd4d1
|
@ -168,9 +168,9 @@ class ConfigurationClassEnhancer {
|
||||||
try {
|
try {
|
||||||
subclass = enhancer.createClass();
|
subclass = enhancer.createClass();
|
||||||
}
|
}
|
||||||
catch (CodeGenerationException ex) {
|
catch (Throwable ex) {
|
||||||
if (!fallback) {
|
if (!fallback) {
|
||||||
throw ex;
|
throw (ex instanceof CodeGenerationException cgex ? cgex : new CodeGenerationException(ex));
|
||||||
}
|
}
|
||||||
// Possibly a package-visible @Bean method declaration not accessible
|
// Possibly a package-visible @Bean method declaration not accessible
|
||||||
// in the given ClassLoader -> retry with original ClassLoader
|
// in the given ClassLoader -> retry with original ClassLoader
|
||||||
|
|
Loading…
Reference in New Issue