Skip to content

Commit 610d1f5

Browse files
brfrn169josh-wong
andauthored
Apply suggestions from code review
Co-authored-by: Josh Wong <[email protected]>
1 parent 0e9d5e3 commit 610d1f5

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

microservice-transaction-sample-with-shared-cluster-with-jdbc/client/src/main/java/sample/client/command/RepaymentCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class RepaymentCommand implements Callable<Integer> {
1414
@Parameters(index = "0", paramLabel = "CUSTOMER_ID", description = "customer ID")
1515
private int customerId;
1616

17-
@Parameters(index = "1", paramLabel = "AMOUNT", description = "amount of the money for repayment")
17+
@Parameters(index = "1", paramLabel = "AMOUNT", description = "repayment amount")
1818
private int amount;
1919

2020
@Override

microservice-transaction-sample-with-shared-cluster-with-jdbc/client/src/main/java/sample/client/command/Utils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public static void shutdownChannel(ManagedChannel channel) {
2323
try {
2424
channel.shutdown().awaitTermination(5, TimeUnit.SECONDS);
2525
} catch (InterruptedException e) {
26-
System.err.println("failed to shutdown the channel");
26+
System.err.println("failed to shut down the channel");
2727
}
2828
}
2929

microservice-transaction-sample-with-shared-cluster-with-jdbc/customer-service/src/main/java/sample/customer/CustomerService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,9 @@ public void repayment(
165165

166166
int updatedCreditTotal = result.get().creditTotal - request.getAmount();
167167

168-
// Check if over repayment or not
168+
// Check if over-repayment or not
169169
if (updatedCreditTotal < 0) {
170-
throw Status.FAILED_PRECONDITION.withDescription("Over repayment").asRuntimeException();
170+
throw Status.FAILED_PRECONDITION.withDescription("Over-repayment").asRuntimeException();
171171
}
172172

173173
// Reduce credit_total for the customer

microservice-transaction-sample-with-shared-cluster-with-jdbc/order-service/src/main/java/sample/order/OrderService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,11 +385,11 @@ private void closeConnection(Connection connection) {
385385

386386
@Override
387387
public void close() {
388-
// Shutdown the gRPC channel to Customer service
388+
// Shut down the gRPC channel to Customer service
389389
try {
390390
channel.shutdown().awaitTermination(5, TimeUnit.SECONDS);
391391
} catch (InterruptedException e) {
392-
logger.warn("Failed to shutdown the channel", e);
392+
logger.warn("Failed to shut down the channel", e);
393393
}
394394
}
395395
}

0 commit comments

Comments
 (0)