Go back to Java 1.4 compatibility. The few generics uses aren't worth it to require Java 1.5.

This commit is contained in:
hns 2008-10-17 09:14:36 +00:00
parent e827d0beb4
commit a635964fc8
5 changed files with 13 additions and 13 deletions

View file

@ -106,8 +106,8 @@
<replace file="${build.work}/src/helma/main/Server.java"
token="__builddate__" value="${TODAY}"/>
<javac srcdir="${build.work}/src"
source="1.5"
target="1.5"
source="1.4"
target="1.4"
destdir="${build.classes}"
debug="${debug}"
deprecation="${deprecation}"

View file

@ -105,7 +105,7 @@ public final class Application implements Runnable {
ThreadGroup threadgroup;
// threadlocal variable for the current RequestEvaluator
ThreadLocal<RequestEvaluator> currentEvaluator = new ThreadLocal<RequestEvaluator>();
ThreadLocal currentEvaluator = new ThreadLocal();
// Map of requesttrans -> active requestevaluators
Hashtable activeRequests;

View file

@ -350,7 +350,7 @@ public class ApplicationManager implements XmlRpcHandler {
ignoreDirs = conf.getProperty("ignore");
// read and configure app repositories
ArrayList<Repository> repositoryList = new ArrayList<Repository>();
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);
}

View file

@ -66,7 +66,7 @@ public class Transactor {
// the thread we're associated with
private Thread thread;
private static final ThreadLocal <Transactor> txtor = new ThreadLocal <Transactor> ();
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);

View file

@ -78,7 +78,7 @@ public final class StandaloneServletClient extends AbstractServletClient {
}
Class[] parameters = { String.class };
ArrayList<Repository> repositoryList = new ArrayList<Repository>();
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);
}