X-Git-Url: http://jaekl.net/gitweb/?p=cfb.git;a=blobdiff_plain;f=prod%2Fnet%2Fjaekl%2Fcfb%2Fxml%2FBugInstance.java;h=b805096c67551c7f3a35847b12f6660bc35acca0;hp=0683a7d23c83dd1437b08ebe77bd545d01a830f4;hb=4ba1c41e8a698ed67e8f262412e1fef7a09c5d17;hpb=6d56e7d489a96bed67c7fe7fc37fdb6da3a54dd3 diff --git a/prod/net/jaekl/cfb/xml/BugInstance.java b/prod/net/jaekl/cfb/xml/BugInstance.java index 0683a7d..b805096 100644 --- a/prod/net/jaekl/cfb/xml/BugInstance.java +++ b/prod/net/jaekl/cfb/xml/BugInstance.java @@ -212,9 +212,21 @@ public class BugInstance extends ParseResult { // This should be the place where the bug is reported. Location getPrincipalLocation() { - if (null != m_locations && m_locations.size() > 0) { - return m_locations.get(0); + if (null == m_locations) { + return null; } + + for (int idx = 0; idx < m_locations.size(); ++idx) { + Location loc = m_locations.get(idx); + if (Location.METHOD_CALLED.equals(loc.getMethodRole())) { + // METHOD_CALLED locations describe the method that is being called, + // but the bug is located in the caller, not in the callee. + // Thus, ignore this information about the callee. + continue; + } + return loc; + } + return null; }