fix problem with unexpected null value (following fix for IDEA-154578)

This commit is contained in:
Dmitry Batrak
2016-04-13 11:45:04 +03:00
parent bc0826f4e0
commit ce2dec4ee1
2 changed files with 5 additions and 2 deletions
@@ -332,8 +332,9 @@ class DocumentFoldingInfo implements JDOMExternalizable, CodeFoldingState {
if (start < 0 || end >= document.getTextLength() || start > end) continue;
RangeMarker marker = document.createRangeMarker(start, end);
myRangeMarkers.add(marker);
String placeHolderText = StringUtil.unescapeIllegalXmlChars(e.getAttributeValue(PLACEHOLDER_ATT));
if (placeHolderText == null) placeHolderText = DEFAULT_PLACEHOLDER;
String placeholderAttributeValue = e.getAttributeValue(PLACEHOLDER_ATT);
String placeHolderText = placeholderAttributeValue == null ? DEFAULT_PLACEHOLDER
: StringUtil.unescapeIllegalXmlChars(placeholderAttributeValue);
FoldingInfo fi = new FoldingInfo(placeHolderText, expanded);
marker.putUserData(FOLDING_INFO_KEY, fi);
}
@@ -2203,6 +2203,7 @@ public class StringUtil extends StringUtilRt {
* @see <a href="https://www.w3.org/International/questions/qa-controls">https://www.w3.org/International/questions/qa-controls</a>
* @see Verifier#isXMLCharacter(int)
*/
@NotNull
public static String escapeIllegalXmlChars(@NotNull String text) {
StringBuilder b = null;
int lastPos = 0;
@@ -2226,6 +2227,7 @@ public class StringUtil extends StringUtilRt {
/**
* @see #escapeIllegalXmlChars(String)
*/
@NotNull
public static String unescapeIllegalXmlChars(@NotNull String text) {
StringBuilder b = null;
int lastPos = 0;