Skip to content
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

Add failing test case to debug SpoonMapping and Matchers #77

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

algomaster99
Copy link
Member

The test-case in this PR throws the following exception:

java.lang.IllegalArgumentException: Element not mapped: {
    System.out.println("x");
}

This is because else branch of the if-elseif-else block is not mapped by the matchers in GumTree itself which eliminates the possibility of a bug in SpoonMapping.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 two THEN branches were mapped (probably because of more number of matched components in the branch), I felt ELSE 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.

Delete Block at Invocation:6
	{
	
	}
, Insert Block at Invocation:4
	{
	
	}
, Move Invocation from Invocation:9 to Invocation:5
	System.out.println("x")
, Move Block from Invocation:4 to Invocation:6
	{
	    System.out.println("y");
	}
, Move Invocation from Invocation:7 to Invocation:9
	System.out.println("z")

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

Successfully merging this pull request may close these issues.

1 participant