コード例 #1
0
 void report(IvyXmlWriter xw) {
   xw.begin("COVERAGE");
   for (MethodCountData mcd : method_data.values()) {
     mcd.report(xw);
   }
   xw.end("COVERAGE");
 }
コード例 #2
0
    UseMode getMethodUsage(String mthd) {
      MethodCountData mcd = method_data.get(mthd);
      if (mcd == null) {
        int idx0 = mthd.indexOf("(");
        if (idx0 < 0) return UseMode.NONE;
        String mthd0 = mthd.substring(0, idx0);
        String mthd1 = mthd.substring(idx0);
        for (Map.Entry<String, MethodCountData> ent : method_data.entrySet()) {
          String nm = ent.getKey();
          nm = nm.replace('/', '.');
          int idx = nm.indexOf("(");
          if (idx < 0) continue;
          if (mthd0.equals(nm.substring(0, idx))) {
            if (BumpLocation.compareParameters(mthd1, nm.substring(idx))) {
              mcd = ent.getValue();
              method_data.put(mthd, mcd);
              break;
            }
          }
        }
      }

      if (mcd != null) {
        if (mcd.getTopCount() > 0) return UseMode.DIRECT;
        if (mcd.getCalledCount() > 0) return UseMode.INDIRECT;
      }
      return UseMode.NONE;
    }
コード例 #3
0
    CountData(Element e) {
      method_data = new HashMap<String, MethodCountData>();

      for (Element me : IvyXml.children(e, "METHOD")) {
        MethodCountData mcd = new MethodCountData(me);
        method_data.put(mcd.getName(), mcd);
      }
    }
コード例 #4
0
 FileState usesClasses(Map<String, FileState> clsset, FileState st) {
   for (MethodCountData mcd : method_data.values()) {
     st = mcd.usesClasses(clsset, st);
   }
   return st;
 }