diff options
author | Tor Norbye <tnorbye@google.com> | 2013-01-29 07:34:44 -0800 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2013-01-29 07:34:44 -0800 |
commit | cfcabc7589ff93697c6b85a143b75e642e9943f4 (patch) | |
tree | b28c7cd6e6e02b177954bedd2f822a62cd678d0e /eclipse/plugins | |
parent | da7b4d7544af422698e152ddc24c7baa5333c498 (diff) | |
download | sdk-cfcabc7589ff93697c6b85a143b75e642e9943f4.zip sdk-cfcabc7589ff93697c6b85a143b75e642e9943f4.tar.gz sdk-cfcabc7589ff93697c6b85a143b75e642e9943f4.tar.bz2 |
43409: NPE when trying to rename the application package identifier
Change-Id: I909048c37553b2c0ac8292e31f13933e8b103862
Diffstat (limited to 'eclipse/plugins')
-rw-r--r-- | eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/renamepackage/ApplicationPackageNameRefactoring.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/renamepackage/ApplicationPackageNameRefactoring.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/renamepackage/ApplicationPackageNameRefactoring.java index f6fa6ee..406cebc 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/renamepackage/ApplicationPackageNameRefactoring.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/renamepackage/ApplicationPackageNameRefactoring.java @@ -146,7 +146,7 @@ class ApplicationPackageNameRefactoring extends Refactoring { TextEdit rewrittenImports = importVisitor.getTextEdit(); // If the import of R was potentially implicit, insert an import statement - if (cu.getPackage().getName().getFullyQualifiedName() + if (rewrittenImports != null && cu.getPackage().getName().getFullyQualifiedName() .equals(mOldPackageName.getFullyQualifiedName())) { UsageVisitor usageVisitor = new UsageVisitor(); @@ -438,10 +438,10 @@ class ApplicationPackageNameRefactoring extends Refactoring { mParser.setSource(icu); CompilationUnit cu = (CompilationUnit) mParser.createAST(null); - TextEdit text_edit = updateJavaFileImports(cu); - if (text_edit.hasChildren()) { + TextEdit textEdit = updateJavaFileImports(cu); + if (textEdit != null && textEdit.hasChildren()) { MultiTextEdit edit = new MultiTextEdit(); - edit.addChild(text_edit); + edit.addChild(textEdit); TextFileChange text_file_change = new TextFileChange(file.getName(), file); text_file_change.setTextType(SdkConstants.EXT_JAVA); |