public MutableDeclaredType renameTypeParameter(RenameActionType actionType, String parameter, String oldName, boolean recursive) { if (getTypeVariables() == null || getTypeVariables().size() == 0) { return this; } dirty(); for (MutableTypeVariable typeParameter: this.getTypeVariables()) { String variable = typeParameter.getVariable(); if (variable != null && !variable.equals(MutableWildcardType.WILDCARD_NAME)) { if (oldName == null || oldName.equals(variable)) { variable = actionType.apply(variable, parameter); } typeParameter.setVariable(variable); } else if (recursive) { renameBounds(typeParameter.getUpperBounds(), actionType, parameter, oldName, recursive); renameBounds(typeParameter.getLowerBounds(), actionType, parameter, oldName, recursive); } } return this; }