我收到 PMD 红色违规
避免重新分配参数,例如“bankRequest”
这是我的方法
@Override
public BankDTO loadTariff(BankDTO bankRequest, int[] executionLevels) {
double[] fee = null;
for (int level : executionLevels) {
// Check the tariff availability from execution level one to .....
fee = loadCokaAndBankFee(bankRequest,level);
if (fee != null) { // if fee found reload the bank request with new
// amount
bankRequest = reloadBankRequest(bankRequest, fee);
break; // no need to go for any other level deep level cover //
// here.
} // if tariff not found use the esb provided amounts
}
return bankRequest;
}
有人可以解释这段代码有什么问题。如果我忽略它会有什么影响。