Skip to content

Commit e29c35c

Browse files
BENCH-153 Addressed Andrews PR Comment: renamed local variable name within retireProduct in ProductService
1 parent 5ef2061 commit e29c35c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/java/com/answerdigital/academy/answerking/service/ProductService.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ public Product updateProduct(final long productId, final ProductRequest productR
5555
}
5656

5757
public Product retireProduct(final long productId) {
58-
final Product productToRetire = findById(productId);
59-
if (productToRetire.isRetired()) {
58+
final Product product = findById(productId);
59+
if (product.isRetired()) {
6060
throw new RetirementException(String.format("The product with ID %d is already retired", productId));
6161
}
62-
productToRetire.setRetired(true);
63-
return productRepository.save(productToRetire);
62+
product.setRetired(true);
63+
return productRepository.save(product);
6464
}
6565
}

0 commit comments

Comments
 (0)