[IDEA-204272] Fix varargs params losing generic info

Regression introduced in commit 82a2939271
"java-decompiler: cleanups and fixes"
This commit is contained in:
md_5
2018-12-17 13:48:12 +01:00
committed by Roman Shevchenko
parent f320e3abd4
commit 4e0e391798

View File

@@ -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; package org.jetbrains.java.decompiler.struct.gen.generics;
import org.jetbrains.java.decompiler.code.CodeConstants; import org.jetbrains.java.decompiler.code.CodeConstants;
@@ -28,6 +28,17 @@ public class GenericType {
this.value = value; 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) { public GenericType(String signature) {
int type = 0; int type = 0;
int arrayDim = 0; int arrayDim = 0;
@@ -197,7 +208,7 @@ public class GenericType {
public GenericType decreaseArrayDim() { public GenericType decreaseArrayDim() {
assert arrayDim > 0 : this; assert arrayDim > 0 : this;
return new GenericType(type, arrayDim - 1, value); return new GenericType(this, arrayDim - 1);
} }
public List<GenericType> getArguments() { public List<GenericType> getArguments() {