Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Routing] Fix AnnotationDirectionLoaderTest #21845

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 3, 2017

Conversation

chalasr
Copy link
Member

@chalasr chalasr commented Mar 3, 2017

Q A
Branch? master
Tests pass? yes

This directory contains more annotated classes on master, one being read twice (perhaps a bug?)

@nicolas-grekas
Copy link
Member

Thank you @chalasr.

@nicolas-grekas nicolas-grekas merged commit 6f84877 into symfony:master Mar 3, 2017
nicolas-grekas added a commit that referenced this pull request Mar 3, 2017
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Routing] Fix AnnotationDirectionLoaderTest

| Q             | A
| ------------- | ---
| Branch?       | master
| Tests pass? | yes

This directory contains more annotated classes on master, one being read twice (perhaps a bug?)

Commits
-------

6f84877 [Routing] Fix AnnotationDirectionLoaderTest
@chalasr chalasr deleted the fix-annotationdir-test branch March 3, 2017 10:43
@nicolas-grekas
Copy link
Member

Can you still investigate a bit the double?

@chalasr
Copy link
Member Author

chalasr commented Mar 3, 2017

@nicolas-grekas will do. My knowledge regarding annotations is quite limited, let's try to change that.

@chalasr
Copy link
Member Author

chalasr commented Mar 3, 2017

In AnnotationClassLoader::load(), there're two places triggering AnnotationReader::getClassAnnotation() to be called: here and here.
In the latter, the call is the last condition of an if statement. This call is never reached for other classes because they are invokable (satisfying the check before reaching the method call), the fact BazClass is not invokable justifies this extra call. At the end of AnnotationDirectoryClassLoader::load(), the double doesn't exist, only this method call occurs twice for the same class. Voilà :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants