cziegeler 2002/06/03 03:36:02
Modified: src/java/org/apache/cocoon/webapps/authentication/components
HandlerManager.java
Log:
Fixed bug in handlers
Revision Changes Path
1.6 +10 -7
xml-cocoon2/src/java/org/apache/cocoon/webapps/authentication/components/HandlerManager.java
Index: HandlerManager.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/webapps/authentication/components/HandlerManager.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- HandlerManager.java 3 Jun 2002 10:02:01 -0000 1.5
+++ HandlerManager.java 3 Jun 2002 10:36:01 -0000 1.6
@@ -64,7 +64,7 @@
* This is a utility class managing the authentication handlers
*
* @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a>
- * @version CVS $Id: HandlerManager.java,v 1.5 2002/06/03 10:02:01 cziegeler Exp $
+ * @version CVS $Id: HandlerManager.java,v 1.6 2002/06/03 10:36:01 cziegeler Exp $
*/
public final class HandlerManager {
@@ -103,8 +103,16 @@
if ( null != handlersWrapper ) {
Configuration[] handlers =
handlersWrapper.getChildren("handler");
if ( null != handlers ) {
- for(int i=0; i<handlers.length;i++)
+ ArrayList al = new ArrayList(4);
+ for(int i=0; i<handlers.length;i++) {
+ // check unique name
+ final String name =
handlers[i].getAttribute("name");
+ if ( al.contains(name) ) {
+ throw new ConfigurationException("Handler names
must be unique: " + name);
+ }
+ al.add( name );
this.addHandler( handlers[i], resolver, request);
+ }
}
}
}
@@ -121,11 +129,6 @@
throws ConfigurationException {
// get handler name
final String name = configuration.getAttribute("name");
-
- // test if handler is unique
- if (configuredHandlers.get(name) != null) {
- throw new ConfigurationException("Handler names must be unique: " +
name);
- }
// create handler
Handler currentHandler = new Handler(name);
----------------------------------------------------------------------
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]