incubator-aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From o...@apache.org
Subject svn commit: r897867 - /incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerTwo.java
Date Mon, 11 Jan 2010 14:05:36 GMT
Author: ozzy
Date: Mon Jan 11 14:05:35 2010
New Revision: 897867

URL: http://svn.apache.org/viewvc?rev=897867&view=rev
Log:
ARIES-85 Groundwork for asm interceptor patch

Modified:
    incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerTwo.java

Modified: incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerTwo.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerTwo.java?rev=897867&r1=897866&r2=897867&view=diff
==============================================================================
--- incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerTwo.java
(original)
+++ incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerTwo.java
Mon Jan 11 14:05:35 2010
@@ -51,8 +51,18 @@
     
     private static Interceptor tracker = new Interceptor() {
         
+        //debug/trace calls to toString etc will mess up the interceptor
+        //log, and break tests if tracked. So we filter them out here.
+        private boolean isIgnorableMethod(Method m){
+            if(m.getDeclaringClass()==Object.class){
+                return true;
+            }
+            else
+                return false;
+        }
+        
         public Object preCall(ComponentMetadata cm, Method m, Object... parameters)
-                throws Throwable {
+                throws Throwable {            
             String args = "[";
             if(parameters!=null){
                 if(parameters.length>0){
@@ -64,18 +74,25 @@
             }
             args+="]";
             String token = cm.getId() +":"+ m.getName() +":"+args+":"+System.currentTimeMillis();
-            interceptorLog.add("PRECALL:"+token);
+            
+            if(!isIgnorableMethod(m))
+              interceptorLog.add("PRECALL:"+token);
+            
             return token;
         }
         
         public void postCallWithReturn(ComponentMetadata cm, Method m,
                 Object returnType, Object preCallToken) throws Throwable {
-            interceptorLog.add("POSTCALL["+returnType.toString()+"]:"+preCallToken);
+            
+            if(!isIgnorableMethod(m))
+                interceptorLog.add("POSTCALL["+returnType.toString()+"]:"+preCallToken);
         }
         
         public void postCallWithException(ComponentMetadata cm, Method m,
                 Exception ex, Object preCallToken) throws Throwable {
-            interceptorLog.add("POSTCALLEXCEPTION["+ex.toString()+"]:"+preCallToken);
+            
+            if(!isIgnorableMethod(m))
+                interceptorLog.add("POSTCALLEXCEPTION["+ex.toString()+"]:"+preCallToken);
         }
         
         public int getRank() {



Mime
View raw message