Skip to content

Commit 2ffb1cf

Browse files
shuyangzhoubrianchandotcom
authored andcommitted
LPD-59429 Try cheap string parsing first.
1 parent eb18490 commit 2ffb1cf

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

portal-impl/src/com/liferay/portal/util/LocalizationImpl.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,6 +1417,18 @@ private String _getRootAttributeValue(
14171417
return defaultValue;
14181418
}
14191419

1420+
int startIndex = xml.indexOf(name + "=\"");
1421+
1422+
if (startIndex != -1) {
1423+
startIndex += name.length() + 2;
1424+
1425+
int endIndex = xml.indexOf('"', startIndex);
1426+
1427+
if (endIndex != -1) {
1428+
return xml.substring(startIndex, endIndex);
1429+
}
1430+
}
1431+
14201432
String value = null;
14211433

14221434
XMLStreamReader xmlStreamReader = null;

0 commit comments

Comments
 (0)