Java: Account for extraction of calls to <obinit>.

This commit is contained in:
Anders Schack-Mulligen
2018-11-06 17:42:02 +01:00
parent 9ee4d3b187
commit 6f791bb530
5 changed files with 14 additions and 4 deletions

View File

@@ -158,7 +158,9 @@ class LocationOverridingImportStaticTypeMember extends ImportStaticTypeMember {
}
Element definition(Element e, string kind) {
e.(MethodAccess).getMethod().getSourceDeclaration() = result and kind = "M"
e.(MethodAccess).getMethod().getSourceDeclaration() = result and
kind = "M" and
not result instanceof InitializerMethod
or
e.(TypeAccess).getType().(RefType).getSourceDeclaration() = result and kind = "T"
or

View File

@@ -6,6 +6,7 @@
| structure/A.java:15:17:15:17 | A | --none-- |
| structure/A.java:16:2:16:4 | int | --none-- |
| structure/A.java:21:2:21:4 | int | --none-- |
| structure/A.java:24:7:24:7 | <obinit>(...) | D |
| structure/A.java:24:17:24:17 | B | --none-- |
| structure/A.java:25:4:25:13 | new (...) | <obinit> |
| structure/A.java:25:8:25:8 | C | <obinit> |

View File

@@ -6,6 +6,7 @@
| structure/A.java:15:17:15:17 | A | --none-- |
| structure/A.java:16:2:16:4 | int | --none-- |
| structure/A.java:21:2:21:4 | int | --none-- |
| structure/A.java:24:7:24:7 | <obinit>(...) | stmt on line 24 |
| structure/A.java:24:17:24:17 | B | --none-- |
| structure/A.java:25:4:25:13 | new (...) | stmt on line 25 |
| structure/A.java:25:8:25:8 | C | stmt on line 25 |

View File

@@ -229,7 +229,9 @@
| TestLoopBranch.java:105:7:105:11 | ... + ... | TestLoopBranch.java:105:3:105:11 | ...=... |
| TestLoopBranch.java:105:11:105:11 | y | TestLoopBranch.java:105:7:105:11 | ... + ... |
| TestLoopBranch.java:106:3:106:9 | stmt | TestLoopBranch.java:7:14:7:14 | f |
| TestLoopBranch.java:109:9:109:22 | super(...) | TestLoopBranch.java:111:3:111:10 | stmt |
| TestLoopBranch.java:109:9:109:22 | <obinit>(...) | TestLoopBranch.java:111:3:111:10 | stmt |
| TestLoopBranch.java:109:9:109:22 | stmt | TestLoopBranch.java:109:9:109:22 | <obinit>(...) |
| TestLoopBranch.java:109:9:109:22 | super(...) | TestLoopBranch.java:109:9:109:22 | stmt |
| TestLoopBranch.java:110:2:113:2 | stmt | TestLoopBranch.java:109:9:109:22 | super(...) |
| TestLoopBranch.java:111:3:111:9 | ...=... | TestLoopBranch.java:112:3:112:10 | stmt |
| TestLoopBranch.java:111:3:111:10 | stmt | TestLoopBranch.java:111:8:111:9 | 33 |
@@ -237,7 +239,9 @@
| TestLoopBranch.java:112:3:112:9 | ...=... | TestLoopBranch.java:109:9:109:22 | TestLoopBranch |
| TestLoopBranch.java:112:3:112:10 | stmt | TestLoopBranch.java:112:8:112:9 | 44 |
| TestLoopBranch.java:112:8:112:9 | 44 | TestLoopBranch.java:112:3:112:9 | ...=... |
| TestLoopBranch.java:115:9:115:22 | super(...) | TestLoopBranch.java:117:3:117:9 | stmt |
| TestLoopBranch.java:115:9:115:22 | <obinit>(...) | TestLoopBranch.java:117:3:117:9 | stmt |
| TestLoopBranch.java:115:9:115:22 | stmt | TestLoopBranch.java:115:9:115:22 | <obinit>(...) |
| TestLoopBranch.java:115:9:115:22 | super(...) | TestLoopBranch.java:115:9:115:22 | stmt |
| TestLoopBranch.java:116:2:119:2 | stmt | TestLoopBranch.java:115:9:115:22 | super(...) |
| TestLoopBranch.java:117:3:117:8 | ...=... | TestLoopBranch.java:118:3:118:9 | stmt |
| TestLoopBranch.java:117:3:117:9 | stmt | TestLoopBranch.java:117:8:117:8 | i |

View File

@@ -1,6 +1,8 @@
| TestThrow2.java:3:7:3:16 | <obinit>(...) | TestThrow2.java:3:7:3:16 | TestThrow2 |
| TestThrow2.java:3:7:3:16 | stmt | TestThrow2.java:3:7:3:16 | <obinit>(...) |
| TestThrow2.java:3:7:3:16 | stmt | TestThrow2.java:3:7:3:16 | super(...) |
| TestThrow2.java:3:7:3:16 | stmt | TestThrow2.java:5:2:11:2 | stmt |
| TestThrow2.java:3:7:3:16 | super(...) | TestThrow2.java:3:7:3:16 | TestThrow2 |
| TestThrow2.java:3:7:3:16 | super(...) | TestThrow2.java:3:7:3:16 | stmt |
| TestThrow2.java:5:2:11:2 | stmt | TestThrow2.java:6:3:10:3 | stmt |
| TestThrow2.java:6:3:10:3 | stmt | TestThrow2.java:6:7:8:3 | stmt |
| TestThrow2.java:6:7:8:3 | stmt | TestThrow2.java:7:4:7:13 | stmt |