Polishing

(cherry picked from commit c926ec4)
This commit is contained in:
Juergen Hoeller
2016-08-17 17:40:26 +02:00
parent 264f5335a3
commit 22ca7ac927
9 changed files with 37 additions and 36 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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.
@@ -46,6 +46,7 @@ public class SimpleMappingExceptionResolver extends AbstractHandlerExceptionReso
/** The default name of the exception attribute: "exception". */
public static final String DEFAULT_EXCEPTION_ATTRIBUTE = "exception";
private Properties exceptionMappings;
private Class<?>[] excludedExceptions;
@@ -108,7 +109,7 @@ public class SimpleMappingExceptionResolver extends AbstractHandlerExceptionReso
public void setStatusCodes(Properties statusCodes) {
for (Enumeration<?> enumeration = statusCodes.propertyNames(); enumeration.hasMoreElements();) {
String viewName = (String) enumeration.nextElement();
Integer statusCode = new Integer(statusCodes.getProperty(viewName));
Integer statusCode = Integer.valueOf(statusCodes.getProperty(viewName));
this.statusCodes.put(viewName, statusCode);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2016 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.
@@ -390,7 +390,7 @@ public abstract class AbstractJasperReportsView extends AbstractUrlBasedView {
else if (str.length() > 0 && Character.isDigit(str.charAt(0))) {
// Looks like a number... let's try.
try {
return new Integer(str);
return Integer.valueOf(str);
}
catch (NumberFormatException ex) {
// OK, then let's keep it as a String value.