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

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

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


##########
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:
   Changes here are not necessary. Currently there is no strong code indent rule in the Java code. Please revert these changes.



-- 
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