Skip to content

Conversation

polyglot-k
Copy link
Contributor

@polyglot-k polyglot-k commented Sep 18, 2025

PR Description:

This pull request refactors the logic for collecting bean names by type in DefaultListableBeanFactory to improve readability and maintainability. The main change is splitting the logic into two helper methods: one for processing bean definitions and another for processing manually registered singletons. This makes the code easier to follow and maintain, without altering its functionality.

Refactoring and code organization:

  • Extracted the core logic for collecting bean names into two new private methods: processBeanDefinitions (handles bean definitions) and processManualSingletons (handles manually registered singletons), improving separation of concerns and code readability.
  • Simplified and clarified the logic for skipping aliases, handling abstract and lazy beans, and checking type matches within the new helper methods.

Error handling improvements:

  • Improved exception handling by consolidating catch blocks and adding more descriptive logging when bean class loading or metadata resolution fails.

Note

This helps with hot path configuration at the jit computer level.

Thank you for reviewing this PR! Your feedback is highly appreciated.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Sep 18, 2025
Signed-off-by: KNU-K <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged or decided on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants