INRIA / spoon

Spoon is a metaprogramming library to analyze and transform Java source code. :spoon: is made with :heart:, :beers: and :sparkles:. It parses source files to build a well-designed AST with powerful analysis and transformation API.

Home Page:http://spoon.gforge.inria.fr/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Control Flow Graph doesn't handle cases with multiple expressions

Mr-Pine opened this issue · comments

Describe the bug

In a case statement with multiple expressions, only the first expression is represented in the CFG:
image

Expected would be something like this:
image

Source code you are trying to analyze/transform

public int mySwitch() {
	int a = 0;
	switch (a) {
		case 1, 2: break;
		default: break;
	}
}

Source code for your Spoon processing

testMethod("mySwitch", false, null, null, null); // with testMethod from the cfg test class ForwardFlowBuilderVisitorTest.java

Actual output

No response

Expected output

No response

Spoon Version

10.4.2 / Control Flow 0.0.2-SNAPSHOT

JVM Version

21

What operating system are you using?

Linux