[343736] Clean up generics and some other warnings in tomcat.core plug-in
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/CatalinaPropertiesUtil.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/CatalinaPropertiesUtil.java
index 9876742..4c96c47 100644
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/CatalinaPropertiesUtil.java
+++ b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/CatalinaPropertiesUtil.java
@@ -1,5 +1,5 @@
/**********************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -110,7 +110,7 @@
loaderProperty = propAndValue[1];
}
- Set classpath = new LinkedHashSet();
+ Set<String> classpath = new LinkedHashSet<String>();
StringTokenizer st = new StringTokenizer(loaderProperty, ",");
while (st.hasMoreTokens()) {
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/PublishOperation2.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/PublishOperation2.java
index 0b0c7b3..ed5dbb4 100644
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/PublishOperation2.java
+++ b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/PublishOperation2.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2010 IBM Corporation and others.
+ * Copyright (c) 2005, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -76,7 +76,7 @@
* @see PublishOperation#execute(IProgressMonitor, IAdaptable)
*/
public void execute(IProgressMonitor monitor, IAdaptable info) throws CoreException {
- List status = new ArrayList();
+ List<IStatus> status = new ArrayList<IStatus>();
// If parent web module
if (module.length == 1) {
publishDir(module[0], status, monitor);
@@ -110,7 +110,7 @@
server.setModulePublishState2(module, IServer.PUBLISH_STATE_NONE);
}
- private void publishDir(IModule module2, List status, IProgressMonitor monitor) throws CoreException {
+ private void publishDir(IModule module2, List<IStatus> status, IProgressMonitor monitor) throws CoreException {
IPath path = server.getModuleDeployDirectory(module2);
// Remove if requested or if previously published and are now serving without publishing
@@ -143,7 +143,7 @@
}
}
- private void publishJar(String jarURI, Properties p, List status, IProgressMonitor monitor) throws CoreException {
+ private void publishJar(String jarURI, Properties p, List<IStatus> status, IProgressMonitor monitor) throws CoreException {
IPath path = server.getModuleDeployDirectory(module[0]);
boolean moving = false;
// Get URI used for previous publish, if known
@@ -196,7 +196,7 @@
p.put(module[1].getId(), jarURI);
}
- private void publishArchiveModule(String jarURI, Properties p, List status, IProgressMonitor monitor) {
+ private void publishArchiveModule(String jarURI, Properties p, List<IStatus> status, IProgressMonitor monitor) {
IPath path = server.getModuleDeployDirectory(module[0]);
boolean moving = false;
// Get URI used for previous publish, if known
@@ -257,12 +257,12 @@
* @param status a List containing error and warning IStatus
* @throws CoreException
*/
- protected static void throwException(List status) throws CoreException {
+ protected static void throwException(List<IStatus> status) throws CoreException {
if (status == null || status.size() == 0)
return;
if (status.size() == 1) {
- IStatus status2 = (IStatus) status.get(0);
+ IStatus status2 = status.get(0);
throw new CoreException(status2);
}
IStatus[] children = new IStatus[status.size()];
@@ -272,7 +272,7 @@
throw new CoreException(status2);
}
- protected static void addArrayToList(List list, IStatus[] a) {
+ protected static void addArrayToList(List<IStatus> list, IStatus[] a) {
if (list == null || a == null || a.length == 0)
return;
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/PublishTask.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/PublishTask.java
index 4b3d556..194a6ad 100644
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/PublishTask.java
+++ b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/PublishTask.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
+ * Copyright (c) 2005, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -26,7 +26,7 @@
if (!tomcatServer.getTomcatServer().isTestEnvironment())
return null;
- List tasks = new ArrayList();
+ List<PublishOperation> tasks = new ArrayList<PublishOperation>();
int size = modules.size();
for (int i = 0; i < size; i++) {
IModule[] module = (IModule[]) modules.get(i);
@@ -34,6 +34,6 @@
tasks.add(new PublishOperation2(tomcatServer, kind, module, in.intValue()));
}
- return (PublishOperation[]) tasks.toArray(new PublishOperation[tasks.size()]);
+ return tasks.toArray(new PublishOperation[tasks.size()]);
}
}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat32Configuration.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat32Configuration.java
index ca05108..b18e1dc 100644
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat32Configuration.java
+++ b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat32Configuration.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM Corporation and others.
+ * Copyright (c) 2003, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -108,7 +108,7 @@
* @return java.util.List
*/
public List getServerPorts() {
- List ports = new ArrayList();
+ List<ServerPort> ports = new ArrayList<ServerPort>();
try {
Connector [] connectors = serverInstance.getConnectors();
@@ -173,7 +173,7 @@
* @return java.util.List
*/
public List getWebModules() {
- List list = new ArrayList();
+ List<WebModule> list = new ArrayList<WebModule>();
try {
Context [] contexts = serverInstance.getContexts();
@@ -503,7 +503,7 @@
// If not deploying to "webapps", context docBase attributes need updating
boolean deployingToWebapps = "webapps".equals(server2.getDeployDirectory());
- Map pathMap = new HashMap();
+ Map<String, String> pathMap = new HashMap<String, String>();
MultiStatus ms = new MultiStatus(TomcatPlugin.PLUGIN_ID, 0,
NLS.bind(Messages.errorPublishServer, server2.getServer().getName()), null);
@@ -532,7 +532,7 @@
pathMap.put(lcPath, origPath);
}
else {
- String otherPath = (String)pathMap.get(lcPath);
+ String otherPath = pathMap.get(lcPath);
IStatus s = new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID,
origPath.equals(otherPath) ? NLS.bind(Messages.errorPublishPathDup, origPath)
: NLS.bind(Messages.errorPublishPathConflict, origPath, otherPath));
@@ -694,7 +694,7 @@
ServerInstance oldInstance = new ServerInstance(oldServer);
// Collect paths of old web modules managed by WTP
- Set oldPaths = new HashSet();
+ Set<String> oldPaths = new HashSet<String>();
Context [] contexts = oldInstance.getContexts();
if (contexts != null) {
for (int i = 0; i < contexts.length; i++) {
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat32Handler.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat32Handler.java
index bf8b227..76fd28a 100644
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat32Handler.java
+++ b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat32Handler.java
@@ -17,6 +17,7 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
import org.eclipse.jdt.launching.JavaRuntime;
import org.eclipse.wst.server.core.IModule;
/**
@@ -41,7 +42,7 @@
* @see ITomcatVersionHandler#getRuntimeClasspath(IPath, IPath)
*/
public List getRuntimeClasspath(IPath installPath, IPath configPath) {
- List cp = new ArrayList();
+ List<IRuntimeClasspathEntry> cp = new ArrayList<IRuntimeClasspathEntry>();
// add all jars from the Tomcat lib directory
File libDir = installPath.append("lib").toFile();
if (libDir.exists()) {
@@ -61,7 +62,7 @@
* @see ITomcatVersionHandler#getRuntimeProgramArguments(IPath, boolean, boolean)
*/
public String[] getRuntimeProgramArguments(IPath configPath, boolean debug, boolean starting) {
- List list = new ArrayList();
+ List<String> list = new ArrayList<String>();
if (configPath != null) {
list.add("-f \"" + configPath.append("conf").append("server.xml").toOSString() + "\"");
}
@@ -85,7 +86,7 @@
* @see ITomcatVersionHandler#getRuntimeVMArguments(IPath, IPath, IPath, boolean)
*/
public String[] getRuntimeVMArguments(IPath installPath, IPath configPath, IPath deployPath, boolean isTestEnv) {
- List list = new ArrayList();
+ List<String> list = new ArrayList<String>();
list.add("-Dtomcat.home=\"" + installPath.toOSString() + "\"");
// Include a system property for the configurable deploy location
list.add("-Dwtp.deploy=\"" + deployPath.toOSString() + "\"");
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat40Configuration.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat40Configuration.java
index 18009d9..a12fa1b 100644
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat40Configuration.java
+++ b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat40Configuration.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * Copyright (c) 2003, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -98,7 +98,7 @@
* @return java.util.List
*/
public List getServerPorts() {
- List ports = new ArrayList();
+ List<ServerPort> ports = new ArrayList<ServerPort>();
// first add server port
try {
@@ -168,7 +168,7 @@
* @return java.util.List
*/
public List getWebModules() {
- List list = new ArrayList();
+ List<WebModule> list = new ArrayList<WebModule>();
try {
Context [] contexts = serverInstance.getContexts();
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat40Handler.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat40Handler.java
index 352376e..f153168 100644
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat40Handler.java
+++ b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat40Handler.java
@@ -16,6 +16,7 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
import org.eclipse.jdt.launching.JavaRuntime;
import org.eclipse.wst.server.core.IModule;
/**
@@ -40,7 +41,7 @@
* @see ITomcatVersionHandler#getRuntimeClasspath(IPath, IPath)
*/
public List getRuntimeClasspath(IPath installPath, IPath configPath) {
- List cp = new ArrayList();
+ List<IRuntimeClasspathEntry> cp = new ArrayList<IRuntimeClasspathEntry>();
// 4.0 - add bootstrap.jar from the Tomcat bin directory
IPath binPath = installPath.append("bin");
@@ -56,7 +57,7 @@
* @see ITomcatVersionHandler#getRuntimeProgramArguments(IPath, boolean, boolean)
*/
public String[] getRuntimeProgramArguments(IPath configPath, boolean debug, boolean starting) {
- List list = new ArrayList();
+ List<String> list = new ArrayList<String>();
if (debug)
list.add("-debug");
@@ -85,7 +86,7 @@
* @see ITomcatVersionHandler#getRuntimeVMArguments(IPath, IPath, IPath, boolean)
*/
public String[] getRuntimeVMArguments(IPath installPath, IPath configPath, IPath deployPath, boolean isTestEnv) {
- List list = new ArrayList();
+ List<String> list = new ArrayList<String>();
if (isTestEnv)
list.add("-Dcatalina.base=\"" + configPath.toOSString() + "\"");
else
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat41Configuration.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat41Configuration.java
index ef0ebf2..67ed8c5 100644
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat41Configuration.java
+++ b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat41Configuration.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * Copyright (c) 2003, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -100,7 +100,7 @@
* @return java.util.List
*/
public List getServerPorts() {
- List ports = new ArrayList();
+ List<ServerPort> ports = new ArrayList<ServerPort>();
// first add server port
try {
@@ -175,7 +175,7 @@
* @return java.util.List
*/
public List getWebModules() {
- List list = new ArrayList();
+ List<WebModule> list = new ArrayList<WebModule>();
try {
Context [] contexts = serverInstance.getContexts();
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat41Handler.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat41Handler.java
index 0a3e3f8..6e6db23 100644
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat41Handler.java
+++ b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat41Handler.java
@@ -16,6 +16,7 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
import org.eclipse.jdt.launching.JavaRuntime;
import org.eclipse.wst.server.core.IModule;
/**
@@ -45,7 +46,7 @@
* @see ITomcatVersionHandler#getRuntimeClasspath(IPath, IPath)
*/
public List getRuntimeClasspath(IPath installPath, IPath configPath) {
- List cp = new ArrayList();
+ List<IRuntimeClasspathEntry> cp = new ArrayList<IRuntimeClasspathEntry>();
// 4.1 - add bootstrap.jar from the Tomcat bin directory
IPath binPath = installPath.append("bin");
@@ -61,7 +62,7 @@
* @see ITomcatVersionHandler#getRuntimeProgramArguments(IPath, boolean, boolean)
*/
public String[] getRuntimeProgramArguments(IPath configPath, boolean debug, boolean starting) {
- List list = new ArrayList();
+ List<String> list = new ArrayList<String>();
if (debug)
list.add("-debug");
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat50Configuration.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat50Configuration.java
index 0d48d4f..6be6a44 100644
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat50Configuration.java
+++ b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat50Configuration.java
@@ -59,7 +59,7 @@
protected String propertiesFile;
- protected static final Map protocolHandlerMap = new HashMap();
+ protected static final Map<String, String> protocolHandlerMap = new HashMap<String, String>();
static {
protocolHandlerMap.put("org.apache.coyote.http11.Http11Protocol", "HTTP/1.1");
protocolHandlerMap.put("org.apache.jk.server.JkCoyoteHandler", "AJP/1.3");
@@ -103,7 +103,7 @@
* @return java.util.List
*/
public List getServerPorts() {
- List ports = new ArrayList();
+ List<ServerPort> ports = new ArrayList<ServerPort>();
// first add server port
try {
@@ -143,7 +143,7 @@
}
else {
// Get Tomcat equivalent name if protocol handler class specified
- name = (String)protocolHandlerMap.get(protocol);
+ name = protocolHandlerMap.get(protocol);
if (name != null) {
// Prepare simple protocol string for ServerPort protocol
int index = name.indexOf('/');
@@ -186,7 +186,7 @@
* @return java.util.List
*/
public List getWebModules() {
- List list = new ArrayList();
+ List<WebModule> list = new ArrayList<WebModule>();
try {
Context [] contexts = serverInstance.getContexts();
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat50Handler.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat50Handler.java
index 8a39552..a08dd26 100644
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat50Handler.java
+++ b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat50Handler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2010 IBM Corporation and others.
+ * Copyright (c) 2003, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -16,6 +16,7 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
import org.eclipse.jdt.launching.JavaRuntime;
import org.eclipse.wst.server.core.IModule;
/**
@@ -45,7 +46,7 @@
* @see ITomcatVersionHandler#getRuntimeClasspath(IPath, IPath)
*/
public List getRuntimeClasspath(IPath installPath, IPath configPath) {
- List cp = new ArrayList();
+ List<IRuntimeClasspathEntry> cp = new ArrayList<IRuntimeClasspathEntry>();
// 5.0 - add bootstrap.jar from the Tomcat bin directory
IPath binPath = installPath.append("bin");
@@ -61,7 +62,7 @@
* @see ITomcatVersionHandler#getRuntimeProgramArguments(IPath, boolean, boolean)
*/
public String[] getRuntimeProgramArguments(IPath configPath, boolean debug, boolean starting) {
- List list = new ArrayList();
+ List<String> list = new ArrayList<String>();
if (debug)
list.add("-debug");
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat55Configuration.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat55Configuration.java
index 8dfadfa..994327d 100644
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat55Configuration.java
+++ b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat55Configuration.java
@@ -61,7 +61,7 @@
protected String propertiesFile;
- protected static final Map protocolHandlerMap = new HashMap();
+ protected static final Map<String, String> protocolHandlerMap = new HashMap<String, String>();
static {
protocolHandlerMap.put("org.apache.coyote.http11.Http11Protocol", "HTTP/1.1");
protocolHandlerMap.put("org.apache.coyote.http11.Http11AprProtocol", "HTTP/1.1");
@@ -107,7 +107,7 @@
* @return java.util.List
*/
public List getServerPorts() {
- List ports = new ArrayList();
+ List<ServerPort> ports = new ArrayList<ServerPort>();
// first add server port
try {
@@ -147,7 +147,7 @@
}
else {
// Get Tomcat equivalent name if protocol handler class specified
- name = (String)protocolHandlerMap.get(protocol);
+ name = protocolHandlerMap.get(protocol);
if (name != null) {
// Prepare simple protocol string for ServerPort protocol
int index = name.indexOf('/');
@@ -190,7 +190,7 @@
* @return java.util.List
*/
public List getWebModules() {
- List list = new ArrayList();
+ List<WebModule> list = new ArrayList<WebModule>();
try {
Context [] contexts = serverInstance.getContexts();
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat60Configuration.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat60Configuration.java
index 89550ba..098a4e7 100644
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat60Configuration.java
+++ b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat60Configuration.java
@@ -62,7 +62,7 @@
protected String propertiesFile;
- protected static final Map protocolHandlerMap = new HashMap();
+ protected static final Map<String, String> protocolHandlerMap = new HashMap<String, String>();
static {
protocolHandlerMap.put("org.apache.coyote.http11.Http11Protocol", "HTTP/1.1");
protocolHandlerMap.put("org.apache.coyote.http11.Http11NioProtocol", "HTTP/1.1");
@@ -109,7 +109,7 @@
* @return java.util.List
*/
public List getServerPorts() {
- List ports = new ArrayList();
+ List<ServerPort> ports = new ArrayList<ServerPort>();
// first add server port
try {
@@ -149,7 +149,7 @@
}
else {
// Get Tomcat equivalent name if protocol handler class specified
- name = (String)protocolHandlerMap.get(protocol);
+ name = protocolHandlerMap.get(protocol);
if (name != null) {
// Prepare simple protocol string for ServerPort protocol
int index = name.indexOf('/');
@@ -192,7 +192,7 @@
* @return java.util.List
*/
public List getWebModules() {
- List list = new ArrayList();
+ List<WebModule> list = new ArrayList<WebModule>();
try {
Context [] contexts = serverInstance.getContexts();
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat60Handler.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat60Handler.java
index 1b1e807..4135611 100644
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat60Handler.java
+++ b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat60Handler.java
@@ -16,6 +16,7 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
import org.eclipse.jdt.launching.JavaRuntime;
import org.eclipse.wst.server.core.IModule;
/**
@@ -45,7 +46,7 @@
* @see ITomcatVersionHandler#getRuntimeClasspath(IPath, IPath)
*/
public List getRuntimeClasspath(IPath installPath, IPath configPath) {
- List cp = new ArrayList();
+ List<IRuntimeClasspathEntry> cp = new ArrayList<IRuntimeClasspathEntry>();
// 6.0 - add bootstrap.jar from the Tomcat bin directory
IPath binPath = installPath.append("bin");
@@ -61,7 +62,7 @@
* @see ITomcatVersionHandler#getRuntimeProgramArguments(IPath, boolean, boolean)
*/
public String[] getRuntimeProgramArguments(IPath configPath, boolean debug, boolean starting) {
- List list = new ArrayList();
+ List<String> list = new ArrayList<String>();
if (starting)
list.add("start");
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat70Configuration.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat70Configuration.java
index a0af5f1..dc37b1d 100644
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat70Configuration.java
+++ b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat70Configuration.java
@@ -62,7 +62,7 @@
protected String propertiesFile;
- protected static final Map protocolHandlerMap = new HashMap();
+ protected static final Map<String, String> protocolHandlerMap = new HashMap<String, String>();
static {
protocolHandlerMap.put("org.apache.coyote.http11.Http11Protocol", "HTTP/1.1");
protocolHandlerMap.put("org.apache.coyote.http11.Http11NioProtocol", "HTTP/1.1");
@@ -109,7 +109,7 @@
* @return java.util.List
*/
public List getServerPorts() {
- List ports = new ArrayList();
+ List<ServerPort> ports = new ArrayList<ServerPort>();
// first add server port
try {
@@ -149,7 +149,7 @@
}
else {
// Get Tomcat equivalent name if protocol handler class specified
- name = (String)protocolHandlerMap.get(protocol);
+ name = protocolHandlerMap.get(protocol);
if (name != null) {
// Prepare simple protocol string for ServerPort protocol
int index = name.indexOf('/');
@@ -192,7 +192,7 @@
* @return java.util.List
*/
public List getWebModules() {
- List list = new ArrayList();
+ List<WebModule> list = new ArrayList<WebModule>();
try {
Context [] contexts = serverInstance.getContexts();
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat70Handler.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat70Handler.java
index d803bf4..98bcb32 100644
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat70Handler.java
+++ b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/Tomcat70Handler.java
@@ -16,6 +16,7 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
import org.eclipse.jdt.launching.JavaRuntime;
import org.eclipse.wst.server.core.IModule;
/**
@@ -45,7 +46,7 @@
* @see ITomcatVersionHandler#getRuntimeClasspath(IPath, IPath)
*/
public List getRuntimeClasspath(IPath installPath, IPath configPath) {
- List cp = new ArrayList();
+ List<IRuntimeClasspathEntry> cp = new ArrayList<IRuntimeClasspathEntry>();
// 7.0 - add bootstrap.jar and tomcat-juli.jar from the Tomcat bin directory
IPath binPath = installPath.append("bin");
@@ -73,7 +74,7 @@
* @see ITomcatVersionHandler#getRuntimeProgramArguments(IPath, boolean, boolean)
*/
public String[] getRuntimeProgramArguments(IPath configPath, boolean debug, boolean starting) {
- List list = new ArrayList();
+ List<String> list = new ArrayList<String>();
if (starting)
list.add("start");
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatConfiguration.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatConfiguration.java
index 37816d8..c905841 100644
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatConfiguration.java
+++ b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatConfiguration.java
@@ -46,7 +46,7 @@
protected IFolder configPath;
// property change listeners
- private transient List propertyListeners;
+ private transient List<PropertyChangeListener> propertyListeners;
/**
* TomcatConfiguration constructor.
@@ -300,7 +300,7 @@
*/
public void addPropertyChangeListener(PropertyChangeListener listener) {
if (propertyListeners == null)
- propertyListeners = new ArrayList();
+ propertyListeners = new ArrayList<PropertyChangeListener>();
propertyListeners.add(listener);
}
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatPlugin.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatPlugin.java
index 1df80c0..814d90b 100644
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatPlugin.java
+++ b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatPlugin.java
@@ -185,7 +185,7 @@
verify.replace('/', File.separatorChar);
StringTokenizer st = new StringTokenizer(verify, ",");
- List list = new ArrayList();
+ List<VerifyResourceSpec> list = new ArrayList<VerifyResourceSpec>();
while (st.hasMoreTokens())
list.add(new VerifyResourceSpec(st.nextToken()));
Trace.trace(Trace.FINEST, "Verify32: " + list.toString());
@@ -201,7 +201,7 @@
verify.replace('/', File.separatorChar);
st = new StringTokenizer(verify, ",");
- list = new ArrayList();
+ list = new ArrayList<VerifyResourceSpec>();
while (st.hasMoreTokens())
list.add(new VerifyResourceSpec(st.nextToken()));
Trace.trace(Trace.FINEST, "Verify40: " + list.toString());
@@ -217,7 +217,7 @@
verify.replace('/', File.separatorChar);
st = new StringTokenizer(verify, ",");
- list = new ArrayList();
+ list = new ArrayList<VerifyResourceSpec>();
while (st.hasMoreTokens())
list.add(new VerifyResourceSpec(st.nextToken()));
Trace.trace(Trace.FINEST, "Verify41: " + list.toString());
@@ -233,7 +233,7 @@
verify.replace('/', File.separatorChar);
st = new StringTokenizer(verify, ",");
- list = new ArrayList();
+ list = new ArrayList<VerifyResourceSpec>();
while (st.hasMoreTokens())
list.add(new VerifyResourceSpec(st.nextToken()));
Trace.trace(Trace.FINEST, "Verify50: " + list.toString());
@@ -249,7 +249,7 @@
verify.replace('/', File.separatorChar);
st = new StringTokenizer(verify, ",");
- list = new ArrayList();
+ list = new ArrayList<VerifyResourceSpec>();
while (st.hasMoreTokens())
list.add(new VerifyResourceSpec(st.nextToken()));
Trace.trace(Trace.FINEST, "Verify55: " + list.toString());
@@ -265,7 +265,7 @@
verify.replace('/', File.separatorChar);
st = new StringTokenizer(verify, ",");
- list = new ArrayList();
+ list = new ArrayList<VerifyResourceSpec>();
while (st.hasMoreTokens())
list.add(new VerifyResourceSpec(st.nextToken()));
Trace.trace(Trace.FINEST, "Verify60: " + list.toString());
@@ -281,7 +281,7 @@
verify.replace('/', File.separatorChar);
st = new StringTokenizer(verify, ",");
- list = new ArrayList();
+ list = new ArrayList<VerifyResourceSpec>();
while (st.hasMoreTokens())
list.add(new VerifyResourceSpec(st.nextToken()));
Trace.trace(Trace.FINEST, "Verify70: " + list.toString());
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatPublishModuleVisitor.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatPublishModuleVisitor.java
index 8774f85..4e161cf 100644
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatPublishModuleVisitor.java
+++ b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatPublishModuleVisitor.java
@@ -78,19 +78,19 @@
/**
* Classpath entries added by ear configurations.
*/
- protected final List earCommonResources = new ArrayList();
+ protected final List<String> earCommonResources = new ArrayList<String>();
/**
* List of classpath elements that will be used by the custom tomcat loader.
* This set should include any class dir from referenced project.
*/
- protected Set virtualClassClasspathElements = new LinkedHashSet();
- protected Set virtualJarClasspathElements = new LinkedHashSet();
+ protected Set<String> virtualClassClasspathElements = new LinkedHashSet<String>();
+ protected Set<String> virtualJarClasspathElements = new LinkedHashSet<String>();
/**
* Map of resources found in "META-INF/resources" folder of dependent projects
*/
- protected Map virtualDependentResources = new LinkedHashMap();
+ protected Map<String, List<String>> virtualDependentResources = new LinkedHashMap<String, List<String>>();
/**
* Instantiate a new TomcatPublishModuleVisitor
@@ -171,7 +171,7 @@
try {
CatalinaPropertiesUtil.addGlobalClasspath(baseDir.append(
"conf/catalina.properties").toFile(), sharedLoader,
- (String[]) earCommonResources.toArray(new String[earCommonResources.size()]));
+ earCommonResources.toArray(new String[earCommonResources.size()]));
} catch (IOException e) {
Trace.trace(Trace.WARNING, "Unable to add ear path entries to catalina.properties", e);
} finally {
@@ -309,10 +309,10 @@
virtualClassClasspathElements.clear();
virtualJarClasspathElements.clear();
- Set rtPathsProcessed = new HashSet();
- Set locationsIncluded = new HashSet();
+ Set<String> rtPathsProcessed = new HashSet<String>();
+ Set<String> locationsIncluded = new HashSet<String>();
locationsIncluded.add(docBase);
- Map retryLocations = new HashMap();
+ Map<String, String> retryLocations = new HashMap<String, String>();
IVirtualResource [] virtualResources = component.getRootFolder().getResources("");
// Loop over the module's resources
for (int i = 0; i < virtualResources.length; i++) {
@@ -533,9 +533,9 @@
private void addContentResource(IPath runtimePath, IPath workspacePath) {
String rtPath = runtimePath.toString();
- List locations = (List)virtualDependentResources.get(rtPath);
+ List<String> locations = virtualDependentResources.get(rtPath);
if (locations == null) {
- locations = new ArrayList();
+ locations = new ArrayList<String>();
virtualDependentResources.put(rtPath, locations);
}
locations.add(workspacePath.toOSString());
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatRuntime.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatRuntime.java
index d579f8c..5d40935 100644
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatRuntime.java
+++ b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatRuntime.java
@@ -39,7 +39,7 @@
protected static final String PROP_VM_INSTALL_TYPE_ID = "vm-install-type-id";
protected static final String PROP_VM_INSTALL_ID = "vm-install-id";
- protected static Map sdkMap = new HashMap(2);
+ protected static Map<File, Boolean> sdkMap = new HashMap<File, Boolean>(2);
public TomcatRuntime() {
// do nothing
@@ -224,7 +224,7 @@
// first try the cache
File javaHome = getVMInstall().getInstallLocation();
try {
- Boolean b = (Boolean) sdkMap.get(javaHome);
+ Boolean b = sdkMap.get(javaHome);
return b.booleanValue();
} catch (Exception e) {
// ignore
@@ -278,14 +278,14 @@
}
// log error that we were unable to check for the compiler
- TomcatPlugin.log(MessageFormat.format("Failed compiler check for {0}", new String[] { javaHome.getAbsolutePath() }));
+ TomcatPlugin.log(MessageFormat.format("Failed compiler check for {0}", (Object []) new String[] { javaHome.getAbsolutePath() }));
return false;
}
- private static Map javaVersionMap = new ConcurrentHashMap();
+ private static Map<String, Integer> javaVersionMap = new ConcurrentHashMap<String, Integer>();
private boolean isVMMinimumVersion(String javaVersion, int minimumVersion) {
- Integer version = (Integer)javaVersionMap.get(javaVersion);
+ Integer version = javaVersionMap.get(javaVersion);
if (version == null) {
int index = javaVersion.indexOf('.');
if (index > 0) {
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatRuntimeClasspathProvider.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatRuntimeClasspathProvider.java
index 6983d64..7f55952 100644
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatRuntimeClasspathProvider.java
+++ b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatRuntimeClasspathProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2010 IBM Corporation and others.
+ * Copyright (c) 2003, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -32,7 +32,7 @@
if (installPath == null)
return new IClasspathEntry[0];
- List list = new ArrayList();
+ List<IClasspathEntry> list = new ArrayList<IClasspathEntry>();
String runtimeId = runtime.getRuntimeType().getId();
if (runtimeId.indexOf("32") > 0) {
IPath path = installPath.append("lib");
@@ -48,6 +48,6 @@
addLibraryEntries(list, path.append("lib").toFile(), true);
addLibraryEntries(list, path.append("endorsed").toFile(), true);
}
- return (IClasspathEntry[])list.toArray(new IClasspathEntry[list.size()]);
+ return list.toArray(new IClasspathEntry[list.size()]);
}
}
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatServer.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatServer.java
index 6df586e..665e6f2 100644
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatServer.java
+++ b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatServer.java
@@ -423,7 +423,8 @@
return new ServerPort[0];
try {
- List list = getTomcatConfiguration().getServerPorts();
+ @SuppressWarnings("unchecked")
+ List<ServerPort> list = getTomcatConfiguration().getServerPorts();
ServerPort[] sp = new ServerPort[list.size()];
list.toArray(sp);
return sp;
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatServerBehaviour.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatServerBehaviour.java
index 0fefc98..e6e8102 100644
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatServerBehaviour.java
+++ b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatServerBehaviour.java
@@ -305,7 +305,7 @@
* @throws CoreException
*/
private void publishDir(int deltaKind, Properties p, IModule module[], PublishHelper helper, IProgressMonitor monitor) throws CoreException {
- List status = new ArrayList();
+ List<IStatus> status = new ArrayList<IStatus>();
// Remove if requested or if previously published and are now serving without publishing
if (deltaKind == REMOVED || getTomcatServer().isServeModulesWithoutPublish()) {
String publishPath = (String) p.get(module[0].getId());
@@ -394,7 +394,7 @@
IModuleResource[] mr = getResources(module);
IStatus[] stat = helper.publishZip(mr, jarPath, monitor);
- List status = new ArrayList();
+ List<IStatus> status = new ArrayList<IStatus>();
PublishOperation2.addArrayToList(status, stat);
PublishOperation2.throwException(status);
p.put(module[1].getId(), jarPath.toOSString());
@@ -414,7 +414,7 @@
throw new CoreException(new Status(IStatus.WARNING, TomcatPlugin.PLUGIN_ID, 0, "Could not remove archive module", e));
}
} else {
- List status = new ArrayList();
+ List<IStatus> status = new ArrayList<IStatus>();
IPath path = getModuleDeployDirectory(module[0]);
if (jarURI == null) {
jarURI = "WEB-INF/lib" + module[1].getName();
@@ -497,7 +497,7 @@
// check that ports are free
Iterator iterator = configuration.getServerPorts().iterator();
- List usedPorts = new ArrayList();
+ List<ServerPort> usedPorts = new ArrayList<ServerPort>();
while (iterator.hasNext()) {
ServerPort sp = (ServerPort) iterator.next();
if (sp.getPort() < 0)
@@ -507,7 +507,7 @@
}
}
if (usedPorts.size() == 1) {
- ServerPort port = (ServerPort) usedPorts.get(0);
+ ServerPort port = usedPorts.get(0);
throw new CoreException(new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, NLS.bind(Messages.errorPortInUse, new String[] {port.getPort() + "", getServer().getName()}), null));
} else if (usedPorts.size() > 1) {
String portStr = "";
@@ -525,7 +525,7 @@
// check that there is only one app for each context root
iterator = configuration.getWebModules().iterator();
- List contextRoots = new ArrayList();
+ List<String> contextRoots = new ArrayList<String>();
while (iterator.hasNext()) {
WebModule module = (WebModule) iterator.next();
String contextRoot = module.getPath();
@@ -796,10 +796,10 @@
* @param cp
* @param entry
*/
- public static void replaceJREContainer(List cp, IRuntimeClasspathEntry entry) {
+ public static void replaceJREContainer(List<IRuntimeClasspathEntry> cp, IRuntimeClasspathEntry entry) {
int size = cp.size();
for (int i = 0; i < size; i++) {
- IRuntimeClasspathEntry entry2 = (IRuntimeClasspathEntry) cp.get(i);
+ IRuntimeClasspathEntry entry2 = cp.get(i);
if (entry2.getPath().uptoSegment(2).isPrefixOf(entry.getPath())) {
cp.set(i, entry);
return;
@@ -815,7 +815,7 @@
* @param cp
* @param entry
*/
- public static void mergeClasspath(List cp, IRuntimeClasspathEntry entry) {
+ public static void mergeClasspath(List<IRuntimeClasspathEntry> cp, IRuntimeClasspathEntry entry) {
Iterator iterator = cp.iterator();
while (iterator.hasNext()) {
IRuntimeClasspathEntry entry2 = (IRuntimeClasspathEntry) iterator.next();
@@ -893,7 +893,7 @@
// update classpath
IRuntimeClasspathEntry[] originalClasspath = JavaRuntime.computeUnresolvedRuntimeClasspath(workingCopy);
int size = originalClasspath.length;
- List oldCp = new ArrayList(originalClasspath.length + 2);
+ List<IRuntimeClasspathEntry> oldCp = new ArrayList<IRuntimeClasspathEntry>(originalClasspath.length + 2);
for (int i = 0; i < size; i++)
oldCp.add(originalClasspath[i]);
@@ -920,7 +920,7 @@
// Search for index to any existing tools.jar entry
int toolsIndex;
for (toolsIndex = 0; toolsIndex < oldCp.size(); toolsIndex++ ) {
- IRuntimeClasspathEntry entry = (IRuntimeClasspathEntry) oldCp.get(toolsIndex);
+ IRuntimeClasspathEntry entry = oldCp.get(toolsIndex);
if (entry.getType() == IRuntimeClasspathEntry.ARCHIVE
&& entry.getPath().lastSegment().equals("tools.jar")) {
break;
@@ -936,7 +936,7 @@
}
iterator = oldCp.iterator();
- List list = new ArrayList();
+ List<String> list = new ArrayList<String>();
while (iterator.hasNext()) {
IRuntimeClasspathEntry entry = (IRuntimeClasspathEntry) iterator.next();
try {
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatSourcePathComputerDelegate.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatSourcePathComputerDelegate.java
index d0ec269..585b6bd 100644
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatSourcePathComputerDelegate.java
+++ b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatSourcePathComputerDelegate.java
@@ -65,7 +65,7 @@
/**
* List<IRuntimeClasspathEntry> of unresolved IRuntimeClasspathEntries
*/
- List runtimeClasspath = new ArrayList();
+ List<IRuntimeClasspathEntry> runtimeClasspath = new ArrayList<IRuntimeClasspathEntry>();
SourcePathComputerVisitor(ILaunchConfiguration configuration) {
this.configuration = configuration;
@@ -157,7 +157,7 @@
ISourceContainer[] getSourceContainers() throws CoreException {
runtimeClasspath.addAll(Arrays.asList(JavaRuntime
.computeUnresolvedSourceLookupPath(configuration)));
- IRuntimeClasspathEntry[] entries = (IRuntimeClasspathEntry[]) runtimeClasspath
+ IRuntimeClasspathEntry[] entries = runtimeClasspath
.toArray(new IRuntimeClasspathEntry[runtimeClasspath.size()]);
IRuntimeClasspathEntry[] resolved = JavaRuntime
.resolveSourceLookupPath(entries, configuration);
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatVersionHelper.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatVersionHelper.java
index 3fda44e..0675afa 100644
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatVersionHelper.java
+++ b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatVersionHelper.java
@@ -98,7 +98,7 @@
/**
* Map of server type ID to expected version string fragment for version checking.
*/
- private static final Map versionStringMap = new HashMap();
+ private static final Map<String, String> versionStringMap = new HashMap<String, String>();
static {
versionStringMap.put(TomcatPlugin.TOMCAT_41, "4.1.");
@@ -175,7 +175,7 @@
* @return array of strings containing VM arguments
*/
public static String[] getCatalinaVMArguments(IPath installPath, IPath instancePath, IPath deployPath, String endorsedDirs, boolean isTestEnv) {
- List list = new ArrayList();
+ List<String> list = new ArrayList<String>();
if (isTestEnv)
list.add("-Dcatalina.base=\"" + instancePath.toOSString() + "\"");
else
@@ -217,7 +217,7 @@
IPath contextPath = serverInstance.getContextXmlDirectory(serverXml.removeLastSegments(1));
File contextDir = contextPath.toFile();
if (contextDir.exists()) {
- Map projectContexts = new HashMap();
+ Map<File, Context> projectContexts = new HashMap<File, Context>();
loadSeparateContextFiles(contextPath.toFile(), factory, projectContexts);
// add any separately saved contexts
@@ -246,7 +246,7 @@
* @param keptContextsMap Map to receive kept contexts mapped by path
*/
public static void getRemovedKeptCatalinaContexts(ServerInstance oldServerInstance,
- List modules, Map removedContextsMap, Map keptContextsMap) {
+ List modules, Map<String, Context> removedContextsMap, Map<String, Context> keptContextsMap) {
// Collect paths of old web modules managed by WTP
Context [] contexts = oldServerInstance.getContexts();
if (contexts != null) {
@@ -262,7 +262,7 @@
int size = modules.size();
for (int i = 0; i < size; i++) {
WebModule module = (WebModule) modules.get(i);
- Context context = (Context)removedContextsMap.remove(module.getPath());
+ Context context = removedContextsMap.remove(module.getPath());
if (context != null)
keptContextsMap.put(context.getPath(), context);
}
@@ -294,8 +294,8 @@
IPath serverXml = baseDir.append("conf").append("server.xml");
ServerInstance oldInstance = TomcatVersionHelper.getCatalinaServerInstance(serverXml, null, null);
if (oldInstance != null) {
- Map removedContextsMap = new HashMap();
- Map keptContextsMap = new HashMap();
+ Map<String, Context> removedContextsMap = new HashMap<String, Context>();
+ Map<String, Context> keptContextsMap = new HashMap<String, Context>();
TomcatVersionHelper.getRemovedKeptCatalinaContexts(oldInstance, modules, removedContextsMap, keptContextsMap);
monitor.worked(100);
if (removedContextsMap.size() > 0) {
@@ -306,7 +306,7 @@
Iterator iter = removedContextsMap.keySet().iterator();
while (iter.hasNext()) {
String oldPath = (String)iter.next();
- Context ctx = (Context)removedContextsMap.get(oldPath);
+ Context ctx = removedContextsMap.get(oldPath);
// Delete the corresponding context file, if it exists
IPath ctxFilePath = oldInstance.getContextFilePath(baseDir, ctx);
@@ -362,7 +362,7 @@
Iterator iter = keptContextsMap.keySet().iterator();
while (iter.hasNext()) {
String keptPath = (String)iter.next();
- Context ctx = (Context)keptContextsMap.get(keptPath);
+ Context ctx = keptContextsMap.get(keptPath);
// Delete the corresponding context file, if it exists
IPath ctxFilePath = oldInstance.getContextFilePath(baseDir, ctx);
@@ -652,7 +652,7 @@
// TODO Improve to compare with appBase value instead of hardcoded "webapps"
boolean deployingToAppBase = "webapps".equals(server.getDeployDirectory());
- Map pathMap = new HashMap();
+ Map<String, String> pathMap = new HashMap<String, String>();
MultiStatus ms = new MultiStatus(TomcatPlugin.PLUGIN_ID, 0,
NLS.bind(Messages.errorPublishServer, server.getServer().getName()), null);
@@ -680,7 +680,7 @@
pathMap.put(lcPath, origPath);
}
else {
- String otherPath = (String)pathMap.get(lcPath);
+ String otherPath = pathMap.get(lcPath);
IStatus s = new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID,
origPath.equals(otherPath) ? NLS.bind(Messages.errorPublishPathDup, origPath)
: NLS.bind(Messages.errorPublishPathConflict, origPath, otherPath));
@@ -1035,7 +1035,7 @@
return Status.OK_STATUS;
}
- private static void loadSeparateContextFiles(File contextDir, Factory factory, Map projectContexts) {
+ private static void loadSeparateContextFiles(File contextDir, Factory factory, Map<File, Context> projectContexts) {
File[] contextFiles = contextDir.listFiles(new FilenameFilter() {
public boolean accept(File dir, String name) {
return name.toLowerCase().endsWith(".xml");
@@ -1202,7 +1202,7 @@
if (versionSubString != null) {
// If we have an actual version, test the version
if (versionSubString.length() > 0) {
- String versionTest = (String)versionStringMap.get(serverType);
+ String versionTest = versionStringMap.get(serverType);
if (versionTest != null && !versionSubString.startsWith(versionTest)) {
return new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID,
NLS.bind(Messages.errorInstallDirWrongVersion2,
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/WebAppDocument.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/WebAppDocument.java
index 97aea27..40c5098 100644
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/WebAppDocument.java
+++ b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/WebAppDocument.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * Copyright (c) 2003, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -79,7 +79,7 @@
* @return java.util.List
*/
public List getMimeMappings() {
- List map = new ArrayList();
+ List<MimeMapping> map = new ArrayList<MimeMapping>();
Element root = webAppDocument.getDocumentElement();
Iterator iterator = XMLUtil.getNodeIterator(root, "mime-mapping");
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/wst/ModuleTraverser.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/wst/ModuleTraverser.java
index 2fc4467..9c1366d 100644
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/wst/ModuleTraverser.java
+++ b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/wst/ModuleTraverser.java
@@ -51,6 +51,7 @@
/**
* Temporary solution for https://bugs.eclipse.org/bugs/show_bug.cgi?id=103888
*/
+@SuppressWarnings("restriction")
public class ModuleTraverser {
/**
@@ -413,7 +414,7 @@
// get the raw entries
final Map referencedRawEntries = getRawComponentClasspathDependencies(javaProject);
- final Map validRawEntries = new HashMap();
+ final Map<IClasspathEntry, IClasspathAttribute> validRawEntries = new HashMap<IClasspathEntry, IClasspathAttribute>();
// filter out non-valid referenced raw entries
final Iterator i = referencedRawEntries.keySet().iterator();
@@ -439,14 +440,14 @@
// retrieve the resolved classpath
final IClasspathEntry[] entries = javaProject.getResolvedClasspath(true);
- final Map pathToResolvedEntry = new HashMap();
+ final Map<IPath, IClasspathEntry> pathToResolvedEntry = new HashMap<IPath, IClasspathEntry>();
// store in a map from path to entry
for (int j = 0; j < entries.length; j++) {
pathToResolvedEntry.put(entries[j].getPath(), entries[j]);
}
- final Map referencedEntries = new LinkedHashMap();
+ final Map<IClasspathEntry, IClasspathAttribute> referencedEntries = new LinkedHashMap<IClasspathEntry, IClasspathAttribute>();
// grab all IPackageFragmentRoots
final IPackageFragmentRoot[] roots = javaProject.getPackageFragmentRoots();
@@ -455,13 +456,13 @@
final IClasspathEntry rawEntry = root.getRawClasspathEntry();
// is the raw entry valid?
- IClasspathAttribute attrib = (IClasspathAttribute) validRawEntries.get(rawEntry);
+ IClasspathAttribute attrib = validRawEntries.get(rawEntry);
if (attrib == null) {
continue;
}
final IPath pkgFragPath = root.getPath();
- final IClasspathEntry resolvedEntry = (IClasspathEntry) pathToResolvedEntry.get(pkgFragPath);
+ final IClasspathEntry resolvedEntry = pathToResolvedEntry.get(pkgFragPath);
final IClasspathAttribute resolvedAttrib = checkForComponentDependencyAttribute(resolvedEntry,
DEPENDECYATTRIBUTETYPE_DEPENDENCY_OR_NONDEPENDENCY);
// attribute for the resolved entry must either be unspecified or it must be the
@@ -488,7 +489,7 @@
if (javaProject == null) {
return Collections.EMPTY_MAP;
}
- final Map referencedRawEntries = new HashMap();
+ final Map<IClasspathEntry, IClasspathAttribute> referencedRawEntries = new HashMap<IClasspathEntry, IClasspathAttribute>();
final IClasspathEntry[] entries = javaProject.getRawClasspath();
for (int i = 0; i < entries.length; i++) {
final IClasspathEntry entry = entries[i];
@@ -591,9 +592,8 @@
if (attrib == null || attrib.getValue()== null || attrib.getValue().length() == 0) {
if (isWebApp) {
return isClassFolder ? "/WEB_INF/classes" : "WEB-INF/lib";
- } else {
- return isClassFolder ? "/" : "../";
}
+ return isClassFolder ? "/" : "../";
}
return attrib.getValue();
}
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/XMLElement.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/XMLElement.java
index 12fb15a..cb5eff9 100644
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/XMLElement.java
+++ b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/XMLElement.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * Copyright (c) 2003, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -78,7 +78,7 @@
}
public Map getAttributes() {
- Map attributes = new LinkedHashMap();
+ Map<String, String> attributes = new LinkedHashMap<String, String>();
NamedNodeMap attrs = xmlElement.getAttributes();
if (null != attrs) {
for (int i = 0; i < attrs.getLength(); i++) {
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/XMLUtil.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/XMLUtil.java
index f9ca6ac..140eb9d 100644
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/XMLUtil.java
+++ b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/xml/XMLUtil.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2010 IBM Corporation and others.
+ * Copyright (c) 2003, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -154,7 +154,7 @@
* @param name java.lang.String
*/
public static Iterator getNodeIterator(Element element, String name) {
- List list = new ArrayList();
+ List<Node> list = new ArrayList<Node>();
NodeList nodeList = element.getElementsByTagName(name);
int length = nodeList.getLength();