Add failing test case to debug SpoonMapping and Matchers #77
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The test-case in this PR throws the following exception:
This is because
else
branch of theif-elseif-else
block is not mapped by the matchers in GumTree itself which eliminates the possibility of a bug inSpoonMapping.java
. I am not sure if this is supposed to be a bug in GumTree match algorithms but if it is, the fix would have to be made in the second phase (BottomUp
phase). However, since the other twoTHEN
branches were mapped (probably because of more number of matched components in the branch), I feltELSE
could have been mapped too.Another issue I had with this test-case was its number and type of operations. I expected it to have three move operations involving movement of the invocations but that is not the case as shown in the output below. Again, this stems from GumTree only as the it generates the actions.
gumtree-spoon-ast-diff
converts each action into a spoon-equivalent.