Polishing

(cherry picked from commit 22ca7ac)
This commit is contained in:
Juergen Hoeller
2016-08-17 17:40:26 +02:00
parent 3185f67b43
commit 52f21bdf54
8 changed files with 32 additions and 31 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 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-2013 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.
@@ -312,7 +312,7 @@ public abstract class AbstractJasperReportsView extends AbstractUrlBasedView {
"'reportDataKey' for main report is required when specifying a value for 'subReportDataKeys'");
}
this.subReports = new HashMap<String, JasperReport>(this.subReportUrls.size());
for (Enumeration urls = this.subReportUrls.propertyNames(); urls.hasMoreElements();) {
for (Enumeration<?> urls = this.subReportUrls.propertyNames(); urls.hasMoreElements();) {
String key = (String) urls.nextElement();
String path = this.subReportUrls.getProperty(key);
Resource resource = getApplicationContext().getResource(path);
@@ -383,7 +383,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.