Backed out changeset 974090a524da (bug 1265708)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Sat, 04 Jun 2016 09:24:16 +0200
changeset 339395 5cdc84e272d574ba1b8614e0d6f1823a59e4048b
parent 339394 710bda4e42c63a0cc4654e91fbaf8e2c6911de0b
child 339396 e1fb7ee96e4e54f8e5d1ed308914730e2f7d41fe
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1265708
milestone49.0a1
backs out974090a524da56fad3b8045b19461e9ae6817529
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 974090a524da (bug 1265708)
mobile/android/base/java/org/mozilla/gecko/util/StringUtils.java
mobile/android/base/moz.build
mobile/android/tests/background/junit4/src/org/mozilla/gecko/util/TestStringUtils.java
--- a/mobile/android/base/java/org/mozilla/gecko/util/StringUtils.java
+++ b/mobile/android/base/java/org/mozilla/gecko/util/StringUtils.java
@@ -57,36 +57,16 @@ public class StringUtils {
         // Otherwise, if a dot or a colon is found, we assume this is a URL
         if (dot > -1 || colon > -1) {
             return false;
         }
         // Otherwise, text is ambiguous, and we keep its status unchanged
         return wasSearchQuery;
     }
 
-    /**
-     * Strip the ref from a URL, if present
-     *
-     * @return The base URL, without the ref. The original String is returned if it has no ref,
-     *         of if the input is malformed.
-     */
-    public static String stripRef(final String inputURL) {
-        if (inputURL == null) {
-            return null;
-        }
-
-        final int refIndex = inputURL.indexOf('#');
-
-        if (refIndex >= 0) {
-            return inputURL.substring(0, refIndex);
-        }
-
-        return inputURL;
-    }
-
     public static class UrlFlags {
         public static final int NONE = 0;
         public static final int STRIP_HTTPS = 1;
     }
 
     public static String stripScheme(String url) {
         return stripScheme(url, UrlFlags.NONE);
     }
--- a/mobile/android/base/moz.build
+++ b/mobile/android/base/moz.build
@@ -126,17 +126,16 @@ gujar.sources += ['java/org/mozilla/geck
     'util/NetworkUtils.java',
     'util/NonEvictingLruCache.java',
     'util/PrefUtils.java',
     'util/ProxySelector.java',
     'util/RawResource.java',
     'util/StringUtils.java',
     'util/ThreadUtils.java',
     'util/UIAsyncTask.java',
-    'util/URLUtils.java',
     'util/UUIDUtil.java',
     'util/WeakReferenceHandler.java',
     'util/WebActivityMapper.java',
     'util/WindowUtils.java',
 ]]
 gujar.extra_jars = [
     CONFIG['ANDROID_SUPPORT_ANNOTATIONS_JAR_LIB'],
     CONFIG['ANDROID_SUPPORT_V4_AAR_LIB'],
--- a/mobile/android/tests/background/junit4/src/org/mozilla/gecko/util/TestStringUtils.java
+++ b/mobile/android/tests/background/junit4/src/org/mozilla/gecko/util/TestStringUtils.java
@@ -6,18 +6,16 @@
 package org.mozilla.gecko.util;
 
 import junit.framework.Assert;
 
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mozilla.gecko.background.testhelpers.TestRunner;
 
-import static org.junit.Assert.assertEquals;
-
 @RunWith(TestRunner.class)
 public class TestStringUtils {
     @Test
     public void testIsHttpOrHttps() {
         // No value
         Assert.assertFalse(StringUtils.isHttpOrHttps(null));
         Assert.assertFalse(StringUtils.isHttpOrHttps(""));
 
@@ -37,20 +35,9 @@ public class TestStringUtils {
         Assert.assertFalse(StringUtils.isHttpOrHttps("ftp://people.mozilla.org"));
         Assert.assertFalse(StringUtils.isHttpOrHttps("javascript:window.google.com"));
         Assert.assertFalse(StringUtils.isHttpOrHttps("tel://1234567890"));
 
         // No scheme
         Assert.assertFalse(StringUtils.isHttpOrHttps("google.com"));
         Assert.assertFalse(StringUtils.isHttpOrHttps("git@github.com:mozilla/gecko-dev.git"));
     }
-
-    @Test
-    public void testStripRef() {
-        assertEquals(StringUtils.stripRef(null), null);
-        assertEquals(StringUtils.stripRef(""), "");
-
-        assertEquals(StringUtils.stripRef("??AAABBBCCC"), "??AAABBBCCC");
-        assertEquals(StringUtils.stripRef("https://mozilla.org"), "https://mozilla.org");
-        assertEquals(StringUtils.stripRef("https://mozilla.org#BBBB"), "https://mozilla.org");
-        assertEquals(StringUtils.stripRef("https://mozilla.org/#BBBB"), "https://mozilla.org/");
-    }
 }