Bug 834471 - Part 4: Fix FindBugs warning about unlockProfile() not checking file.delete() return value. r=wesj
authorChris Peterson <cpeterson@mozilla.com>
Thu, 24 Jan 2013 14:26:01 -0800
changeset 120109 528f5373b47a782567fa9944913007da1f6f7040
parent 120108 23e83bcb87f8490cbe4f5294cee8ff2d4db330f7
child 120110 874b9c8e05f1ffbf3ddd878f2b3c31d8fd6d2731
push id24239
push userryanvm@gmail.com
push dateTue, 29 Jan 2013 14:36:31 +0000
treeherdermozilla-central@d3a5e1de98b0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswesj
bugs834471
milestone21.0a1
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
Bug 834471 - Part 4: Fix FindBugs warning about unlockProfile() not checking file.delete() return value. r=wesj
mobile/android/base/GeckoAppShell.java
--- a/mobile/android/base/GeckoAppShell.java
+++ b/mobile/android/base/GeckoAppShell.java
@@ -2246,29 +2246,25 @@ public class GeckoAppShell
     public static void unregisterSurfaceTextureFrameListener(Object surfaceTexture) {
         ((SurfaceTexture)surfaceTexture).setOnFrameAvailableListener(null);
     }
 
     public static void notifyCheckUpdateResult(boolean result) {
         if (GeckoApp.mAppContext != null)
             GeckoApp.mAppContext.notifyCheckUpdateResult(result);
     }
-    
+
     public static boolean unlockProfile() {
         // Try to kill any zombie Fennec's that might be running
         GeckoAppShell.killAnyZombies();
 
         // Then force unlock this profile
         GeckoProfile profile = GeckoApp.mAppContext.getProfile();
         File lock = profile.getFile(".parentlock");
-        if (lock.exists()) {
-            lock.delete();
-            return true;
-        }
-        return false;
+        return lock.exists() && lock.delete();
     }
 
     public static String getProxyForURI(String spec, String scheme, String host, int port) {
         URI uri = null;
         try {
             uri = new URI(spec);
         } catch(java.net.URISyntaxException uriEx) {
             try {