Browse Source

Polishing

pull/816/head
Juergen Hoeller 10 years ago
parent
commit
d195ad216a
  1. 2
      spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncExecutionAspectSupport.java
  2. 8
      spring-context/src/test/java/org/springframework/scheduling/config/ExecutorBeanDefinitionParserTests.java
  3. 10
      spring-web/src/main/java/org/springframework/web/multipart/commons/CommonsMultipartFile.java

2
spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncExecutionAspectSupport.java

@ -155,7 +155,7 @@ public abstract class AsyncExecutionAspectSupport implements BeanFactoryAware { @@ -155,7 +155,7 @@ public abstract class AsyncExecutionAspectSupport implements BeanFactoryAware {
/**
* Handles a fatal error thrown while asynchronously invoking the specified
* {@link Method}.
* <p>If the return type of the method is a {@link java.util.concurrent.Future} object, the original
* <p>If the return type of the method is a {@link Future} object, the original
* exception can be propagated by just throwing it at the higher level. However,
* for all other cases, the exception will not be transmitted back to the client.
* In that later case, the current {@link AsyncUncaughtExceptionHandler} will be

8
spring-context/src/test/java/org/springframework/scheduling/config/ExecutorBeanDefinitionParserTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2015 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.
@ -48,21 +48,23 @@ public class ExecutorBeanDefinitionParserTests { @@ -48,21 +48,23 @@ public class ExecutorBeanDefinitionParserTests {
"executorContext.xml", ExecutorBeanDefinitionParserTests.class);
}
@Test
public void defaultExecutor() throws Exception {
Object executor = this.context.getBean("default");
ThreadPoolTaskExecutor executor = this.context.getBean("default", ThreadPoolTaskExecutor.class);
assertEquals(1, getCorePoolSize(executor));
assertEquals(Integer.MAX_VALUE, getMaxPoolSize(executor));
assertEquals(Integer.MAX_VALUE, getQueueCapacity(executor));
assertEquals(60, getKeepAliveSeconds(executor));
assertEquals(false, getAllowCoreThreadTimeOut(executor));
FutureTask<String> task = new FutureTask<String>(new Callable<String>() {
@Override
public String call() throws Exception {
return "foo";
}
});
((ThreadPoolTaskExecutor)executor).execute(task);
executor.execute(task);
assertEquals("foo", task.get());
}

10
spring-web/src/main/java/org/springframework/web/multipart/commons/CommonsMultipartFile.java

@ -57,6 +57,7 @@ public class CommonsMultipartFile implements MultipartFile, Serializable { @@ -57,6 +57,7 @@ public class CommonsMultipartFile implements MultipartFile, Serializable {
this.size = this.fileItem.getSize();
}
/**
* Return the underlying {@code org.apache.commons.fileupload.FileItem}
* instance. There is hardly any need to access this.
@ -65,7 +66,6 @@ public class CommonsMultipartFile implements MultipartFile, Serializable { @@ -65,7 +66,6 @@ public class CommonsMultipartFile implements MultipartFile, Serializable {
return this.fileItem;
}
@Override
public String getName() {
return this.fileItem.getFieldName();
@ -78,18 +78,18 @@ public class CommonsMultipartFile implements MultipartFile, Serializable { @@ -78,18 +78,18 @@ public class CommonsMultipartFile implements MultipartFile, Serializable {
// Should never happen.
return "";
}
// check for Unix-style path
// Check for Unix-style path
int pos = filename.lastIndexOf("/");
if (pos == -1) {
// check for Windows-style path
// Check for Windows-style path
pos = filename.lastIndexOf("\\");
}
if (pos != -1) {
// any sort of path separator found
// Any sort of path separator found...
return filename.substring(pos + 1);
}
else {
// plain name
// A plain name
return filename;
}
}

Loading…
Cancel
Save