• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

aspectran / aspectran / #4738 / 1
44%
master: 44%

Build:
DEFAULT BRANCH: master
Ran 01 Nov 2025 10:51PM UTC
Files 1018
Run time 22s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

01 Nov 2025 10:48PM UTC coverage: 38.181% (+0.2%) from 37.972%
#4738.1

push

github

topframe
Refactor: Overhaul FactoryBean and factory-method lifecycle

This commit introduces a comprehensive overhaul of the bean creation lifecycle, specifically for beans produced by a FactoryBean or a factory-method. The primary goal is to fix a critical bug where the factory instance was incorrectly injected as a dependency instead of its
product.

Key changes include:

- **Correct Dependency Injection:** The core logic in `AbstractBeanRegistry` and `AbstractBeanFactory` has been refactored to ensure that when a `FactoryBean` is requested as a dependency (e.g., in a constructor argument or autowired field), the container now correctly provides the
object created by the factory (`getObject()`) rather than the factory itself.

- **Thread-Safe Singleton Creation:** The `getScopedBean` method in `AbstractBeanRegistry` now employs a robust double-checked locking mechanism. This ensures that singleton beans, including those from factories, are instantiated in a thread-safe manner, preventing race conditions
during concurrent access.

- **Explicit BeanInstance State:** `BeanInstance` has been refactored to use static factory methods (`forProduct`, `forFactory`, `of`). This eliminates ambiguity by making the state of a bean instance (whether it holds a product, a factory, or both) explicit at the point of
creation.

- **Unified Factory Logic:** The `getFactoryProducedObject` method now centralizes the logic for obtaining a product from both `FactoryBean` instances and `factory-method` definitions. It also correctly handles the caching of singleton products.

This refactoring resolves fundamental issues in the IoC container's handling of factory-produced beans, leading to more predictable, robust, and thread-safe behavior.

15852 of 41518 relevant lines covered (38.18%)

0.38 hits per line

Source Files on job #4738.1
  • Tree
  • List 1018
  • Changed 19
  • Source Changed 17
  • Coverage Changed 15
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 4738
  • 0adfd192 on github
  • Prev Job for on master (##4737.1)
  • Next Job for on master (##4739.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc