From a635964fc8555cf33e67fe6a44faaa5ac683a5c7 Mon Sep 17 00:00:00 2001 From: hns Date: Fri, 17 Oct 2008 09:14:36 +0000 Subject: [PATCH] Go back to Java 1.4 compatibility. The few generics uses aren't worth it to require Java 1.5. --- build.xml | 4 ++-- src/helma/framework/core/Application.java | 2 +- src/helma/main/ApplicationManager.java | 6 +++--- src/helma/objectmodel/db/Transactor.java | 8 ++++---- src/helma/servlet/StandaloneServletClient.java | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/build.xml b/build.xml index cdda514d..98b4f932 100644 --- a/build.xml +++ b/build.xml @@ -106,8 +106,8 @@ currentEvaluator = new ThreadLocal(); + ThreadLocal currentEvaluator = new ThreadLocal(); // Map of requesttrans -> active requestevaluators Hashtable activeRequests; diff --git a/src/helma/main/ApplicationManager.java b/src/helma/main/ApplicationManager.java index a690eb1a..edef65ad 100644 --- a/src/helma/main/ApplicationManager.java +++ b/src/helma/main/ApplicationManager.java @@ -350,7 +350,7 @@ public class ApplicationManager implements XmlRpcHandler { ignoreDirs = conf.getProperty("ignore"); // read and configure app repositories - ArrayList repositoryList = new ArrayList(); + ArrayList repositoryList = new ArrayList(); Class[] parameters = { String.class }; for (int i = 0; true; i++) { String repositoryArgs = conf.getProperty("repository." + i); @@ -373,7 +373,7 @@ public class ApplicationManager implements XmlRpcHandler { try { Repository newRepository = (Repository) Class.forName(repositoryImpl) .getConstructor(parameters) - .newInstance(repositoryArgs); + .newInstance(new Object[] {repositoryArgs}); repositoryList.add(newRepository); } catch (Exception ex) { getLogger().error("Adding repository " + repositoryArgs + " failed. " + @@ -397,7 +397,7 @@ public class ApplicationManager implements XmlRpcHandler { new File(server.getAppsHome(), appName))); } repositories = new Repository[repositoryList.size()]; - repositories = repositoryList.toArray(repositories); + repositories = (Repository[]) repositoryList.toArray(repositories); } diff --git a/src/helma/objectmodel/db/Transactor.java b/src/helma/objectmodel/db/Transactor.java index f333d6a1..15b0f181 100644 --- a/src/helma/objectmodel/db/Transactor.java +++ b/src/helma/objectmodel/db/Transactor.java @@ -66,7 +66,7 @@ public class Transactor { // the thread we're associated with private Thread thread; - private static final ThreadLocal txtor = new ThreadLocal (); + private static final ThreadLocal txtor = new ThreadLocal(); /** * Creates a new Transactor object. @@ -92,7 +92,7 @@ public class Transactor { * @return the transactor associated with the current thread */ public static Transactor getInstance() { - return txtor.get(); + return (Transactor) txtor.get(); } /** @@ -101,7 +101,7 @@ public class Transactor { * @throws IllegalStateException if no transactor is associated with the current thread */ public static Transactor getInstanceOrFail() throws IllegalStateException { - Transactor tx = txtor.get(); + Transactor tx = (Transactor) txtor.get(); if (tx == null) throw new IllegalStateException("Operation requires a Transactor, " + "but current thread does not have one."); @@ -114,7 +114,7 @@ public class Transactor { * @return the transactor associated with the current thread */ public static Transactor getInstance(NodeManager nmgr) { - Transactor t = txtor.get(); + Transactor t = (Transactor) txtor.get(); if (t == null) { t = new Transactor(nmgr); txtor.set(t); diff --git a/src/helma/servlet/StandaloneServletClient.java b/src/helma/servlet/StandaloneServletClient.java index d31e0ce0..40a6f4d3 100644 --- a/src/helma/servlet/StandaloneServletClient.java +++ b/src/helma/servlet/StandaloneServletClient.java @@ -78,7 +78,7 @@ public final class StandaloneServletClient extends AbstractServletClient { } Class[] parameters = { String.class }; - ArrayList repositoryList = new ArrayList(); + ArrayList repositoryList = new ArrayList(); for (int i = 0; true; i++) { String repositoryArgs = init.getInitParameter("repository." + i); @@ -100,7 +100,7 @@ public final class StandaloneServletClient extends AbstractServletClient { try { Repository newRepository = (Repository) Class.forName(repositoryImpl) .getConstructor(parameters) - .newInstance(repositoryArgs); + .newInstance(new Object[] {repositoryArgs}); repositoryList.add(newRepository); log("adding repository: " + repositoryArgs); } catch (Exception ex) { @@ -123,7 +123,7 @@ public final class StandaloneServletClient extends AbstractServletClient { } repositories = new Repository[repositoryList.size()]; - repositories = repositoryList.toArray(repositories); + repositories = (Repository[]) repositoryList.toArray(repositories); }