You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by ni...@apache.org on 2007/07/29 03:49:02 UTC
svn commit: r560653 -
/struts/struts1/trunk/core/src/main/java/org/apache/struts/util/RequestUtils.java
Author: niallp
Date: Sat Jul 28 18:49:01 2007
New Revision: 560653
URL: http://svn.apache.org/viewvc?view=rev&rev=560653
Log:
Style changes only - remove tabs, uses braces with if statement
Modified:
struts/struts1/trunk/core/src/main/java/org/apache/struts/util/RequestUtils.java
Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/util/RequestUtils.java
URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/util/RequestUtils.java?view=diff&rev=560653&r1=560652&r2=560653
==============================================================================
--- struts/struts1/trunk/core/src/main/java/org/apache/struts/util/RequestUtils.java (original)
+++ struts/struts1/trunk/core/src/main/java/org/apache/struts/util/RequestUtils.java Sat Jul 28 18:49:01 2007
@@ -495,36 +495,38 @@
* @throws ServletException if the introspection has any errors.
*/
private static Object rationalizeMultipleFileProperty(Object bean, String name, Object parameterValue) throws ServletException {
- if (!(parameterValue instanceof FormFile)) return parameterValue;
+ if (!(parameterValue instanceof FormFile)) {
+ return parameterValue;
+ }
- FormFile formFileValue = (FormFile) parameterValue;
- try {
- Class propertyType = PropertyUtils.getPropertyType(bean, name);
-
- if (propertyType.isAssignableFrom(List.class)) {
- ArrayList list = new ArrayList(1);
- list.add(formFileValue);
- return list;
- }
-
- if (propertyType.isArray() && propertyType.getComponentType().equals(FormFile.class)) {
- return new FormFile[] { formFileValue };
- }
-
- } catch (IllegalAccessException e) {
- throw new ServletException(e);
- } catch (InvocationTargetException e) {
- throw new ServletException(e);
- } catch (NoSuchMethodException e) {
- throw new ServletException(e);
- }
-
- // no changes
- return parameterValue;
-
- }
+ FormFile formFileValue = (FormFile) parameterValue;
+ try {
+ Class propertyType = PropertyUtils.getPropertyType(bean, name);
- /**
+ if (propertyType.isAssignableFrom(List.class)) {
+ ArrayList list = new ArrayList(1);
+ list.add(formFileValue);
+ return list;
+ }
+
+ if (propertyType.isArray() && propertyType.getComponentType().equals(FormFile.class)) {
+ return new FormFile[] { formFileValue };
+ }
+
+ } catch (IllegalAccessException e) {
+ throw new ServletException(e);
+ } catch (InvocationTargetException e) {
+ throw new ServletException(e);
+ } catch (NoSuchMethodException e) {
+ throw new ServletException(e);
+ }
+
+ // no changes
+ return parameterValue;
+
+ }
+
+ /**
* <p>Try to locate a multipart request handler for this request. First,
* look for a mapping-specific handler stored for us under an attribute.
* If one is not present, use the global multipart handler, if there is