8000 Remove examples if-then-else pattern · Issue #618 · googleapis/google-cloud-java · GitHub
[go: up one dir, main page]

Skip to content

Remove examples if-then-else pattern #618

@mziccard

Description

@mziccard

In bigquery example we have the following patttern:

Table table = getTable(...);
if (table == null) {
  // create table
} else {
  // load data
}

in storage we have:

Blob blob = getBlob(...);
if (blob == null) {
  // create blob
} else {
  // get and update blob's content
}

In both cases we should remove the else branch and rather execute it after table/blob creation.

Also in datastore we do:

Entity entity = getEntity(...);
if (entity = null) {
  // create entity
} else {
  // update entity access type
}

@ajkannan @aozarov @mderka Do you guys think we should remove the else branch also for datastore's example? It makes slightly less sense to me.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0