From 5ae1c8a24284d1bbc96c8410c81600a5e1a7a9f5 Mon Sep 17 00:00:00 2001 From: Philippe Marschall Date: Sun, 20 Apr 2014 19:17:06 +0200 Subject: [PATCH] Clean up spring-webmvc-portlet tests warnings Clean up compiler warnings in the tests of spring-webmvc-portlet. This commit adds type parameters to all the types (mostly `List` and `Map`). After this commit the only warnings in spring-web left are the subclasses of `MyCommandProvidingFormController`. --- .../context/BeanThatListens.java | 6 +-- .../springframework/context/TestListener.java | 18 +++++++- .../mock/web/portlet/MockPortletRequest.java | 6 +-- .../ComplexPortletApplicationContext.java | 17 +++---- .../web/portlet/DispatcherPortletTests.java | 46 +++++++++---------- .../bind/PortletRequestDataBinderTests.java | 6 +-- .../context/PortletWebRequestTests.java | 14 +++--- .../Portlet20AnnotationControllerTests.java | 11 +++-- .../PortletAnnotationControllerTests.java | 12 ++--- .../web/portlet/util/PortletUtilsTests.java | 7 +-- 10 files changed, 79 insertions(+), 64 deletions(-) diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/context/BeanThatListens.java b/spring-webmvc-portlet/src/test/java/org/springframework/context/BeanThatListens.java index ab40da4b89..d6f4b6ab91 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/context/BeanThatListens.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/context/BeanThatListens.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +24,7 @@ import java.util.Map; * @author Thomas Risberg * @author Juergen Hoeller */ -public class BeanThatListens implements ApplicationListener { +public class BeanThatListens implements ApplicationListener { private BeanThatBroadcasts beanThatBroadcasts; @@ -36,7 +36,7 @@ public class BeanThatListens implements ApplicationListener { public BeanThatListens(BeanThatBroadcasts beanThatBroadcasts) { this.beanThatBroadcasts = beanThatBroadcasts; - Map beans = beanThatBroadcasts.applicationContext.getBeansOfType(BeanThatListens.class); + Map beans = beanThatBroadcasts.applicationContext.getBeansOfType(BeanThatListens.class); if (!beans.isEmpty()) { throw new IllegalStateException("Shouldn't have found any BeanThatListens instances"); } diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/context/TestListener.java b/spring-webmvc-portlet/src/test/java/org/springframework/context/TestListener.java index 739222190f..7762131ab4 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/context/TestListener.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/context/TestListener.java @@ -1,3 +1,19 @@ +/* + * Copyright 2002-2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.springframework.context; import org.springframework.context.ApplicationEvent; @@ -9,7 +25,7 @@ import org.springframework.context.ApplicationListener; * @author Rod Johnson * @since January 21, 2001 */ -public class TestListener implements ApplicationListener { +public class TestListener implements ApplicationListener { private int eventCount; diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockPortletRequest.java b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockPortletRequest.java index 2cbefb79c1..08278d07d5 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockPortletRequest.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockPortletRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -271,8 +271,8 @@ public class MockPortletRequest implements PortletRequest { @Override public String getProperty(String key) { Assert.notNull(key, "Property key must not be null"); - List list = this.properties.get(key); - return (list != null && list.size() > 0 ? (String) list.get(0) : null); + List list = this.properties.get(key); + return (list != null && list.size() > 0 ? list.get(0) : null); } @Override diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/ComplexPortletApplicationContext.java b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/ComplexPortletApplicationContext.java index b1b1459ee7..564a2d5722 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/ComplexPortletApplicationContext.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/ComplexPortletApplicationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,6 +39,7 @@ import javax.portlet.ResourceResponse; import org.springframework.beans.BeansException; import org.springframework.beans.MutablePropertyValues; +import org.springframework.beans.factory.config.BeanReference; import org.springframework.beans.factory.config.ConstructorArgumentValues; import org.springframework.beans.factory.config.RuntimeBeanReference; import org.springframework.beans.factory.support.ManagedList; @@ -118,14 +119,14 @@ public class ComplexPortletApplicationContext extends StaticPortletApplicationCo ParameterMappingInterceptor parameterMappingInterceptor = new ParameterMappingInterceptor(); parameterMappingInterceptor.setParameterName("interceptingParam"); - List interceptors = new ArrayList(); + List interceptors = new ArrayList(4); interceptors.add(parameterMappingInterceptor); interceptors.add(userRoleInterceptor); interceptors.add(new MyHandlerInterceptor1()); interceptors.add(new MyHandlerInterceptor2()); MutablePropertyValues pvs = new MutablePropertyValues(); - Map portletModeMap = new ManagedMap(); + Map portletModeMap = new ManagedMap(); portletModeMap.put("view", new RuntimeBeanReference("viewController")); portletModeMap.put("edit", new RuntimeBeanReference("editController")); pvs.add("portletModeMap", portletModeMap); @@ -133,7 +134,7 @@ public class ComplexPortletApplicationContext extends StaticPortletApplicationCo registerSingleton("handlerMapping3", PortletModeHandlerMapping.class, pvs); pvs = new MutablePropertyValues(); - Map parameterMap = new ManagedMap(); + Map parameterMap = new ManagedMap(); parameterMap.put("test1", new RuntimeBeanReference("testController1")); parameterMap.put("test2", new RuntimeBeanReference("testController2")); parameterMap.put("requestLocaleChecker", new RuntimeBeanReference("requestLocaleCheckingController")); @@ -148,10 +149,10 @@ public class ComplexPortletApplicationContext extends StaticPortletApplicationCo registerSingleton("handlerMapping2", ParameterHandlerMapping.class, pvs); pvs = new MutablePropertyValues(); - Map innerMap = new ManagedMap(); + Map innerMap = new ManagedMap(); innerMap.put("help1", new RuntimeBeanReference("helpController1")); innerMap.put("help2", new RuntimeBeanReference("helpController2")); - Map outerMap = new ManagedMap(); + Map outerMap = new ManagedMap(); outerMap.put("help", innerMap); pvs.add("portletModeParameterMap", outerMap); pvs.add("order", "1"); @@ -171,7 +172,7 @@ public class ComplexPortletApplicationContext extends StaticPortletApplicationCo pvs.add("exceptionMappings", "java.lang.Exception=failed-exception\n" + "java.lang.RuntimeException=failed-runtime"); - List mappedHandlers = new ManagedList(); + List mappedHandlers = new ManagedList(); mappedHandlers.add(new RuntimeBeanReference("exceptionThrowingHandler1")); pvs.add("mappedHandlers", mappedHandlers); pvs.add("defaultErrorView", "failed-default-0"); @@ -533,7 +534,7 @@ public class ComplexPortletApplicationContext extends StaticPortletApplicationCo } - public static class TestApplicationListener implements ApplicationListener { + public static class TestApplicationListener implements ApplicationListener { public int counter = 0; diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/DispatcherPortletTests.java b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/DispatcherPortletTests.java index 16ee96b7fd..d99733d26c 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/DispatcherPortletTests.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/DispatcherPortletTests.java @@ -1,18 +1,18 @@ /* -* Copyright 2002-2013 the original author or authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright 2002-2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.web.portlet; @@ -125,7 +125,7 @@ public class DispatcherPortletTests extends TestCase { request.setPortletMode(PortletMode.HELP); request.setParameter("action", "help3"); complexDispatcherPortlet.doDispatch(request, response); - Map model = (Map) request.getAttribute(ViewRendererServlet.MODEL_ATTRIBUTE); + Map model = (Map) request.getAttribute(ViewRendererServlet.MODEL_ATTRIBUTE); assertTrue(model.get("exception").getClass().equals(NoHandlerFoundException.class)); InternalResourceView view = (InternalResourceView) request.getAttribute(ViewRendererServlet.VIEW_ATTRIBUTE); assertEquals("failed-unavailable", view.getBeanName()); @@ -164,7 +164,7 @@ public class DispatcherPortletTests extends TestCase { request.setParameter("action", "not mapped"); request.setParameter("myParam", "not mapped"); complexDispatcherPortlet.doDispatch(request, response); - Map model = (Map) request.getAttribute(ViewRendererServlet.MODEL_ATTRIBUTE); + Map model = (Map) request.getAttribute(ViewRendererServlet.MODEL_ATTRIBUTE); assertEquals("view was here", model.get("result")); InternalResourceView view = (InternalResourceView) request.getAttribute(ViewRendererServlet.VIEW_ATTRIBUTE); assertEquals("someViewName", view.getBeanName()); @@ -178,7 +178,7 @@ public class DispatcherPortletTests extends TestCase { request.setParameter("action", "not mapped"); request.setParameter("myParam", "not mapped"); complexDispatcherPortlet.doDispatch(request, response); - Map model = (Map) request.getAttribute(ViewRendererServlet.MODEL_ATTRIBUTE); + Map model = (Map) request.getAttribute(ViewRendererServlet.MODEL_ATTRIBUTE); Exception exception = (Exception) model.get("exception"); assertNotNull(exception); assertTrue(exception.getClass().equals(PortletSecurityException.class)); @@ -222,7 +222,7 @@ public class DispatcherPortletTests extends TestCase { MockRenderResponse response = new MockRenderResponse(); request.setParameter("myParam", "unknown"); complexDispatcherPortlet.doDispatch(request, response); - Map model = (Map) request.getAttribute(ViewRendererServlet.MODEL_ATTRIBUTE); + Map model = (Map) request.getAttribute(ViewRendererServlet.MODEL_ATTRIBUTE); Exception exception = (Exception)model.get("exception"); assertTrue(exception.getClass().equals(PortletException.class)); assertTrue(exception.getMessage().indexOf("No adapter for handler") != -1); @@ -255,7 +255,7 @@ public class DispatcherPortletTests extends TestCase { MockRenderResponse response = new MockRenderResponse(); request.setParameter("myParam", "test1"); complexDispatcherPortlet.doDispatch(request, response); - Map model = (Map) request.getAttribute(ViewRendererServlet.MODEL_ATTRIBUTE); + Map model = (Map) request.getAttribute(ViewRendererServlet.MODEL_ATTRIBUTE); Exception exception = (Exception) model.get("exception"); assertTrue(exception.getClass().equals(NoHandlerFoundException.class)); InternalResourceView view = (InternalResourceView) request.getAttribute(ViewRendererServlet.VIEW_ATTRIBUTE); @@ -333,7 +333,7 @@ public class DispatcherPortletTests extends TestCase { request.setParameter("myParam", "requestLocaleChecker"); request.addPreferredLocale(Locale.ENGLISH); complexDispatcherPortlet.doDispatch(request, response); - Map model = (Map) request.getAttribute(ViewRendererServlet.MODEL_ATTRIBUTE); + Map model = (Map) request.getAttribute(ViewRendererServlet.MODEL_ATTRIBUTE); Exception exception = (Exception) model.get("exception"); assertTrue(exception.getClass().equals(PortletException.class)); assertEquals("Incorrect Locale in RenderRequest", exception.getMessage()); @@ -356,7 +356,7 @@ public class DispatcherPortletTests extends TestCase { request.setParameter("myParam", "contextLocaleChecker"); request.addPreferredLocale(Locale.ENGLISH); complexDispatcherPortlet.doDispatch(request, response); - Map model = (Map) request.getAttribute(ViewRendererServlet.MODEL_ATTRIBUTE); + Map model = (Map) request.getAttribute(ViewRendererServlet.MODEL_ATTRIBUTE); Exception exception = (Exception) model.get("exception"); assertTrue(exception.getClass().equals(PortletException.class)); assertEquals("Incorrect Locale in LocaleContextHolder", exception.getMessage()); @@ -401,7 +401,7 @@ public class DispatcherPortletTests extends TestCase { request.addUserRole("role1"); request.addParameter("noView", "false"); complexDispatcherPortlet.doDispatch(request, response); - Map model = (Map) request.getAttribute(ViewRendererServlet.MODEL_ATTRIBUTE); + Map model = (Map) request.getAttribute(ViewRendererServlet.MODEL_ATTRIBUTE); assertEquals("view was here", model.get("result")); InternalResourceView view = (InternalResourceView) request.getAttribute(ViewRendererServlet.VIEW_ATTRIBUTE); assertEquals("someViewName", view.getBeanName()); @@ -414,7 +414,7 @@ public class DispatcherPortletTests extends TestCase { request.addUserRole("role1"); request.addParameter("noView", "true"); complexDispatcherPortlet.doDispatch(request, response); - Map model = (Map) request.getAttribute(ViewRendererServlet.MODEL_ATTRIBUTE); + Map model = (Map) request.getAttribute(ViewRendererServlet.MODEL_ATTRIBUTE); assertNull(model); InternalResourceView view = (InternalResourceView) request.getAttribute(ViewRendererServlet.VIEW_ATTRIBUTE); assertNull(view); diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/bind/PortletRequestDataBinderTests.java b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/bind/PortletRequestDataBinderTests.java index 3bf2462489..7bb97cda6c 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/bind/PortletRequestDataBinderTests.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/bind/PortletRequestDataBinderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -166,7 +166,7 @@ public class PortletRequestDataBinderTests extends TestCase { public void testBindingSet() { TestBean bean = new TestBean(); - Set set = new LinkedHashSet<>(2); + Set set = new LinkedHashSet(2); set.add(new TestBean("test1")); set.add(new TestBean("test2")); bean.setSomeSet(set); @@ -181,7 +181,7 @@ public class PortletRequestDataBinderTests extends TestCase { assertNotNull(bean.getSomeSet()); assertEquals(2, bean.getSomeSet().size()); - Iterator iter = bean.getSomeSet().iterator(); + Iterator iter = bean.getSomeSet().iterator(); TestBean bean1 = (TestBean) iter.next(); assertEquals("test1", bean1.getName()); diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/PortletWebRequestTests.java b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/PortletWebRequestTests.java index e52c722b2c..da32fcfdc7 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/PortletWebRequestTests.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/PortletWebRequestTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -56,13 +56,13 @@ public class PortletWebRequestTests { assertEquals("value2", request.getParameterValues("param2")[0]); assertEquals("value2a", request.getParameterValues("param2")[1]); - Map paramMap = request.getParameterMap(); + Map paramMap = request.getParameterMap(); assertEquals(2, paramMap.size()); - assertEquals(1, ((String[]) paramMap.get("param1")).length); - assertEquals("value1", ((String[]) paramMap.get("param1"))[0]); - assertEquals(2, ((String[]) paramMap.get("param2")).length); - assertEquals("value2", ((String[]) paramMap.get("param2"))[0]); - assertEquals("value2a", ((String[]) paramMap.get("param2"))[1]); + assertEquals(1, paramMap.get("param1").length); + assertEquals("value1", paramMap.get("param1")[0]); + assertEquals(2, paramMap.get("param2").length); + assertEquals("value2", paramMap.get("param2")[0]); + assertEquals("value2a", paramMap.get("param2")[1]); } @Test diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/mvc/annotation/Portlet20AnnotationControllerTests.java b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/mvc/annotation/Portlet20AnnotationControllerTests.java index 600dc7e8fa..755738871e 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/mvc/annotation/Portlet20AnnotationControllerTests.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/mvc/annotation/Portlet20AnnotationControllerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ import java.util.Date; import java.util.LinkedList; import java.util.List; import java.util.Map; + import javax.portlet.ActionRequest; import javax.portlet.ActionResponse; import javax.portlet.EventResponse; @@ -173,7 +174,7 @@ public class Portlet20AnnotationControllerTests { doTestAdaptedHandleMethods(MyAdaptedController4.class); } - private void doTestAdaptedHandleMethods(final Class controllerClass) throws Exception { + private void doTestAdaptedHandleMethods(final Class controllerClass) throws Exception { DispatcherPortlet portlet = new DispatcherPortlet() { @Override protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException { @@ -1233,7 +1234,7 @@ public class Portlet20AnnotationControllerTests { private static class TestView { - public void render(String viewName, Map model, PortletRequest request, MimeResponse response) throws Exception { + public void render(String viewName, Map model, PortletRequest request, MimeResponse response) throws Exception { TestBean tb = (TestBean) model.get("testBean"); if (tb == null) { tb = (TestBean) model.get("myCommand"); @@ -1248,9 +1249,9 @@ public class Portlet20AnnotationControllerTests { if (errors.hasFieldErrors("date")) { throw new IllegalStateException(); } - List testBeans = (List) model.get("testBeanList"); + List testBeans = (List) model.get("testBeanList"); response.getWriter().write(viewName + "-" + tb.getName() + "-" + errors.getFieldError("age").getCode() + - "-" + testBeans.get(0).getName() + "-" + model.get("myKey")); + "-" + ((TestBean) testBeans.get(0)).getName() + "-" + model.get("myKey")); } } diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/mvc/annotation/PortletAnnotationControllerTests.java b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/mvc/annotation/PortletAnnotationControllerTests.java index 7a58b4a1c4..4ab35eae05 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/mvc/annotation/PortletAnnotationControllerTests.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/mvc/annotation/PortletAnnotationControllerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -114,7 +114,7 @@ public class PortletAnnotationControllerTests extends TestCase { doTestAdaptedHandleMethods(MyAdaptedController3.class); } - public void doTestAdaptedHandleMethods(final Class controllerClass) throws Exception { + public void doTestAdaptedHandleMethods(final Class controllerClass) throws Exception { DispatcherPortlet portlet = new DispatcherPortlet() { @Override protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException { @@ -796,7 +796,7 @@ public class PortletAnnotationControllerTests extends TestCase { private static class TestView { - public void render(String viewName, Map model, PortletRequest request, MimeResponse response) throws Exception { + public void render(String viewName, Map model, PortletRequest request, MimeResponse response) throws Exception { TestBean tb = (TestBean) model.get("testBean"); if (tb == null) { tb = (TestBean) model.get("myCommand"); @@ -811,9 +811,9 @@ public class PortletAnnotationControllerTests extends TestCase { if (errors.hasFieldErrors("date")) { throw new IllegalStateException(); } - List testBeans = (List) model.get("testBeanList"); + List testBeans = (List) model.get("testBeanList"); response.getWriter().write(viewName + "-" + tb.getName() + "-" + errors.getFieldError("age").getCode() + - "-" + testBeans.get(0).getName() + "-" + model.get("myKey")); + "-" + ((TestBean) testBeans.get(0)).getName() + "-" + model.get("myKey")); } } @@ -830,7 +830,7 @@ public class PortletAnnotationControllerTests extends TestCase { @Override public org.springframework.web.servlet.ModelAndView resolveModelAndView(Method handlerMethod, - Class handlerType, + Class handlerType, Object returnValue, ExtendedModelMap implicitModel, NativeWebRequest webRequest) { diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/util/PortletUtilsTests.java b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/util/PortletUtilsTests.java index f7192f7acc..ba0d45e971 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/util/PortletUtilsTests.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/util/PortletUtilsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -245,8 +245,7 @@ public final class PortletUtilsTests { public void testClearAllRenderParametersDoesNotPropagateExceptionIfRedirectAlreadySentAtTimeOfCall() throws Exception { MockActionResponse response = new MockActionResponse() { @Override - @SuppressWarnings("unchecked") - public void setRenderParameters(Map parameters) { + public void setRenderParameters(Map parameters) { throw new IllegalStateException(); } }; @@ -302,7 +301,6 @@ public final class PortletUtilsTests { PortletUtils.exposeRequestAttributes(new MockPortletRequest(), null); } - @SuppressWarnings("unchecked") @Test public void testExposeRequestAttributesSunnyDay() throws Exception { MockPortletRequest request = new MockPortletRequest(); @@ -314,7 +312,6 @@ public final class PortletUtilsTests { assertEquals("Roy Fokker", request.getAttribute("mentor")); } - @SuppressWarnings("unchecked") @Test public void testExposeRequestAttributesWithEmptyAttributesMapIsAnIdempotentOperation() throws Exception { MockPortletRequest request = new MockPortletRequest();