-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,7 +47,7 @@ public class GenericAvroReader implements SchemaReader<GenericRecord> { | |
private final List<Field> fields; | ||
private final Schema schema; | ||
private final byte[] schemaVersion; | ||
private int offset; | ||
private final int offset; | ||
|
||
public GenericAvroReader(Schema schema) { | ||
this(null, schema, null); | ||
|
@@ -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 commentThe 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 commentThe 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. |
||
|
||
if (schema.getObjectProp(GenericAvroSchema.OFFSET_PROP) != null) { | ||
this.offset = Integer.parseInt(schema.getObjectProp(GenericAvroSchema.OFFSET_PROP).toString()); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,7 @@ public class GenericAvroWriter implements SchemaWriter<GenericRecord> { | |
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 commentThe reason will be displayed to describe this comment to others. Learn more. Same as the above comment. |
||
} | ||
|
||
@Override | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. Same as the above comment |
||
ReflectData reflectData = new ReflectData(); | ||
AvroSchema.addLogicalTypeConversions(reflectData, jsr310ConversionEnabled); | ||
this.writer = new ReflectDatumWriter<>(schema, reflectData); | ||
|
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.