2018-10-29 08:02:43 -04:00
com.fasterxml.jackson.databind.ObjectMapper#reader(com.fasterxml.jackson.core.type.TypeReference) @ Use ObjectMapper#readerFor instead
com.fasterxml.jackson.databind.ObjectMapper#reader(com.fasterxml.jackson.databind.JavaType) @ Use ObjectMapper#readerFor instead
com.fasterxml.jackson.databind.ObjectMapper#reader(java.lang.Class) @ Use ObjectMapper#readerFor instead
2022-04-27 17:17:26 -04:00
com.fasterxml.jackson.databind.ObjectMapper#writeValue(com.fasterxml.jackson.core.JsonGenerator, java.lang.Object) @ Use JacksonUtils#writeObjectUsingSerializerProvider to allow SerializerProvider reuse
com.fasterxml.jackson.core.JsonGenerator#writeObject(java.lang.Object) @ Use JacksonUtils#writeObjectUsingSerializerProvider to allow SerializerProvider reuse
2018-10-29 08:02:43 -04:00
com.google.common.base.Charsets @ Use java.nio.charset.StandardCharsets instead
com.google.common.collect.Iterators#emptyIterator() @ Use java.util.Collections#emptyIterator()
GroupBy: Reduce allocations by reusing entry and key holders. (#12474)
* GroupBy: Reduce allocations by reusing entry and key holders.
Two main changes:
1) Reuse Entry objects returned by various implementations of
Grouper.iterator.
2) Reuse key objects contained within those Entry objects.
This is allowed by the contract, which states that entries must be
processed and immediately discarded. However, not all call sites
respected this, so this patch also updates those call sites.
One particularly sneaky way that the old code retained entries too long
is due to Guava's MergingIterator and CombiningIterator. Internally,
these both advance to the next value prior to returning the current
value. So, this patch addresses that in two ways:
1) For merging, we have our own implementation MergeIterator already,
although it had the same problem. So, this patch updates our
implementation to return the current item prior to advancing to the
next item. It also adds a forbidden-api entry to ensure that this
safer implementation is used instead of Guava's.
2) For combining, we address the problem in a different way: by copying
the key when creating the new, combined entry.
* Attempt to fix test.
* Remove unused import.
2022-04-29 02:21:13 -04:00
com.google.common.collect.Iterators#mergeSorted(java.lang.Iterable,java.util.Comparator) @ Use org.apache.druid.java.util.common.collect.Utils#mergeSorted()
2018-10-29 08:02:43 -04:00
com.google.common.collect.Lists#newArrayList() @ Create java.util.ArrayList directly
com.google.common.collect.Lists#newLinkedList() @ Use ArrayList or ArrayDeque instead
com.google.common.collect.Lists#newLinkedList(java.lang.Iterable) @ Use ArrayList or ArrayDeque instead
2017-09-27 09:49:47 -04:00
com.google.common.collect.MapMaker @ Create java.util.concurrent.ConcurrentHashMap directly
2018-03-20 11:59:33 -04:00
com.google.common.collect.Maps#newConcurrentMap() @ Create java.util.concurrent.ConcurrentHashMap directly
2018-10-29 08:02:43 -04:00
com.google.common.collect.Maps#newHashMap() @ Create java.util.HashMap directly
com.google.common.collect.Maps#newHashMap(java.util.Map) @ Create java.util.HashMap directly
com.google.common.collect.Maps#newTreeMap() @ Create java.util.TreeMap directly
com.google.common.collect.Maps#newTreeMap(java.util.Comparator) @ Create java.util.TreeMap directly
com.google.common.collect.Maps#newTreeMap(java.util.SortedMap) @ Create java.util.TreeMap directly
com.google.common.collect.Queues#newArrayDeque() @ Create java.util.ArrayDeque directly
com.google.common.collect.Queues#newConcurrentLinkedQueue() @ Create java.util.concurrent.ConcurrentLinkedQueue directly
com.google.common.collect.Queues#newLinkedBlockingQueue() @ Create java.util.concurrent.LinkedBlockingQueue directly
com.google.common.collect.Sets#newHashSet() @ Create java.util.HashSet directly
com.google.common.collect.Sets#newLinkedHashSet() @ Create java.util.LinkedHashSet directly
com.google.common.collect.Sets#newTreeSet() @ Create java.util.TreeSet directly
com.google.common.collect.Sets#newTreeSet(java.util.Comparator) @ Create java.util.TreeSet directly
2019-11-22 22:48:49 -05:00
com.google.common.io.Files#createTempDir() @ Use org.apache.druid.java.util.common.FileUtils.createTempDir()
2021-11-09 14:10:49 -05:00
java.io.File#mkdirs() @ Use org.apache.druid.java.util.common.FileUtils.mkdirp instead
2018-08-16 14:05:45 -04:00
java.io.File#toURL() @ Use java.io.File#toURI() and java.net.URI#toURL() instead
2018-11-15 16:21:34 -05:00
java.lang.String#matches(java.lang.String) @ Use startsWith(), endsWith(), contains(), or compile and cache a Pattern explicitly
java.lang.String#replace(java.lang.CharSequence,java.lang.CharSequence) @ Use one of the appropriate methods in StringUtils instead
java.lang.String#replaceAll(java.lang.String,java.lang.String) @ Use one of the appropriate methods in StringUtils instead, or compile and cache a Pattern explicitly
java.lang.String#replaceFirst(java.lang.String,java.lang.String) @ Use String.indexOf() and substring methods, or compile and cache a Pattern explicitly
2020-12-05 18:26:57 -05:00
java.nio.file.Files#createTempDirectory(java.lang.String,java.nio.file.attribute.FileAttribute[]) @ Use org.apache.druid.java.util.common.FileUtils.createTempDir()
2021-12-08 01:21:01 -05:00
java.nio.file.Files#createTempDirectory(java.nio.file.Path,java.lang.String,java.nio.file.attribute.FileAttribute[]) @ Use org.apache.druid.java.util.common.FileUtils.createTempDir()
2020-02-07 02:44:09 -05:00
java.util.HashMap#<init>(int) @ Use com.google.common.collect.Maps#newHashMapWithExpectedSize(int) instead
java.util.HashMap#<init>(int, float) @ Use com.google.common.collect.Maps#newHashMapWithExpectedSize(int) instead
java.util.LinkedHashMap#<init>(int) @ Use org.apache.druid.utils.CollectionUtils#newLinkedHashMapWithExpectedSize(int) instead
java.util.LinkedHashMap#<init>(int, float) @ Use org.apache.druid.utils.CollectionUtils#newLinkedHashMapWithExpectedSize(int) instead
java.util.HashSet#<init>(int) @ Use com.google.collect.Sets#newHashSetWithExpectedSize(int) instead
java.util.HashSet#<init>(int, float) @ Use com.google.collect.Sets#newHashSetWithExpectedSize(int) instead
java.util.LinkedHashSet#<init>(int) @ Use com.google.collect.Sets#newLinkedHashSatWithExpectedSize(int) instead
java.util.LinkedHashSet#<init>(int, float) @ Use com.google.collect.Sets#newLinkedHashSatWithExpectedSize(int) instead
2018-09-13 21:07:06 -04:00
java.util.LinkedList @ Use ArrayList or ArrayDeque instead
2018-10-03 16:55:20 -04:00
java.util.Random#<init>() @ Use ThreadLocalRandom.current() or the constructor with a seed (the latter in tests only!)
2019-01-25 06:49:20 -05:00
java.lang.Math#random() @ Use ThreadLocalRandom.current()
2018-11-15 16:21:34 -05:00
java.util.regex.Pattern#matches(java.lang.String,java.lang.CharSequence) @ Use String.startsWith(), endsWith(), contains(), or compile and cache a Pattern explicitly
2019-01-25 20:32:29 -05:00
org.apache.commons.io.FileUtils#getTempDirectory() @ Use org.junit.rules.TemporaryFolder for tests instead
2020-12-05 18:26:57 -05:00
org.apache.commons.io.FileUtils#deleteDirectory(java.io.File) @ Use org.apache.druid.java.util.common.FileUtils#deleteDirectory()
2021-11-09 14:10:49 -05:00
org.apache.commons.io.FileUtils#forceMkdir(java.io.File) @ Use org.apache.druid.java.util.common.FileUtils.mkdirp instead
2019-07-16 18:21:50 -04:00
java.lang.Class#getCanonicalName() @ Class.getCanonicalName can return null for anonymous types, use Class.getName instead.
2023-01-12 05:04:36 -05:00
java.util.concurrent.Executors#newFixedThreadPool(int) @ Executor is non-daemon and can prevent JVM shutdown, use org.apache.druid.java.util.common.concurrent.Execs#multiThreaded(int, java.lang.String) instead.
2019-01-25 20:32:29 -05:00
2019-03-13 17:47:14 -04:00
@defaultMessage Use Locale.ENGLISH
com.ibm.icu.text.DateFormatSymbols#<init>()
com.ibm.icu.text.SimpleDateFormat#<init>()
com.ibm.icu.text.SimpleDateFormat#<init>(java.lang.String)
2019-01-25 20:32:29 -05:00
@defaultMessage For performance reasons, use the utf8Base64 / encodeBase64 / encodeBase64String / decodeBase64 / decodeBase64String methods in StringUtils
org.apache.commons.codec.binary.Base64
2020-12-05 18:26:57 -05:00
com.google.common.io.BaseEncoding#base64()
2019-06-17 09:58:51 -04:00
@defaultMessage Use com.google.errorprone.annotations.concurrent.GuardedBy
2020-12-05 18:26:57 -05:00
javax.annotation.concurrent.GuardedBy
2019-11-22 22:48:49 -05:00
com.amazonaws.annotation.GuardedBy
2022-02-28 01:47:09 -05:00
org.powermock.** @ Use Mockito instead of Powermock for compatibility with newer Java versions