Skip to content

Commit 47e086d

Browse files
committed
incorporate feedbacks
1 parent 0625f80 commit 47e086d

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

google-cloud-datastore/src/main/java/com/google/cloud/datastore/TransactionExceptionHandler.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222
public class TransactionExceptionHandler {
2323
public static final Interceptor TRANSACTION_EXCEPTION_HANDLER_INTERCEPTOR =
2424
new Interceptor() {
25-
private final int ABORTED_CODE = 10;
25+
private static final int ABORTED_CODE = 10;
2626

2727
@Override
2828
public RetryResult beforeEval(Exception exception) {
2929
if (exception instanceof DatastoreException) {
3030
DatastoreException e = getInnerException((DatastoreException) exception);
31-
if (e.getCode() == ABORTED_CODE || e.getReason() == "ABORTED") {
31+
if (e.getCode() == ABORTED_CODE || e.getReason().equals("ABORTED")) {
3232
return Interceptor.RetryResult.RETRY;
3333
}
3434
}
@@ -55,4 +55,7 @@ public static ExceptionHandler build() {
5555
DatastoreImpl.EXCEPTION_HANDLER_INTERCEPTOR, TRANSACTION_EXCEPTION_HANDLER_INTERCEPTOR)
5656
.build();
5757
}
58+
59+
/** Intentionally private empty constructor to disable instantiation of this class. */
60+
private TransactionExceptionHandler() {}
5861
}

0 commit comments

Comments
 (0)