-
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
[Pulsar client] Enable spotbugs in module pulsar-client. #9630
[Pulsar client] Enable spotbugs in module pulsar-client. #9630
Conversation
(op.cmd == null ? null : op.cmd.getClass().getName())); | ||
log.warn("[{}] Failed while casting {} into ByteBufPair", producerName, null); |
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.
This will cause the log always print casting null?
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.
the op.cmd is always null, i will delete print it .
@@ -49,7 +49,7 @@ | |||
private transient ServiceUrlProvider serviceUrlProvider; | |||
|
|||
@JsonIgnore | |||
private Authentication authentication = AuthenticationDisabled.INSTANCE; | |||
private Authentication authentication; |
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.
Why need to remove the default value?
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.
it has no any meaning.
public Authentication getAuthentication() {
if (authentication == null) {
this.authentication = new AuthenticationDisabled();
}
return authentication;
}
@@ -66,7 +66,7 @@ public GenericAvroReader(Schema writerSchema, Schema readerSchema, byte[] schema | |||
this.reader = new GenericDatumReader<>(writerSchema, readerSchema); | |||
} | |||
this.byteArrayOutputStream = new ByteArrayOutputStream(); | |||
this.encoder = EncoderFactory.get().binaryEncoder(this.byteArrayOutputStream, encoder); | |||
this.encoder = EncoderFactory.get().binaryEncoder(this.byteArrayOutputStream, null); |
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.
Use null will avoid reusing the encode?
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.
It doesn't make any sense, the encoder in this time is always null. same below.
@@ -37,7 +37,7 @@ | |||
public GenericAvroWriter(Schema schema) { | |||
this.writer = new GenericDatumWriter<>(schema); | |||
this.byteArrayOutputStream = new ByteArrayOutputStream(); | |||
this.encoder = EncoderFactory.get().binaryEncoder(this.byteArrayOutputStream, encoder); | |||
this.encoder = EncoderFactory.get().binaryEncoder(this.byteArrayOutputStream, null); |
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.
Same as the above comment.
@@ -40,7 +40,7 @@ public AvroWriter(Schema schema) { | |||
|
|||
public AvroWriter(Schema schema, boolean jsr310ConversionEnabled) { | |||
this.byteArrayOutputStream = new ByteArrayOutputStream(); | |||
this.encoder = EncoderFactory.get().binaryEncoder(this.byteArrayOutputStream, this.encoder); | |||
this.encoder = EncoderFactory.get().binaryEncoder(this.byteArrayOutputStream, null); |
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.
Same as the above comment
/pulsarbot run-failure-checks |
1 similar comment
/pulsarbot run-failure-checks |
- apache#9630 and apache#9329 were merged concurrently which caused the master branch to break - fixes SpotBugs error "Medium: org.apache.pulsar.client.impl.ConsumerBase.NONE_KEY should be package protected [org.apache.pulsar.client.impl.ConsumerBase] At ConsumerBase.java:[line 887] MS_PKGPROTECT"
Motivation
Enable spotbugs in module pulsar-client.
Does this pull request potentially affect one of the following parts:
If yes was chosen, please highlight the changes
Dependencies (does it add or upgrade a dependency): (no)
The public API: (no)
The schema: (no)
The default values of configurations: (no)
The wire protocol: (no)
The rest endpoints: (no)
The admin cli options: (no)
Anything that affects deployment: (no)