remove redundanct default search location (#1716)

compare two arrays, use `Arrays.equals` , otherwise the default will add into locations twice.
This commit is contained in:
chainHo
2021-01-12 06:33:39 +08:00
committed by GitHub
parent 5b18e0ea7a
commit 05d5d2e61e

View File

@@ -21,10 +21,12 @@ import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.LinkedHashSet;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -217,7 +219,7 @@ public abstract class AbstractScmAccessor implements ResourceLoaderAware {
if (locations == null || locations.length == 0) {
locations = AbstractScmAccessorProperties.DEFAULT_LOCATIONS;
}
else if (locations != AbstractScmAccessorProperties.DEFAULT_LOCATIONS) {
else if (!Arrays.equals(locations, AbstractScmAccessorProperties.DEFAULT_LOCATIONS)) {
locations = StringUtils.concatenateStringArrays(AbstractScmAccessorProperties.DEFAULT_LOCATIONS, locations);
}
Collection<String> output = new LinkedHashSet<String>();