Consider the following class-graph:
A=B.
B=.
C:B|C
D=E.
E=.
... and the following PD:
FROM A TO E
Inject/J obviuosly finds the path
A->B->C->D->E
which is wrong, because after the edge B->C the edhe
C->D is not an option (rule: not alternation edge
directly after an inheritance edge)
I assume, you used the following algorithm to calculate
the path set for a PD:
1 mark all nodes/edges reachable from the "from"-node
2 mark all nodes/edges that can reach the "to"-nodes
3 the nodes/edges making up the path are the ones, that
have both marks
Poosible reasons for the bug are:
- you do not follow the rule "no alternation edge
after an inheritance edge" in 1 and/or 2
- you do not consider the case where a node is
reachable from the start and from that node you
can reach the end, but the concatenation of the two
path does not respect the above mentionned rule
By the way: The rule basically says, that you are not
allowed to do down-casts. In the example, the path
that Inject/J determines would mean a cast of a
B-object to a D-object, which is obviuosly not a good
idea.
see attachement for code