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 10 years ago. Updated over 10 years ago.

Status:
Resolved
Priority:
Must have
Category:
AOP
Start date:
2011-04-14
Due date:
% Done:

100%

Estimated time:
PHP Version:
Has patch:
Complexity:

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:
$rebuildEverything = FALSE; foreach (array_keys($this->aspectContainers) as $aspectClassName) { if ($this->compiler->hasCacheEntryForClass($aspectClassName) === FALSE) { $rebuildEverything = TRUE; $this->systemLogger->log(sprintf('Aspect %s has been modified, therefore rebuilding all target classes.', $aspectClassName), LOG_INFO); break; } }

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 changeResolvedChristopher Hlubek2011-04-19

Actions
#1

Updated by Sebastian Kurfuerst over 10 years ago

!!! When fixing this issue, make sure to revert http://review.typo3.org/1614 again!

#2

Updated by Karsten Dambekalns over 10 years ago

  • Status changed from New to Accepted
  • Assignee set to Karsten Dambekalns
#3

Updated by Mr. Hudson over 10 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 10 years ago

  • Status changed from Accepted to Under Review
#5

Updated by Karsten Dambekalns over 10 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#6

Updated by Christopher Hlubek over 10 years ago

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

Also available in: Atom PDF