Skip to content

Commit 341eef0

Browse files
author
“A1-4U2T1NN”
committed
fix: ran ./gradlew :exceptions_app:spotlessApply to correct Java formatting;
1 parent 786a5e9 commit 341eef0

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

lesson_14/exceptions/exceptions_app/src/main/java/com/codedifferently/lesson14/ecommerce/EcommerceSystem.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ public String placeOrder(String productId, int quantity) throws ProductNotFoundE
2121
Product product = products.get(productId);
2222
String orderId = UUID.randomUUID().toString();
2323
orders.put(orderId, new Order(orderId, product, quantity));
24-
//Asks if product is null and to throw the exception message 'Product with ID {orderId} not found' if it is.
24+
// Asks if product is null and to throw the exception message 'Product with ID {orderId} not
25+
// found' if it is.
2526
if (product == null) {
2627
throw new ProductNotFoundException("Product with ID " + productId + " not found");
2728
}
@@ -35,7 +36,8 @@ public void cancelOrder(String orderId) {
3536

3637
public String checkOrderStatus(String orderId) throws OrderNotFoundException {
3738
Order order = orders.get(orderId);
38-
//Asks if order is null and to throw the exception message 'Order with ID {orderId} not found' if it is.
39+
// Asks if order is null and to throw the exception message 'Order with ID {orderId} not found'
40+
// if it is.
3941
if (order == null) {
4042
throw new OrderNotFoundException("Order with ID " + orderId + " not found");
4143
}

lesson_14/exceptions/exceptions_app/src/main/java/com/codedifferently/lesson14/ecommerce/OrderNotFoundException.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
*/
55

66
package com.codedifferently.lesson14.ecommerce;
7-
//Custom Exception with the name OrderNotFoundException set to display a string message of your choosing
7+
8+
// Custom Exception with the name OrderNotFoundException set to display a string message of your
9+
// choosing
810
class OrderNotFoundException extends Exception {
911
public OrderNotFoundException(String message) {
1012
super(message);

lesson_14/exceptions/exceptions_app/src/main/java/com/codedifferently/lesson14/ecommerce/ProductNotFoundException.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
*/
55

66
package com.codedifferently.lesson14.ecommerce;
7-
//Custom Exception with the name ProductNotFoundException set to display a string message of your choosing
7+
8+
// Custom Exception with the name ProductNotFoundException set to display a string message of your
9+
// choosing
810
class ProductNotFoundException extends Exception {
911
public ProductNotFoundException(String message) {
1012
super(message);

0 commit comments

Comments
 (0)