diff --git a/tools/idea/jps-common/teavm-jps-common.iml b/tools/idea/jps-common/teavm-jps-common.iml
index 492bc8742..bc40e44c8 100644
--- a/tools/idea/jps-common/teavm-jps-common.iml
+++ b/tools/idea/jps-common/teavm-jps-common.iml
@@ -9,14 +9,15 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
diff --git a/tools/idea/jps-plugin/src/main/java/org/teavm/idea/jps/TeaVMBuild.java b/tools/idea/jps-plugin/src/main/java/org/teavm/idea/jps/TeaVMBuild.java
index ac8d0ddda..642bb11bf 100644
--- a/tools/idea/jps-plugin/src/main/java/org/teavm/idea/jps/TeaVMBuild.java
+++ b/tools/idea/jps-plugin/src/main/java/org/teavm/idea/jps/TeaVMBuild.java
@@ -26,6 +26,7 @@ import java.nio.charset.StandardCharsets;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
@@ -267,9 +268,11 @@ class TeaVMBuild {
problemsToReport.add(result);
} else {
for (CallSite callSite : node.getCallerCallSites()) {
- CallLocation nextLocation = new CallLocation(callSite.getCaller().getMethod(),
- callSite.getLocation());
- workList.add(new Step(new CallLocationList(step.location, step.locationList), nextLocation));
+ for (CallGraphNode caller : callSite.getCallers()) {
+ CallLocation nextLocation = new CallLocation(caller.getMethod(),
+ getLocation(callSite.getLocations(caller)));
+ workList.add(new Step(new CallLocationList(step.location, step.locationList), nextLocation));
+ }
}
}
}
@@ -277,6 +280,10 @@ class TeaVMBuild {
return problemsToReport;
}
+ private TextLocation getLocation(Collection extends TextLocation> location) {
+ return location.isEmpty() ? null : location.iterator().next();
+ }
+
private boolean isValid(ProblemToReport problemToReport) {
return problemToReport.path != null && (problemToReport.line >= 0 || problemToReport.startOffset >= 0);
}
diff --git a/tools/idea/jps-plugin/teavm-jps-plugin.iml b/tools/idea/jps-plugin/teavm-jps-plugin.iml
index 8c153becc..f724c540a 100644
--- a/tools/idea/jps-plugin/teavm-jps-plugin.iml
+++ b/tools/idea/jps-plugin/teavm-jps-plugin.iml
@@ -10,14 +10,15 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
\ No newline at end of file