youzipi commented on code in PR #17691: URL: https://github.com/apache/pulsar/pull/17691#discussion_r979728197
########## managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedCursor.java: ########## @@ -18,13 +18,13 @@ */ package org.apache.bookkeeper.mledger; -import com.google.common.base.Predicate; import com.google.common.collect.Range; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.Set; import java.util.concurrent.CompletableFuture; +import java.util.function.Predicate; Review Comment:  ``` /Users/mac/projects/source_code/pulsar/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription$3.java:-1: Prefer java.util.function.Predicate ``` here is the only one `guava Predicate` in PersistentSubscription, an anonymous class: https://github.com/apache/pulsar/blob/e73b29863614a210d14e105c26f691c29d0548d5/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java#L558-L563 --- moderinzer use ASM to scan the class files and detect the latency usage. current rule only detect `implementing legacy interfaces`, see https://github.com/gaul/modernizer-maven-plugin/issues/1 I build a test case and debug it, found that modernizer use a map to store all rules, and match with the class token by `absolutely equal`(not `contains`): ```java private final Map<String, Violation> violations; ... Violation violation = violations.get(token); checkToken(token, violation, name, lineNumber); ``` actually, this case is detected in the interface list, that is where the `lineNumber=-1` from: ```java for (String itr : interfaces) { Violation violation = violations.get(itr); checkToken(itr, violation, name, /*lineNumber=*/ -1); } ``` -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
