You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "tisonkun (via GitHub)" <gi...@apache.org> on 2023/04/14 17:00:44 UTC

[GitHub] [pulsar] tisonkun commented on a diff in pull request #20096: [improve][broker] Harden non-null checker

tisonkun commented on code in PR #20096:
URL: https://github.com/apache/pulsar/pull/20096#discussion_r1167084512


##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java:
##########
@@ -3066,34 +3068,38 @@ boolean shouldCloseLedger(LedgerHandle lh) {
         }
     }
 
-    void switchToNewLedger(final LedgerHandle lh, final VoidCallback callback) {
+    void switchToNewLedger(@Nonnull LedgerHandle lh, VoidCallback callback) {
+        requireNonNull(lh, "LedgerHandle should not be null");
+
         if (log.isDebugEnabled()) {
             log.debug("[{}] Switching cursor {} to ledger {}", ledger.getName(), name, lh.getId());
         }
+
         persistPositionMetaStore(lh.getId(), lastMarkDeleteEntry.newPosition, lastMarkDeleteEntry.properties,
-                new MetaStoreCallback<Void>() {

Review Comment:
   Reverted.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org