You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2008/04/25 20:38:40 UTC
svn commit: r651680 - in /tomcat/trunk/java/org/apache/catalina/deploy:
ContextHandler.java ContextService.java ContextTransaction.java
FilterDef.java NamingResources.java ResourceBase.java
Author: markt
Date: Fri Apr 25 11:38:38 2008
New Revision: 651680
URL: http://svn.apache.org/viewvc?rev=651680&view=rev
Log:
Fix compiler warnings for o.a.c.deploy.*
Note using generics would have highlighted bug 43470
Modified:
tomcat/trunk/java/org/apache/catalina/deploy/ContextHandler.java
tomcat/trunk/java/org/apache/catalina/deploy/ContextService.java
tomcat/trunk/java/org/apache/catalina/deploy/ContextTransaction.java
tomcat/trunk/java/org/apache/catalina/deploy/FilterDef.java
tomcat/trunk/java/org/apache/catalina/deploy/NamingResources.java
tomcat/trunk/java/org/apache/catalina/deploy/ResourceBase.java
Modified: tomcat/trunk/java/org/apache/catalina/deploy/ContextHandler.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/deploy/ContextHandler.java?rev=651680&r1=651679&r2=651680&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/deploy/ContextHandler.java (original)
+++ tomcat/trunk/java/org/apache/catalina/deploy/ContextHandler.java Fri Apr 25 11:38:38 2008
@@ -59,14 +59,14 @@
* soapHeader[0] : namespaceURI
* soapHeader[1] : localpart
*/
- private HashMap soapHeaders = new HashMap();
+ private HashMap<String, String> soapHeaders = new HashMap<String, String>();
- public Iterator getLocalparts() {
+ public Iterator<String> getLocalparts() {
return soapHeaders.keySet().iterator();
}
public String getNamespaceuri(String localpart) {
- return (String) soapHeaders.get(localpart);
+ return soapHeaders.get(localpart);
}
public void addSoapHeaders(String localpart, String namespaceuri) {
@@ -83,7 +83,7 @@
/**
* The soapRole.
*/
- private ArrayList<String> soapRoles = new ArrayList();
+ private ArrayList<String> soapRoles = new ArrayList<String>();
public String getSoapRole(int i) {
return this.soapRoles.get(i);
@@ -100,7 +100,7 @@
/**
* The portName.
*/
- private ArrayList<String> portNames = new ArrayList();
+ private ArrayList<String> portNames = new ArrayList<String>();
public String getPortName(int i) {
return this.portNames.get(i);
Modified: tomcat/trunk/java/org/apache/catalina/deploy/ContextService.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/deploy/ContextService.java?rev=651680&r1=651679&r2=651680&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/deploy/ContextService.java (original)
+++ tomcat/trunk/java/org/apache/catalina/deploy/ContextService.java Fri Apr 25 11:38:38 2008
@@ -19,7 +19,6 @@
package org.apache.catalina.deploy;
import java.io.Serializable;
-import java.util.ArrayList;
import java.util.Iterator;
import java.util.HashMap;
@@ -143,7 +142,7 @@
* particular port-component.
*
*/
- public Iterator getServiceendpoints() {
+ public Iterator<String> getServiceendpoints() {
return this.listProperties();
}
@@ -162,14 +161,15 @@
*
* The instanciation of the handler have to be done.
*/
- private HashMap handlers = new HashMap();
+ private HashMap<String, ContextHandler> handlers =
+ new HashMap<String, ContextHandler>();
- public Iterator getHandlers() {
+ public Iterator<String> getHandlers() {
return handlers.keySet().iterator();
}
public ContextHandler getHandler(String handlername) {
- return (ContextHandler) handlers.get(handlername);
+ return handlers.get(handlername);
}
public void addHandler(ContextHandler handler) {
Modified: tomcat/trunk/java/org/apache/catalina/deploy/ContextTransaction.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/deploy/ContextTransaction.java?rev=651680&r1=651679&r2=651680&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/deploy/ContextTransaction.java (original)
+++ tomcat/trunk/java/org/apache/catalina/deploy/ContextTransaction.java Fri Apr 25 11:38:38 2008
@@ -40,7 +40,7 @@
/**
* Holder for our configured properties.
*/
- private HashMap properties = new HashMap();
+ private HashMap<String, Object> properties = new HashMap<String, Object>();
/**
* Return a configured property.
@@ -66,7 +66,7 @@
/**
* List properties.
*/
- public Iterator listProperties() {
+ public Iterator<String> listProperties() {
return properties.keySet().iterator();
}
Modified: tomcat/trunk/java/org/apache/catalina/deploy/FilterDef.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/deploy/FilterDef.java?rev=651680&r1=651679&r2=651680&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/deploy/FilterDef.java (original)
+++ tomcat/trunk/java/org/apache/catalina/deploy/FilterDef.java Fri Apr 25 11:38:38 2008
@@ -113,9 +113,9 @@
* The set of initialization parameters for this filter, keyed by
* parameter name.
*/
- private Map parameters = new HashMap();
+ private Map<String, String> parameters = new HashMap<String, String>();
- public Map getParameterMap() {
+ public Map<String, String> getParameterMap() {
return (this.parameters);
Modified: tomcat/trunk/java/org/apache/catalina/deploy/NamingResources.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/deploy/NamingResources.java?rev=651680&r1=651679&r2=651680&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/deploy/NamingResources.java (original)
+++ tomcat/trunk/java/org/apache/catalina/deploy/NamingResources.java Fri Apr 25 11:38:38 2008
@@ -62,58 +62,67 @@
* List of naming entries, keyed by name. The value is the entry type, as
* declared by the user.
*/
- private Hashtable entries = new Hashtable();
+ private Hashtable<String, String> entries =
+ new Hashtable<String, String>();
/**
* The EJB resource references for this web application, keyed by name.
*/
- private HashMap ejbs = new HashMap();
+ private HashMap<String, ContextEjb> ejbs =
+ new HashMap<String, ContextEjb>();
/**
* The environment entries for this web application, keyed by name.
*/
- private HashMap envs = new HashMap();
+ private HashMap<String, ContextEnvironment> envs =
+ new HashMap<String, ContextEnvironment>();
/**
* The local EJB resource references for this web application, keyed by
* name.
*/
- private HashMap localEjbs = new HashMap();
+ private HashMap<String, ContextLocalEjb> localEjbs =
+ new HashMap<String, ContextLocalEjb>();
/**
* The message destination referencess for this web application,
* keyed by name.
*/
- private HashMap mdrs = new HashMap();
+ private HashMap<String, MessageDestinationRef> mdrs =
+ new HashMap<String, MessageDestinationRef>();
/**
* The resource environment references for this web application,
* keyed by name.
*/
- private HashMap resourceEnvRefs = new HashMap();
+ private HashMap<String, ContextResourceEnvRef> resourceEnvRefs =
+ new HashMap<String, ContextResourceEnvRef>();
/**
* The resource references for this web application, keyed by name.
*/
- private HashMap resources = new HashMap();
+ private HashMap<String, ContextResource> resources =
+ new HashMap<String, ContextResource>();
/**
* The resource links for this web application, keyed by name.
*/
- private HashMap resourceLinks = new HashMap();
+ private HashMap<String, ContextResourceLink> resourceLinks =
+ new HashMap<String, ContextResourceLink>();
/**
* The web service references for this web application, keyed by name.
*/
- private HashMap services = new HashMap();
+ private HashMap<String, ContextService> services =
+ new HashMap<String, ContextService>();
/**
@@ -339,7 +348,7 @@
if (entries.containsKey(resourceLink.getName())) {
return;
} else {
- Object value = resourceLink.getType();
+ String value = resourceLink.getType();
if (value == null) {
value = "";
}
@@ -365,7 +374,7 @@
if (entries.containsKey(service.getName())) {
return;
} else {
- Object value = service.getType();
+ String value = service.getType();
if (value == null) {
value = "";
}
@@ -390,7 +399,7 @@
public ContextEjb findEjb(String name) {
synchronized (ejbs) {
- return ((ContextEjb) ejbs.get(name));
+ return ejbs.get(name);
}
}
@@ -404,7 +413,7 @@
synchronized (ejbs) {
ContextEjb results[] = new ContextEjb[ejbs.size()];
- return ((ContextEjb[]) ejbs.values().toArray(results));
+ return ejbs.values().toArray(results);
}
}
@@ -419,7 +428,7 @@
public ContextEnvironment findEnvironment(String name) {
synchronized (envs) {
- return ((ContextEnvironment) envs.get(name));
+ return envs.get(name);
}
}
@@ -434,7 +443,7 @@
synchronized (envs) {
ContextEnvironment results[] = new ContextEnvironment[envs.size()];
- return ((ContextEnvironment[]) envs.values().toArray(results));
+ return envs.values().toArray(results);
}
}
@@ -449,7 +458,7 @@
public ContextLocalEjb findLocalEjb(String name) {
synchronized (localEjbs) {
- return ((ContextLocalEjb) localEjbs.get(name));
+ return localEjbs.get(name);
}
}
@@ -463,7 +472,7 @@
synchronized (localEjbs) {
ContextLocalEjb results[] = new ContextLocalEjb[localEjbs.size()];
- return ((ContextLocalEjb[]) localEjbs.values().toArray(results));
+ return localEjbs.values().toArray(results);
}
}
@@ -478,7 +487,7 @@
public MessageDestinationRef findMessageDestinationRef(String name) {
synchronized (mdrs) {
- return ((MessageDestinationRef) mdrs.get(name));
+ return mdrs.get(name);
}
}
@@ -493,7 +502,7 @@
synchronized (mdrs) {
MessageDestinationRef results[] =
new MessageDestinationRef[mdrs.size()];
- return ((MessageDestinationRef[]) mdrs.values().toArray(results));
+ return mdrs.values().toArray(results);
}
}
@@ -508,7 +517,7 @@
public ContextResource findResource(String name) {
synchronized (resources) {
- return ((ContextResource) resources.get(name));
+ return resources.get(name);
}
}
@@ -523,7 +532,7 @@
public ContextResourceLink findResourceLink(String name) {
synchronized (resourceLinks) {
- return ((ContextResourceLink) resourceLinks.get(name));
+ return resourceLinks.get(name);
}
}
@@ -538,8 +547,7 @@
synchronized (resourceLinks) {
ContextResourceLink results[] =
new ContextResourceLink[resourceLinks.size()];
- return ((ContextResourceLink[]) resourceLinks.values()
- .toArray(results));
+ return resourceLinks.values().toArray(results);
}
}
@@ -553,7 +561,7 @@
synchronized (resources) {
ContextResource results[] = new ContextResource[resources.size()];
- return ((ContextResource[]) resources.values().toArray(results));
+ return resources.values().toArray(results);
}
}
@@ -568,7 +576,7 @@
public ContextResourceEnvRef findResourceEnvRef(String name) {
synchronized (resourceEnvRefs) {
- return ((ContextResourceEnvRef) resourceEnvRefs.get(name));
+ return resourceEnvRefs.get(name);
}
}
@@ -583,7 +591,7 @@
synchronized (resourceEnvRefs) {
ContextResourceEnvRef results[] = new ContextResourceEnvRef[resourceEnvRefs.size()];
- return ((ContextResourceEnvRef[]) resourceEnvRefs.values().toArray(results));
+ return resourceEnvRefs.values().toArray(results);
}
}
@@ -598,7 +606,7 @@
public ContextService findService(String name) {
synchronized (services) {
- return ((ContextService) services.get(name));
+ return services.get(name);
}
}
@@ -612,7 +620,7 @@
synchronized (services) {
ContextService results[] = new ContextService[services.size()];
- return ((ContextService[]) services.values().toArray(results));
+ return services.values().toArray(results);
}
}
@@ -639,7 +647,7 @@
ContextEjb ejb = null;
synchronized (ejbs) {
- ejb = (ContextEjb) ejbs.remove(name);
+ ejb = ejbs.remove(name);
}
if (ejb != null) {
support.firePropertyChange("ejb", ejb, null);
@@ -660,7 +668,7 @@
ContextEnvironment environment = null;
synchronized (envs) {
- environment = (ContextEnvironment) envs.remove(name);
+ environment = envs.remove(name);
}
if (environment != null) {
support.firePropertyChange("environment", environment, null);
@@ -681,7 +689,7 @@
ContextLocalEjb localEjb = null;
synchronized (localEjbs) {
- localEjb = (ContextLocalEjb) localEjbs.remove(name);
+ localEjb = localEjbs.remove(name);
}
if (localEjb != null) {
support.firePropertyChange("localEjb", localEjb, null);
@@ -702,7 +710,7 @@
MessageDestinationRef mdr = null;
synchronized (mdrs) {
- mdr = (MessageDestinationRef) mdrs.remove(name);
+ mdr = mdrs.remove(name);
}
if (mdr != null) {
support.firePropertyChange("messageDestinationRef",
@@ -736,7 +744,7 @@
ContextResource resource = null;
synchronized (resources) {
- resource = (ContextResource) resources.remove(name);
+ resource = resources.remove(name);
}
if (resource != null) {
support.firePropertyChange("resource", resource, null);
@@ -758,7 +766,7 @@
ContextResourceEnvRef resourceEnvRef = null;
synchronized (resourceEnvRefs) {
resourceEnvRef =
- (ContextResourceEnvRef) resourceEnvRefs.remove(name);
+ resourceEnvRefs.remove(name);
}
if (resourceEnvRef != null) {
support.firePropertyChange("resourceEnvRef", resourceEnvRef, null);
@@ -779,7 +787,7 @@
ContextResourceLink resourceLink = null;
synchronized (resourceLinks) {
- resourceLink = (ContextResourceLink) resourceLinks.remove(name);
+ resourceLink = resourceLinks.remove(name);
}
if (resourceLink != null) {
support.firePropertyChange("resourceLink", resourceLink, null);
@@ -800,7 +808,7 @@
ContextService service = null;
synchronized (services) {
- service = (ContextService) services.remove(name);
+ service = services.remove(name);
}
if (service != null) {
support.firePropertyChange("service", service, null);
Modified: tomcat/trunk/java/org/apache/catalina/deploy/ResourceBase.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/deploy/ResourceBase.java?rev=651680&r1=651679&r2=651680&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/deploy/ResourceBase.java (original)
+++ tomcat/trunk/java/org/apache/catalina/deploy/ResourceBase.java Fri Apr 25 11:38:38 2008
@@ -84,7 +84,7 @@
/**
* Holder for our configured properties.
*/
- private HashMap properties = new HashMap();
+ private HashMap<String, Object> properties = new HashMap<String, Object>();
/**
* Return a configured property.
@@ -110,7 +110,7 @@
/**
* List properties.
*/
- public Iterator listProperties() {
+ public Iterator<String> listProperties() {
return properties.keySet().iterator();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org