C#/C++/Java: Prettier PartialAccessPath.toString

This commit is contained in:
Jonas Jensen
2019-09-02 14:05:50 +02:00
parent c3bc9f8575
commit cdede8744f
20 changed files with 86 additions and 48 deletions

View File

@@ -2081,7 +2081,7 @@ private module FlowExploration {
private class PartialAccessPathNil extends PartialAccessPath, TPartialNil {
override string toString() {
exists(DataFlowType t | this = TPartialNil(t) | result = ppReprType(t))
exists(DataFlowType t | this = TPartialNil(t) | result = concat(ppReprType(t)))
}
override AccessPathFront getFront() {
@@ -2092,7 +2092,9 @@ private module FlowExploration {
private class PartialAccessPathCons extends PartialAccessPath, TPartialCons {
override string toString() {
exists(Content f, int len | this = TPartialCons(f, len) |
result = f.toString() + ", ... (" + len.toString() + ")"
if len = 1
then result = f.toString()
else result = f.toString() + ", ... (" + len.toString() + ")"
)
}

View File

@@ -2081,7 +2081,7 @@ private module FlowExploration {
private class PartialAccessPathNil extends PartialAccessPath, TPartialNil {
override string toString() {
exists(DataFlowType t | this = TPartialNil(t) | result = ppReprType(t))
exists(DataFlowType t | this = TPartialNil(t) | result = concat(ppReprType(t)))
}
override AccessPathFront getFront() {
@@ -2092,7 +2092,9 @@ private module FlowExploration {
private class PartialAccessPathCons extends PartialAccessPath, TPartialCons {
override string toString() {
exists(Content f, int len | this = TPartialCons(f, len) |
result = f.toString() + ", ... (" + len.toString() + ")"
if len = 1
then result = f.toString()
else result = f.toString() + ", ... (" + len.toString() + ")"
)
}

View File

@@ -2081,7 +2081,7 @@ private module FlowExploration {
private class PartialAccessPathNil extends PartialAccessPath, TPartialNil {
override string toString() {
exists(DataFlowType t | this = TPartialNil(t) | result = ppReprType(t))
exists(DataFlowType t | this = TPartialNil(t) | result = concat(ppReprType(t)))
}
override AccessPathFront getFront() {
@@ -2092,7 +2092,9 @@ private module FlowExploration {
private class PartialAccessPathCons extends PartialAccessPath, TPartialCons {
override string toString() {
exists(Content f, int len | this = TPartialCons(f, len) |
result = f.toString() + ", ... (" + len.toString() + ")"
if len = 1
then result = f.toString()
else result = f.toString() + ", ... (" + len.toString() + ")"
)
}

View File

@@ -2081,7 +2081,7 @@ private module FlowExploration {
private class PartialAccessPathNil extends PartialAccessPath, TPartialNil {
override string toString() {
exists(DataFlowType t | this = TPartialNil(t) | result = ppReprType(t))
exists(DataFlowType t | this = TPartialNil(t) | result = concat(ppReprType(t)))
}
override AccessPathFront getFront() {
@@ -2092,7 +2092,9 @@ private module FlowExploration {
private class PartialAccessPathCons extends PartialAccessPath, TPartialCons {
override string toString() {
exists(Content f, int len | this = TPartialCons(f, len) |
result = f.toString() + ", ... (" + len.toString() + ")"
if len = 1
then result = f.toString()
else result = f.toString() + ", ... (" + len.toString() + ")"
)
}

View File

@@ -2081,7 +2081,7 @@ private module FlowExploration {
private class PartialAccessPathNil extends PartialAccessPath, TPartialNil {
override string toString() {
exists(DataFlowType t | this = TPartialNil(t) | result = ppReprType(t))
exists(DataFlowType t | this = TPartialNil(t) | result = concat(ppReprType(t)))
}
override AccessPathFront getFront() {
@@ -2092,7 +2092,9 @@ private module FlowExploration {
private class PartialAccessPathCons extends PartialAccessPath, TPartialCons {
override string toString() {
exists(Content f, int len | this = TPartialCons(f, len) |
result = f.toString() + ", ... (" + len.toString() + ")"
if len = 1
then result = f.toString()
else result = f.toString() + ", ... (" + len.toString() + ")"
)
}

View File

@@ -1,14 +1,14 @@
edges
| A.java:12:5:12:5 | b [post update] [elem, ... (1)] | A.java:13:12:13:12 | b [elem, ... (1)] |
| A.java:12:14:12:18 | src(...) [Object] | A.java:12:5:12:5 | b [post update] [elem, ... (1)] |
| A.java:12:5:12:5 | b [post update] [elem] | A.java:13:12:13:12 | b [elem] |
| A.java:12:14:12:18 | src(...) [Object] | A.java:12:5:12:5 | b [post update] [elem] |
| A.java:12:14:12:18 | src(...) [Object] | A.java:12:5:12:18 | ...=... [Object] |
| A.java:13:12:13:12 | b [elem, ... (1)] | A.java:17:13:17:16 | f1(...) [elem, ... (1)] |
| A.java:17:13:17:16 | f1(...) [elem, ... (1)] | A.java:18:8:18:8 | b [elem, ... (1)] |
| A.java:18:8:18:8 | b [elem, ... (1)] | A.java:21:11:21:15 | b [elem, ... (1)] |
| A.java:13:12:13:12 | b [elem] | A.java:17:13:17:16 | f1(...) [elem] |
| A.java:17:13:17:16 | f1(...) [elem] | A.java:18:8:18:8 | b [elem] |
| A.java:18:8:18:8 | b [elem] | A.java:21:11:21:15 | b [elem] |
#select
| 0 | A.java:12:5:12:5 | b [post update] [elem, ... (1)] |
| 0 | A.java:12:5:12:5 | b [post update] [elem] |
| 0 | A.java:12:5:12:18 | ...=... [Object] |
| 0 | A.java:13:12:13:12 | b [elem, ... (1)] |
| 1 | A.java:17:13:17:16 | f1(...) [elem, ... (1)] |
| 1 | A.java:18:8:18:8 | b [elem, ... (1)] |
| 2 | A.java:21:11:21:15 | b [elem, ... (1)] |
| 0 | A.java:13:12:13:12 | b [elem] |
| 1 | A.java:17:13:17:16 | f1(...) [elem] |
| 1 | A.java:18:8:18:8 | b [elem] |
| 2 | A.java:21:11:21:15 | b [elem] |