Fixed bug on deannotating: when annotation tag removed, parent is also removed if the latter has no children. Added test.

This commit is contained in:
Evgeny Gerashchenko
2012-08-30 15:23:44 +04:00
parent 9c20a65d0e
commit 37ceccb1eb
4 changed files with 14 additions and 2 deletions

View File

@@ -137,12 +137,14 @@ public class AddAnnotationFixTest extends UsefulTestCase {
addLibrary();
myFixture.configureByFiles("lib/p/TestPrimitive.java", "content/anno/p/annotations.xml");
doDeannotate("lib/p/TestDeannotation.java", "Annotate method 'get' as @NotNull", "Annotate method 'get' as @Nullable");
myFixture.checkResultByFile("content/anno/p/annotations.xml", "content/anno/p/annotationsDeannotation_after.xml", false);
}
public void testDeannotation1() throws Throwable {
addLibrary();
myFixture.configureByFiles("lib/p/TestPrimitive.java", "content/anno/p/annotations.xml");
doDeannotate("lib/p/TestDeannotation1.java", "Annotate parameter 'ss' as @NotNull", "Annotate parameter 'ss' as @Nullable");
myFixture.checkResultByFile("content/anno/p/annotations.xml", "content/anno/p/annotationsDeannotation1_after.xml", false);
}
private void doDeannotate(@NonNls final String testPath, String hint1, String hint2) throws Throwable {