Rename setOptions(Option...) to setOption()

Since Spring XML properties population is based on the JavaBeans convention, two setters with the same name but different argument types clashes and we can sporadically end up with:
```
 java.lang.IllegalStateException: Cannot convert value of type 'java.lang.String' to required type
'org.springframework.integration.file.remote.gateway.AbstractRemoteFileOutboundGateway$Option' for property 'options[0]':
no matching editors or conversion strategy found
```

So, rename the new method for Java configuration to the `setOption(Option...)`
This commit is contained in:
Artem Bilan
2016-11-11 12:06:59 -05:00
parent f71d6a0e66
commit f96c42d156
2 changed files with 2 additions and 2 deletions

View File

@@ -69,7 +69,7 @@ public abstract class RemoteFileOutboundGatewaySpec<F, S extends RemoteFileOutbo
* @return the spec
*/
public S options(AbstractRemoteFileOutboundGateway.Option... options) {
this.target.setOptions(options);
this.target.setOption(options);
return _this();
}

View File

@@ -331,7 +331,7 @@ public abstract class AbstractRemoteFileOutboundGateway<F> extends AbstractReply
* @param options the {@link Option} array to use.
* @since 5.0
*/
public void setOptions(Option... options) {
public void setOption(Option... options) {
Assert.notNull(options, "'options' must not be null");
Assert.noNullElements(options, "'options' cannot contain null element");