Bug #25965

AOP ProxyClassBuilder always detects an aspect as "changed" if no Dependency Injection is used in this aspect (f.e. in LazyLoadingObjectAspect)

Added by Sebastian Kurfuerst over 4 years ago. Updated over 4 years ago.

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

related to TYPO3.Flow - Bug #26107: Proxy class builder rebuild classes without AOP on every ... Resolved 2011-04-19

Associated revisions

Revision b021a963
Added by Karsten Dambekalns over 4 years ago

[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

#6 Updated by Christopher Hlubek over 4 years ago

The change handling is still not optimal, see #26107.

Also available in: Atom PDF