diff --git a/org.ntlab.traceAnalyzer/src/org/ntlab/deltaExtractor/Alias.java b/org.ntlab.traceAnalyzer/src/org/ntlab/deltaExtractor/Alias.java index 15e6bb8..c59c4c6 100644 --- a/org.ntlab.traceAnalyzer/src/org/ntlab/deltaExtractor/Alias.java +++ b/org.ntlab.traceAnalyzer/src/org/ntlab/deltaExtractor/Alias.java @@ -1,5 +1,7 @@ package org.ntlab.deltaExtractor; +import org.ntlab.deltaExtractor.Alias.AliasType; import org.ntlab.trace.MethodExecution; +import org.ntlab.trace.MethodInvocation; import org.ntlab.trace.Statement; import org.ntlab.trace.TracePoint; /** @@ -63,7 +65,27 @@ public String getMethodSignature() { return occurrencePoint.getMethodExecution().getSignature(); } - + + /** + * Get time stamp of statement. + * @return + */ + public long getTimeStamp() { + if (!occurrencePoint.isValid()) { + return occurrencePoint.getMethodExecution().getEntryTime(); + } + long stTimeStamp = occurrencePoint.getStatement().getTimeStamp(); + Statement st = occurrencePoint.getStatement(); + if (aliasType == AliasType.RETURN_VALUE) { + stTimeStamp = occurrencePoint.getMethodExecution().getExitTime(); + } else if (aliasType == AliasType.METHOD_INVOCATION && st instanceof MethodInvocation) { + stTimeStamp = ((MethodInvocation) st).getCalledMethodExecution().getExitTime(); + } else if (aliasType == AliasType.FORMAL_PARAMETER) { + stTimeStamp = occurrencePoint.getMethodExecution().getEntryTime(); + } + return stTimeStamp; + } + public int getLineNo() { try { Statement statement = occurrencePoint.getStatement();