Esempio n. 1
0
  public void CheckDPDList(TObj tobj) {
    TObj objlist[] = tobj.getTObjList();
    if (objlist == null) return;
    for (int i = 0; i < objlist.length; i++) {
      TObj tmpobj = objlist[i];
      CheckDPDList(tmpobj);
      TDpd dpdlist[] = tmpobj.getTDpdList();
      if (dpdlist == null) continue;
      for (int j = 0; j < dpdlist.length; j++) {
        TDpd tmpdpd = dpdlist[j];
        if (tmpdpd == null) continue;

        if (tmpdpd.getType() == C_FUNCTION_CALL) {
          String dpd_name = tmpdpd.getName();
          if (dpd_name.indexOf('(') > 0) {
            dpd_name = dpd_name.substring(0, dpd_name.indexOf('(')).trim();
          }
          if (hfunname.containsKey(dpd_name)) {
            Integer val = (Integer) hfunname.get(dpd_name);
            int cnt = val.intValue() + 1;
            hfunname.put(dpd_name, new Integer(cnt));
            // log.debug("push hash", dpd_name + ", count =" + cnt);
          }
        }
      }
    }
  }
Esempio n. 2
0
  public long generateGID(String prefix, TDpd tdpd) {
    String dpd_name = tdpd.getName();
    if (tdpd.getType() == C_FUNCTION_CALL) {
      if (dpd_name.indexOf('(') > 0) {
        dpd_name = dpd_name.substring(0, dpd_name.indexOf('(')).trim();
      }
      dpd_name = dpd_name.trim();
      int cnt = 0;
      if (hfunname.containsKey(dpd_name)) {
        Integer val = (Integer) hfunname.get(dpd_name);
        cnt = val.intValue();
      }

      if (mainflag) {
        if (cnt == 0) {
          String str = new String();
          str = dpd_name;
          tdpd.setGID(str);
          return FileUtil.getGID("<EC>", str);
        }
        String str = new String();
        str = filestr + "." + dpd_name;
        tdpd.setGID(str);
        return FileUtil.getGID("<EC>", str);
      } else if (submainflag) {
        if (hsubmainname.containsKey(dpd_name)) {
          String str = new String();
          str = dpd_name;
          tdpd.setGID(str);
          return FileUtil.getGID("<EC>", str);
        }
        if (cnt == 0) {
          String str = new String();
          str = dpd_name;
          tdpd.setGID(str);
          return FileUtil.getGID("<EC>", str);
        }
        String str = new String();
        str = filestr + "." + dpd_name;

        tdpd.setGID(str);
        return FileUtil.getGID("<EC>", str);
      } else {
        String str = new String();
        if (hStaticfun.containsKey(dpd_name)) {
          str = filestr + "." + dpd_name;
        } else str = dpd_name;
        tdpd.setGID(tdpd.getGID()); // str
        return FileUtil.getGID("<EC>", str);
      }
    }
    return 0L;
  }
Esempio n. 3
0
 public int doTDpd(int depth, TDpd tdpd, CM_SRC cm_src, CM_OBJ cm_obj, int seq)
     throws SQLException {
   String dpd_name = tdpd.getName();
   /*		if(System.getenv("CPSERVER") == null) {
   	return RETURN_CONTINUE;
   }*/
   if (tdpd.getType() == C_FUNCTION_CALL) {
     if (tdpd.getGID() == null) {
       tdpd.setKeyValidation(100);
       if (dpd_name.indexOf('(') > 0) {
         dpd_name = dpd_name.substring(0, dpd_name.indexOf('(')).trim();
         String fileName =
             Environment.getSourceDir()
                 + cm_src.getCOLLECT_ID()
                 + cm_src.getSPATH()
                 + cm_src.getSNAME();
         tdpd.setGID(fileName + "|" + dpd_name);
       }
     }
   }
   return RETURN_CONTINUE;
 }