Skip to content

Commit 94ca80d

Browse files
author
Mairbek Khadikov
committed
Make codacy-bot happy
1 parent 4fbb46a commit 94ca80d

3 files changed

Lines changed: 12 additions & 8 deletions

File tree

google-cloud-spanner/src/main/java/com/google/cloud/spanner/GrpcStruct.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ static Object fromTypedProto(Value proto) {
121121
return decodeValue(type, proto.getListValue().getValues(1));
122122
}
123123

124-
private static Object decodeValue(Type fieldType, com.google.protobuf.Value proto) {
124+
private static Object decodeValue(Type fieldType, Value proto) {
125125
if (proto.getKindCase() == Value.KindCase.NULL_VALUE) {
126126
return null;
127127
}
@@ -263,7 +263,7 @@ private static void checkType(Type fieldType, Value proto, Value.KindCase expect
263263
}
264264
}
265265

266-
private static double valueProtoToFloat64(com.google.protobuf.Value proto) {
266+
private static double valueProtoToFloat64(Value proto) {
267267
if (proto.getKindCase() == Value.KindCase.STRING_VALUE) {
268268
switch (proto.getStringValue()) {
269269
case "-Infinity":
@@ -296,7 +296,7 @@ private static NullPointerException throwNotNull(int columnIndex) {
296296
"Cannot call array getter for column " + columnIndex + " with null elements");
297297
}
298298

299-
boolean consumeRow(Iterator<com.google.protobuf.Value> iterator) {
299+
boolean consumeRow(Iterator<Value> iterator) {
300300
rowData.clear();
301301
if (!iterator.hasNext()) {
302302
return false;
@@ -307,7 +307,7 @@ boolean consumeRow(Iterator<com.google.protobuf.Value> iterator) {
307307
ErrorCode.INTERNAL,
308308
"Invalid value stream: end of stream reached before row is complete");
309309
}
310-
com.google.protobuf.Value value = iterator.next();
310+
Value value = iterator.next();
311311
rowData.add(decodeValue(fieldType.getType(), value));
312312
}
313313
return true;
@@ -469,7 +469,7 @@ private abstract static class PrimitiveArray<T, A> extends AbstractList<T> {
469469

470470
abstract A newArray(int size);
471471

472-
abstract void setProto(A array, int i, com.google.protobuf.Value protoValue);
472+
abstract void setProto(A array, int i, Value protoValue);
473473

474474
abstract T get(A array, int i);
475475

@@ -511,7 +511,7 @@ long[] newArray(int size) {
511511
}
512512

513513
@Override
514-
void setProto(long[] array, int i, com.google.protobuf.Value protoValue) {
514+
void setProto(long[] array, int i, Value protoValue) {
515515
array[i] = Long.parseLong(protoValue.getStringValue());
516516
}
517517

@@ -536,7 +536,7 @@ private static class Float64Array extends PrimitiveArray<Double, double[]> {
536536
}
537537

538538
@Override
539-
void setProto(double[] array, int i, com.google.protobuf.Value protoValue) {
539+
void setProto(double[] array, int i, Value protoValue) {
540540
array[i] = valueProtoToFloat64(protoValue);
541541
}
542542

google-cloud-spanner/src/main/java/com/google/cloud/spanner/Mutation.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ public enum Op {
8282
DELETE,
8383
}
8484

85+
private static final long serialVersionUID = 1L;
86+
8587
private final String table;
8688
private final Op operation;
8789
private final ImmutableList<String> columns;
@@ -407,6 +409,8 @@ static void toProto(Iterable<Mutation> mutations, List<com.google.spanner.v1.Mut
407409
* A proxy class that handles {@link Mutation} serialization.
408410
*/
409411
private static class SerializationProxy implements Serializable {
412+
private static final long serialVersionUID = 2L;
413+
410414
private com.google.spanner.v1.Mutation proto;
411415

412416
private SerializationProxy(Mutation mutation) {

google-cloud-spanner/src/main/java/com/google/cloud/spanner/Value.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ static Value structArray(Iterable<Type.StructField> fieldTypes, @Nullable Iterab
445445
*/
446446
com.google.protobuf.Value toTypedProto() {
447447
com.google.protobuf.Value.Builder valueBuilder = com.google.protobuf.Value.newBuilder();
448-
com.google.protobuf.ListValue.Builder listBuilder = valueBuilder.getListValueBuilder();
448+
ListValue.Builder listBuilder = valueBuilder.getListValueBuilder();
449449
listBuilder.addValuesBuilder().setStringValueBytes(getType().toProto().toByteString()).build();
450450
listBuilder.addValues(toProto());
451451
return valueBuilder.build();

0 commit comments

Comments
 (0)