diff --git a/java/java-impl/src/com/intellij/psi/impl/source/tree/JavaASTFactory.java b/java/java-impl/src/com/intellij/psi/impl/source/tree/JavaASTFactory.java index 20f7ab1e2f44..af52572abe40 100644 --- a/java/java-impl/src/com/intellij/psi/impl/source/tree/JavaASTFactory.java +++ b/java/java-impl/src/com/intellij/psi/impl/source/tree/JavaASTFactory.java @@ -17,14 +17,15 @@ package com.intellij.psi.impl.source.tree; import com.intellij.psi.impl.source.javadoc.PsiDocTagValueImpl; import com.intellij.psi.tree.IElementType; +import org.jetbrains.annotations.NotNull; /** * @author max */ public class JavaASTFactory extends CoreJavaASTFactory { @Override - public CompositeElement createComposite(final IElementType type) { - if (type == DOC_TAG_VALUE_ELEMENT) { + public CompositeElement createComposite(@NotNull final IElementType type) { + if (type == JavaDocElementType.DOC_TAG_VALUE_ELEMENT) { return new PsiDocTagValueImpl(); } diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/CoreJavaASTFactory.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/CoreJavaASTFactory.java index 4f796dce93e6..20e94043a5ac 100644 --- a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/CoreJavaASTFactory.java +++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/CoreJavaASTFactory.java @@ -18,7 +18,7 @@ package com.intellij.psi.impl.source.tree; import com.intellij.lang.ASTFactory; import com.intellij.lang.DefaultASTFactory; import com.intellij.openapi.components.ServiceManager; -import com.intellij.psi.impl.source.Constants; +import com.intellij.psi.JavaTokenType; import com.intellij.psi.impl.source.javadoc.CorePsiDocTagValueImpl; import com.intellij.psi.impl.source.javadoc.PsiDocTokenImpl; import com.intellij.psi.impl.source.tree.java.PsiIdentifierImpl; @@ -32,25 +32,25 @@ import org.jetbrains.annotations.NotNull; /** * @author yole */ -public class CoreJavaASTFactory extends ASTFactory implements Constants { +public class CoreJavaASTFactory extends ASTFactory { private final DefaultASTFactory myDefaultASTFactory = ServiceManager.getService(DefaultASTFactory.class); @Override public LeafElement createLeaf(@NotNull final IElementType type, @NotNull final CharSequence text) { - if (type == C_STYLE_COMMENT || type == END_OF_LINE_COMMENT) { + if (type == JavaTokenType.C_STYLE_COMMENT || type == JavaTokenType.END_OF_LINE_COMMENT) { return myDefaultASTFactory.createComment(type, text); } - else if (type == IDENTIFIER) { + if (type == JavaTokenType.IDENTIFIER) { return new PsiIdentifierImpl(text); } - else if (KEYWORD_BIT_SET.contains(type)) { + if (ElementType.KEYWORD_BIT_SET.contains(type)) { return new PsiKeywordImpl(type, text); } - else if (type instanceof IJavaElementType) { + if (type instanceof IJavaElementType) { return new PsiJavaTokenImpl(type, text); } - else if (type instanceof IJavaDocElementType) { - assert type != DOC_TAG_VALUE_ELEMENT; + if (type instanceof IJavaDocElementType) { + assert type != JavaDocElementType.DOC_TAG_VALUE_ELEMENT; return new PsiDocTokenImpl(type, text); } @@ -58,8 +58,8 @@ public class CoreJavaASTFactory extends ASTFactory implements Constants { } @Override - public CompositeElement createComposite(IElementType type) { - if (type == DOC_TAG_VALUE_ELEMENT) { + public CompositeElement createComposite(@NotNull IElementType type) { + if (type == JavaDocElementType.DOC_TAG_VALUE_ELEMENT) { return new CorePsiDocTagValueImpl(); } return null; diff --git a/platform/core-api/src/com/intellij/psi/LiteralTextEscaper.java b/platform/core-api/src/com/intellij/psi/LiteralTextEscaper.java index f992e6c43f23..053d86319c07 100644 --- a/platform/core-api/src/com/intellij/psi/LiteralTextEscaper.java +++ b/platform/core-api/src/com/intellij/psi/LiteralTextEscaper.java @@ -74,7 +74,8 @@ public abstract class LiteralTextEscaper { */ public abstract boolean isOneLine(); - public static LiteralTextEscaper createSimple(T element) { + @NotNull + public static LiteralTextEscaper createSimple(@NotNull T element) { return new LiteralTextEscaper(element) { @Override public boolean decode(@NotNull TextRange rangeInsideHost, @NotNull StringBuilder outChars) { diff --git a/platform/core-api/src/com/intellij/psi/PsiInvalidElementAccessException.java b/platform/core-api/src/com/intellij/psi/PsiInvalidElementAccessException.java index ae07b491eeed..d4ff908bfa09 100644 --- a/platform/core-api/src/com/intellij/psi/PsiInvalidElementAccessException.java +++ b/platform/core-api/src/com/intellij/psi/PsiInvalidElementAccessException.java @@ -108,7 +108,7 @@ public class PsiInvalidElementAccessException extends RuntimeException implement private static Object getPsiInvalidationTrace(@NotNull PsiElement element) { Object trace = getInvalidationTrace(element); if (trace != null) return trace; - + if (element instanceof PsiFile) { return getInvalidationTrace(((PsiFile)element).getOriginalFile()); } @@ -167,7 +167,9 @@ public class PsiInvalidElementAccessException extends RuntimeException implement @NonNls @NotNull public static String findOutInvalidationReason(@NotNull PsiElement root) { - if (root == PsiUtilCore.NULL_PSI_ELEMENT) return "NULL_PSI_ELEMENT"; + if (root == PsiUtilCore.NULL_PSI_ELEMENT) { + return "NULL_PSI_ELEMENT"; + } PsiElement element = root instanceof PsiFile ? root : root.getParent(); if (element == null) { @@ -188,11 +190,15 @@ public class PsiInvalidElementAccessException extends RuntimeException implement while (element != null && !(element instanceof PsiFile)) element = element.getParent(); PsiFile file = (PsiFile)element; - if (file == null) return "containing file is null"; + if (file == null) { + return "containing file is null"; + } FileViewProvider provider = file.getViewProvider(); VirtualFile vFile = provider.getVirtualFile(); - if (!vFile.isValid()) return vFile + " is invalid"; + if (!vFile.isValid()) { + return vFile + " is invalid"; + } if (!provider.isPhysical()) { PsiElement context = file.getContext(); if (context != null && !context.isValid()) { @@ -206,15 +212,23 @@ public class PsiInvalidElementAccessException extends RuntimeException implement } PsiManager manager = file.getManager(); - if (manager.getProject().isDisposed()) return "project is disposed"; + if (manager.getProject().isDisposed()) { + return "project is disposed"; + } Language language = file.getLanguage(); - if (language != provider.getBaseLanguage()) return "File language:" + language + " != Provider base language:" + provider.getBaseLanguage(); + if (language != provider.getBaseLanguage()) { + return "File language:" + language + " != Provider base language:" + provider.getBaseLanguage(); + } FileViewProvider p = manager.findViewProvider(vFile); - if (provider != p) return "different providers: " + provider + "(" + id(provider) + "); " + p + "(" + id(p) + ")"; + if (provider != p) { + return "different providers: " + provider + "(" + id(provider) + "); " + p + "(" + id(p) + ")"; + } - if (!provider.isPhysical()) return "non-physical provider: " + provider; // "dummy" file? + if (!provider.isPhysical()) { + return "non-physical provider: " + provider; // "dummy" file? + } return "psi is outdated"; } diff --git a/platform/core-api/src/com/intellij/psi/PsiLanguageInjectionHost.java b/platform/core-api/src/com/intellij/psi/PsiLanguageInjectionHost.java index ea89efe4101c..5c71e83a63d3 100644 --- a/platform/core-api/src/com/intellij/psi/PsiLanguageInjectionHost.java +++ b/platform/core-api/src/com/intellij/psi/PsiLanguageInjectionHost.java @@ -46,7 +46,7 @@ public interface PsiLanguageInjectionHost extends PsiElement { /** * Update the host element using the provided text of the injected file. It may be required to escape characters from {@code text} * in accordance with the host language syntax. The implementation may delegate to {@link ElementManipulators#handleContentChange(PsiElement, String)} - * if {@link com.intellij.psi.ElementManipulator} implementation is registered for this element class + * if {@link ElementManipulator} implementation is registered for this element class * @param text text of the injected file * @return the updated instance */ diff --git a/platform/core-impl/src/com/intellij/lang/ASTFactory.java b/platform/core-impl/src/com/intellij/lang/ASTFactory.java index e50feb7dcf22..7fbcb0f3d419 100644 --- a/platform/core-impl/src/com/intellij/lang/ASTFactory.java +++ b/platform/core-impl/src/com/intellij/lang/ASTFactory.java @@ -42,12 +42,12 @@ public abstract class ASTFactory { // interface methods @Nullable - public LazyParseableElement createLazy(final ILazyParseableElementType type, final CharSequence text) { + public LazyParseableElement createLazy(@NotNull ILazyParseableElementType type, final CharSequence text) { return null; } @Nullable - public CompositeElement createComposite(final IElementType type) { + public CompositeElement createComposite(@NotNull IElementType type) { return null; } @@ -66,7 +66,7 @@ public abstract class ASTFactory { if (type == TokenType.CODE_FRAGMENT) { return new CodeFragmentElement(null); } - else if (type == TokenType.DUMMY_HOLDER) { + if (type == TokenType.DUMMY_HOLDER) { return new DummyHolderElement(text); } @@ -98,7 +98,6 @@ public abstract class ASTFactory { return customLeaf != null ? customLeaf : DefaultFactoryHolder.DEFAULT.createLeaf(type, text); } - @Nullable private static ASTFactory factory(final IElementType type) { return LanguageASTFactory.INSTANCE.forLanguage(type.getLanguage()); } diff --git a/platform/core-impl/src/com/intellij/openapi/progress/impl/CoreProgressManager.java b/platform/core-impl/src/com/intellij/openapi/progress/impl/CoreProgressManager.java index b02af8a0bf60..3530e0a87d96 100644 --- a/platform/core-impl/src/com/intellij/openapi/progress/impl/CoreProgressManager.java +++ b/platform/core-impl/src/com/intellij/openapi/progress/impl/CoreProgressManager.java @@ -373,7 +373,7 @@ public class CoreProgressManager extends ProgressManager implements Disposable { @NotNull final ModalityState modalityState) { IndicatorDisposable indicatorDisposable; if (progressIndicator instanceof Disposable) { - // use CancelIndicatorDisposable instead of progressIndicator to + // use IndicatorDisposable instead of progressIndicator to // avoid re-registering progressIndicator if it was registered on some other parent before indicatorDisposable = new IndicatorDisposable(progressIndicator); Disposer.register(ApplicationManager.getApplication(), indicatorDisposable); diff --git a/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/psi/impl/PropertiesASTFactory.java b/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/psi/impl/PropertiesASTFactory.java index a3d8e5ddb967..1cab2708f24a 100644 --- a/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/psi/impl/PropertiesASTFactory.java +++ b/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/psi/impl/PropertiesASTFactory.java @@ -29,7 +29,7 @@ import org.jetbrains.annotations.Nullable; public class PropertiesASTFactory extends ASTFactory { @Override @Nullable - public CompositeElement createComposite(final IElementType type) { + public CompositeElement createComposite(@NotNull final IElementType type) { if (type instanceof IFileElementType) { return new FileElement(type, null); } diff --git a/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/psi/impl/PropertyImpl.java b/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/psi/impl/PropertyImpl.java index 812a607e6b87..2db1ace46daa 100644 --- a/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/psi/impl/PropertyImpl.java +++ b/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/psi/impl/PropertyImpl.java @@ -43,6 +43,7 @@ public class PropertyImpl extends PropertiesStubElementImpl implem return "Property{ key = " + getKey() + ", value = " + getValue() + "}"; } + @Override public PsiElement setName(@NotNull String name) throws IncorrectOperationException { PropertyImpl property = (PropertyImpl)PropertiesElementFactory.createProperty(getProject(), name, "xxx", null); ASTNode keyNode = getKeyNode(); @@ -57,6 +58,7 @@ public class PropertyImpl extends PropertiesStubElementImpl implem return this; } + @Override public void setValue(@NotNull String value) throws IncorrectOperationException { ASTNode node = getValueNode(); PropertyImpl property = (PropertyImpl)PropertiesElementFactory.createProperty(getProject(), "xxx", value, getKeyValueDelimiter()); @@ -76,10 +78,12 @@ public class PropertyImpl extends PropertiesStubElementImpl implem } } + @Override public String getName() { return getUnescapedKey(); } + @Override public String getKey() { final PropertyStub stub = getStub(); if (stub != null) { @@ -103,6 +107,7 @@ public class PropertyImpl extends PropertiesStubElementImpl implem return getNode().findChildByType(PropertiesTokenTypes.VALUE_CHARACTERS); } + @Override public String getValue() { final ASTNode node = getValueNode(); if (node == null) { @@ -111,6 +116,7 @@ public class PropertyImpl extends PropertiesStubElementImpl implem return node.getText(); } + @Override @Nullable public String getUnescapedValue() { return unescape(getValue()); @@ -335,6 +341,7 @@ public class PropertyImpl extends PropertiesStubElementImpl implem return startSpaces == -1 ? null : new TextRange(startSpaces, len); } + @Override @Nullable public String getUnescapedKey() { return unescape(getKey()); @@ -346,6 +353,7 @@ public class PropertyImpl extends PropertiesStubElementImpl implem return PlatformIcons.PROPERTY_ICON; } + @Override public void delete() throws IncorrectOperationException { final ASTNode parentNode = getParent().getNode(); assert parentNode != null; @@ -360,10 +368,12 @@ public class PropertyImpl extends PropertiesStubElementImpl implem } } + @Override public PropertiesFile getPropertiesFile() { return (PropertiesFile)super.getContainingFile(); } + @Override public String getDocCommentText() { StringBuilder text = new StringBuilder(); for (PsiElement doc = getPrevSibling(); doc != null; doc = doc.getPrevSibling()) { @@ -389,22 +399,27 @@ public class PropertyImpl extends PropertiesStubElementImpl implem return this; } + @Override @NotNull public SearchScope getUseScope() { // property ref can occur in any file return GlobalSearchScope.allScope(getProject()); } + @Override public ItemPresentation getPresentation() { return new ItemPresentation() { + @Override public String getPresentableText() { return getName(); } + @Override public String getLocationString() { return getPropertiesFile().getName(); } + @Override public Icon getIcon(final boolean open) { return null; } diff --git a/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/psi/impl/PropertyImplEscaper.java b/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/psi/impl/PropertyImplEscaper.java index c4d6d8983f81..89d6311bfcb8 100644 --- a/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/psi/impl/PropertyImplEscaper.java +++ b/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/psi/impl/PropertyImplEscaper.java @@ -8,12 +8,12 @@ import org.jetbrains.annotations.NotNull; /** * @author gregsh */ -public class PropertyImplEscaper extends LiteralTextEscaper { +class PropertyImplEscaper extends LiteralTextEscaper { private static final Logger LOG = Logger.getInstance(PropertyImplEscaper.class); private int[] outSourceOffsets; - public PropertyImplEscaper(PropertyImpl value) { + PropertyImplEscaper(@NotNull PropertyImpl value) { super(value); } diff --git a/python/src/com/jetbrains/python/psi/impl/PyStringLiteralExpressionImpl.java b/python/src/com/jetbrains/python/psi/impl/PyStringLiteralExpressionImpl.java index c3044dfdf6a2..3914a867f6ba 100644 --- a/python/src/com/jetbrains/python/psi/impl/PyStringLiteralExpressionImpl.java +++ b/python/src/com/jetbrains/python/psi/impl/PyStringLiteralExpressionImpl.java @@ -348,10 +348,12 @@ public class PyStringLiteralExpressionImpl extends PyElementImpl implements PySt }; } + @Override public PsiLanguageInjectionHost updateText(@NotNull String text) { return ElementManipulators.handleContentChange(this, text); } + @Override @NotNull public LiteralTextEscaper createLiteralTextEscaper() { return new StringLiteralTextEscaper(this); diff --git a/xml/xml-psi-impl/src/com/intellij/lang/xml/XmlASTFactory.java b/xml/xml-psi-impl/src/com/intellij/lang/xml/XmlASTFactory.java index 7fdcc6c41502..003209029c4f 100644 --- a/xml/xml-psi-impl/src/com/intellij/lang/xml/XmlASTFactory.java +++ b/xml/xml-psi-impl/src/com/intellij/lang/xml/XmlASTFactory.java @@ -35,80 +35,80 @@ import static com.intellij.psi.xml.XmlElementType.*; public class XmlASTFactory extends ASTFactory { @Override - public CompositeElement createComposite(final IElementType type) { + public CompositeElement createComposite(@NotNull final IElementType type) { if (type == XML_TAG) { return new XmlTagImpl(); } - else if (type == XML_CONDITIONAL_SECTION) { + if (type == XML_CONDITIONAL_SECTION) { return new XmlConditionalSectionImpl(); } - else if (type == HTML_TAG) { + if (type == HTML_TAG) { return new HtmlTagImpl(); } - else if (type == XML_TEXT) { + if (type == XML_TEXT) { return new XmlTextImpl(); } - else if (type == XML_PROCESSING_INSTRUCTION) { + if (type == XML_PROCESSING_INSTRUCTION) { return new XmlProcessingInstructionImpl(); } - else if (type == XML_DOCUMENT) { + if (type == XML_DOCUMENT) { return new XmlDocumentImpl(); } - else if (type == HTML_DOCUMENT) { + if (type == HTML_DOCUMENT) { return new HtmlDocumentImpl(); } - else if (type == XML_PROLOG) { + if (type == XML_PROLOG) { return new XmlPrologImpl(); } - else if (type == XML_DECL) { + if (type == XML_DECL) { return new XmlDeclImpl(); } - else if (type == XML_ATTRIBUTE) { + if (type == XML_ATTRIBUTE) { return new XmlAttributeImpl(); } - else if (type == XML_ATTRIBUTE_VALUE) { + if (type == XML_ATTRIBUTE_VALUE) { return new XmlAttributeValueImpl(); } - else if (type == XML_COMMENT) { + if (type == XML_COMMENT) { return new XmlCommentImpl(); } - else if (type == XML_DOCTYPE) { + if (type == XML_DOCTYPE) { return new XmlDoctypeImpl(); } - else if (type == XML_MARKUP_DECL) { + if (type == XML_MARKUP_DECL) { return new XmlMarkupDeclImpl(); } - else if (type == XML_ELEMENT_DECL) { + if (type == XML_ELEMENT_DECL) { return new XmlElementDeclImpl(); } - else if (type == XML_ENTITY_DECL) { + if (type == XML_ENTITY_DECL) { return new XmlEntityDeclImpl(); } - else if (type == XML_ATTLIST_DECL) { + if (type == XML_ATTLIST_DECL) { return new XmlAttlistDeclImpl(); } - else if (type == XML_ATTRIBUTE_DECL) { + if (type == XML_ATTRIBUTE_DECL) { return new XmlAttributeDeclImpl(); } - else if (type == XML_NOTATION_DECL) { + if (type == XML_NOTATION_DECL) { return new XmlNotationDeclImpl(); } - else if (type == XML_ELEMENT_CONTENT_SPEC) { + if (type == XML_ELEMENT_CONTENT_SPEC) { return new XmlElementContentSpecImpl(); } - else if (type == XML_ELEMENT_CONTENT_GROUP) { + if (type == XML_ELEMENT_CONTENT_GROUP) { return new XmlElementContentGroupImpl(); } - else if (type == XML_ENTITY_REF) { + if (type == XML_ENTITY_REF) { return new XmlEntityRefImpl(); } - else if (type == XML_ENUMERATED_TYPE) { + if (type == XML_ENUMERATED_TYPE) { return new XmlEnumeratedTypeImpl(); } - else if (type == XML_CDATA) { + if (type == XML_CDATA) { return new CompositePsiElement(XML_CDATA) {}; } - else if (type instanceof ITemplateDataElementType) { + if (type instanceof ITemplateDataElementType) { return new XmlFileElement(type, null); } @@ -116,20 +116,20 @@ public class XmlASTFactory extends ASTFactory { } @Override - public LazyParseableElement createLazy(ILazyParseableElementType type, CharSequence text) { + public LazyParseableElement createLazy(@NotNull ILazyParseableElementType type, CharSequence text) { if (type == XML_FILE) { return new XmlFileElement(type, text); } - else if (type == DTD_FILE) { + if (type == DTD_FILE) { return new XmlFileElement(type, text); } - else if (type == XHTML_FILE) { + if (type == XHTML_FILE) { return new XmlFileElement(type, text); } - else if (type == HTML_FILE) { + if (type == HTML_FILE) { return new HtmlFileElement(text); } - else if (type instanceof ITemplateDataElementType) { + if (type instanceof ITemplateDataElementType) { return new XmlFileElement(type, text); } return null; diff --git a/xml/xml-psi-impl/src/com/intellij/psi/impl/source/tree/injected/XmlTextLiteralEscaper.java b/xml/xml-psi-impl/src/com/intellij/psi/impl/source/tree/injected/XmlTextLiteralEscaper.java index e8ff30ff028e..ea394365aadd 100644 --- a/xml/xml-psi-impl/src/com/intellij/psi/impl/source/tree/injected/XmlTextLiteralEscaper.java +++ b/xml/xml-psi-impl/src/com/intellij/psi/impl/source/tree/injected/XmlTextLiteralEscaper.java @@ -24,7 +24,7 @@ import org.jetbrains.annotations.NotNull; * @author cdr */ public class XmlTextLiteralEscaper extends LiteralTextEscaper { - public XmlTextLiteralEscaper(final XmlTextImpl xmlText) { + public XmlTextLiteralEscaper(@NotNull XmlTextImpl xmlText) { super(xmlText); } diff --git a/xml/xml-psi-impl/src/com/intellij/psi/impl/source/xml/XmlTextImpl.java b/xml/xml-psi-impl/src/com/intellij/psi/impl/source/xml/XmlTextImpl.java index ae28c1f89908..6723ca099904 100644 --- a/xml/xml-psi-impl/src/com/intellij/psi/impl/source/xml/XmlTextImpl.java +++ b/xml/xml-psi-impl/src/com/intellij/psi/impl/source/xml/XmlTextImpl.java @@ -98,11 +98,11 @@ public class XmlTextImpl extends XmlElementImpl implements XmlText, PsiLanguageI LOG.assertTrue(text != null, child); buffer.append(XmlUtil.getCharFromEntityRef(text)); } - else if (elementType == XmlTokenType.XML_WHITE_SPACE || elementType == XmlTokenType.XML_DATA_CHARACTERS || elementType == XmlTokenType - .XML_ATTRIBUTE_VALUE_TOKEN) { - buffer.append(child.getText()); - } - else if (elementType == TokenType.ERROR_ELEMENT || elementType == TokenType.NEW_LINE_INDENT) { + else if (elementType == XmlTokenType.XML_WHITE_SPACE || + elementType == XmlTokenType.XML_DATA_CHARACTERS || + elementType == XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN || + elementType == TokenType.ERROR_ELEMENT || + elementType == TokenType.NEW_LINE_INDENT) { buffer.append(child.getText()); } @@ -379,11 +379,11 @@ public class XmlTextImpl extends XmlElementImpl implements XmlText, PsiLanguageI public TextRange getCDATAInterior() { PsiElement[] elements = getChildren(); - int start = 0; int first = 0; if (elements.length > 0 && elements[0] instanceof PsiWhiteSpace) { first ++; } + int start = 0; if (elements.length > first && elements[first].getNode().getElementType() == XmlElementType.XML_CDATA) { ASTNode startNode = elements[first].getNode().findChildByType(XmlTokenType.XML_CDATA_START); if (startNode != null) {