Skip to content

Commit

Permalink
Fix unboxing npe in SendMessageRequestHeader (apache#7873)
Browse files Browse the repository at this point in the history
  • Loading branch information
drpmma authored Mar 1, 2024
1 parent a33f1d1 commit cb9ea9e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ public class SendMessageRequestHeader extends TopicQueueRequestHeader {
@CFNullable
private Integer reconsumeTimes;
@CFNullable
private boolean unitMode = false;
private Boolean unitMode;
@CFNullable
private boolean batch = false;
private Boolean batch;
private Integer maxReconsumeTimes;

@Override
Expand Down Expand Up @@ -136,6 +136,9 @@ public void setProperties(String properties) {
}

public Integer getReconsumeTimes() {
if (null == reconsumeTimes) {
return 0;
}
return reconsumeTimes;
}

Expand All @@ -144,10 +147,13 @@ public void setReconsumeTimes(Integer reconsumeTimes) {
}

public boolean isUnitMode() {
if (null == unitMode) {
return false;
}
return unitMode;
}

public void setUnitMode(boolean isUnitMode) {
public void setUnitMode(Boolean isUnitMode) {
this.unitMode = isUnitMode;
}

Expand All @@ -160,10 +166,13 @@ public void setMaxReconsumeTimes(final Integer maxReconsumeTimes) {
}

public boolean isBatch() {
if (null == batch) {
return false;
}
return batch;
}

public void setBatch(boolean batch) {
public void setBatch(Boolean batch) {
this.batch = batch;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class SendMessageRequestHeaderV2 extends TopicQueueRequestHeader implemen
@CFNullable
private Integer j; // reconsumeTimes;
@CFNullable
private Boolean k; // unitMode = false;
private Boolean k; // unitMode;

private Integer l; // consumeRetryTimes

Expand Down

0 comments on commit cb9ea9e

Please sign in to comment.