diff options
author | Simon Kaegi | 2010-03-05 22:15:13 +0000 |
---|---|---|
committer | Simon Kaegi | 2010-03-05 22:15:13 +0000 |
commit | 2a15a97635e1c8db9e63a33eded4baef61838993 (patch) | |
tree | bbb6666ed51da5c5ac4394cd4a12b26a17f9c6a6 /bundles/org.eclipse.equinox.http.registry/src/org/eclipse/equinox | |
parent | 98a3bce0f5cb4d94620d182c841d8c2c06cb282f (diff) | |
download | rt.equinox.bundles-2a15a97635e1c8db9e63a33eded4baef61838993.tar.gz rt.equinox.bundles-2a15a97635e1c8db9e63a33eded4baef61838993.tar.xz rt.equinox.bundles-2a15a97635e1c8db9e63a33eded4baef61838993.zip |
Bug 304121 - Httpservice should log errors due to duplicate resource alias definition
Diffstat (limited to 'bundles/org.eclipse.equinox.http.registry/src/org/eclipse/equinox')
-rw-r--r-- | bundles/org.eclipse.equinox.http.registry/src/org/eclipse/equinox/http/registry/internal/HttpRegistryManager.java | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/bundles/org.eclipse.equinox.http.registry/src/org/eclipse/equinox/http/registry/internal/HttpRegistryManager.java b/bundles/org.eclipse.equinox.http.registry/src/org/eclipse/equinox/http/registry/internal/HttpRegistryManager.java index cd84614c8..68b73fb79 100644 --- a/bundles/org.eclipse.equinox.http.registry/src/org/eclipse/equinox/http/registry/internal/HttpRegistryManager.java +++ b/bundles/org.eclipse.equinox.http.registry/src/org/eclipse/equinox/http/registry/internal/HttpRegistryManager.java @@ -115,8 +115,10 @@ public class HttpRegistryManager { } public synchronized boolean addResourcesContribution(String alias, String baseName, String httpContextId, IContributor contributor) { - if (resources.containsKey(alias) || servlets.containsKey(alias)) - return false; // TODO: should log this + if (resources.containsKey(alias) || servlets.containsKey(alias)) { + System.err.println("ERROR: Duplicate alias. Failed to register resource for [alias=\"" + alias + "\", contributor=\"" + contributor + "\"]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + return false; + } ResourcesContribution contribution = new ResourcesContribution(alias, baseName, httpContextId, contributor); resources.put(alias, contribution); @@ -127,8 +129,10 @@ public class HttpRegistryManager { } public synchronized boolean addServletContribution(String alias, Servlet servlet, Dictionary initparams, String httpContextId, IContributor contributor) { - if (resources.containsKey(alias) || servlets.containsKey(alias)) - return false; // TODO: should log this + if (resources.containsKey(alias) || servlets.containsKey(alias)) { + System.err.println("ERROR: Duplicate alias. Failed to register servlet for [alias=\"" + alias + "\", contributor=\"" + contributor + "\"]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + return false; + } ServletContribution contribution = new ServletContribution(alias, servlet, initparams, httpContextId, contributor); servlets.put(alias, contribution); @@ -168,8 +172,10 @@ public class HttpRegistryManager { } public synchronized boolean addHttpContextContribution(String httpContextId, HttpContext context, IContributor contributor) { - if (contexts.containsKey(httpContextId)) - return false; // TODO: should log this + if (contexts.containsKey(httpContextId)) { + System.err.println("ERROR: Duplicate HttpContextId. Failed to register HttpContext for [httpContextId=\"" + httpContextId + "\", contributor=\"" + contributor + "\"]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + return false; + } contexts.put(httpContextId, new HttpContextContribution(context, contributor)); for (Iterator it = filters.values().iterator(); it.hasNext();) { |