diff options
author | Keith Seitz <keiths@redhat.com> | 2006-06-12 20:39:15 +0000 |
---|---|---|
committer | Keith Seitz <keiths@redhat.com> | 2006-06-12 20:39:15 +0000 |
commit | c72c8351d9768b0adc79817594a22a8293e5dd6a (patch) | |
tree | 68d82afa007334d58516492b8313ae6733aa68a1 /gnu/classpath | |
parent | 333f906b13b7fc902d7bb064599d6daf68ca71ea (diff) | |
download | classpath-c72c8351d9768b0adc79817594a22a8293e5dd6a.tar.gz |
From Kyle Galloway <kgallowa@redhat.com>:
* gnu/classpath/jdwp/event/filters/ExceptionOnlyFilter.java
(forCaught): Removed unused/unnecessary method.
(forUncaught): Likewise.
(matches): Implement.
Diffstat (limited to 'gnu/classpath')
-rw-r--r-- | gnu/classpath/jdwp/event/filters/ExceptionOnlyFilter.java | 45 |
1 files changed, 20 insertions, 25 deletions
diff --git a/gnu/classpath/jdwp/event/filters/ExceptionOnlyFilter.java b/gnu/classpath/jdwp/event/filters/ExceptionOnlyFilter.java index cf6c0704d..3ab907d41 100644 --- a/gnu/classpath/jdwp/event/filters/ExceptionOnlyFilter.java +++ b/gnu/classpath/jdwp/event/filters/ExceptionOnlyFilter.java @@ -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; } } |