SPR-6464 Fix minor issue

master
Rossen Stoyanchev 13 years ago
parent 6f1818a604
commit c97257b16f
  1. 2
      org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/mvc/support/DefaultHandlerExceptionResolver.java
  2. 4
      org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/support/DefaultFlashMapManager.java
  3. 2
      org.springframework.web.servlet/src/test/java/org/springframework/web/servlet/FlashMapTests.java
  4. 1
      org.springframework.web.servlet/src/test/java/org/springframework/web/servlet/support/DefaultFlashMapManagerTests.java

@ -62,7 +62,7 @@ import org.springframework.web.servlet.mvc.multiaction.NoSuchRequestHandlingMeth
* @see #handleTypeMismatch * @see #handleTypeMismatch
* @see #handleHttpMessageNotReadable * @see #handleHttpMessageNotReadable
* @see #handleHttpMessageNotWritable * @see #handleHttpMessageNotWritable
* @see #handleRequestBodyNotValidException * @see #handleMethodArgumentNotValidException
*/ */
public class DefaultHandlerExceptionResolver extends AbstractHandlerExceptionResolver { public class DefaultHandlerExceptionResolver extends AbstractHandlerExceptionResolver {

@ -121,7 +121,9 @@ public class DefaultFlashMapManager implements FlashMapManager {
if (!matches.isEmpty()) { if (!matches.isEmpty()) {
Collections.sort(matches); Collections.sort(matches);
return matches.remove(0); FlashMap match = matches.remove(0);
allMaps.remove(match);
return match;
} }
return null; return null;

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.web.servlet.support; package org.springframework.web.servlet;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertFalse;

@ -71,6 +71,7 @@ public class DefaultFlashMapManagerTests {
this.flashMapManager.requestStarted(this.request); this.flashMapManager.requestStarted(this.request);
assertSame(flashMap, request.getAttribute(DefaultFlashMapManager.PREVIOUS_FLASH_MAP_ATTRIBUTE)); assertSame(flashMap, request.getAttribute(DefaultFlashMapManager.PREVIOUS_FLASH_MAP_ATTRIBUTE));
assertEquals("Previous FlashMap should have been removed", 0, allMaps.size());
} }
@Test @Test

Loading…
Cancel
Save