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


##########
buildtools/src/main/java/org/apache/pulsar/tests/MockitoThreadLocalStateCleaner.java:
##########
@@ -72,16 +74,33 @@ public void cleanup() {
                         LOG.warn("Invalid usage of Mockito detected on thread 
{}."
                                         + " There is ongoing stubbing on mock 
of class={} instance={}",
                                 thread, mock.getClass().getName(), mock);
+                        try {
+                            clearInvocations(thread, mock);
+                        } catch (Exception e) {
+                            LOG.warn("Clearing invocations failed", e);
+                        }

Review Comment:
   What's the difference between this private method and:
   
   ```java
   import static org.mockito.Mockito.clearInvocations;
   
                           try {
                               clearInvocations(thread, mock);
                           } catch (Exception e) {
                               LOG.warn("Clearing invocations failed", e);
                           }
   ```
   
   I may tend to avoid importing something from `internal` package.



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

Reply via email to