mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
Creating self-closing tag when annotation arguments list is not null, but empty. Added test.
This commit is contained in:
@@ -607,7 +607,7 @@ public class ExternalAnnotationsManagerImpl extends BaseExternalAnnotationsManag
|
||||
@NotNull
|
||||
private static String createAnnotationTag(@NotNull String annotationFQName, @Nullable PsiNameValuePair[] values) {
|
||||
@NonNls String text;
|
||||
if (values != null) {
|
||||
if (values != null && values.length != 0) {
|
||||
text = " <annotation name=\'" + annotationFQName + "\'>\n";
|
||||
text += StringUtil.join(values, new Function<PsiNameValuePair, String>() {
|
||||
@NonNls
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
<root>
|
||||
<item name='p.TestDeannotation java.lang.String get()'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
<item name='p.TestDeannotation1 java.lang.String get(java.lang.String) 0'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
<item name='p.Test java.lang.String get()'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
</root>
|
||||
@@ -106,6 +106,8 @@ public class AddAnnotationFixTest extends UsefulTestCase {
|
||||
final PsiModifierListOwner listOwner = PsiTreeUtil.getParentOfType(psiElement, PsiModifierListOwner.class);
|
||||
assertNotNull(listOwner);
|
||||
assertNotNull(ExternalAnnotationsManager.getInstance(project).findExternalAnnotation(listOwner, AnnotationUtil.NOT_NULL));
|
||||
|
||||
myFixture.checkResultByFile("content/anno/p/annotations.xml", "content/anno/p/annotationsAnnotateLibrary_after.xml", false);
|
||||
}
|
||||
|
||||
public void testPrimitive() throws Throwable {
|
||||
|
||||
Reference in New Issue
Block a user