summaryrefslogtreecommitdiff
path: root/xml/dom-impl
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2013-05-06 10:36:42 -0700
committerTor Norbye <tnorbye@google.com>2013-05-06 10:36:42 -0700
commitf56a0fff1a336635c966bffc25e16af9a4e6e988 (patch)
tree19e53b8f61e9fc94d35d5d6d97cc1499cad1cc59 /xml/dom-impl
parent8fb0021093e7d978cc06043ba4c06b0a47778294 (diff)
downloadidea-f56a0fff1a336635c966bffc25e16af9a4e6e988.tar.gz
Snapshot 36a7a0702ddda30083713c9b8f140495d5f09d32 from master branch of git://git.jetbrains.org/idea/community.git
Change-Id: Ia9068e36d373808400a123a395b037bdb6940a17
Diffstat (limited to 'xml/dom-impl')
-rw-r--r--xml/dom-impl/src/com/intellij/util/xml/impl/DomAnchorImpl.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/DomAnchorImpl.java b/xml/dom-impl/src/com/intellij/util/xml/impl/DomAnchorImpl.java
index 4fa7f613fef6..965f1bd7d121 100644
--- a/xml/dom-impl/src/com/intellij/util/xml/impl/DomAnchorImpl.java
+++ b/xml/dom-impl/src/com/intellij/util/xml/impl/DomAnchorImpl.java
@@ -36,11 +36,11 @@ import java.util.List;
public abstract class DomAnchorImpl<T extends DomElement> implements DomAnchor<T> {
private static final Logger LOG = Logger.getInstance("#com.intellij.util.xml.impl.DomAnchorImpl");
- public static <T extends DomElement> DomAnchorImpl<T> createAnchor(@NotNull T t) {
+ public static <T extends DomElement> DomAnchor<T> createAnchor(@NotNull T t) {
return createAnchor(t, false);
}
- public static <T extends DomElement> DomAnchorImpl<T> createAnchor(@NotNull T t, boolean usePsi) {
+ public static <T extends DomElement> DomAnchor<T> createAnchor(@NotNull T t, boolean usePsi) {
if (usePsi) {
final XmlElement element = t.getXmlElement();
if (element != null) {
@@ -48,6 +48,11 @@ public abstract class DomAnchorImpl<T extends DomElement> implements DomAnchor<T
}
}
+ DomInvocationHandler handler = DomManagerImpl.getNotNullHandler(t);
+ if (handler.getStub() != null) {
+ return new StubAnchor<T>(handler);
+ }
+
final DomElement parent = t.getParent();
if (parent == null) {
LOG.error("Parent null: " + t);
@@ -59,7 +64,7 @@ public abstract class DomAnchorImpl<T extends DomElement> implements DomAnchor<T
return new RootAnchor<T>(fileElement.getFile(), fileElement.getRootElementClass());
}
- final DomAnchorImpl<DomElement> parentAnchor = createAnchor(parent);
+ final DomAnchorImpl<DomElement> parentAnchor = (DomAnchorImpl<DomElement>)createAnchor(parent);
final String name = t.getGenericInfo().getElementName(t);
final AbstractDomChildrenDescription description = t.getChildDescription();
final List<? extends DomElement> values = description.getValues(parent);
@@ -373,9 +378,4 @@ public abstract class DomAnchorImpl<T extends DomElement> implements DomAnchor<T
return myHandler.getXmlElement();
}
}
-
- public static <T extends DomElement> DomAnchor<T> createStubAnchor(T element) {
- DomInvocationHandler handler = DomManagerImpl.getDomInvocationHandler(element);
- return handler.getStub() == null ? createAnchor(element, true) : new StubAnchor<T>(handler);
- }
}