blob: 8de47717afb1946768a400bee57ab3e4e0dfe569 [file] [log] [blame]
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to you 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.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Signatures of APIs to avoid.
# Cribbed from Elasticsearch
java.lang.Character#codePointBefore(char[],int) @ Implicit start offset is error-prone when the char[] is a buffer and the first chars are random chars
java.lang.Character#codePointAt(char[],int) @ Implicit end offset is error-prone when the char[] is a buffer and the last chars are random chars
@defaultMessage Only use wait / notify when really needed try to use concurrency primitives, latches or callbacks instead.
java.lang.Object#wait()
java.lang.Object#wait(long)
java.lang.Object#wait(long,int)
java.lang.Object#notify()
java.lang.Object#notifyAll()
@defaultMessage If you want regex use Pattern.compile; otherwise String.replace is faster
java.lang.String#replaceAll(java.lang.String, java.lang.String)
@defaultMessage Use toLowerCase(Locale.ROOT) and toUpperCase(Locale.ROOT)
java.lang.String#toUpperCase()
java.lang.String#toLowerCase()
@defaultMessage Use StringBuilder; it is more efficient
java.lang.StringBuffer
@defaultMessage Please do not try to stop the world
java.lang.System#gc()
@defaultMessage Please do not try to kill the world
java.lang.System#exit(int)
java.lang.Runtime#exit(int)
@defaultMessage Don't interrupt threads use FutureUtils#cancel(Future<T>) instead
java.util.concurrent.Future#cancel(boolean)
@defaultMessage Spawning processes is a potential security issue
java.lang.ProcessBuilder
java.lang.Runtime#exec(java.lang.String)
java.lang.Runtime#exec(java.lang.String[])
java.lang.Runtime#exec(java.lang.String, java.lang.String[])
java.lang.Runtime#exec(java.lang.String, java.lang.String[], java.io.File)
java.lang.Runtime#exec(java.lang.String[], java.lang.String[])
java.lang.Runtime#exec(java.lang.String[], java.lang.String[], java.io.File)
@defaultMessage For an enum, use == rather than equals
java.lang.Enum#equals(java.lang.Object)
@defaultMessage It does not handle encoded URLs, use Sources.of(URL).file() instead
java.net.URL#getPath()
# Preconditions.checkArgument,
# Preconditions.checkPositionIndex, and
# Preconditions.checkState are still OK
@defaultMessage Use Objects.requireNonNull
com.google.common.base.Preconditions#checkNotNull(java.lang.Object)
com.google.common.base.Preconditions#checkNotNull(java.lang.Object, java.lang.Object)
@defaultMessage Use java.util.Objects.equals
com.google.common.base.Objects#equal(java.lang.Object, java.lang.Object)
@defaultMessage Use java.util.Objects
com.google.common.base.Objects
@defaultMessage Use java.lang.String.join
com.google.common.base.Joiner
# Remove Guava calls to construct empty collections;
# Sets.identityHashSet(),
# Sets.newHashSet(Iterable) are still OK
@defaultMessage Use "new ArrayList<>()"
com.google.common.collect.Lists#newArrayList()
@defaultMessage Use "org.apache.calcite.util.Util#transform(List, Function)"
com.google.common.collect.Lists#transform(java.util.List, com.google.common.base.Function)
@defaultMessage Use "org.apache.calcite.util.Util#transform(Iterable, Function)"
com.google.common.collect.Iterables#transform(java.lang.Iterable, com.google.common.base.Function)
@defaultMessage Use "new HashMap<>()"
com.google.common.collect.Maps#newHashMap()
@defaultMessage Use "new IdentityHashMap<>()"
com.google.common.collect.Maps#newIdentityHashMap()
@defaultMessage Use "new TreeMap<>()"
com.google.common.collect.Maps#newTreeMap()
@defaultMessage Use "new HashSet<>()"
com.google.common.collect.Sets#newHashSet()