mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java-stubs] TypeInfo: fix annotation parsing for multi-parameter generic types (IDEA-356112)
GitOrigin-RevId: 154294caab47747e81b80de26ca1bffd919fce98
This commit is contained in:
committed by
intellij-monorepo-bot
parent
d82076a22c
commit
eafd66854b
@@ -491,12 +491,12 @@ public /*sealed*/ abstract class TypeInfo {
|
||||
else if (refTokenType == JavaElementType.REFERENCE_PARAMETER_LIST) {
|
||||
List<LighterASTNode> subTypes = LightTreeUtil.getChildrenOfType(tree, refChild, JavaElementType.TYPE);
|
||||
if (!subTypes.isEmpty()) {
|
||||
byte[] newPrefix = Arrays.copyOf(prefix, prefix.length + 2);
|
||||
newPrefix[prefix.length] = TypeAnnotationContainer.Collector.TYPE_ARGUMENT;
|
||||
for (int i = 0; i < subTypes.size(); i++) {
|
||||
newPrefix[prefix.length + 1] = (byte)i;
|
||||
TypeInfo componentInfo = info.genericComponent(i);
|
||||
if (componentInfo != null) {
|
||||
byte[] newPrefix = Arrays.copyOf(prefix, prefix.length + 2);
|
||||
newPrefix[prefix.length] = TypeAnnotationContainer.Collector.TYPE_ARGUMENT;
|
||||
newPrefix[prefix.length + 1] = (byte)i;
|
||||
collectAnnotations(componentInfo, collector, tree, subTypes.get(i), newPrefix);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,6 +72,10 @@ public class TypeInfoTest extends LightJavaCodeInsightFixtureTestCase {
|
||||
public void testGenericNested() {
|
||||
doTest("X1<@A2 X2<? extends @A3 X3>>.@A4 X4<@A5 X5,@A6 X6 @A7 []>");
|
||||
}
|
||||
|
||||
public void testGenericNested2() {
|
||||
doTest("List1<Outer.@Anno2 Middle.@Anno @Anno1 Inner,Outer.@Anno2 Middle.@Anno1 @Anno2 Inner>");
|
||||
}
|
||||
|
||||
private void doTest(String typeText) {
|
||||
String javaFile = "class X { " + typeText + " x; }\n" + USED_CLASSES;
|
||||
|
||||
Reference in New Issue
Block a user