From 64fe39358b3b56135a8954867d752206c593bfc4 Mon Sep 17 00:00:00 2001 From: Michael Wright Date: Fri, 3 Aug 2012 22:08:38 -0700 Subject: Increment count when backing up bad devices.xml Fixes a bug where if you had devices.xml.old.0 in ~/.android, then the DeviceManager would spin in an infinite loop because the count wouldn't be incremented each time. Change-Id: I525a0da120205ffb9e507bf1a83cb02f077ba76d --- .../libs/sdklib/src/com/android/sdklib/devices/DeviceManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/DeviceManager.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/DeviceManager.java index c203231..d46ca5f 100644 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/DeviceManager.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/DeviceManager.java @@ -198,7 +198,7 @@ public class DeviceManager { File renamedConfig = new File(base); int i = 0; while (renamedConfig.exists()) { - renamedConfig = new File(base+"."+i); + renamedConfig = new File(base + "." + (i++)); } mLog.error(null, "Error parsing %1$s, backing up to %2$s", userDevicesFile.getAbsolutePath(), renamedConfig.getAbsolutePath()); -- cgit v1.1