From 27fc61de6e269ea1466cc8bddab0ddaf1372fccc Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 15 Sep 2011 16:37:29 +0200 Subject: [PATCH] fix array merging in relaxNg --- .../html/impl/RelaxedHtmlFromSchemaElementDescriptor.java | 2 +- .../src/com/intellij/xml/XmlAttributeDescriptor.java | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/xml/impl/src/com/intellij/html/impl/RelaxedHtmlFromSchemaElementDescriptor.java b/xml/impl/src/com/intellij/html/impl/RelaxedHtmlFromSchemaElementDescriptor.java index 13201f8f993a..52a1920a1d9b 100644 --- a/xml/impl/src/com/intellij/html/impl/RelaxedHtmlFromSchemaElementDescriptor.java +++ b/xml/impl/src/com/intellij/html/impl/RelaxedHtmlFromSchemaElementDescriptor.java @@ -74,7 +74,7 @@ public class RelaxedHtmlFromSchemaElementDescriptor extends XmlElementDescriptor return descriptors; } for (XmlAttributeDescriptorsProvider provider: Extensions.getExtensions(XmlAttributeDescriptorsProvider.EP_NAME)) { - descriptors = ArrayUtil.mergeArrays(descriptors, provider.getAttributeDescriptors(context)); + descriptors = ArrayUtil.mergeArrays(descriptors, provider.getAttributeDescriptors(context), XmlAttributeDescriptor.ARRAY_FACTORY); } return descriptors; } diff --git a/xml/openapi/src/com/intellij/xml/XmlAttributeDescriptor.java b/xml/openapi/src/com/intellij/xml/XmlAttributeDescriptor.java index 545028c0d8aa..e279ed71c684 100644 --- a/xml/openapi/src/com/intellij/xml/XmlAttributeDescriptor.java +++ b/xml/openapi/src/com/intellij/xml/XmlAttributeDescriptor.java @@ -18,6 +18,7 @@ package com.intellij.xml; import com.intellij.psi.meta.PsiMetaData; import com.intellij.psi.xml.XmlElement; +import com.intellij.util.ArrayFactory; import org.jetbrains.annotations.Nullable; /** @@ -25,6 +26,12 @@ import org.jetbrains.annotations.Nullable; */ public interface XmlAttributeDescriptor extends PsiMetaData { XmlAttributeDescriptor[] EMPTY = new XmlAttributeDescriptor[0]; + ArrayFactory ARRAY_FACTORY = new ArrayFactory() { + @Override + public XmlAttributeDescriptor[] create(int count) { + return new XmlAttributeDescriptor[count]; + } + }; boolean isRequired(); boolean isFixed();