Repository navigation
[cleanup][broker][Modernizer] fix violations in pulsar-broker - #17275
Conversation
|
/pulsarbot run-failure-checks |
|
/pulsarbot run-failure-checks |
| 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.
method signature is StringBuffer getRequestURL();, so can't use StringBuilder here.
There was a problem hiding this comment.
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
|
/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). |
| <ignorePackage>org.apache.pulsar.client</ignorePackage> | ||
| </ignorePackages> | ||
| <exclusionPatterns> | ||
| <exclusionPattern>java/lang/StringBuffer."<init>":.*</exclusionPattern> |
There was a problem hiding this comment.
@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