]> source.dussan.org Git - aspectj.git/commitdiff
timing support
authoraclement <aclement>
Mon, 2 Nov 2009 21:02:37 +0000 (21:02 +0000)
committeraclement <aclement>
Mon, 2 Nov 2009 21:02:37 +0000 (21:02 +0000)
org.aspectj.matcher/src/org/aspectj/weaver/ShadowMunger.java

index d1294210809de3b62132e277587f0bd4ca392d05..1b6dbbe6f76ce560cec03045c3bfc1b8c69400e6 100644 (file)
@@ -24,6 +24,7 @@ import org.aspectj.bridge.IMessage;
 import org.aspectj.bridge.ISourceLocation;
 import org.aspectj.bridge.MessageUtil;
 import org.aspectj.bridge.SourceLocation;
+import org.aspectj.util.FuzzyBoolean;
 import org.aspectj.util.PartialOrder;
 import org.aspectj.weaver.patterns.PerClause;
 import org.aspectj.weaver.patterns.Pointcut;
@@ -103,7 +104,16 @@ public abstract class ShadowMunger implements PartialOrder.PartialComparable, IH
                                }
                        }
                }
-               return pointcut.match(shadow).maybeTrue();
+               if (world.areInfoMessagesEnabled() && world.isTimingEnabled()) {
+                       long starttime = System.nanoTime();
+                       FuzzyBoolean isMatch = pointcut.match(shadow);
+                       long endtime = System.nanoTime();
+                       world.record(pointcut, endtime - starttime);
+                       return isMatch.maybeTrue();
+               } else {
+                       FuzzyBoolean isMatch = pointcut.match(shadow);
+                       return isMatch.maybeTrue();
+               }
        }
 
        public int fallbackCompareTo(Object other) {