From 41ed273cab8f47b5130fdb61a1876d4f8c4d02bb Mon Sep 17 00:00:00 2001 From: Alain Jobart Date: Wed, 18 Jul 2018 10:47:05 -0700 Subject: [PATCH] In java, proto3 strings are never null. Back-porting an internal fix. Signed-off-by: Alain Jobart --- .../main/java/io/vitess/client/cursor/FieldMap.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/java/client/src/main/java/io/vitess/client/cursor/FieldMap.java b/java/client/src/main/java/io/vitess/client/cursor/FieldMap.java index 7f7af532c06..3826d0782a7 100644 --- a/java/client/src/main/java/io/vitess/client/cursor/FieldMap.java +++ b/java/client/src/main/java/io/vitess/client/cursor/FieldMap.java @@ -1,12 +1,12 @@ /* * Copyright 2017 Google Inc. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -20,12 +20,12 @@ import static com.google.common.base.Preconditions.checkNotNull; import com.google.common.collect.ImmutableList; +import io.vitess.proto.Query.Field; import java.util.List; import java.util.Map; import javax.annotation.Nullable; import org.apache.commons.collections4.map.CaseInsensitiveMap; -import io.vitess.proto.Query.Field; /** * A wrapper for {@code List} that also facilitates lookup by field name. @@ -58,11 +58,11 @@ public FieldMap(Iterable fields) { labelMap.put(columnLabel, columnIndex); } String origName = field.getOrgName(); - if (origName != null && !"".equals(origName) && !nameMap.containsKey(origName)) { + if (!"".equals(origName) && !nameMap.containsKey(origName)) { nameMap.put(origName, columnIndex); } String tableName = field.getTable(); - if (tableName != null && !"".equals(tableName)) { + if (!"".equals(tableName)) { StringBuilder fullNameBuf = new StringBuilder(); fullNameBuf.append(tableName); fullNameBuf.append('.');