Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -510,8 +510,10 @@ public void onApplicationEvent(ApplicationEvent event) {
}
}

// Register the sources classes to the specific binder context after configuring the environment property sources
List<Class> sourceClasses = new ArrayList<>(Arrays.asList(binderType.getConfigurationClasses()));
// Modified registration: first user classes (spring.main.sources) and then binder classes
List<Class> sourceClasses = new ArrayList<>();

// First register user classes if defined in spring.main.sources
if (binderProperties.containsKey("spring.main.sources")) {
String sources = (String) binderProperties.get("spring.main.sources");
if (StringUtils.hasText(sources)) {
Expand All @@ -525,6 +527,10 @@ public void onApplicationEvent(ApplicationEvent event) {
});
}
}

// Then add binder configuration classes
sourceClasses.addAll(Arrays.asList(binderType.getConfigurationClasses()));

binderProducingContext.register(sourceClasses.toArray(new Class[] {}));

if (refresh) {
Expand Down