File tree Expand file tree Collapse file tree
google-cloud-datastore/src/main/java/com/google/cloud/datastore Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222public 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}
You can’t perform that action at this time.
0 commit comments