From b824aef12961ca600e847c73e4edbfb1c4372fb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yann=20C=C3=A9bron?= Date: Wed, 6 May 2015 11:43:41 +0200 Subject: [PATCH] DOM: CollectionElementInvocationHandler.getValue() must use Stub --- .../xml/impl/CollectionElementInvocationHandler.java | 11 ++++++++--- xml/dom-tests/testData/stubs/foo.xml | 6 ++++++ .../com/intellij/util/xml/stubs/DomStubUsingTest.java | 9 ++++++++- .../tests/com/intellij/util/xml/stubs/model/Foo.java | 3 +++ 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/CollectionElementInvocationHandler.java b/xml/dom-impl/src/com/intellij/util/xml/impl/CollectionElementInvocationHandler.java index e30246ee6191..6751f9a6a769 100644 --- a/xml/dom-impl/src/com/intellij/util/xml/impl/CollectionElementInvocationHandler.java +++ b/xml/dom-impl/src/com/intellij/util/xml/impl/CollectionElementInvocationHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,8 +16,8 @@ package com.intellij.util.xml.impl; import com.intellij.openapi.util.Factory; -import com.intellij.psi.xml.XmlTag; import com.intellij.psi.xml.XmlElement; +import com.intellij.psi.xml.XmlTag; import com.intellij.util.xml.DomElement; import com.intellij.util.xml.EvaluatedXmlName; import com.intellij.util.xml.events.DomEvent; @@ -32,7 +32,7 @@ import java.util.List; /** * @author peter */ -public class CollectionElementInvocationHandler extends DomInvocationHandler{ +public class CollectionElementInvocationHandler extends DomInvocationHandler { public CollectionElementInvocationHandler(final Type type, @NotNull final XmlTag tag, final AbstractCollectionChildDescription description, @@ -47,7 +47,12 @@ public class CollectionElementInvocationHandler extends DomInvocationHandler foo + + list0 + + + list1 + \ No newline at end of file diff --git a/xml/dom-tests/tests/com/intellij/util/xml/stubs/DomStubUsingTest.java b/xml/dom-tests/tests/com/intellij/util/xml/stubs/DomStubUsingTest.java index cd00fc62143e..42c6c7c4795d 100644 --- a/xml/dom-tests/tests/com/intellij/util/xml/stubs/DomStubUsingTest.java +++ b/xml/dom-tests/tests/com/intellij/util/xml/stubs/DomStubUsingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,6 +46,13 @@ public class DomStubUsingTest extends DomStubTest { List bars = foo.getBars(); assertFalse(file.getNode().isParsed()); + final List> listElements = foo.getLists(); + final GenericDomValue listElement0 = listElements.get(0); + assertEquals("list0", listElement0.getValue()); + final GenericDomValue listElement1 = listElements.get(1); + assertEquals("list1", listElement1.getValue()); + assertFalse(file.getNode().isParsed()); + assertEquals(2, bars.size()); Bar bar = bars.get(0); String value = bar.getString().getStringValue(); diff --git a/xml/dom-tests/tests/com/intellij/util/xml/stubs/model/Foo.java b/xml/dom-tests/tests/com/intellij/util/xml/stubs/model/Foo.java index f39351cde5bc..eb58b3dedf2c 100644 --- a/xml/dom-tests/tests/com/intellij/util/xml/stubs/model/Foo.java +++ b/xml/dom-tests/tests/com/intellij/util/xml/stubs/model/Foo.java @@ -31,6 +31,9 @@ public interface Foo extends DomElement { @Stubbed GenericDomValue getId(); + @Stubbed + List> getLists(); + @Stubbed List getBars();