aloyszhang commented on a change in pull request #9194:
URL: https://github.com/apache/pulsar/pull/9194#discussion_r556341919



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/intercept/ManagedLedgerInterceptorImpl.java
##########
@@ -81,10 +81,11 @@ public void onManagedLedgerPropertiesInitialize(Map<String, 
String> propertiesMa
 
     @Override
     public void onManagedLedgerLastLedgerInitialize(String name, LedgerHandle 
lh) {
+        LedgerEntries ledgerEntries = null;
         try {
             for (BrokerEntryMetadataInterceptor interceptor : 
brokerEntryMetadataInterceptors) {
                 if (interceptor instanceof AppendIndexMetadataInterceptor && 
lh.getLastAddConfirmed() >= 0) {
-                    LedgerEntries ledgerEntries =
+                    ledgerEntries =

Review comment:
       try-with-resources is alternative way and makes code more tidy. 
    I think it's better to raise an individual issue for refactor code like 
try-with-resources




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to