diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/mapping/BeanWrapperFieldSetMapper.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/mapping/BeanWrapperFieldSetMapper.java index 031c6eb88..25026e86b 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/mapping/BeanWrapperFieldSetMapper.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/mapping/BeanWrapperFieldSetMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2007 the original author or authors. + * Copyright 2006-2019 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. @@ -91,6 +91,7 @@ import org.springframework.validation.DataBinder; * match is found. If more than one match is found there will be an error. * * @author Dave Syer + * @author Mahmoud Ben Hassine * */ public class BeanWrapperFieldSetMapper extends DefaultPropertyEditorRegistrar implements FieldSetMapper, @@ -259,6 +260,10 @@ public class BeanWrapperFieldSetMapper extends DefaultPropertyEditorRegistrar */ private Properties getBeanProperties(Object bean, Properties properties) { + if (this.distanceLimit == 0) { + return properties; + } + Class cls = bean.getClass(); // Map from field names to property names