Skip to content

Commit

Permalink
Disable fuzzy matching when distanceLimit = 0
Browse files Browse the repository at this point in the history
Before this commit, fuzzy matching is performed even though exact
matching is requested (distanceLimit = 0).

This commit bypasses fuzzy matching when distanceLimit = 0 which
improves performance.

Resolves BATCH-1801
  • Loading branch information
fmbenhassine committed May 30, 2019
1 parent 39f4d71 commit cae3f33
Showing 1 changed file with 6 additions and 1 deletion.
@@ -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.
Expand Down Expand Up @@ -91,6 +91,7 @@
* 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<T> extends DefaultPropertyEditorRegistrar implements FieldSetMapper<T>,
Expand Down Expand Up @@ -259,6 +260,10 @@ private T getBean() {
*/
private Properties getBeanProperties(Object bean, Properties properties) {

if (this.distanceLimit == 0) {
return properties;
}

Class<?> cls = bean.getClass();

// Map from field names to property names
Expand Down

0 comments on commit cae3f33

Please sign in to comment.