Bug #25965
AOP ProxyClassBuilder always detects an aspect as "changed" if no Dependency Injection is used in this aspect (f.e. in LazyLoadingObjectAspect)
Status: | Resolved | Start date: | 2011-04-14 | |
---|---|---|---|---|
Priority: | Must have | Due date: | ||
Assigned To: | Karsten Dambekalns | % Done: | 100% |
|
Category: | AOP | |||
Target version: | TYPO3 Flow Base Distribution - 1.0 beta 1 | |||
PHP Version: | Complexity: | |||
Has patch: | Affected Flow version: |
Description
Problem¶
If there is an aspect A, which does not need dependency injection, and another class C is modified, the ProxyClassBuilder is incorrectly assuming that Aspect A has changed, and triggers a full rebuild of all AOP target classes.
From method build() in Aop/Builder/ProxyClassBuilder:1$rebuildEverything = FALSE;
2 foreach (array_keys($this->aspectContainers) as $aspectClassName) {
3 if ($this->compiler->hasCacheEntryForClass($aspectClassName) === FALSE) {
4 $rebuildEverything = TRUE;
5 $this->systemLogger->log(sprintf('Aspect %s has been modified, therefore rebuilding all target classes.', $aspectClassName), LOG_INFO);
6 break;
7 }
8 }
for aspects which do not need Dependency Injection, "hasCacheEntryForClass" is always FALSE. This becomes clear when looking into the Object\Proxy\Compiler:
There, the cache is only written for classes where a proxy is needed.
Hotfix¶
It can be solved by adding empty Dependency Injection (though this is no real solution)... I am not sure how to solve this in a clean way, that's why I first wanted to document it here.
Related issues
Associated revisions
[BUGFIX] Fix aspect change detection in AOP ProxyClassBuilder
If there is an aspect A, which does not need dependency injection, and
another class C is modified, the ProxyClassBuilder was incorrectly
assuming that aspect A had changed, and triggered a full rebuild of all
AOP target classes.
Change-Id: I4182a91bdf02e6ffd93804d2df76095f12bb4508
Fixes: #25965
History
#1 Updated by Sebastian Kurfuerst over 4 years ago
!!! When fixing this issue, make sure to revert http://review.typo3.org/1614 again!
#2 Updated by Karsten Dambekalns over 4 years ago
- Status changed from New to Accepted
- Assigned To set to Karsten Dambekalns
#3 Updated by Mr. Hudson over 4 years ago
Patch set 1 of change I4182a91bdf02e6ffd93804d2df76095f12bb4508 has been pushed to the review server.
It is available at http://review.typo3.org/1633
#4 Updated by Karsten Dambekalns over 4 years ago
- Status changed from Accepted to Under Review
#5 Updated by Karsten Dambekalns over 4 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset b021a963cdcfc3b4e8cfbb07627a1a8cc64bf8ae.
#6 Updated by Christopher Hlubek over 4 years ago
The change handling is still not optimal, see #26107.