Bug 1297117 - Make getUrlFromAboutReader private to avoid erronous usage r?sebastian
getUrlFromAboutReader can return null. There have been crashes caused by not checking this
result in the past. stripAboutReaderFromUrl is a safer version which returns the input URL
if necessary, and is probably what should be used in new code, hence we can make this method
private.
MozReview-Commit-ID: Lg7QWrpSE8F
--- a/mobile/android/base/java/org/mozilla/gecko/reader/ReaderModeUtils.java
+++ b/mobile/android/base/java/org/mozilla/gecko/reader/ReaderModeUtils.java
@@ -15,17 +15,17 @@ public class ReaderModeUtils {
/**
* Extract the URL from a valid about:reader URL. You may want to use stripAboutReaderUrl
* instead to always obtain a valid String.
*
* @see #stripAboutReaderUrl(String) for a safer version that returns the original URL for malformed/invalid
* URLs.
* @return <code>null</code> if the URL is malformed or doesn't contain a URL parameter.
*/
- public static String getUrlFromAboutReader(String aboutReaderUrl) {
+ private static String getUrlFromAboutReader(String aboutReaderUrl) {
return StringUtils.getQueryParameter(aboutReaderUrl, "url");
}
public static boolean isEnteringReaderMode(String currentUrl, String newUrl) {
if (currentUrl == null || newUrl == null) {
return false;
}