Skip to content

Commit 1f94483

Browse files
committed
fix: apply code formatting using Spotless
1 parent 04f2fa9 commit 1f94483

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,25 @@ public void addProduct(String productId, String name) {
1919

2020
public String placeOrder(String productId, int quantity) throws ProductNotFoundException {
2121
Product product = products.get(productId);
22-
if (product == null){
23-
throw new ProductNotFoundException ("Product with ID " + productId + " not found");
22+
if (product == null) {
23+
throw new ProductNotFoundException("Product with ID " + productId + " not found");
2424
}
2525
String orderId = UUID.randomUUID().toString();
2626
orders.put(orderId, new Order(orderId, product, quantity));
2727
return orderId;
2828
}
2929

3030
public void cancelOrder(String orderId) throws OrderNotFoundException {
31-
Order order = orders.remove(orderId);
31+
Order order = orders.remove(orderId);
3232
if (order == null) {
33-
throw new OrderNotFoundException ("Order with ID 1 " + orderId + " not found" );
33+
throw new OrderNotFoundException("Order with ID 1 " + orderId + " not found");
3434
}
3535
}
3636

3737
public String checkOrderStatus(String orderId) throws OrderNotFoundException {
3838
Order order = orders.get(orderId);
3939
if (order == null) {
40-
throw new OrderNotFoundException ("Order with ID " + orderId + " not found" );
40+
throw new OrderNotFoundException("Order with ID " + orderId + " not found");
4141
}
4242
return "Order ID: "
4343
+ orderId
@@ -46,4 +46,4 @@ public String checkOrderStatus(String orderId) throws OrderNotFoundException {
4646
+ ", Quantity: "
4747
+ order.getQuantity();
4848
}
49-
}
49+
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
package com.codedifferently.lesson14.ecommerce;
77

88
public class OrderNotFoundException extends Exception {
9-
public OrderNotFoundException (String message) {
10-
super (message);
11-
}
9+
public OrderNotFoundException(String message) {
10+
super(message);
11+
}
1212
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
package com.codedifferently.lesson14.ecommerce;
77

8-
public class ProductNotFoundException extends Exception{
9-
public ProductNotFoundException (String message) {
10-
super (message);
11-
}
8+
public class ProductNotFoundException extends Exception {
9+
public ProductNotFoundException(String message) {
10+
super(message);
11+
}
1212
}

0 commit comments

Comments
 (0)