Revision: 917
http://stripes.svn.sourceforge.net/stripes/?rev=917&view=rev
Author: javelotinfo
Date: 2008-05-20 08:32:56 -0700 (Tue, 20 May 2008)
Log Message:
-----------
Added a warning for multiple methods that handle the same exception type.
Modified Paths:
--------------
trunk/stripes/src/net/sourceforge/stripes/exception/DefaultExceptionHandler.java
Modified:
trunk/stripes/src/net/sourceforge/stripes/exception/DefaultExceptionHandler.java
===================================================================
---
trunk/stripes/src/net/sourceforge/stripes/exception/DefaultExceptionHandler.java
2008-05-20 14:38:45 UTC (rev 916)
+++
trunk/stripes/src/net/sourceforge/stripes/exception/DefaultExceptionHandler.java
2008-05-20 15:32:56 UTC (rev 917)
@@ -91,6 +91,10 @@
((Resolution) resolution).execute(req, res);
}
}
+
+ Method getHandlerMethod() {
+ return handlerMethod;
+ }
}
/**
@@ -181,6 +185,12 @@
// And if we made it this far, add it!
Class<? extends Throwable> type = parameters[0];
HandlerProxy proxy = new HandlerProxy(handler, method);
+ HandlerProxy previous = handlers.get(type);
+ if (previous != null) {
+ log.warn("More than one exception handler for exception type
", type, " in ",
+ handler.getClass().getSimpleName(), ". '",
method.getName(),
+ "()' will be used instead of '",
previous.getHandlerMethod().getName(), "()'.");
+ }
handlers.put(type, proxy);
log.debug("Added exception handler '",
handler.getClass().getSimpleName(), ".",
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development