aboutsummaryrefslogtreecommitdiff
path: root/common/src/main/java/at/gv/egovernment/moa/util/StringUtils.java
diff options
context:
space:
mode:
Diffstat (limited to 'common/src/main/java/at/gv/egovernment/moa/util/StringUtils.java')
-rw-r--r--common/src/main/java/at/gv/egovernment/moa/util/StringUtils.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/common/src/main/java/at/gv/egovernment/moa/util/StringUtils.java b/common/src/main/java/at/gv/egovernment/moa/util/StringUtils.java
index 61b1a18ea..82c10d90f 100644
--- a/common/src/main/java/at/gv/egovernment/moa/util/StringUtils.java
+++ b/common/src/main/java/at/gv/egovernment/moa/util/StringUtils.java
@@ -87,11 +87,11 @@ public class StringUtils {
* Replaces each substring of string <code>s</code> that matches the given
* <code>search</code> string by the given <code>replace</code> string.
*
- * @param s The string where the replacment should take place.
+ * @param s The string where the replacement should take place.
* @param search The pattern that should be replaced.
* @param replace The string that should replace all each <code>search</code>
* string within <code>s</code>.
- * @return A string whrer all occurrence of <code>search</code> are
+ * @return A string where all occurrence of <code>search</code> are
* replaced with <code>replace</code>.
*/
public static String replaceAll (String s, String search, String replace)
@@ -153,7 +153,7 @@ public class StringUtils {
* @return XML expression, XML declaration removed
*/
public static String removeXMLDeclaration(String xmlString) {
- if (xmlString.startsWith("<?xml")) {
+ if (xmlString!=null && xmlString.startsWith("<?xml")) {
int firstElement = xmlString.indexOf("<", 1);
return xmlString.substring(firstElement);
} else {