[improvement](broker) TOperationStatus determines that a null pointer is redundant. (#18712)
TOperationStatus determines that a null pointer is redundant. If tOperationStatus is a null pointer, then tOperationStatus.getMessage() will have a null pointer exception.
This commit is contained in:
@ -126,7 +126,9 @@ public class BrokerReader {
|
||||
} catch (TException e) {
|
||||
LOG.warn("Broker close reader failed. fd={}, address={}", fd.toString(), address, e);
|
||||
}
|
||||
if (tOperationStatus == null || tOperationStatus.getStatusCode() != TBrokerOperationStatusCode.OK) {
|
||||
if (tOperationStatus == null) {
|
||||
LOG.warn("Broker close reader failed. fd={}, address={}", fd.toString(), address);
|
||||
} else if (tOperationStatus.getStatusCode() != TBrokerOperationStatusCode.OK) {
|
||||
LOG.warn("Broker close reader failed. fd={}, address={}, error={}", fd.toString(), address,
|
||||
tOperationStatus.getMessage());
|
||||
}
|
||||
|
||||
@ -263,7 +263,7 @@ public class BrokerUtil {
|
||||
LOG.warn("Broker close reader failed. path={}, address={}", path, address, ex);
|
||||
}
|
||||
}
|
||||
if (tOperationStatus == null || tOperationStatus.getStatusCode() != TBrokerOperationStatusCode.OK) {
|
||||
if (tOperationStatus.getStatusCode() != TBrokerOperationStatusCode.OK) {
|
||||
LOG.warn("Broker close reader failed. path={}, address={}, error={}", path, address,
|
||||
tOperationStatus.getMessage());
|
||||
} else {
|
||||
@ -564,7 +564,9 @@ public class BrokerUtil {
|
||||
LOG.warn("Broker close writer failed. filePath={}, address={}", brokerFilePath, address, ex);
|
||||
}
|
||||
}
|
||||
if (tOperationStatus == null || tOperationStatus.getStatusCode() != TBrokerOperationStatusCode.OK) {
|
||||
if (tOperationStatus == null) {
|
||||
LOG.warn("Broker close reader failed. fd={}, address={}", fd.toString(), address);
|
||||
} else if (tOperationStatus.getStatusCode() != TBrokerOperationStatusCode.OK) {
|
||||
LOG.warn("Broker close writer failed. filePath={}, address={}, error={}", brokerFilePath,
|
||||
address, tOperationStatus.getMessage());
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user