Changeset 374

Show
Ignore:
Timestamp:
08/22/08 15:44:28 (9 years ago)
Author:
cseifert
Message:
 
Location:
capture-hpc/trunk/capture-server/capture
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • capture-hpc/trunk/capture-server/capture/ProcessStateChange.java

    r340 r374  
    4141        setTime(time); 
    4242        this.action = action; 
    43         this.processId = Integer.parseInt(processId); 
     43        try { 
     44            this.processId = Integer.parseInt(processId); 
     45        } catch (NumberFormatException e) { 
     46            this.processId = -1; 
     47        } 
    4448        this.process = process; 
    45         this.parentProcessId = Integer.parseInt(parentProcessId); 
     49        try { 
     50            this.parentProcessId = Integer.parseInt(parentProcessId); 
     51        } catch (NumberFormatException e) { 
     52            this.parentProcessId = -1; 
     53        } 
    4654        this.parentProcess = parentProcess; 
    4755    } 
    4856 
    4957    public boolean addStateChange(StateChange sc) { 
    50         if(sc instanceof ObjectStateChange) { 
     58        if (sc instanceof ObjectStateChange) { 
    5159            ObjectStateChange osc = (ObjectStateChange) sc; 
    52             if(osc.getProcessId()==processId) { 
     60            if (osc.getProcessId() == processId) { 
    5361                stateChanges.add(osc); 
    5462                return true; 
     
    5664        } 
    5765 
    58         if(sc instanceof ProcessStateChange) { 
     66        if (sc instanceof ProcessStateChange) { 
    5967            ProcessStateChange psc = (ProcessStateChange) sc; 
    60             if(psc.getParentProcessId() == this.processId) { 
     68            if (psc.getParentProcessId() == this.processId) { 
    6169                childProcesses.add(psc); 
    6270                return true; 
     
    6775            ProcessStateChange childProcess = childStateChangeIterator.next(); 
    6876            boolean added = childProcess.addStateChange(sc); 
    69             if(added) { 
     77            if (added) { 
    7078                return true; 
    7179            } 
     
    7684 
    7785    public String toCSV() { 
    78         return "\""+type+"\",\""+getTimeString()+"\",\""+parentProcessId+"\",\""+parentProcess+"\",\""+action+"\",\""+processId+"\",\""+process+"\"\n"; 
     86        return "\"" + type + "\",\"" + getTimeString() + "\",\"" + parentProcessId + "\",\"" + parentProcess + "\",\"" + action + "\",\"" + processId + "\",\"" + process + "\"\n"; 
    7987    } 
    8088 
     
    9199        Collections.sort(allStateChanges, new Comparator() { 
    92100            public int compare(Object o1, Object o2) { 
    93                 Date d1 = ((StateChange)o1).getTime(); 
    94                 Date d2 = ((StateChange)o2).getTime(); 
     101                Date d1 = ((StateChange) o1).getTime(); 
     102                Date d2 = ((StateChange) o2).getTime(); 
    95103                int dateDiff = d1.compareTo(d2); 
    96                 if(dateDiff==0) { 
    97                     String type1 = ((StateChange)o1).getType(); 
    98                     String type2 = ((StateChange)o2).getType(); 
     104                if (dateDiff == 0) { 
     105                    String type1 = ((StateChange) o1).getType(); 
     106                    String type2 = ((StateChange) o2).getType(); 
    99107                    return type2.compareTo(type1); 
    100108                } else { 
     
    122130            return false; 
    123131        if (process != null ? !process.equals(that.process) : that.process != null) return false; 
    124         if (action != null ? !action.equals(that.action) : that.action!= null) return false; 
    125          if (time != null ? !time.equals(that.time) : that.time != null) return false; 
     132        if (action != null ? !action.equals(that.action) : that.action != null) return false; 
     133        if (time != null ? !time.equals(that.time) : that.time != null) return false; 
    126134        if (type != null ? !type.equals(that.type) : that.type != null) return false; 
    127135 
  • capture-hpc/trunk/capture-server/capture/UrlGroup.java

    r369 r374  
    3434    private Date visitStartTime; 
    3535    private Date visitFinishTime; 
    36     private String algorithm; 
     36    private String algorithm = ""; 
    3737 
    3838    public UrlGroup(List<Url> urlList, boolean initialGroup) {