Move utility method to CommonUtils
This commit is contained in:
parent
ba5982e1eb
commit
40dcc8b34a
|
|
@ -189,11 +189,7 @@ public final class SingleSignOutHandler {
|
|||
}
|
||||
|
||||
private String getPath(HttpServletRequest request) {
|
||||
return request.getServletPath() + nullToEmpty(request.getPathInfo());
|
||||
}
|
||||
|
||||
private String nullToEmpty(String string) {
|
||||
return string == null ? "" : string;
|
||||
return request.getServletPath() + CommonUtils.nullToEmpty(request.getPathInfo());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -719,4 +719,15 @@ public final class CommonUtils {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the string as-is, unless it's <code>null</code>;
|
||||
* in this case an empty string is returned.
|
||||
*
|
||||
* @param string a possibly <code>null</code> string
|
||||
* @return a non-<code>null</code> string
|
||||
*/
|
||||
public static String nullToEmpty(String string) {
|
||||
return string == null ? "" : string;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue