Commit 3cc845b9 authored by kezhenxu94's avatar kezhenxu94 Committed by Jason Song

[APOLLO-2015]: fix bug that cannot resolve blank line in properties under Windows (#2017)

* bugfix: line feed under Windows. resolve issue #2015
parent 15b35ed7
...@@ -5,6 +5,7 @@ import com.ctrip.framework.apollo.common.dto.ItemDTO; ...@@ -5,6 +5,7 @@ import com.ctrip.framework.apollo.common.dto.ItemDTO;
import com.ctrip.framework.apollo.common.exception.BadRequestException; import com.ctrip.framework.apollo.common.exception.BadRequestException;
import com.ctrip.framework.apollo.common.utils.BeanUtils; import com.ctrip.framework.apollo.common.utils.BeanUtils;
import com.google.common.base.Strings;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.HashMap; import java.util.HashMap;
...@@ -155,7 +156,7 @@ public class PropertyResolver implements ConfigTextResolver { ...@@ -155,7 +156,7 @@ public class PropertyResolver implements ConfigTextResolver {
} }
private boolean isBlankItem(String line) { private boolean isBlankItem(String line) {
return "".equals(line); return Strings.nullToEmpty(line).trim().isEmpty();
} }
private void deleteNormalKVItem(Map<String, ItemDTO> baseKeyMapItem, ItemChangeSets changeSets) { private void deleteNormalKVItem(Map<String, ItemDTO> baseKeyMapItem, ItemChangeSets changeSets) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment