googleapis / googleapis/java-bigtable-hbase

OneOf is set multiple times with different values

Aperta Adatta ai principianti
#4,359 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
api: bigtable
Lingua principale
Java
Stelle
184
Fork
184
Merge medio
10h
PR unite (30g)
6

Descrizione

These calls to OneOf setters in `BigtableTableAdminClientWrapper.java` overwrite previously set values:

https://github.com/googleapis/java-bigtable-hbase/blob/d3403e14cf0463d39e71d1af62a81f3c4110d125/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableTableAdminClientWrapper.java#L240

https://github.com/googleapis/java-bigtable-hbase/blob/d3403e14cf0463d39e71d1af62a81f3c4110d125/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableTableAdminClientWrapper.java#L258

This was noticed because of an [Error Prone static check](https://errorprone.info/bugpattern/RedundantSetterCall), which reports the following error for that code:

```
src/main/java/com/google/cloud/bigtable/grpc/BigtableTableAdminClientWrapper.java:240: error: [RedundantSetterCall] The oneof `Target` (set via setDeleteAllDataFromTable, setRowKeyPrefix) was called twice with . Setting the same field multiple times is redundant, and could mask a bug.
.setRowKeyPrefix(rowKeyPrefix)
^
(see https://errorprone.info/bugpattern/RedundantSetterCall)
src/main/java/com/google/cloud/bigtable/grpc/BigtableTableAdminClientWrapper.java:258: error: [RedundantSetterCall] The oneof `Target` (set via setDeleteAllDataFromTable, setRowKeyPrefix) was called twice with . Setting the same field multiple times is redundant, and could mask a bug.
.setRowKeyPrefix(rowKeyPrefix)
^
(see https://errorprone.info/bugpattern/RedundantSetterCall)
```

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start in bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableTableAdminClientWrapper.java at the calls near lines 240 and 258. Read the surrounding OneOf target construction and run the Error Prone RedundantSetterCall check. Done means the redundant setter warnings are resolved without changing the intended target behavior.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java
Ambito
database
Tipo di issue
Bug
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
68/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.