当 @PathVariable 名称声明与形参名称匹配时,报告其冗余。
该快速修复将移除注解中的显式名称特性。
示例:
@GetMapping("/{orderId}")
public Order getOrder(@PathVariable("orderId") Long orderId)
return return orderRepository.findOne(orderId);
}
应用该快速修复后,结果将如下所示:
@GetMapping("/{orderId}")
public Order getOrder(@PathVariable Long orderId)
return orderRepository.findOne(orderId);
}