-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[cleanup][broker][Modernizer] fix violations in pulsar-broker #17275
Conversation
/pulsarbot run-failure-checks |
/pulsarbot run-failure-checks |
@@ -71,7 +71,7 @@ public void testFilterOutForPreInterceptFilter() throws Exception { | |||
Mockito.doNothing().when(chain).doFilter(Mockito.any(), Mockito.any()); | |||
HttpServletRequestWrapper mockInputStream = new MockRequestWrapper(request); | |||
Mockito.doReturn(mockInputStream.getInputStream()).when(request).getInputStream(); | |||
Mockito.doReturn(new StringBuffer("http://127.0.0.1:8080")).when(request).getRequestURL(); | |||
Mockito.doReturn(new StringBuilder("http://127.0.0.1:8080")).when(request).getRequestURL(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
method signature is StringBuffer getRequestURL();
, so can't use StringBuilder here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I saw the failed case.
I plan to exclude this rule.
I created an issue:
gaul/modernizer-maven-plugin#149
they insist this as a default rule.
02b0b06
to
1ba1ba0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
/pulsarbot run-failure-checks |
1 similar comment
/pulsarbot run-failure-checks |
I can't trigger the checks. |
I think there were some CI changes that happened yesterday, you can merge the latest master and things should be fine. Ping me if it still doesn't work for you. |
@tisonkun |
@youzipi this is correct. Other tasks will be scheduled after the prerequisites are finished. And now we squash all required tasks into two final steps (Pulsar CI checks completed & cpp-tests). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. ping @codelipenghui
<ignorePackage>org.apache.pulsar.client</ignorePackage> | ||
</ignorePackages> | ||
<exclusionPatterns> | ||
<exclusionPattern>java/lang/StringBuffer."<init>":.*</exclusionPattern> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@youzipi may I ask the reason you add this pattern?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tisonkun
there is a conflict between mockito and moderinizer:
moderinizer prefers StringBuilder
instead of StringBuffer
always,
but Mockito.doReturn(new StringBuilder("http://127.0.0.1:8080")).when(request).getRequestURL();
will fail in CI as type not match.
former discussion:
#17275 (comment)
Master Issue: #12271 #16991
Motivation
Apply Maven Modernizer plugin to enforce we move away from legacy APIs.
Modifications
fix violations in pulsar-broker
Verifying this change
This change is already covered by existing tests, such as (please describe tests).
Does this pull request potentially affect one of the following parts:
Documentation
doc-not-needed