CHAIN-108 - Build fails with Java 6; assigning variables helps the compiler to figure out typed arguments
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/chain/trunk@1500972 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 8c8b059..aa9ed7c 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -41,6 +41,9 @@
<body>
<release version="2.0" description="Major release">
+ <action issue="CHAIN-108" dev="britter" type="update">
+ Build fails with Java 6
+ </action>
<action issue="CHAIN-94" dev="britter" type="update" due-to="Jonas Sprenger">
Refactor tests in class TestContextTestCase
</action>
diff --git a/web/src/main/java/org/apache/commons/chain2/web/ChainListener.java b/web/src/main/java/org/apache/commons/chain2/web/ChainListener.java
index 5adc7fd..87d0ac6 100644
--- a/web/src/main/java/org/apache/commons/chain2/web/ChainListener.java
+++ b/web/src/main/java/org/apache/commons/chain2/web/ChainListener.java
@@ -19,6 +19,7 @@
import java.io.InputStream;
import java.net.URL;
import java.util.HashSet;
+import java.util.Map;
import java.util.Set;
import javax.servlet.ServletContext;
@@ -258,7 +259,8 @@
if (log.isDebugEnabled()) {
log.debug("Parsing: " + resourceURL);
}
- parser.parse(resourceURL);
+ @SuppressWarnings("unused") // FIXME we have to assign the factory here to help the compiler with the type arguments
+ CatalogFactory<Object, Object,Map<Object,Object>> factory = parser.parse(resourceURL);
} catch (Exception e) {
String externalURL = "null";
if (resourceURL != null) {
diff --git a/web/src/main/java/org/apache/commons/chain2/web/ChainResources.java b/web/src/main/java/org/apache/commons/chain2/web/ChainResources.java
index aaf4db1..18bb2a7 100644
--- a/web/src/main/java/org/apache/commons/chain2/web/ChainResources.java
+++ b/web/src/main/java/org/apache/commons/chain2/web/ChainResources.java
@@ -17,6 +17,7 @@
package org.apache.commons.chain2.web;
import org.apache.commons.chain2.Catalog;
+import org.apache.commons.chain2.CatalogFactory;
import org.apache.commons.chain2.config.xml.XmlConfigParser;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -25,6 +26,7 @@
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
import java.util.StringTokenizer;
/**
@@ -74,7 +76,8 @@
if (log.isDebugEnabled()) {
log.debug("Loading chain config resource '" + path + "'");
}
- parser.parse(url);
+ @SuppressWarnings("unused") // FIXME we have to assign the factory here to help the compiler with the type arguments
+ CatalogFactory<Object,Object,Map<Object,Object>> factory = parser.parse(url);
}
} catch (Exception e) {
throw new RuntimeException
@@ -110,7 +113,8 @@
if (log.isDebugEnabled()) {
log.debug("Loading chain config resource '" + path + "'");
}
- parser.parse(url);
+ @SuppressWarnings("unused") // FIXME we have to assign the factory here to help the compiler with the type arguments
+ CatalogFactory<Object, Object, Map<Object, Object>> factory = parser.parse(url);
}
} catch (Exception e) {
throw new RuntimeException