summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcaustin2011-11-30 10:22:07 (EST)
committercaustin2011-11-30 10:22:07 (EST)
commit7237dea927aed210a7f6bb4e8d4989962880da7d (patch)
tree9174c6c4a19bc9ba2c67be9a52acd20cb975dd6c
parentb39926c0ab2dd7974b66869b9cd310679d4fc926 (diff)
downloadeclipse.platform.ua-7237dea927aed210a7f6bb4e8d4989962880da7d.zip
eclipse.platform.ua-7237dea927aed210a7f6bb4e8d4989962880da7d.tar.gz
eclipse.platform.ua-7237dea927aed210a7f6bb4e8d4989962880da7d.tar.bz2
Bug 364112 - Compile warnings in official buildv20111130-1522
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/LocaleTest.java9
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/MockServletRequest.java17
2 files changed, 14 insertions, 12 deletions
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/LocaleTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/LocaleTest.java
index ca01603..1891459 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/LocaleTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/LocaleTest.java
@@ -15,12 +15,13 @@ import java.util.Locale;
import javax.servlet.http.Cookie;
-import org.eclipse.core.runtime.Platform;
+import junit.framework.TestCase;
+
import org.eclipse.help.internal.base.BaseHelpSystem;
import org.eclipse.help.internal.util.ProductPreferences;
import org.eclipse.help.internal.webapp.data.UrlUtil;
-import junit.framework.TestCase;
+import org.eclipse.core.runtime.Platform;
/**
* Tests for locale related code in UrlUtil
@@ -50,7 +51,7 @@ public class LocaleTest extends TestCase {
BaseHelpSystem.setMode(BaseHelpSystem.MODE_INFOCENTER);
MockServletRequest req = new MockServletRequest();
req.setLocale(new Locale("de"));
- req.getParameterMap().put("lang", "es");
+ req.getParameterMap().put("lang", new String[] { "es" });
String locale = UrlUtil.getLocale(req, null);
assertEquals("es", locale);
}
@@ -61,7 +62,7 @@ public class LocaleTest extends TestCase {
MockServletRequest req = new MockServletRequest();
req.setLocale(new Locale("de"));
req.setCookies(new Cookie[] {new Cookie("lang", "it")});
- req.getParameterMap().put("lang", "es");
+ req.getParameterMap().put("lang", new String[] { "es" });
String locale = UrlUtil.getLocale(req, null);
assertEquals("es", locale);
}
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/MockServletRequest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/MockServletRequest.java
index 326b1fa..1aea35a 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/MockServletRequest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/MockServletRequest.java
@@ -42,7 +42,7 @@ import javax.servlet.http.Part;
public class MockServletRequest implements HttpServletRequest {
private Locale locale;
- private Map parameterMap = new HashMap();
+ private Map<String, String[]> parameterMap = new HashMap<String, String[]>();
private Cookie[] cookies = new Cookie[0];
private String pathInfo = null;
@@ -77,12 +77,12 @@ public class MockServletRequest implements HttpServletRequest {
return null;
}
- public Enumeration getHeaderNames() {
+ public Enumeration<String> getHeaderNames() {
// TODO Auto-generated method stub
return null;
}
- public Enumeration getHeaders(String arg0) {
+ public Enumeration<String> getHeaders(String arg0) {
// TODO Auto-generated method stub
return null;
}
@@ -184,7 +184,7 @@ public class MockServletRequest implements HttpServletRequest {
return null;
}
- public Enumeration getAttributeNames() {
+ public Enumeration<String> getAttributeNames() {
// TODO Auto-generated method stub
return null;
}
@@ -233,20 +233,21 @@ public class MockServletRequest implements HttpServletRequest {
}
- public Enumeration getLocales() {
+ public Enumeration<Locale> getLocales() {
// TODO Auto-generated method stub
return null;
}
public String getParameter(String arg0) {
- return (String)parameterMap.get(arg0);
+ String[] values= parameterMap.get(arg0);
+ return values != null ? parameterMap.get(arg0)[0] : null;
}
- public Map getParameterMap() {
+ public Map<String, String[]> getParameterMap() {
return parameterMap;
}
- public Enumeration getParameterNames() {
+ public Enumeration<String> getParameterNames() {
// TODO Auto-generated method stub
return null;
}