public void replaceDeclaredTypeParameters(List<JvmTypeParameter> typeParameters) { List<JvmTypeParameter> list = basicGetDeclardTypeParameters(); if (list != null) { throw new IllegalStateException( "Cannot replace declared type parameters if there are already type parameters in this StackedResolvedTypes"); } super.addDeclaredTypeParameters(typeParameters); }
@Override public void addDeclaredTypeParameters(List<JvmTypeParameter> typeParameters) { if (typeParameters.isEmpty()) return; List<JvmTypeParameter> list = basicGetDeclardTypeParameters(); if (list == null) { super.addDeclaredTypeParameters(parent.getDeclaredTypeParameters()); getDeclaredTypeParameters().addAll(typeParameters); } else { list.addAll(typeParameters); } }