Closed YangAoLib closed 5 months ago
Currently only method call are generated. other statement, such as return, variable definition, asignment will not generate. e.g.
int a = 2;
String s = "";
if (a > 0) {
s = "A is a positive number";
} else {
s = "A is a negative number or 0 ";
}
the code block will generate nothing. but, when there is a method call in it, e.g.
int a = 2;
String s = "";
if (a > 0) {
s = "A is a positive number";
System.out.println(s);
} else {
s = "A is a negative number or 0 ";
}
the alt
(than branch) block will generate, because it has println()
call in it. the else branch
will ignored.
Another example: return 1;
will not generate. but return sum(2);
will generate sum()
instead.
This OPEN area was included when I exported the puml, but the RETURN was added by me. So why is the generated plot displayed with one less alt region than the exported puml?
In fact, every branch has been generated, OPEN
, CLOSE
, HALF_OPEN
, and default
. But the drawing strategy is different from PlantUML, there is no call statement, and it is not drawn.
Describe the bug I gnerated a sequence diagram, it has call the method arrow that actor to metod, but don't has return when the method return end.
To Reproduce Steps to reproduce the behavior:
Expected behavior The diagram has the return action, and the alt that has nothing will not show.
Screenshots
Plugin & IDE info:
Additional context
import cn.hutool.core.util.RandomUtil; import edu.yangao.hedgehog.anno.Hedgehog; import lombok.extern.slf4j.Slf4j; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.Signature; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; import org.springframework.stereotype.Component;
import java.lang.reflect.Method; import java.util.HashMap; import java.util.Map;
@Aspect @Component @Slf4j public class HedgehogAspect {
}