# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one # or more contributor license agreements. Licensed under the "Elastic License # 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side # Public License v 1"; you may not use this file except in compliance with, at # your election, the "Elastic License 2.0", the "GNU Affero General Public # License v3.0 only", or the "Server Side Public License, v 1". @defaultMessage Convert to URI java.net.URL#getPath() java.net.URL#getFile() @defaultMessage Usage of getLocalHost is discouraged java.net.InetAddress#getLocalHost() @defaultMessage Use java.nio.file instead of java.io.File API java.util.jar.JarFile java.util.zip.ZipFile java.io.File java.io.FileInputStream java.io.FileOutputStream java.io.PrintStream#(java.lang.String,java.lang.String) java.io.PrintWriter#(java.lang.String,java.lang.String) java.util.Formatter#(java.lang.String,java.lang.String,java.util.Locale) java.io.RandomAccessFile java.nio.file.Path#toFile() @defaultMessage Specify a location for the temp file/directory instead. java.nio.file.Files#createTempDirectory(java.lang.String,java.nio.file.attribute.FileAttribute[]) java.nio.file.Files#createTempFile(java.lang.String,java.lang.String,java.nio.file.attribute.FileAttribute[]) @defaultMessage Don't use java serialization - this can break BWC without noticing it java.io.ObjectOutputStream java.io.ObjectOutput java.io.ObjectInputStream java.io.ObjectInput java.nio.file.Files#isHidden(java.nio.file.Path) @ Dependent on the operating system, use FileSystemUtils.isHidden instead @defaultMessage Resolve hosts explicitly to the address(es) you want with InetAddress. java.net.InetSocketAddress#(java.lang.String,int) java.net.Socket#(java.lang.String,int) java.net.Socket#(java.lang.String,int,java.net.InetAddress,int) @defaultMessage Don't bind to wildcard addresses. Be specific. java.net.DatagramSocket#() java.net.DatagramSocket#(int) java.net.InetSocketAddress#(int) java.net.MulticastSocket#() java.net.MulticastSocket#(int) java.net.ServerSocket#(int) java.net.ServerSocket#(int,int) @defaultMessage use NetworkAddress format() to print IP or IP+ports java.net.InetAddress#toString() java.net.InetAddress#getHostAddress() java.net.Inet4Address#getHostAddress() java.net.Inet6Address#getHostAddress() java.net.InetSocketAddress#toString() @defaultMessage avoid DNS lookups by accident: if you have a valid reason, then @SuppressWarnings with that reason so its completely clear java.net.InetAddress#getHostName() java.net.InetAddress#getCanonicalHostName() java.net.InetSocketAddress#getHostName() @ Use getHostString() instead, which avoids a DNS lookup @defaultMessage Do not violate java's access system java.lang.Class#getDeclaredClasses() @ Do not violate java's access system: Use getClasses() instead java.lang.Class#getDeclaredConstructor(java.lang.Class[]) @ Do not violate java's access system: Use getConstructor() instead java.lang.Class#getDeclaredConstructors() @ Do not violate java's access system: Use getConstructors() instead java.lang.Class#getDeclaredField(java.lang.String) @ Do not violate java's access system: Use getField() instead java.lang.Class#getDeclaredFields() @ Do not violate java's access system: Use getFields() instead java.lang.Class#getDeclaredMethod(java.lang.String, java.lang.Class[]) @ Do not violate java's access system: Use getMethod() instead java.lang.Class#getDeclaredMethods() @ Do not violate java's access system: Use getMethods() instead java.lang.reflect.AccessibleObject#setAccessible(boolean) java.lang.reflect.AccessibleObject#setAccessible(java.lang.reflect.AccessibleObject[], boolean) @defaultMessage this method needs special permission java.lang.Thread#getAllStackTraces() @defaultMessage Stopping threads explicitly leads to inconsistent states. Use interrupt() instead. java.lang.Thread#stop() # uncomment when https://github.com/elastic/elasticsearch/issues/31715 is fixed # java.lang.Thread#stop(java.lang.Throwable) @defaultMessage Please do not terminate the application java.lang.System#exit(int) java.lang.Runtime#exit(int) java.lang.Runtime#halt(int) @defaultMessage Treat system properties as immutable java.lang.System#setProperties(java.util.Properties) java.lang.System#setProperty(java.lang.String,java.lang.String) java.lang.System#clearProperty(java.lang.String) java.lang.System#getProperties() @ Use BootstrapInfo.getSystemProperties for a read-only view @defaultMessage Avoid unchecked warnings by using Collections#empty(List|Map|Set) methods java.util.Collections#EMPTY_LIST java.util.Collections#EMPTY_MAP java.util.Collections#EMPTY_SET java.util.Collections#shuffle(java.util.List) @ Use java.util.Collections#shuffle(java.util.List, java.util.Random) with a reproducible source of randomness @defaultMessage Avoid creating FilePermission objects directly, but use FilePermissionUtils instead java.io.FilePermission#(java.lang.String,java.lang.String) @defaultMessage DocumentBuilderFactory should not be used directly. Use XmlUtils#getHardenedDocumentBuilder(java.lang.String[]) instead. javax.xml.parsers.DocumentBuilderFactory#newInstance() javax.xml.parsers.DocumentBuilderFactory#newInstance(java.lang.String, java.lang.ClassLoader) javax.xml.parsers.DocumentBuilderFactory#newDefaultNSInstance() javax.xml.parsers.DocumentBuilderFactory#newNSInstance() javax.xml.parsers.DocumentBuilderFactory#newNSInstance(java.lang.String, java.lang.ClassLoader) @defaultMessage TransformerFactory should not be used directly. Use XmlUtils#getHardenedXMLTransformer() instead. javax.xml.transform.TransformerFactory#newInstance() javax.xml.transform.TransformerFactory#newInstance(java.lang.String, java.lang.ClassLoader) @defaultMessage SAXParserFactory should not be used directly. Use XmlUtils#getHardenedSaxParser() instead javax.xml.parsers.SAXParserFactory#newInstance() javax.xml.parsers.SAXParserFactory#newInstance(java.lang.String, java.lang.ClassLoader) javax.xml.parsers.SAXParserFactory#newDefaultNSInstance() javax.xml.parsers.SAXParserFactory#newNSInstance() javax.xml.parsers.SAXParserFactory#newNSInstance(java.lang.String, java.lang.ClassLoader) @defaultMessage SchemaValidator should not be used directly. Use XmlUtils#getHardenedSchemaValidator() instead javax.xml.validation.SchemaFactory#newDefaultInstance() javax.xml.validation.SchemaFactory#newInstance(java.lang.String) javax.xml.validation.SchemaFactory#newInstance(java.lang.String, java.lang.String, java.lang.ClassLoader) @defaultMessage Validator should not be used directly. Use XmlUtils#getHardenedValidator() instead javax.xml.validation.Schema#newValidator() @defaultMessage XPathFactory should not be used directly. Use XmlUtils#getHardenedXPath() instead javax.xml.xpath.XPathFactory#newDefaultInstance() javax.xml.xpath.XPathFactory#newInstance() javax.xml.xpath.XPathFactory#newInstance(java.lang.String) javax.xml.xpath.XPathFactory#newInstance(java.lang.String, java.lang.String, java.lang.ClassLoader)