зеркало из https://github.com/github/vitess-gh.git
In java, proto3 strings are never null.
Back-porting an internal fix. Signed-off-by: Alain Jobart <alainjobart@google.com>
This commit is contained in:
Родитель
5501814177
Коммит
41ed273cab
|
@ -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.checkArgument;
|
|||
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<Field>} that also facilitates lookup by field name.
|
||||
|
@ -58,11 +58,11 @@ public class FieldMap {
|
|||
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('.');
|
||||
|
|
Загрузка…
Ссылка в новой задаче