Skip to content

Commit d05ad30

Browse files
committed
remove unnecessary null check
1 parent fec352d commit d05ad30

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -509,9 +509,7 @@ public com.google.api.services.bigquery.model.Dataset call() throws IOException
509509
BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER,
510510
getOptions().getClock(),
511511
EMPTY_RETRY_CONFIG);
512-
// This null check is not strictly necessary as getDatasetSkipExceptionTranslation will never
513-
// return null.
514-
return answer == null ? null : Dataset.fromPb(this, answer);
512+
return Dataset.fromPb(this, answer);
515513
} catch (BigQueryRetryHelperException e) {
516514
if (isRetryErrorCodeHttpNotFound(e)) {
517515
if (getOptions().getThrowNotFound()) {
@@ -865,9 +863,7 @@ public com.google.api.services.bigquery.model.Table call() throws IOException {
865863
BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER,
866864
getOptions().getClock(),
867865
EMPTY_RETRY_CONFIG);
868-
// This null check is not strictly necessary as getTableSkipExceptionTranslation will never
869-
// return null.
870-
return answer == null ? null : Table.fromPb(this, answer);
866+
return Table.fromPb(this, answer);
871867
} catch (BigQueryRetryHelperException e) {
872868
if (isRetryErrorCodeHttpNotFound(e)) {
873869
if (getOptions().getThrowNotFound()) {
@@ -909,9 +905,7 @@ public com.google.api.services.bigquery.model.Model call() throws IOException {
909905
BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER,
910906
getOptions().getClock(),
911907
EMPTY_RETRY_CONFIG);
912-
// This null check is not strictly necessary as getModelSkipExceptionTranslation will never
913-
// return null.
914-
return answer == null ? null : Model.fromPb(this, answer);
908+
return Model.fromPb(this, answer);
915909
} catch (BigQueryRetryHelperException e) {
916910
if (isRetryErrorCodeHttpNotFound(e)) {
917911
if (getOptions().getThrowNotFound()) {
@@ -953,9 +947,7 @@ public com.google.api.services.bigquery.model.Routine call() throws IOException
953947
BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER,
954948
getOptions().getClock(),
955949
EMPTY_RETRY_CONFIG);
956-
// This null check is not strictly necessary as getRoutineSkipExceptionTranslation will never
957-
// return null.
958-
return answer == null ? null : Routine.fromPb(this, answer);
950+
return Routine.fromPb(this, answer);
959951
} catch (BigQueryRetryHelperException e) {
960952
if (isRetryErrorCodeHttpNotFound(e)) {
961953
if (getOptions().getThrowNotFound()) {
@@ -1324,9 +1316,7 @@ public com.google.api.services.bigquery.model.Job call() throws IOException {
13241316
BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER,
13251317
getOptions().getClock(),
13261318
EMPTY_RETRY_CONFIG);
1327-
// This null check is not strictly necessary as getJobSkipExceptionTranslation will never
1328-
// return null.
1329-
return answer == null ? null : Job.fromPb(this, answer);
1319+
return Job.fromPb(this, answer);
13301320
} catch (BigQueryRetryHelperException e) {
13311321
if (isRetryErrorCodeHttpNotFound(e)) {
13321322
if (getOptions().getThrowNotFound()) {

0 commit comments

Comments
 (0)