From 4e0e3917981c97716b47fcaff3d0ee33a22e3c1e Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 17 Dec 2018 13:48:12 +0100 Subject: [PATCH] [IDEA-204272] Fix varargs params losing generic info Regression introduced in commit 82a2939271c55732637cf921ba447af6caef796b "java-decompiler: cleanups and fixes" --- .../struct/gen/generics/GenericType.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/org/jetbrains/java/decompiler/struct/gen/generics/GenericType.java b/src/org/jetbrains/java/decompiler/struct/gen/generics/GenericType.java index 4b213a0..fa0256d 100644 --- a/src/org/jetbrains/java/decompiler/struct/gen/generics/GenericType.java +++ b/src/org/jetbrains/java/decompiler/struct/gen/generics/GenericType.java @@ -1,4 +1,4 @@ -// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.java.decompiler.struct.gen.generics; import org.jetbrains.java.decompiler.code.CodeConstants; @@ -28,6 +28,17 @@ public class GenericType { this.value = value; } + public GenericType(GenericType other, int arrayDim) { + this.type = other.type; + this.value = other.value; + + this.enclosingClasses.addAll(other.enclosingClasses); + this.arguments.addAll(other.arguments); + this.wildcards.addAll(other.wildcards); + + this.arrayDim = arrayDim; + } + public GenericType(String signature) { int type = 0; int arrayDim = 0; @@ -197,7 +208,7 @@ public class GenericType { public GenericType decreaseArrayDim() { assert arrayDim > 0 : this; - return new GenericType(type, arrayDim - 1, value); + return new GenericType(this, arrayDim - 1); } public List getArguments() {