Skip to content
New issue

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

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

Already on GitHub? # to your account

review fix: issue related with Processor and generic types #1504

Merged
merged 4 commits into from
Aug 31, 2017

Conversation

surli
Copy link
Collaborator

@surli surli commented Aug 10, 2017

This PR propose a first solution to fix #1503 by overriding the method in the subclass.

It changes the behaviour of ProcessingVisitor#canBeProcessed to consider the intersection of types instead of the union. => I don't know if considering the union of types was a wanted behavior or a mistake: in the first case, we have to had a new test to explicit the contract and the condition to use it.

@surli surli changed the title fix: issue related with Processor and generic types review fix: issue related with Processor and generic types Aug 10, 2017
@@ -45,10 +45,11 @@ private boolean canBeProcessed(CtElement e) {
if (!factory.getEnvironment().isProcessingStopped()
&& processor.getProcessedElementTypes() != null) {
for (Object o : processor.getProcessedElementTypes()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a multi-processor test with two incompatible elements

@@ -45,10 +45,11 @@ private boolean canBeProcessed(CtElement e) {
if (!factory.getEnvironment().isProcessingStopped()
&& processor.getProcessedElementTypes() != null) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bug is in getProcessedElementTypes()

@surli surli changed the title review fix: issue related with Processor and generic types WiP fix: issue related with Processor and generic types Aug 31, 2017
@surli surli changed the title WiP fix: issue related with Processor and generic types review fix: issue related with Processor and generic types Aug 31, 2017
@monperrus monperrus merged commit 1d1ed44 into INRIA:master Aug 31, 2017
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Processor is not using templated type when process method is in an abstract class
2 participants