mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Added escaping/unescaping "name" attribute value in external annotations.
This commit is contained in:
@@ -131,7 +131,7 @@ public abstract class BaseExternalAnnotationsManager extends ExternalAnnotations
|
||||
final String externalName = getExternalName(listOwner, false);
|
||||
final String oldExternalName = getNormalizedExternalName(listOwner);
|
||||
for (final XmlTag tag : rootTag.getSubTags()) {
|
||||
final String className = tag.getAttributeValue("name");
|
||||
final String className = StringUtil.unescapeXml(tag.getAttributeValue("name"));
|
||||
if (!Comparing.strEqual(className, externalName) && !Comparing.strEqual(className, oldExternalName)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -446,7 +446,7 @@ public class ExternalAnnotationsManagerImpl extends BaseExternalAnnotationsManag
|
||||
final String externalName = getExternalName(listOwner, false);
|
||||
if (rootTag != null) {
|
||||
for (XmlTag tag : rootTag.getSubTags()) {
|
||||
if (Comparing.strEqual(tag.getAttributeValue("name"), externalName)) {
|
||||
if (Comparing.strEqual(StringUtil.unescapeXml(tag.getAttributeValue("name")), externalName)) {
|
||||
for (XmlTag annTag : tag.getSubTags()) {
|
||||
if (Comparing.strEqual(annTag.getAttributeValue("name"), annotationFQName)) {
|
||||
annTag.delete();
|
||||
@@ -459,7 +459,7 @@ public class ExternalAnnotationsManagerImpl extends BaseExternalAnnotationsManag
|
||||
}
|
||||
}
|
||||
@NonNls String text =
|
||||
"<item name=\'" + externalName + "\'>\n";
|
||||
"<item name=\'" + StringUtil.escapeXml(externalName) + "\'>\n";
|
||||
text += createAnnotationTag(annotationFQName, values);
|
||||
text += "</item>";
|
||||
rootTag.add(XmlElementFactory.getInstance(myPsiManager.getProject()).createTagFromText(text));
|
||||
|
||||
Reference in New Issue
Block a user