aboutsummaryrefslogtreecommitdiffstats
path: root/eclipse
diff options
context:
space:
mode:
authorRaphael Moll <ralf@android.com>2012-04-27 10:22:39 -0700
committerandroid code review <noreply-gerritcodereview@google.com>2012-04-27 10:22:39 -0700
commitf62902ac1a6d5641c836ea47066a599cd88ce129 (patch)
tree155f82e2c6e69ffc1e6263f48e25f4bf2db1b898 /eclipse
parente97dacc242c7c89b65552ee813b93faad427193a (diff)
parent297d439f24c22519ec88c88360c2549f20426d6d (diff)
downloadsdk-f62902ac1a6d5641c836ea47066a599cd88ce129.zip
sdk-f62902ac1a6d5641c836ea47066a599cd88ce129.tar.gz
sdk-f62902ac1a6d5641c836ea47066a599cd88ce129.tar.bz2
Merge "ADT: Fix NPE when converting legacy default.properties"
Diffstat (limited to 'eclipse')
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/properties/AndroidPropertyPage.java4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/Sdk.java4
2 files changed, 7 insertions, 1 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/properties/AndroidPropertyPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/properties/AndroidPropertyPage.java
index 584d49f..212263a 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/properties/AndroidPropertyPage.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/properties/AndroidPropertyPage.java
@@ -143,7 +143,9 @@ public class AndroidPropertyPage extends PropertyPage {
mPropertiesWorkingCopy.save();
IResource projectProp = mProject.findMember(SdkConstants.FN_PROJECT_PROPERTIES);
- projectProp.refreshLocal(IResource.DEPTH_ZERO, new NullProgressMonitor());
+ if (projectProp != null) {
+ projectProp.refreshLocal(IResource.DEPTH_ZERO, new NullProgressMonitor());
+ }
} catch (Exception e) {
String msg = String.format(
"Failed to save %1$s for project %2$s",
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/Sdk.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/Sdk.java
index 2a1fba9..4f9bb09 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/Sdk.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/Sdk.java
@@ -442,6 +442,10 @@ public final class Sdk {
// delete the old file.
ProjectProperties.delete(projectLocation, PropertyType.LEGACY_DEFAULT);
+
+ // make sure to use the new properties
+ properties = ProjectProperties.load(projectLocation,
+ PropertyType.PROJECT);
} catch (Exception e) {
AdtPlugin.log(IStatus.ERROR,
"Failed to rename properties file to %1$s for project '%s2$'",