Kyle Galloway wrote:

2006-06-12  Kyle Galloway <[EMAIL PROTECTED]>

  * gnu/classpath/jdwp/event/filters/ExceptionOnlyFilter.java
  (forCaught): removed useless accessor method
  (forUncaught): removed useless accessor method
  (matches): Implemented

This is approved with some slight modifications, which I've done for you: whack gratuitous whitespace changes, and wrap to 80 columns. I've attached what I've actually committed.

Keith
Index: gnu/classpath/jdwp/event/filters/ExceptionOnlyFilter.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/classpath/jdwp/event/filters/ExceptionOnlyFilter.java,v
retrieving revision 1.2
diff -u -p -r1.2 ExceptionOnlyFilter.java
--- gnu/classpath/jdwp/event/filters/ExceptionOnlyFilter.java	9 Mar 2006 23:18:29 -0000	1.2
+++ gnu/classpath/jdwp/event/filters/ExceptionOnlyFilter.java	12 Jun 2006 20:31:56 -0000
@@ -1,5 +1,5 @@
-/* ExceptionOnlyFilter.java -- 
-   Copyright (C) 2005 Free Software Foundation
+/* ExceptionOnlyFilter.java -- filter for excetions by caught/uncaught and type
+   Copyright (C) 2005, 2006 Free Software Foundation
 
 This file is part of GNU Classpath.
 
@@ -88,34 +88,29 @@ public class ExceptionOnlyFilter
     return _refId;
   }
 
-  /**
-   * Report caught exceptions?
-   *
-   * @return whether to report caught exceptions
-   */
-  public boolean forCaught ()
-  {
-    return _caught;
-  }
-
-  /**
-   * Report uncaught exceptions?
-   *
-   * @return whether to report uncaught exceptions
-   */
-  public boolean forUncaught ()
-  {
-    return _uncaught;
-  }
-
+  
   /**
    * Does the given event match the filter?
    *
    * @param event  the <code>Event</code> to scrutinize
    */
-  public boolean matches (Event event)
+  public boolean matches(Event event)
   {
-    // FIXME
-    throw new RuntimeException ("ExceptionOnlyFilter.matches not implemented");
+    boolean classMatch;
+    
+    try
+      {
+	Class klass = (Class) event.getParameter(Event.EVENT_EXCEPTION_CLASS);
+        classMatch = klass == _refId.getType();
+      }
+    catch (InvalidClassException ex)
+      {
+        classMatch = false;
+      }
+    
+    Boolean caught
+      = (Boolean) event.getParameter(Event.EVENT_EXCEPTION_CAUGHT);
+
+    return classMatch && (caught.booleanValue()) ? _caught : _uncaught;
   }
 }

Reply via email to