From 6765f902505fbdd02f25b599f942437cd805cad1 Mon Sep 17 00:00:00 2001 From: Weijun Wang Date: Wed, 2 Jun 2021 11:57:31 +0000 Subject: [PATCH] 8266459: Implement JEP 411: Deprecate the Security Manager for Removal Co-authored-by: Sean Mullan Co-authored-by: Lance Andersen Co-authored-by: Weijun Wang Reviewed-by: erikj, darcy, chegar, naoto, joehw, alanb, mchung, kcr, prr, lancea --- make/RunTests.gmk | 2 +- src/demo/share/jfc/J2Ddemo/java2d/Tools.java | 4 +- .../sun/nio/ch/DefaultSelectorProvider.java | 3 +- .../jdk/internal/platform/CgroupUtil.java | 4 +- .../sun/nio/ch/DefaultSelectorProvider.java | 3 +- .../classes/apple/security/AppleProvider.java | 3 +- .../classes/apple/security/KeychainStore.java | 1 + .../classes/java/net/DefaultInterface.java | 3 +- .../sun/nio/ch/DefaultSelectorProvider.java | 3 +- .../sun/crypto/provider/DHKeyAgreement.java | 1 + .../com/sun/crypto/provider/JceKeyStore.java | 1 + .../provider/SealedObjectForKeyProtector.java | 4 +- .../com/sun/crypto/provider/SunJCE.java | 3 +- src/java.base/share/classes/java/io/File.java | 25 +++++ .../classes/java/io/FileInputStream.java | 2 + .../classes/java/io/FileOutputStream.java | 4 +- .../share/classes/java/io/FilePermission.java | 1 + .../classes/java/io/ObjectInputFilter.java | 3 +- .../classes/java/io/ObjectInputStream.java | 10 +- .../classes/java/io/ObjectOutputStream.java | 7 +- .../classes/java/io/ObjectStreamClass.java | 9 ++ .../classes/java/io/ObjectStreamField.java | 3 +- .../classes/java/io/RandomAccessFile.java | 3 +- .../classes/java/lang/CharacterName.java | 4 +- .../share/classes/java/lang/Class.java | 35 ++++++- .../share/classes/java/lang/ClassLoader.java | 6 ++ .../classes/java/lang/LiveStackFrame.java | 3 +- .../share/classes/java/lang/Module.java | 2 + .../share/classes/java/lang/ModuleLayer.java | 2 + .../share/classes/java/lang/Package.java | 3 +- .../classes/java/lang/ProcessBuilder.java | 4 +- .../classes/java/lang/ProcessHandleImpl.java | 13 ++- .../classes/java/lang/PublicMethods.java | 3 +- .../share/classes/java/lang/Runtime.java | 6 ++ .../classes/java/lang/SecurityManager.java | 22 +++-- .../share/classes/java/lang/StackWalker.java | 3 +- .../share/classes/java/lang/String.java | 3 + .../share/classes/java/lang/System.java | 89 +++++++++++++----- .../share/classes/java/lang/Thread.java | 21 ++++- .../share/classes/java/lang/ThreadGroup.java | 10 +- .../lang/constant/MethodTypeDescImpl.java | 3 +- .../java/lang/invoke/ClassSpecializer.java | 1 + .../java/lang/invoke/InfoFromMemberName.java | 3 +- .../invoke/InnerClassLambdaMetafactory.java | 4 +- .../lang/invoke/InvokerBytecodeGenerator.java | 1 + .../java/lang/invoke/MethodHandleProxies.java | 3 +- .../java/lang/invoke/MethodHandles.java | 5 + .../classes/java/lang/invoke/MethodType.java | 3 +- .../java/lang/invoke/ProxyClassesDumper.java | 3 +- .../java/lang/invoke/SerializedLambda.java | 3 +- .../java/lang/module/ModuleFinder.java | 3 +- .../classes/java/lang/ref/Finalizer.java | 3 +- .../java/lang/reflect/AccessibleObject.java | 2 + .../classes/java/lang/reflect/Proxy.java | 10 +- .../java/lang/reflect/ProxyGenerator.java | 4 +- .../java/lang/runtime/ObjectMethods.java | 3 +- .../java/net/AbstractPlainSocketImpl.java | 4 +- .../share/classes/java/net/Authenticator.java | 8 +- .../share/classes/java/net/CookieHandler.java | 4 +- .../classes/java/net/DatagramSocket.java | 2 + .../java/net/HttpConnectSocketImpl.java | 2 +- .../classes/java/net/HttpURLConnection.java | 4 +- src/java.base/share/classes/java/net/IDN.java | 3 +- .../share/classes/java/net/InetAddress.java | 5 +- .../classes/java/net/NetMulticastSocket.java | 11 +++ .../classes/java/net/NetworkInterface.java | 3 + .../share/classes/java/net/ProxySelector.java | 4 +- .../share/classes/java/net/ResponseCache.java | 4 +- .../share/classes/java/net/ServerSocket.java | 6 ++ .../share/classes/java/net/Socket.java | 6 ++ .../share/classes/java/net/SocketImpl.java | 3 +- .../classes/java/net/SocketPermission.java | 2 + .../classes/java/net/SocksSocketImpl.java | 4 + src/java.base/share/classes/java/net/URL.java | 7 +- .../classes/java/net/URLClassLoader.java | 24 ++++- .../share/classes/java/net/URLConnection.java | 5 +- .../net/spi/URLStreamHandlerProvider.java | 3 +- .../spi/AsynchronousChannelProvider.java | 4 +- .../nio/channels/spi/SelectorProvider.java | 4 +- .../classes/java/nio/charset/Charset.java | 3 + .../java/nio/charset/spi/CharsetProvider.java | 3 +- .../classes/java/nio/file/FileSystems.java | 3 +- .../classes/java/nio/file/FileTreeWalker.java | 3 +- .../share/classes/java/nio/file/Files.java | 2 + .../classes/java/nio/file/TempFileHelper.java | 3 +- .../java/nio/file/spi/FileSystemProvider.java | 2 + .../java/nio/file/spi/FileTypeDetector.java | 3 +- .../java/security/AccessControlContext.java | 22 ++++- .../java/security/AccessControlException.java | 6 ++ .../java/security/AccessController.java | 50 ++++++++-- .../classes/java/security/DomainCombiner.java | 8 +- .../share/classes/java/security/KeyStore.java | 10 +- .../classes/java/security/Permission.java | 1 + .../share/classes/java/security/Policy.java | 26 +++++- .../classes/java/security/PolicySpi.java | 10 +- .../java/security/ProtectionDomain.java | 12 ++- .../share/classes/java/security/Provider.java | 1 + .../classes/java/security/SecureRandom.java | 1 + .../share/classes/java/security/Security.java | 3 +- .../classes/java/security/URIParameter.java | 3 +- .../java/security/cert/CertPathBuilder.java | 3 +- .../java/security/cert/CertPathValidator.java | 3 +- .../classes/java/security/cert/CertStore.java | 3 +- .../java/time/chrono/HijrahChronology.java | 3 +- .../java/time/zone/ZoneRulesProvider.java | 3 +- .../share/classes/java/util/Arrays.java | 3 +- .../share/classes/java/util/Calendar.java | 4 +- .../share/classes/java/util/Currency.java | 3 +- .../share/classes/java/util/Locale.java | 1 + .../classes/java/util/ResourceBundle.java | 10 +- .../classes/java/util/ServiceLoader.java | 17 +++- .../share/classes/java/util/TimeZone.java | 3 +- .../share/classes/java/util/Tripwire.java | 3 +- .../concurrent/ConcurrentSkipListSet.java | 1 + .../util/concurrent/CopyOnWriteArrayList.java | 1 + .../java/util/concurrent/Executors.java | 34 +++++++ .../java/util/concurrent/ForkJoinPool.java | 1 + .../util/concurrent/ForkJoinWorkerThread.java | 1 + .../util/concurrent/ThreadLocalRandom.java | 2 +- .../util/concurrent/ThreadPoolExecutor.java | 1 + .../atomic/AtomicIntegerFieldUpdater.java | 1 + .../atomic/AtomicLongFieldUpdater.java | 2 + .../atomic/AtomicReferenceArray.java | 1 + .../atomic/AtomicReferenceFieldUpdater.java | 1 + .../util/concurrent/atomic/Striped64.java | 2 +- .../util/random/RandomGeneratorFactory.java | 1 + .../spi/AbstractResourceBundleProvider.java | 3 +- .../java/util/spi/LocaleServiceProvider.java | 3 +- .../classes/java/util/spi/ToolProvider.java | 3 +- .../classes/java/util/stream/Tripwire.java | 3 +- .../share/classes/java/util/zip/ZipFile.java | 3 +- .../javax/crypto/JceSecurity.java.template | 3 +- .../javax/crypto/JceSecurityManager.java | 3 +- .../javax/crypto/ProviderVerifier.java | 3 +- .../javax/net/ssl/HttpsURLConnection.java | 5 +- .../javax/net/ssl/KeyManagerFactory.java | 3 +- .../classes/javax/net/ssl/SSLContext.java | 3 +- .../javax/net/ssl/SSLSocketFactory.java | 3 +- .../javax/net/ssl/TrustManagerFactory.java | 3 +- .../classes/javax/security/auth/Subject.java | 41 ++++++++- .../security/auth/SubjectDomainCombiner.java | 9 +- .../security/auth/login/Configuration.java | 6 +- .../security/auth/login/LoginContext.java | 14 ++- .../jdk/internal/access/JavaLangAccess.java | 2 +- .../internal/access/JavaSecurityAccess.java | 10 +- .../jdk/internal/icu/impl/ICUBinary.java | 4 +- .../jdk/internal/jimage/BasicImageReader.java | 2 + .../internal/jimage/NativeImageBuffer.java | 3 +- .../internal/jrtfs/JrtFileSystemProvider.java | 4 +- .../jdk/internal/jrtfs/SystemImage.java | 3 +- .../jdk/internal/loader/BootLoader.java | 3 + .../internal/loader/BuiltinClassLoader.java | 9 +- .../jdk/internal/loader/ClassLoaders.java | 1 + .../classes/jdk/internal/loader/Loader.java | 8 +- .../jdk/internal/loader/NativeLibraries.java | 3 +- .../jdk/internal/loader/URLClassPath.java | 15 ++- .../jdk/internal/logger/BootstrapLogger.java | 11 ++- .../internal/logger/DefaultLoggerFinder.java | 4 +- .../jdk/internal/logger/LazyLoggers.java | 4 +- .../internal/logger/LoggerFinderLoader.java | 5 +- .../internal/logger/SimpleConsoleLogger.java | 3 +- .../jdk/internal/misc/ExtendedMapMode.java | 3 +- .../jdk/internal/misc/InnocuousThread.java | 1 + .../jdk/internal/module/ModuleReferences.java | 3 +- .../classes/jdk/internal/module/Modules.java | 3 +- .../internal/module/SystemModuleFinders.java | 3 + .../share/classes/jdk/internal/perf/Perf.java | 3 +- .../jdk/internal/perf/PerfCounter.java | 3 +- .../classes/jdk/internal/ref/Cleaner.java | 3 +- .../jdk/internal/reflect/ClassDefiner.java | 3 +- .../reflect/MethodAccessorGenerator.java | 3 +- .../internal/reflect/ReflectionFactory.java | 1 + .../internal/util/random/RandomSupport.java | 3 +- .../classes/sun/invoke/util/VerifyAccess.java | 3 +- .../sun/net/InetAddressCachePolicy.java | 3 +- .../share/classes/sun/net/NetProperties.java | 3 +- .../share/classes/sun/net/NetworkClient.java | 3 +- .../classes/sun/net/ResourceManager.java | 4 +- .../sun/net/ftp/FtpClientProvider.java | 4 +- .../classes/sun/net/ftp/impl/FtpClient.java | 1 + .../sun/net/spi/DefaultProxySelector.java | 5 +- .../classes/sun/net/util/IPAddressUtil.java | 3 +- .../sun/net/util/SocketExceptions.java | 3 +- .../share/classes/sun/net/www/MimeTable.java | 3 +- .../classes/sun/net/www/http/HttpCapture.java | 3 +- .../classes/sun/net/www/http/HttpClient.java | 5 +- .../sun/net/www/http/KeepAliveCache.java | 4 +- .../sun/net/www/http/KeepAliveStream.java | 3 +- .../net/www/http/KeepAliveStreamCleaner.java | 4 +- .../www/protocol/ftp/FtpURLConnection.java | 3 +- .../www/protocol/http/AuthenticationInfo.java | 3 +- .../protocol/http/DigestAuthentication.java | 3 +- .../www/protocol/http/HttpURLConnection.java | 19 +++- .../net/www/protocol/https/HttpsClient.java | 3 +- .../sun/net/www/protocol/jar/URLJarFile.java | 1 + .../jrt/JavaRuntimeURLConnection.java | 3 +- .../protocol/mailto/MailToURLConnection.java | 3 +- .../nio/ch/AsynchronousChannelGroupImpl.java | 8 +- .../AsynchronousServerSocketChannelImpl.java | 3 +- .../nio/ch/AsynchronousSocketChannelImpl.java | 3 +- .../sun/nio/ch/DatagramChannelImpl.java | 10 +- .../sun/nio/ch/DatagramSocketAdaptor.java | 10 +- .../share/classes/sun/nio/ch/Invoker.java | 4 +- .../share/classes/sun/nio/ch/Net.java | 3 + .../share/classes/sun/nio/ch/Reflect.java | 3 +- .../sun/nio/ch/ServerSocketAdaptor.java | 3 +- .../sun/nio/ch/ServerSocketChannelImpl.java | 4 +- .../classes/sun/nio/ch/SocketAdaptor.java | 3 +- .../classes/sun/nio/ch/SocketChannelImpl.java | 4 +- .../share/classes/sun/nio/ch/ThreadPool.java | 5 +- .../classes/sun/nio/ch/UnixDomainSockets.java | 4 +- .../share/classes/sun/nio/ch/Util.java | 4 +- .../classes/sun/nio/cs/CharsetMapping.java | 3 +- .../classes/sun/nio/fs/AbstractPoller.java | 3 +- .../AbstractUserDefinedFileAttributeView.java | 3 +- .../sun/nio/fs/PollingWatchService.java | 4 +- .../share/classes/sun/nio/fs/Reflect.java | 3 +- .../AnnotationInvocationHandler.java | 1 + .../reflect/annotation/AnnotationParser.java | 3 +- .../reflect/annotation/AnnotationSupport.java | 3 +- .../reflect/annotation/AnnotationType.java | 3 +- .../classes/sun/reflect/misc/MethodUtil.java | 5 +- .../classes/sun/reflect/misc/ReflectUtil.java | 11 ++- .../sun/security/action/GetBooleanAction.java | 3 +- .../sun/security/action/GetIntegerAction.java | 4 +- .../security/action/GetPropertyAction.java | 5 +- .../sun/security/jca/ProviderConfig.java | 8 +- .../sun/security/jca/ProviderList.java | 3 +- .../sun/security/pkcs12/PKCS12KeyStore.java | 1 + .../sun/security/provider/ConfigFile.java | 4 +- .../classes/sun/security/provider/DRBG.java | 3 +- .../classes/sun/security/provider/MD4.java | 1 + .../sun/security/provider/PolicyFile.java | 3 +- .../sun/security/provider/PolicySpiFile.java | 3 +- .../sun/security/provider/SeedGenerator.java | 5 +- .../security/provider/SubjectCodeSource.java | 4 +- .../classes/sun/security/provider/Sun.java | 3 +- .../sun/security/provider/SunEntries.java | 3 +- .../provider/VerificationProvider.java | 3 +- .../sun/security/provider/certpath/OCSP.java | 3 +- .../provider/certpath/OCSPResponse.java | 1 + .../provider/certpath/RevocationChecker.java | 1 + .../classes/sun/security/rsa/SunRsaSign.java | 3 +- .../sun/security/ssl/AlpnExtension.java | 3 +- .../ssl/PredefinedDHParameterSpecs.java | 3 +- .../classes/sun/security/ssl/SSLCipher.java | 1 + .../sun/security/ssl/SSLConfiguration.java | 4 +- .../sun/security/ssl/SSLContextImpl.java | 1 + .../sun/security/ssl/SSLEngineImpl.java | 1 + .../sun/security/ssl/SSLSessionImpl.java | 4 +- .../security/ssl/ServerHandshakeContext.java | 3 +- .../security/ssl/StatusResponseManager.java | 4 +- .../classes/sun/security/ssl/SunJSSE.java | 3 +- .../sun/security/ssl/TransportContext.java | 5 + .../security/ssl/TrustManagerFactoryImpl.java | 1 + .../sun/security/ssl/TrustStoreManager.java | 6 +- .../util/AbstractAlgorithmConstraints.java | 3 +- .../sun/security/util/AnchorCertificates.java | 3 +- .../classes/sun/security/util/DomainName.java | 3 +- .../sun/security/util/KeyStoreDelegator.java | 3 +- .../sun/security/util/SecurityProperties.java | 3 +- .../security/util/UntrustedCertificates.java | 1 + .../security/validator/CADistrustPolicy.java | 3 +- .../classes/sun/security/x509/X500Name.java | 3 +- .../sun/util/calendar/ZoneInfoFile.java | 3 +- .../util/cldr/CLDRLocaleProviderAdapter.java | 4 + .../provider/AuxLocaleProviderAdapter.java | 3 +- .../provider/JRELocaleProviderAdapter.java | 16 +++- .../provider/SPILocaleProviderAdapter.java | 3 +- .../BreakIteratorResourceBundle.java | 3 +- .../classes/sun/util/resources/Bundles.java | 1 + .../sun/util/resources/LocaleData.java | 2 + .../unix/classes/java/io/UnixFileSystem.java | 4 +- .../unix/classes/java/lang/ProcessImpl.java | 8 +- .../net/dns/ResolverConfigurationImpl.java | 4 +- .../http/ntlm/NTLMAuthentication.java | 3 +- .../net/www/protocol/jar/JarFileFactory.java | 1 + .../classes/sun/nio/ch/InheritedChannel.java | 3 +- ...ixAsynchronousServerSocketChannelImpl.java | 5 +- .../ch/UnixAsynchronousSocketChannelImpl.java | 1 + .../sun/nio/ch/UnixDomainSocketsUtil.java | 3 +- .../sun/nio/fs/MimeTypesFileTypeDetector.java | 3 +- .../sun/nio/fs/UnixChannelFactory.java | 3 +- .../unix/classes/sun/nio/fs/UnixCopyFile.java | 4 +- .../sun/nio/fs/UnixFileAttributeViews.java | 4 +- .../classes/sun/nio/fs/UnixFileStore.java | 3 +- .../classes/sun/nio/fs/UnixFileSystem.java | 3 + .../sun/nio/fs/UnixFileSystemProvider.java | 7 +- .../unix/classes/sun/nio/fs/UnixPath.java | 4 + .../sun/nio/fs/UnixSecureDirectoryStream.java | 9 +- .../fs/UnixUserDefinedFileAttributeView.java | 7 +- .../sun/nio/fs/UnixUserPrincipals.java | 3 +- .../sun/security/provider/NativePRNG.java | 4 +- .../classes/java/io/WinNTFileSystem.java | 5 +- .../classes/java/lang/ProcessImpl.java | 5 +- .../classes/java/net/PlainSocketImpl.java | 4 +- .../http/ntlm/NTLMAuthentication.java | 4 +- .../net/www/protocol/jar/JarFileFactory.java | 1 + .../sun/nio/ch/DefaultSelectorProvider.java | 1 + .../windows/classes/sun/nio/ch/PipeImpl.java | 1 + .../sun/nio/ch/UnixDomainSocketsUtil.java | 3 +- ...wsAsynchronousServerSocketChannelImpl.java | 7 +- .../WindowsAsynchronousSocketChannelImpl.java | 2 + .../nio/fs/WindowsAclFileAttributeView.java | 3 +- .../sun/nio/fs/WindowsChannelFactory.java | 1 + .../classes/sun/nio/fs/WindowsFileCopy.java | 4 +- .../classes/sun/nio/fs/WindowsFileSystem.java | 4 +- .../sun/nio/fs/WindowsFileSystemProvider.java | 7 +- .../sun/nio/fs/WindowsLinkSupport.java | 3 +- .../classes/sun/nio/fs/WindowsPath.java | 7 +- .../WindowsUserDefinedFileAttributeView.java | 7 +- .../sun/nio/fs/WindowsUserPrincipals.java | 3 +- .../classes/javax/tools/ToolProvider.java | 3 +- .../java/awt/datatransfer/DataFlavor.java | 1 + .../awt/datatransfer/SystemFlavorMap.java | 3 +- .../macosx/classes/apple/laf/JRSUIUtils.java | 3 +- .../classes/com/apple/eawt/Application.java | 3 +- .../classes/com/apple/eio/FileManager.java | 3 +- .../classes/com/apple/laf/AquaFileView.java | 4 +- .../com/apple/laf/AquaImageFactory.java | 4 +- .../com/apple/laf/AquaLookAndFeel.java | 3 +- .../classes/com/apple/laf/AquaMenuBarUI.java | 3 +- .../com/apple/laf/AquaNativeResources.java | 3 +- .../com/apple/laf/AquaUtilControlSize.java | 9 +- .../classes/com/apple/laf/AquaUtils.java | 4 +- .../classes/com/apple/laf/ScreenMenu.java | 4 +- .../classes/sun/awt/CGraphicsDevice.java | 1 + .../classes/sun/awt/PlatformGraphicsInfo.java | 3 +- .../macosx/classes/sun/font/CFontManager.java | 4 +- .../macosx/classes/sun/java2d/MacOSFlags.java | 1 + .../sun/java2d/metal/MTLGraphicsConfig.java | 1 + .../sun/java2d/metal/MTLRenderQueue.java | 1 + .../classes/sun/lwawt/LWComponentPeer.java | 2 + .../macosx/classes/sun/lwawt/LWToolkit.java | 4 +- .../sun/lwawt/macosx/CAccessibility.java | 3 +- .../lwawt/macosx/CDragSourceContextPeer.java | 3 +- .../classes/sun/lwawt/macosx/CFileDialog.java | 4 +- .../classes/sun/lwawt/macosx/CPrinterJob.java | 3 +- .../classes/sun/lwawt/macosx/CTrayIcon.java | 3 +- .../classes/sun/lwawt/macosx/LWCToolkit.java | 1 + .../sun/beans/decoder/DocumentHandler.java | 4 +- .../imageio/plugins/bmp/BMPImageReader.java | 4 +- .../imageio/plugins/jpeg/JPEGImageReader.java | 1 + .../imageio/plugins/jpeg/JPEGImageWriter.java | 1 + .../com/sun/imageio/stream/StreamCloser.java | 3 +- .../java/swing/plaf/gtk/GTKLookAndFeel.java | 1 + .../com/sun/java/swing/plaf/gtk/Metacity.java | 4 +- .../com/sun/media/sound/JDK13Services.java | 3 +- .../sun/media/sound/JSSecurityManager.java | 5 +- .../classes/com/sun/media/sound/Platform.java | 3 +- .../classes/com/sun/media/sound/Printer.java | 3 +- .../com/sun/media/sound/SoftSynthesizer.java | 5 +- .../share/classes/java/awt/AWTEvent.java | 3 + .../share/classes/java/awt/Component.java | 1 + .../share/classes/java/awt/Container.java | 3 + .../share/classes/java/awt/Cursor.java | 2 + .../java/awt/DefaultKeyboardFocusManager.java | 1 + .../share/classes/java/awt/Desktop.java | 10 +- .../share/classes/java/awt/Dialog.java | 4 +- .../share/classes/java/awt/EventQueue.java | 3 +- .../share/classes/java/awt/Font.java | 3 + .../classes/java/awt/GraphicsEnvironment.java | 3 +- .../java/awt/KeyboardFocusManager.java | 5 +- .../share/classes/java/awt/MenuComponent.java | 3 + .../share/classes/java/awt/MouseInfo.java | 3 +- .../share/classes/java/awt/Robot.java | 4 +- .../classes/java/awt/SequencedEvent.java | 1 + .../share/classes/java/awt/SplashScreen.java | 3 +- .../share/classes/java/awt/SystemTray.java | 3 +- .../share/classes/java/awt/Taskbar.java | 3 +- .../share/classes/java/awt/TextComponent.java | 1 + .../share/classes/java/awt/Toolkit.java | 3 +- .../share/classes/java/awt/TrayIcon.java | 4 +- .../classes/java/awt/WaitDispatchSupport.java | 3 +- .../share/classes/java/awt/Window.java | 1 + .../classes/java/awt/color/ICC_Profile.java | 1 + .../classes/java/awt/dnd/DragSource.java | 1 + .../classes/java/awt/event/InputEvent.java | 1 + .../java/awt/event/NativeLibLoader.java | 3 +- .../classes/java/awt/image/BufferedImage.java | 3 +- .../classes/java/awt/image/ColorModel.java | 1 + .../classes/java/awt/print/PrinterJob.java | 3 +- .../share/classes/java/beans/Beans.java | 2 + .../classes/java/beans/EventHandler.java | 5 +- .../classes/java/beans/Introspector.java | 3 +- .../share/classes/java/beans/MetaData.java | 3 +- .../java/beans/PropertyEditorManager.java | 4 +- .../classes/java/beans/SimpleBeanInfo.java | 3 +- .../share/classes/java/beans/Statement.java | 4 +- .../share/classes/java/beans/XMLDecoder.java | 4 +- .../accessibility/AccessibilityProvider.java | 3 +- .../share/classes/javax/imageio/ImageIO.java | 4 +- .../javax/imageio/metadata/IIOMetadata.java | 3 +- .../javax/imageio/spi/IIORegistry.java | 4 +- .../imageio/spi/ImageReaderWriterSpi.java | 3 +- .../javax/imageio/spi/ServiceRegistry.java | 5 +- .../share/classes/javax/print/DocFlavor.java | 1 + .../javax/print/PrintServiceLookup.java | 5 +- .../print/StreamPrintServiceFactory.java | 3 +- .../classes/javax/swing/AbstractAction.java | 1 + .../javax/swing/DefaultListCellRenderer.java | 3 +- .../share/classes/javax/swing/ImageIcon.java | 2 +- .../share/classes/javax/swing/JFrame.java | 3 +- .../share/classes/javax/swing/JLayer.java | 4 +- .../share/classes/javax/swing/JPopupMenu.java | 2 +- .../share/classes/javax/swing/JRootPane.java | 4 +- .../classes/javax/swing/RepaintManager.java | 1 + .../swing/SortingFocusTraversalPolicy.java | 3 +- .../swing/SwingPaintEventDispatcher.java | 3 +- .../classes/javax/swing/SwingUtilities.java | 1 + .../classes/javax/swing/SwingWorker.java | 3 +- .../share/classes/javax/swing/Timer.java | 4 + .../share/classes/javax/swing/TimerQueue.java | 3 +- .../classes/javax/swing/TransferHandler.java | 5 +- .../share/classes/javax/swing/UIDefaults.java | 6 +- .../share/classes/javax/swing/UIManager.java | 7 +- .../swing/filechooser/FileSystemView.java | 1 + .../plaf/basic/BasicComboBoxRenderer.java | 3 +- .../javax/swing/plaf/basic/BasicLabelUI.java | 3 +- .../swing/plaf/basic/BasicLookAndFeel.java | 3 + .../swing/plaf/basic/BasicPopupMenuUI.java | 2 + .../swing/plaf/metal/DefaultMetalTheme.java | 4 +- .../javax/swing/plaf/metal/MetalLabelUI.java | 3 +- .../swing/plaf/metal/MetalLookAndFeel.java | 5 +- .../javax/swing/plaf/metal/MetalSliderUI.java | 4 +- .../swing/plaf/nimbus/NimbusLookAndFeel.java | 3 +- .../swing/table/DefaultTableCellRenderer.java | 3 +- .../javax/swing/text/AbstractDocument.java | 1 + .../javax/swing/text/JTextComponent.java | 3 +- .../classes/javax/swing/text/PlainView.java | 3 +- .../javax/swing/text/html/HTMLEditorKit.java | 3 +- .../text/html/parser/ParserDelegator.java | 3 +- .../javax/swing/text/rtf/RTFReader.java | 3 +- .../share/classes/sun/awt/AWTAccessor.java | 4 +- .../classes/sun/awt/AWTAutoShutdown.java | 3 +- .../share/classes/sun/awt/AppContext.java | 7 +- .../classes/sun/awt/CausedFocusEvent.java | 1 + .../share/classes/sun/awt/DebugSettings.java | 3 +- .../classes/sun/awt/FontConfiguration.java | 5 +- .../share/classes/sun/awt/FontDescriptor.java | 3 +- .../classes/sun/awt/NativeLibLoader.java | 3 +- .../share/classes/sun/awt/SunToolkit.java | 1 + .../sun/awt/datatransfer/DataTransferer.java | 3 + .../awt/datatransfer/TransferableProxy.java | 4 +- .../sun/awt/dnd/SunDropTargetContextPeer.java | 3 +- .../awt/im/ExecutableInputMethodManager.java | 4 +- .../classes/sun/awt/im/InputContext.java | 3 +- .../sun/awt/im/InputMethodContext.java | 3 +- .../sun/awt/image/FileImageSource.java | 3 +- .../sun/awt/image/ImageConsumerQueue.java | 3 +- .../classes/sun/awt/image/ImageDecoder.java | 3 +- .../classes/sun/awt/image/ImageFetcher.java | 3 +- .../classes/sun/awt/image/ImageWatched.java | 5 +- .../classes/sun/awt/image/ImagingLib.java | 3 +- .../sun/awt/image/InputStreamImageSource.java | 3 +- .../sun/awt/image/JPEGImageDecoder.java | 3 +- .../sun/awt/image/NativeLibLoader.java | 3 +- .../classes/sun/awt/image/URLImageSource.java | 4 +- .../sun/awt/image/VSyncedBSManager.java | 3 +- .../sun/awt/shell/ShellFolderManager.java | 8 +- .../sun/awt/util/PerformanceLogger.java | 3 +- .../classes/sun/font/CreatedFontTracker.java | 3 +- .../share/classes/sun/font/FileFont.java | 4 +- .../classes/sun/font/FontManagerFactory.java | 3 +- .../sun/font/FontManagerNativeLibrary.java | 3 +- .../share/classes/sun/font/FontUtilities.java | 3 +- .../share/classes/sun/font/StrikeCache.java | 3 +- .../classes/sun/font/SunFontManager.java | 3 +- .../share/classes/sun/font/TrueTypeFont.java | 4 +- .../share/classes/sun/font/Type1Font.java | 5 +- .../share/classes/sun/java2d/Disposer.java | 3 +- .../sun/java2d/SunGraphicsEnvironment.java | 3 +- .../share/classes/sun/java2d/SurfaceData.java | 3 +- .../classes/sun/java2d/SurfaceDataProxy.java | 4 +- .../classes/sun/java2d/cmm/CMSManager.java | 2 + .../classes/sun/java2d/cmm/lcms/LCMS.java | 1 + .../sun/java2d/loops/GraphicsPrimitive.java | 3 + .../java2d/marlin/DMarlinRenderingEngine.java | 1 + .../sun/java2d/marlin/MarlinProperties.java | 5 +- .../sun/java2d/marlin/RendererStats.java | 3 +- .../sun/java2d/opengl/OGLRenderQueue.java | 3 +- .../sun/java2d/opengl/OGLSurfaceData.java | 6 +- .../sun/java2d/pipe/RenderingEngine.java | 3 + .../share/classes/sun/print/PSPrinterJob.java | 3 +- .../share/classes/sun/print/PrintJob2D.java | 4 +- .../classes/sun/print/RasterPrinterJob.java | 8 +- .../classes/sun/print/ServiceDialog.java | 6 +- .../classes/sun/swing/JLightweightFrame.java | 4 +- .../classes/sun/swing/SwingUtilities2.java | 4 + .../classes/sun/awt/PlatformGraphicsInfo.java | 3 +- .../unix/classes/sun/awt/UNIXToolkit.java | 7 +- .../unix/classes/sun/awt/X11/InfoWindow.java | 3 +- .../sun/awt/X11/MotifColorUtilities.java | 3 +- .../unix/classes/sun/awt/X11/Native.java | 3 +- .../unix/classes/sun/awt/X11/XClipboard.java | 3 +- .../classes/sun/awt/X11/XEmbedCanvasPeer.java | 3 +- .../sun/awt/X11/XErrorHandlerUtil.java | 3 +- .../classes/sun/awt/X11/XFileDialogPeer.java | 4 +- .../unix/classes/sun/awt/X11/XRobotPeer.java | 3 +- .../classes/sun/awt/X11/XTaskbarPeer.java | 4 +- .../unix/classes/sun/awt/X11/XToolkit.java | 8 ++ .../classes/sun/awt/X11/XTrayIconPeer.java | 3 +- .../unix/classes/sun/awt/X11/XWindowPeer.java | 3 +- .../unix/classes/sun/awt/X11/XlibWrapper.java | 2 + .../classes/sun/awt/X11GraphicsDevice.java | 2 + .../sun/awt/X11GraphicsEnvironment.java | 1 + .../sun/java2d/x11/X11SurfaceData.java | 4 +- .../sun/java2d/xr/XRCompositeManager.java | 3 +- .../unix/classes/sun/print/CUPSPrinter.java | 3 +- .../classes/sun/print/IPPPrintService.java | 5 +- .../sun/print/PrintServiceLookupProvider.java | 3 +- .../unix/classes/sun/print/UnixPrintJob.java | 2 + .../classes/sun/print/UnixPrintService.java | 3 +- .../plaf/windows/AnimationController.java | 3 +- .../plaf/windows/WindowsLookAndFeel.java | 4 +- .../sun/java/swing/plaf/windows/XPStyle.java | 3 +- .../classes/sun/awt/Win32FontManager.java | 3 +- .../classes/sun/awt/Win32GraphicsDevice.java | 4 +- .../sun/awt/shell/Win32ShellFolder2.java | 2 + .../awt/shell/Win32ShellFolderManager2.java | 11 ++- .../awt/windows/TranslucentWindowPainter.java | 4 +- .../sun/awt/windows/WEmbeddedFrame.java | 4 +- .../sun/awt/windows/WFileDialogPeer.java | 3 +- .../classes/sun/awt/windows/WFramePeer.java | 3 +- .../sun/awt/windows/WMenuItemPeer.java | 3 +- .../sun/awt/windows/WPathGraphics.java | 1 + .../classes/sun/awt/windows/WPrinterJob.java | 1 + .../classes/sun/awt/windows/WToolkit.java | 7 +- .../java2d/d3d/D3DScreenUpdateManager.java | 4 +- .../sun/java2d/windows/WindowsFlags.java | 3 +- .../sun/print/PrintServiceLookupProvider.java | 1 + .../classes/sun/print/Win32PrintJob.java | 1 + .../classes/sun/print/Win32PrintService.java | 3 +- .../sun/instrument/InstrumentationImpl.java | 3 +- .../java/util/logging/FileHandler.java | 1 + .../classes/java/util/logging/Handler.java | 3 +- .../classes/java/util/logging/Level.java | 3 +- .../classes/java/util/logging/LogManager.java | 10 +- .../classes/java/util/logging/LogRecord.java | 3 +- .../classes/java/util/logging/Logger.java | 4 +- .../java/util/logging/StreamHandler.java | 3 +- .../logging/internal/LoggingProviderImpl.java | 6 +- .../remote/rmi/RMIConnectionImpl.java | 11 ++- .../management/remote/rmi/RMIConnector.java | 3 +- .../DefaultMBeanServerInterceptor.java | 13 ++- .../ClassLoaderRepositorySupport.java | 3 +- .../com/sun/jmx/mbeanserver/Introspector.java | 3 +- .../sun/jmx/mbeanserver/JmxMBeanServer.java | 6 +- .../jmx/mbeanserver/MBeanInstantiator.java | 5 +- .../com/sun/jmx/mbeanserver/MXBeanLookup.java | 3 +- .../com/sun/jmx/mbeanserver/PerInterface.java | 3 +- .../internal/ArrayNotificationBuffer.java | 6 +- .../remote/internal/ClientNotifForwarder.java | 5 +- .../remote/internal/ServerNotifForwarder.java | 5 +- .../jmx/remote/security/FileLoginModule.java | 4 +- .../security/HashedPasswordManager.java | 3 +- .../security/JMXPluggableAuthenticator.java | 4 +- .../security/JMXSubjectDomainCombiner.java | 3 +- .../security/MBeanServerAccessController.java | 8 +- .../MBeanServerFileAccessController.java | 4 +- .../jmx/remote/security/SubjectDelegator.java | 5 +- .../com/sun/jmx/remote/util/EnvHelp.java | 3 +- .../lang/management/ManagementFactory.java | 1 + .../java/lang/management/RuntimeMXBean.java | 3 +- .../management/ClassAttributeValueExp.java | 3 +- .../javax/management/MBeanAttributeInfo.java | 3 +- .../classes/javax/management/MBeanInfo.java | 3 +- .../javax/management/MBeanServerFactory.java | 4 +- .../javax/management/Notification.java | 3 +- .../javax/management/NumericValueExp.java | 3 +- .../classes/javax/management/ObjectName.java | 3 +- .../javax/management/StandardMBean.java | 3 +- .../javax/management/loading/MLet.java | 1 + .../modelmbean/DescriptorSupport.java | 4 +- .../InvalidTargetObjectTypeException.java | 3 +- .../modelmbean/ModelMBeanAttributeInfo.java | 3 +- .../modelmbean/ModelMBeanConstructorInfo.java | 3 +- .../modelmbean/ModelMBeanInfoSupport.java | 3 +- .../ModelMBeanNotificationInfo.java | 3 +- .../modelmbean/ModelMBeanOperationInfo.java | 3 +- .../modelmbean/RequiredModelMBean.java | 9 +- .../modelmbean/XMLParseException.java | 3 +- .../javax/management/monitor/Monitor.java | 9 +- .../javax/management/openmbean/OpenType.java | 4 +- .../openmbean/TabularDataSupport.java | 3 +- .../MBeanServerNotificationFilter.java | 3 +- .../relation/RelationNotification.java | 3 +- .../relation/RelationTypeSupport.java | 3 +- .../javax/management/relation/Role.java | 3 +- .../javax/management/relation/RoleInfo.java | 3 +- .../javax/management/relation/RoleResult.java | 3 +- .../management/relation/RoleUnresolved.java | 3 +- .../remote/JMXConnectorFactory.java | 4 +- .../management/ManagementFactoryHelper.java | 5 +- .../sun/management/MappedMXBeanType.java | 3 +- .../share/classes/sun/management/Util.java | 3 +- .../sun/management/VMManagementImpl.java | 4 +- .../management/spi/PlatformMBeanProvider.java | 3 +- .../classes/com/sun/jndi/ldap/Connection.java | 1 + .../sun/jndi/ldap/LdapBindingEnumeration.java | 2 + .../classes/com/sun/jndi/ldap/LdapCtx.java | 3 +- .../sun/jndi/ldap/LdapDnsProviderService.java | 3 +- .../com/sun/jndi/ldap/LdapPoolManager.java | 1 + .../sun/jndi/ldap/LdapSearchEnumeration.java | 2 + .../com/sun/jndi/ldap/VersionHelper.java | 5 +- .../sun/naming/internal/VersionHelper.java | 8 ++ .../javax/naming/ldap/StartTlsRequest.java | 2 + .../naming/ldap/spi/LdapDnsProvider.java | 3 +- .../javax/naming/spi/NamingManager.java | 5 +- .../provider/certpath/ldap/JdkLDAP.java | 1 + .../provider/certpath/ldap/LDAPCertStore.java | 3 +- .../certpath/ldap/LDAPCertStoreImpl.java | 4 +- .../jdk/internal/net/http/Exchange.java | 6 +- .../jdk/internal/net/http/HttpClientImpl.java | 4 + .../internal/net/http/HttpRequestImpl.java | 5 +- .../jdk/internal/net/http/MultiExchange.java | 5 +- .../net/http/PlainHttpConnection.java | 3 +- .../internal/net/http/PrivilegedExecutor.java | 9 +- .../internal/net/http/RequestPublishers.java | 3 + .../net/http/ResponseBodyHandlers.java | 12 ++- .../net/http/ResponseSubscribers.java | 9 +- .../jdk/internal/net/http/common/Utils.java | 5 + .../jdk/internal/net/http/hpack/HPACK.java | 3 +- .../net/http/websocket/OpeningHandshake.java | 4 +- .../util/prefs/MacOSXPreferencesFile.java | 3 +- .../java/util/prefs/AbstractPreferences.java | 3 +- .../classes/java/util/prefs/Preferences.java | 5 +- .../util/prefs/FileSystemPreferences.java | 3 +- .../java/util/prefs/WindowsPreferences.java | 1 + .../classes/java/rmi/MarshalledObject.java | 3 +- .../classes/java/rmi/RMISecurityManager.java | 11 ++- .../classes/java/rmi/server/LogStream.java | 3 +- .../share/classes/java/rmi/server/ObjID.java | 3 +- .../java/rmi/server/RMIClassLoader.java | 4 +- .../java/rmi/server/RMISocketFactory.java | 4 +- .../classes/sun/rmi/log/ReliableLog.java | 5 +- .../sun/rmi/registry/RegistryImpl.java | 6 ++ .../share/classes/sun/rmi/runtime/Log.java | 5 +- .../sun/rmi/runtime/NewThreadAction.java | 5 +- .../classes/sun/rmi/runtime/RuntimeUtil.java | 5 +- .../classes/sun/rmi/server/LoaderHandler.java | 11 ++- .../sun/rmi/server/MarshalInputStream.java | 6 +- .../sun/rmi/server/MarshalOutputStream.java | 3 +- .../classes/sun/rmi/server/UnicastRef.java | 3 +- .../sun/rmi/server/UnicastServerRef.java | 7 +- .../share/classes/sun/rmi/server/Util.java | 5 +- .../sun/rmi/transport/DGCAckHandler.java | 4 +- .../classes/sun/rmi/transport/DGCClient.java | 3 +- .../classes/sun/rmi/transport/DGCImpl.java | 4 +- .../share/classes/sun/rmi/transport/GC.java | 3 +- .../sun/rmi/transport/ObjectTable.java | 5 +- .../sun/rmi/transport/StreamRemoteCall.java | 3 +- .../classes/sun/rmi/transport/Target.java | 6 +- .../classes/sun/rmi/transport/Transport.java | 4 +- .../sun/rmi/transport/tcp/TCPChannel.java | 11 ++- .../sun/rmi/transport/tcp/TCPEndpoint.java | 6 +- .../sun/rmi/transport/tcp/TCPTransport.java | 4 +- .../javax/script/ScriptEngineManager.java | 3 +- .../auth/kerberos/KerberosPrincipal.java | 1 + .../javax/security/auth/kerberos/KeyTab.java | 5 +- .../classes/sun/security/jgss/GSSUtil.java | 4 +- .../sun/security/jgss/LoginConfigImpl.java | 3 +- .../sun/security/jgss/SunProvider.java | 3 +- .../sun/security/jgss/krb5/InitialToken.java | 3 +- .../jgss/krb5/Krb5AcceptCredential.java | 3 +- .../sun/security/jgss/krb5/Krb5Context.java | 4 +- .../jgss/krb5/Krb5InitCredential.java | 3 +- .../security/jgss/krb5/Krb5MechFactory.java | 4 +- .../security/jgss/krb5/Krb5NameElement.java | 3 +- .../sun/security/jgss/krb5/Krb5Util.java | 11 ++- .../security/jgss/wrapper/GSSCredElement.java | 3 +- .../security/jgss/wrapper/GSSNameElement.java | 3 +- .../sun/security/jgss/wrapper/Krb5Util.java | 3 +- .../jgss/wrapper/NativeGSSContext.java | 4 +- .../jgss/wrapper/SunNativeProvider.java | 1 + .../classes/sun/security/krb5/Config.java | 4 + .../sun/security/krb5/Credentials.java | 3 +- .../classes/sun/security/krb5/KdcComm.java | 2 + .../sun/security/krb5/KrbServiceLocator.java | 4 +- .../security/krb5/SCDynamicStoreConfig.java | 1 + .../internal/ccache/FileCredentialsCache.java | 4 +- .../com/sun/security/sasl/Provider.java | 3 +- .../classes/javax/security/sasl/Sasl.java | 3 +- .../javax/smartcardio/TerminalFactory.java | 3 +- .../sun/security/smartcardio/CardImpl.java | 4 +- .../sun/security/smartcardio/ChannelImpl.java | 3 +- .../sun/security/smartcardio/SunPCSC.java | 3 +- .../security/smartcardio/TerminalImpl.java | 3 +- .../security/smartcardio/PlatformPCSC.java | 3 +- .../security/smartcardio/PlatformPCSC.java | 3 +- .../com/sun/rowset/CachedRowSetImpl.java | 3 +- .../javax/sql/rowset/RowSetProvider.java | 6 +- .../sql/rowset/serial/SerialJavaObject.java | 3 +- .../javax/sql/rowset/spi/SyncFactory.java | 8 +- .../share/classes/java/sql/DriverManager.java | 6 +- .../apache/xml/internal/security/Init.java | 2 + .../c14n/implementations/UtfHelpper.java | 1 + .../security/parser/XMLParserImpl.java | 3 + .../internal/security/signature/Manifest.java | 1 + .../security/signature/Reference.java | 1 + .../security/utils/IgnoreAllErrorHandler.java | 1 + .../internal/security/utils/JavaUtils.java | 1 + .../xml/internal/security/utils/XMLUtils.java | 2 + .../com/sun/org/slf4j/internal/Logger.java | 3 +- .../xml/dsig/internal/dom/DOMReference.java | 3 +- .../org/jcp/xml/dsig/internal/dom/Policy.java | 3 +- .../jcp/xml/dsig/internal/dom/XMLDSigRI.java | 4 +- .../xalan/internal/utils/ObjectFactory.java | 5 +- .../internal/xsltc/compiler/util/Type.java | 3 +- .../internal/xsltc/trax/TemplatesImpl.java | 3 + .../xsltc/trax/TransformerFactoryImpl.java | 1 + .../jaxp/DocumentBuilderFactoryImpl.java | 1 + .../internal/jaxp/SAXParserFactoryImpl.java | 3 +- .../jaxp/validation/XMLSchemaFactory.java | 2 +- .../XMLSchemaValidatorComponentManager.java | 1 + .../xerces/internal/utils/ObjectFactory.java | 5 +- .../xpath/internal/jaxp/XPathFactoryImpl.java | 1 + .../javax/xml/datatype/FactoryFinder.java | 4 +- .../javax/xml/parsers/FactoryFinder.java | 4 +- .../javax/xml/stream/FactoryFinder.java | 4 +- .../javax/xml/transform/FactoryFinder.java | 4 +- .../xml/transform/TransformerException.java | 3 +- .../xml/validation/SchemaFactoryFinder.java | 5 +- .../javax/xml/xpath/XPathFactoryFinder.java | 5 +- .../classes/jdk/xml/internal/JdkXmlUtils.java | 2 + .../jdk/xml/internal/SecuritySupport.java | 16 +++- .../bootstrap/DOMImplementationRegistry.java | 4 + .../org/xml/sax/helpers/NewInstance.java | 3 +- .../org/xml/sax/helpers/XMLReaderFactory.java | 3 +- .../accessibility/util/AWTEventMonitor.java | 3 +- .../accessibility/util/EventQueueMonitor.java | 3 +- .../accessibility/internal/AccessBridge.java | 3 +- .../sun/tools/attach/spi/AttachProvider.java | 3 +- .../tools/attach/HotSpotAttachProvider.java | 3 +- .../tools/attach/HotSpotVirtualMachine.java | 3 +- .../classes/sun/nio/cs/ext/JISAutoDetect.java | 3 +- .../classes/sun/nio/cs/ext/SJIS_0213.java | 1 + .../classes/sun/security/pkcs11/Config.java | 3 +- .../classes/sun/security/pkcs11/P11Key.java | 1 + .../sun/security/pkcs11/P11KeyAgreement.java | 3 +- .../classes/sun/security/pkcs11/P11Util.java | 1 + .../sun/security/pkcs11/SunPKCS11.java | 7 ++ .../sun/security/pkcs11/wrapper/PKCS11.java | 1 + .../share/classes/sun/security/ec/SunEC.java | 3 +- .../sun/security/mscapi/CKeyStore.java | 4 +- .../sun/security/mscapi/SunMSCAPI.java | 3 +- .../classes/jdk/dynalink/BiClassValue.java | 4 +- .../jdk/dynalink/DynamicLinkerFactory.java | 5 +- .../jdk/dynalink/SecureLookupSupplier.java | 3 +- .../jdk/dynalink/beans/BeanIntrospector.java | 3 +- .../beans/CallerSensitiveDynamicMethod.java | 4 +- .../beans/CheckRestrictedPackage.java | 4 +- .../jdk/dynalink/beans/ClassString.java | 4 +- .../beans/OverloadedDynamicMethod.java | 4 +- .../internal/AccessControlContextFactory.java | 5 +- .../linker/GuardingDynamicLinkerExporter.java | 3 +- .../sun/jvm/hotspot/SALauncherLoader.java | 3 +- .../hotspot/tools/jcore/ByteCodeRewriter.java | 3 +- .../httpserver/spi/HttpServerProvider.java | 4 +- .../sun/net/httpserver/ServerConfig.java | 3 +- .../sun/net/httpserver/ServerImpl.java | 1 + .../jdk/incubator/foreign/LibraryLookup.java | 5 +- .../protocol/local/PerfDataBuffer.java | 3 +- .../vm/ci/services/JVMCIServiceLocator.java | 4 +- .../src/jdk/vm/ci/services/Services.java | 5 +- .../tools/jdi/VirtualMachineManagerImpl.java | 3 +- .../share/classes/jdk/jfr/FlightRecorder.java | 3 +- .../jdk/jfr/FlightRecorderPermission.java | 3 +- .../share/classes/jdk/jfr/SettingControl.java | 5 +- .../classes/jdk/jfr/consumer/EventStream.java | 3 + .../jdk/jfr/consumer/RecordingStream.java | 1 + .../classes/jdk/jfr/internal/Control.java | 6 +- .../jdk/jfr/internal/PlatformRecorder.java | 3 +- .../jdk/jfr/internal/PlatformRecording.java | 3 + .../jdk/jfr/internal/PrivateAccess.java | 3 +- .../jdk/jfr/internal/RequestEngine.java | 10 +- .../jdk/jfr/internal/SecuritySupport.java | 11 ++- .../jdk/jfr/internal/ShutdownHook.java | 3 +- .../share/classes/jdk/jfr/internal/Utils.java | 2 + .../jdk/jfr/internal/WriteableUserPath.java | 5 +- .../consumer/AbstractEventStream.java | 4 +- .../consumer/EventDirectoryStream.java | 1 + .../internal/consumer/EventFileStream.java | 4 +- .../management/ManagementSupport.java | 1 + .../jdk/tools/jlink/internal/Jlink.java | 3 +- .../jdk/tools/jlink/internal/Main.java | 3 +- .../classes/sun/tools/jstatd/Jstatd.java | 4 +- .../jdk/internal/agent/spi/AgentProvider.java | 3 +- .../jdk/internal/agent/FileSystemImpl.java | 3 +- .../jdk/internal/agent/FileSystemImpl.java | 3 +- .../jfr/FlightRecorderMXBeanImpl.java | 9 +- .../jdk/management/jfr/MBeanUtils.java | 4 +- .../management/jfr/RemoteRecordingStream.java | 2 + .../internal/DiagnosticCommandImpl.java | 3 +- .../com/sun/management/internal/Flag.java | 3 +- ...rbageCollectionNotifInfoCompositeData.java | 3 +- .../internal/GcInfoCompositeData.java | 4 +- .../internal/HotSpotDiagnostic.java | 4 +- .../internal/PlatformMBeanProviderImpl.java | 3 +- .../com/sun/jndi/dns/DnsContextFactory.java | 3 +- .../jndi/rmi/registry/RegistryContext.java | 4 +- .../classes/jdk/net/LinuxSocketOptions.java | 3 +- .../classes/jdk/net/MacOSXSocketOptions.java | 3 +- .../jdk/net/ExtendedSocketOptions.java | 3 +- .../share/classes/jdk/nio/Channels.java | 3 +- .../sun/nio/ch/sctp/SctpChannelImpl.java | 3 +- .../sun/nio/ch/sctp/SctpMultiChannelImpl.java | 5 +- .../unix/classes/sun/nio/ch/sctp/SctpNet.java | 3 +- .../nio/ch/sctp/SctpServerChannelImpl.java | 4 +- .../security/jgss/ExtendedGSSContextImpl.java | 3 +- .../sun/security/sasl/gsskerb/JdkSASL.java | 3 +- .../sun/reflect/ReflectionFactory.java | 4 +- .../classes/jdk/nio/zipfs/ZipFileSystem.java | 7 +- .../jdk/nio/zipfs/ZipFileSystemProvider.java | 3 +- .../DataFlavor/DataFlavorRemoteTest.java | 6 +- .../LoggerFinderLoaderTest.java | 11 ++- .../lang/System/SecurityManagerWarnings.java | 92 +++++++++++++++++++ .../lambda/LogGeneratedClassesTest.java | 5 +- .../spi/URLStreamHandlerProvider/Basic.java | 8 +- .../DoPrivAccompliceTest.java | 2 +- test/lib/jdk/test/lib/Platform.java | 3 +- .../jdk/test/lib/process/OutputAnalyzer.java | 15 +++ test/lib/sun/hotspot/WhiteBox.java | 1 + .../reflect/ClazzWithSecurityManager.java | 3 +- .../bench/java/security/DoPrivileged.java | 4 +- .../bench/java/security/GetContext.java | 7 +- 826 files changed, 2734 insertions(+), 757 deletions(-) create mode 100644 test/jdk/java/lang/System/SecurityManagerWarnings.java diff --git a/make/RunTests.gmk b/make/RunTests.gmk index f1da577de6a..282db4764e7 100644 --- a/make/RunTests.gmk +++ b/make/RunTests.gmk @@ -767,7 +767,7 @@ define SetupRunJtregTestBody -vmoption:-XX:MaxRAMPercentage=$$($1_JTREG_MAX_RAM_PERCENTAGE) \ -vmoption:-Djava.io.tmpdir="$$($1_TEST_TMP_DIR)" - $1_JTREG_BASIC_OPTIONS += -automatic -ignore:quiet + $1_JTREG_BASIC_OPTIONS += -automatic -ignore:quiet -Djavatest.security.noSecurityManager=true # Make it possible to specify the JIB_DATA_DIR for tests using the # JIB Artifact resolver diff --git a/src/demo/share/jfc/J2Ddemo/java2d/Tools.java b/src/demo/share/jfc/J2Ddemo/java2d/Tools.java index 62a60098caa..3c01042adf4 100644 --- a/src/demo/share/jfc/J2Ddemo/java2d/Tools.java +++ b/src/demo/share/jfc/J2Ddemo/java2d/Tools.java @@ -1,6 +1,6 @@ /* * - * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2021, Oracle and/or its affiliates. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -406,7 +406,7 @@ public final class Tools extends JPanel implements ActionListener, if (pDialogState) { printJob.print(aset); } - } catch (java.security.AccessControlException ace) { + } catch (@SuppressWarnings("removal") java.security.AccessControlException ace) { String errmsg = "Applet access control exception; to allow " + "access to printer, set\n" + "permission for \"queuePrintJob\" in " diff --git a/src/java.base/aix/classes/sun/nio/ch/DefaultSelectorProvider.java b/src/java.base/aix/classes/sun/nio/ch/DefaultSelectorProvider.java index 34187e10fff..86d3ade19de 100644 --- a/src/java.base/aix/classes/sun/nio/ch/DefaultSelectorProvider.java +++ b/src/java.base/aix/classes/sun/nio/ch/DefaultSelectorProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,6 +32,7 @@ import java.security.PrivilegedAction; * Creates this platform's default SelectorProvider */ +@SuppressWarnings("removal") public class DefaultSelectorProvider { private static final SelectorProviderImpl INSTANCE; static { diff --git a/src/java.base/linux/classes/jdk/internal/platform/CgroupUtil.java b/src/java.base/linux/classes/jdk/internal/platform/CgroupUtil.java index d50aa6bbb6d..dbe8a85b2b2 100644 --- a/src/java.base/linux/classes/jdk/internal/platform/CgroupUtil.java +++ b/src/java.base/linux/classes/jdk/internal/platform/CgroupUtil.java @@ -39,6 +39,7 @@ import java.util.stream.Stream; public final class CgroupUtil { + @SuppressWarnings("removal") public static Stream readFilePrivileged(Path path) throws IOException { try { PrivilegedExceptionAction> pea = () -> Files.lines(path); @@ -64,7 +65,7 @@ public final class CgroupUtil { static String readStringValue(CgroupSubsystemController controller, String param) throws IOException { PrivilegedExceptionAction pea = () -> Files.newBufferedReader(Paths.get(controller.path(), param)); - try (BufferedReader bufferedReader = + try (@SuppressWarnings("removal") BufferedReader bufferedReader = AccessController.doPrivileged(pea)) { String line = bufferedReader.readLine(); return line; @@ -76,6 +77,7 @@ public final class CgroupUtil { } } + @SuppressWarnings("removal") public static List readAllLinesPrivileged(Path path) throws IOException { try { PrivilegedExceptionAction> pea = () -> Files.readAllLines(path); diff --git a/src/java.base/linux/classes/sun/nio/ch/DefaultSelectorProvider.java b/src/java.base/linux/classes/sun/nio/ch/DefaultSelectorProvider.java index 134795c8b28..fa925f54546 100644 --- a/src/java.base/linux/classes/sun/nio/ch/DefaultSelectorProvider.java +++ b/src/java.base/linux/classes/sun/nio/ch/DefaultSelectorProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,6 +32,7 @@ import java.security.PrivilegedAction; * Creates this platform's default SelectorProvider */ +@SuppressWarnings("removal") public class DefaultSelectorProvider { private static final SelectorProviderImpl INSTANCE; static { diff --git a/src/java.base/macosx/classes/apple/security/AppleProvider.java b/src/java.base/macosx/classes/apple/security/AppleProvider.java index 3b712846d45..8381ffeb891 100644 --- a/src/java.base/macosx/classes/apple/security/AppleProvider.java +++ b/src/java.base/macosx/classes/apple/security/AppleProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -73,6 +73,7 @@ public final class AppleProvider extends Provider { } + @SuppressWarnings("removal") public AppleProvider() { /* We are the Apple provider */ super("Apple", PROVIDER_VER, info); diff --git a/src/java.base/macosx/classes/apple/security/KeychainStore.java b/src/java.base/macosx/classes/apple/security/KeychainStore.java index 25126f13c9f..cf97d4e04c0 100644 --- a/src/java.base/macosx/classes/apple/security/KeychainStore.java +++ b/src/java.base/macosx/classes/apple/security/KeychainStore.java @@ -110,6 +110,7 @@ public final class KeychainStore extends KeyStoreSpi { } private static void permissionCheck() { + @SuppressWarnings("removal") SecurityManager sec = System.getSecurityManager(); if (sec != null) { diff --git a/src/java.base/macosx/classes/java/net/DefaultInterface.java b/src/java.base/macosx/classes/java/net/DefaultInterface.java index 8aaba11227c..1901fcb156a 100644 --- a/src/java.base/macosx/classes/java/net/DefaultInterface.java +++ b/src/java.base/macosx/classes/java/net/DefaultInterface.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -106,6 +106,7 @@ class DefaultInterface { boolean ip4 = false, ip6 = false, isNonLinkLocal = false; PrivilegedAction> pa = ni::getInetAddresses; + @SuppressWarnings("removal") Enumeration addrs = AccessController.doPrivileged(pa); while (addrs.hasMoreElements()) { InetAddress addr = addrs.nextElement(); diff --git a/src/java.base/macosx/classes/sun/nio/ch/DefaultSelectorProvider.java b/src/java.base/macosx/classes/sun/nio/ch/DefaultSelectorProvider.java index 131911c1bf3..a010b1706d4 100644 --- a/src/java.base/macosx/classes/sun/nio/ch/DefaultSelectorProvider.java +++ b/src/java.base/macosx/classes/sun/nio/ch/DefaultSelectorProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,6 +32,7 @@ import java.security.PrivilegedAction; * Creates this platform's default SelectorProvider */ +@SuppressWarnings("removal") public class DefaultSelectorProvider { private static final SelectorProviderImpl INSTANCE; static { diff --git a/src/java.base/share/classes/com/sun/crypto/provider/DHKeyAgreement.java b/src/java.base/share/classes/com/sun/crypto/provider/DHKeyAgreement.java index 297b78747d9..94f41e614f1 100644 --- a/src/java.base/share/classes/com/sun/crypto/provider/DHKeyAgreement.java +++ b/src/java.base/share/classes/com/sun/crypto/provider/DHKeyAgreement.java @@ -66,6 +66,7 @@ extends KeyAgreementSpi { private static final boolean VALUE = getValue(); + @SuppressWarnings("removal") private static boolean getValue() { return AccessController.doPrivileged( (PrivilegedAction) diff --git a/src/java.base/share/classes/com/sun/crypto/provider/JceKeyStore.java b/src/java.base/share/classes/com/sun/crypto/provider/JceKeyStore.java index c5772b4844c..6038f6de865 100644 --- a/src/java.base/share/classes/com/sun/crypto/provider/JceKeyStore.java +++ b/src/java.base/share/classes/com/sun/crypto/provider/JceKeyStore.java @@ -683,6 +683,7 @@ public final class JceKeyStore extends KeyStoreSpi { * @exception CertificateException if any of the certificates in the * keystore could not be loaded */ + @SuppressWarnings("removal") public void engineLoad(InputStream stream, char[] password) throws IOException, NoSuchAlgorithmException, CertificateException { diff --git a/src/java.base/share/classes/com/sun/crypto/provider/SealedObjectForKeyProtector.java b/src/java.base/share/classes/com/sun/crypto/provider/SealedObjectForKeyProtector.java index e50c018fa6c..01330678083 100644 --- a/src/java.base/share/classes/com/sun/crypto/provider/SealedObjectForKeyProtector.java +++ b/src/java.base/share/classes/com/sun/crypto/provider/SealedObjectForKeyProtector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -73,6 +73,7 @@ final class SealedObjectForKeyProtector extends SealedObject { return params; } + @SuppressWarnings("removal") final Key getKey(Cipher c, int maxLength) throws IOException, ClassNotFoundException, IllegalBlockSizeException, BadPaddingException { @@ -112,6 +113,7 @@ final class SealedObjectForKeyProtector extends SealedObject { private static final ObjectInputFilter OWN_FILTER; static { + @SuppressWarnings("removal") String prop = AccessController.doPrivileged( (PrivilegedAction) () -> { String tmp = System.getProperty(KEY_SERIAL_FILTER); diff --git a/src/java.base/share/classes/com/sun/crypto/provider/SunJCE.java b/src/java.base/share/classes/com/sun/crypto/provider/SunJCE.java index 0c7e0ed266a..030c3c078ec 100644 --- a/src/java.base/share/classes/com/sun/crypto/provider/SunJCE.java +++ b/src/java.base/share/classes/com/sun/crypto/provider/SunJCE.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -117,6 +117,7 @@ public final class SunJCE extends Provider { attrs)); } + @SuppressWarnings("removal") public SunJCE() { /* We are the "SunJCE" provider */ super("SunJCE", PROVIDER_VER, info); diff --git a/src/java.base/share/classes/java/io/File.java b/src/java.base/share/classes/java/io/File.java index aa06bd50ca9..bf2c1f756f3 100644 --- a/src/java.base/share/classes/java/io/File.java +++ b/src/java.base/share/classes/java/io/File.java @@ -770,6 +770,7 @@ public class File * method denies read access to the file */ public boolean canRead() { + @SuppressWarnings("removal") SecurityManager security = System.getSecurityManager(); if (security != null) { security.checkRead(path); @@ -798,6 +799,7 @@ public class File * method denies write access to the file */ public boolean canWrite() { + @SuppressWarnings("removal") SecurityManager security = System.getSecurityManager(); if (security != null) { security.checkWrite(path); @@ -821,6 +823,7 @@ public class File * method denies read access to the file or directory */ public boolean exists() { + @SuppressWarnings("removal") SecurityManager security = System.getSecurityManager(); if (security != null) { security.checkRead(path); @@ -851,6 +854,7 @@ public class File * method denies read access to the file */ public boolean isDirectory() { + @SuppressWarnings("removal") SecurityManager security = System.getSecurityManager(); if (security != null) { security.checkRead(path); @@ -883,6 +887,7 @@ public class File * method denies read access to the file */ public boolean isFile() { + @SuppressWarnings("removal") SecurityManager security = System.getSecurityManager(); if (security != null) { security.checkRead(path); @@ -912,6 +917,7 @@ public class File * @since 1.2 */ public boolean isHidden() { + @SuppressWarnings("removal") SecurityManager security = System.getSecurityManager(); if (security != null) { security.checkRead(path); @@ -955,6 +961,7 @@ public class File * method denies read access to the file */ public long lastModified() { + @SuppressWarnings("removal") SecurityManager security = System.getSecurityManager(); if (security != null) { security.checkRead(path); @@ -986,6 +993,7 @@ public class File * method denies read access to the file */ public long length() { + @SuppressWarnings("removal") SecurityManager security = System.getSecurityManager(); if (security != null) { security.checkRead(path); @@ -1026,6 +1034,7 @@ public class File * @since 1.2 */ public boolean createNewFile() throws IOException { + @SuppressWarnings("removal") SecurityManager security = System.getSecurityManager(); if (security != null) security.checkWrite(path); if (isInvalid()) { @@ -1053,6 +1062,7 @@ public class File * delete access to the file */ public boolean delete() { + @SuppressWarnings("removal") SecurityManager security = System.getSecurityManager(); if (security != null) { security.checkDelete(path); @@ -1091,6 +1101,7 @@ public class File * @since 1.2 */ public void deleteOnExit() { + @SuppressWarnings("removal") SecurityManager security = System.getSecurityManager(); if (security != null) { security.checkDelete(path); @@ -1154,6 +1165,7 @@ public class File * the directory */ private final String[] normalizedList() { + @SuppressWarnings("removal") SecurityManager security = System.getSecurityManager(); if (security != null) { security.checkRead(path); @@ -1356,6 +1368,7 @@ public class File * method does not permit the named directory to be created */ public boolean mkdir() { + @SuppressWarnings("removal") SecurityManager security = System.getSecurityManager(); if (security != null) { security.checkWrite(path); @@ -1438,6 +1451,7 @@ public class File if (dest == null) { throw new NullPointerException(); } + @SuppressWarnings("removal") SecurityManager security = System.getSecurityManager(); if (security != null) { security.checkWrite(path); @@ -1477,6 +1491,7 @@ public class File */ public boolean setLastModified(long time) { if (time < 0) throw new IllegalArgumentException("Negative time"); + @SuppressWarnings("removal") SecurityManager security = System.getSecurityManager(); if (security != null) { security.checkWrite(path); @@ -1507,6 +1522,7 @@ public class File * @since 1.2 */ public boolean setReadOnly() { + @SuppressWarnings("removal") SecurityManager security = System.getSecurityManager(); if (security != null) { security.checkWrite(path); @@ -1550,6 +1566,7 @@ public class File * @since 1.6 */ public boolean setWritable(boolean writable, boolean ownerOnly) { + @SuppressWarnings("removal") SecurityManager security = System.getSecurityManager(); if (security != null) { security.checkWrite(path); @@ -1628,6 +1645,7 @@ public class File * @since 1.6 */ public boolean setReadable(boolean readable, boolean ownerOnly) { + @SuppressWarnings("removal") SecurityManager security = System.getSecurityManager(); if (security != null) { security.checkWrite(path); @@ -1709,6 +1727,7 @@ public class File * @since 1.6 */ public boolean setExecutable(boolean executable, boolean ownerOnly) { + @SuppressWarnings("removal") SecurityManager security = System.getSecurityManager(); if (security != null) { security.checkWrite(path); @@ -1772,6 +1791,7 @@ public class File * @since 1.6 */ public boolean canExecute() { + @SuppressWarnings("removal") SecurityManager security = System.getSecurityManager(); if (security != null) { security.checkExec(path); @@ -1854,6 +1874,7 @@ public class File * @see FileStore#getTotalSpace */ public long getTotalSpace() { + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(new RuntimePermission("getFileSystemAttributes")); @@ -1897,6 +1918,7 @@ public class File * @see FileStore#getUnallocatedSpace */ public long getFreeSpace() { + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(new RuntimePermission("getFileSystemAttributes")); @@ -1943,6 +1965,7 @@ public class File * @see FileStore#getUsableSpace */ public long getUsableSpace() { + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(new RuntimePermission("getFileSystemAttributes")); @@ -1977,6 +2000,7 @@ public class File } return subNameLength; } + @SuppressWarnings("removal") static File generateFile(String prefix, String suffix, File dir) throws IOException { @@ -2125,6 +2149,7 @@ public class File File tmpdir = (directory != null) ? directory : TempDirectory.location(); + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); File f; do { diff --git a/src/java.base/share/classes/java/io/FileInputStream.java b/src/java.base/share/classes/java/io/FileInputStream.java index 4b6831c81c6..1d078142512 100644 --- a/src/java.base/share/classes/java/io/FileInputStream.java +++ b/src/java.base/share/classes/java/io/FileInputStream.java @@ -140,6 +140,7 @@ public class FileInputStream extends InputStream */ public FileInputStream(File file) throws FileNotFoundException { String name = (file != null ? file.getPath() : null); + @SuppressWarnings("removal") SecurityManager security = System.getSecurityManager(); if (security != null) { security.checkRead(name); @@ -182,6 +183,7 @@ public class FileInputStream extends InputStream * @see SecurityManager#checkRead(java.io.FileDescriptor) */ public FileInputStream(FileDescriptor fdObj) { + @SuppressWarnings("removal") SecurityManager security = System.getSecurityManager(); if (fdObj == null) { throw new NullPointerException(); diff --git a/src/java.base/share/classes/java/io/FileOutputStream.java b/src/java.base/share/classes/java/io/FileOutputStream.java index 950c3d8529e..2e71b2bf700 100644 --- a/src/java.base/share/classes/java/io/FileOutputStream.java +++ b/src/java.base/share/classes/java/io/FileOutputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -217,6 +217,7 @@ public class FileOutputStream extends OutputStream throws FileNotFoundException { String name = (file != null ? file.getPath() : null); + @SuppressWarnings("removal") SecurityManager security = System.getSecurityManager(); if (security != null) { security.checkWrite(name); @@ -259,6 +260,7 @@ public class FileOutputStream extends OutputStream * @see java.lang.SecurityManager#checkWrite(java.io.FileDescriptor) */ public FileOutputStream(FileDescriptor fdObj) { + @SuppressWarnings("removal") SecurityManager security = System.getSecurityManager(); if (fdObj == null) { throw new NullPointerException(); diff --git a/src/java.base/share/classes/java/io/FilePermission.java b/src/java.base/share/classes/java/io/FilePermission.java index 40d057f9495..83a1e98dc55 100644 --- a/src/java.base/share/classes/java/io/FilePermission.java +++ b/src/java.base/share/classes/java/io/FilePermission.java @@ -308,6 +308,7 @@ public final class FilePermission extends Permission implements Serializable { * @param mask the actions mask to use. * */ + @SuppressWarnings("removal") private void init(int mask) { if ((mask & ALL) != mask) throw new IllegalArgumentException("invalid actions mask"); diff --git a/src/java.base/share/classes/java/io/ObjectInputFilter.java b/src/java.base/share/classes/java/io/ObjectInputFilter.java index bbc9042ebca..f55c04d28f3 100644 --- a/src/java.base/share/classes/java/io/ObjectInputFilter.java +++ b/src/java.base/share/classes/java/io/ObjectInputFilter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -219,6 +219,7 @@ public interface ObjectInputFilter { * * @since 9 */ + @SuppressWarnings("removal") final class Config { /* No instances. */ private Config() {} diff --git a/src/java.base/share/classes/java/io/ObjectInputStream.java b/src/java.base/share/classes/java/io/ObjectInputStream.java index af7c6fbe74e..203df9c52ad 100644 --- a/src/java.base/share/classes/java/io/ObjectInputStream.java +++ b/src/java.base/share/classes/java/io/ObjectInputStream.java @@ -404,6 +404,7 @@ public class ObjectInputStream * @see java.io.SerializablePermission */ protected ObjectInputStream() throws IOException, SecurityException { + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION); @@ -915,6 +916,7 @@ public class ObjectInputStream return enable; } if (enable) { + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(SUBSTITUTION_PERMISSION); @@ -1307,6 +1309,7 @@ public class ObjectInputStream * @since 9 */ public final void setObjectInputFilter(ObjectInputFilter filter) { + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(ObjectStreamConstants.SERIAL_FILTER_PERMISSION); @@ -1575,6 +1578,7 @@ public class ObjectInputStream if (cl == ObjectInputStream.class) { return; } + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm == null) { return; @@ -1596,6 +1600,7 @@ public class ObjectInputStream * override security-sensitive non-final methods. Returns TRUE if subclass * is "safe", FALSE otherwise. */ + @SuppressWarnings("removal") private static Boolean auditSubclass(Class subcl) { return AccessController.doPrivileged( new PrivilegedAction() { @@ -2660,10 +2665,11 @@ public class ObjectInputStream final ObjectInputValidation obj; final int priority; Callback next; + @SuppressWarnings("removal") final AccessControlContext acc; Callback(ObjectInputValidation obj, int priority, Callback next, - AccessControlContext acc) + @SuppressWarnings("removal") AccessControlContext acc) { this.obj = obj; this.priority = priority; @@ -2697,6 +2703,7 @@ public class ObjectInputStream prev = cur; cur = cur.next; } + @SuppressWarnings("removal") AccessControlContext acc = AccessController.getContext(); if (prev != null) { prev.next = new Callback(obj, priority, cur, acc); @@ -2712,6 +2719,7 @@ public class ObjectInputStream * throws an InvalidObjectException, the callback process is terminated * and the exception propagated upwards. */ + @SuppressWarnings("removal") void doCallbacks() throws InvalidObjectException { try { while (list != null) { diff --git a/src/java.base/share/classes/java/io/ObjectOutputStream.java b/src/java.base/share/classes/java/io/ObjectOutputStream.java index b10e380ca57..d647c0c0e65 100644 --- a/src/java.base/share/classes/java/io/ObjectOutputStream.java +++ b/src/java.base/share/classes/java/io/ObjectOutputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -213,6 +213,7 @@ public class ObjectOutputStream * value of "sun.io.serialization.extendedDebugInfo" property, * as true or false for extended information about exception's place */ + @SuppressWarnings("removal") private static final boolean extendedDebugInfo = java.security.AccessController.doPrivileged( new sun.security.action.GetBooleanAction( @@ -274,6 +275,7 @@ public class ObjectOutputStream * @see java.io.SerializablePermission */ protected ObjectOutputStream() throws IOException, SecurityException { + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION); @@ -621,6 +623,7 @@ public class ObjectOutputStream return enable; } if (enable) { + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(SUBSTITUTION_PERMISSION); @@ -1052,6 +1055,7 @@ public class ObjectOutputStream if (cl == ObjectOutputStream.class) { return; } + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm == null) { return; @@ -1073,6 +1077,7 @@ public class ObjectOutputStream * override security-sensitive non-final methods. Returns TRUE if subclass * is "safe", FALSE otherwise. */ + @SuppressWarnings("removal") private static Boolean auditSubclass(Class subcl) { return AccessController.doPrivileged( new PrivilegedAction<>() { diff --git a/src/java.base/share/classes/java/io/ObjectStreamClass.java b/src/java.base/share/classes/java/io/ObjectStreamClass.java index 733281c896a..1eff6c27278 100644 --- a/src/java.base/share/classes/java/io/ObjectStreamClass.java +++ b/src/java.base/share/classes/java/io/ObjectStreamClass.java @@ -101,6 +101,7 @@ public class ObjectStreamClass implements Serializable { NO_FIELDS; /** reflection factory for obtaining serialization constructors */ + @SuppressWarnings("removal") private static final ReflectionFactory reflFactory = AccessController.doPrivileged( new ReflectionFactory.GetReflectionFactoryAction()); @@ -278,6 +279,7 @@ public class ObjectStreamClass implements Serializable { * * @return the SUID of the class described by this descriptor */ + @SuppressWarnings("removal") public long getSerialVersionUID() { // REMIND: synchronize instead of relying on volatile? if (suid == null) { @@ -301,6 +303,7 @@ public class ObjectStreamClass implements Serializable { * * @return the {@code Class} instance that this descriptor represents */ + @SuppressWarnings("removal") @CallerSensitive public Class forClass() { if (cl == null) { @@ -460,6 +463,7 @@ public class ObjectStreamClass implements Serializable { * Returns the value contained by this EntryFuture, blocking if * necessary until a value is set. */ + @SuppressWarnings("removal") synchronized Object get() { boolean interrupted = false; while (entry == unset) { @@ -493,6 +497,7 @@ public class ObjectStreamClass implements Serializable { /** * Creates local class descriptor representing given class. */ + @SuppressWarnings("removal") private ObjectStreamClass(final Class cl) { this.cl = cl; name = cl.getName(); @@ -620,6 +625,7 @@ public class ObjectStreamClass implements Serializable { * ProtectionDomain that separate the concrete class {@code cl} * from its ancestor's declaring {@code cons}, or {@code null}. */ + @SuppressWarnings("removal") private ProtectionDomain[] getProtectionDomains(Constructor cons, Class cl) { ProtectionDomain[] domains = null; @@ -1130,6 +1136,7 @@ public class ObjectStreamClass implements Serializable { * class is non-serializable or if the appropriate no-arg constructor is * inaccessible/unavailable. */ + @SuppressWarnings("removal") Object newInstance() throws InstantiationException, InvocationTargetException, UnsupportedOperationException @@ -1572,6 +1579,7 @@ public class ObjectStreamClass implements Serializable { * the not found ( which should never happen for correctly generated record * classes ). */ + @SuppressWarnings("removal") private static MethodHandle canonicalRecordCtr(Class cls) { assert cls.isRecord() : "Expected record, got: " + cls; PrivilegedAction pa = () -> { @@ -2584,6 +2592,7 @@ public class ObjectStreamClass implements Serializable { * and return * {@code Object} */ + @SuppressWarnings("removal") static MethodHandle deserializationCtr(ObjectStreamClass desc) { // check the cached value 1st MethodHandle mh = desc.deserializationCtr; diff --git a/src/java.base/share/classes/java/io/ObjectStreamField.java b/src/java.base/share/classes/java/io/ObjectStreamField.java index f8ecb71bd9b..9df32cf2fb0 100644 --- a/src/java.base/share/classes/java/io/ObjectStreamField.java +++ b/src/java.base/share/classes/java/io/ObjectStreamField.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -213,6 +213,7 @@ public class ObjectStreamField * @return a {@code Class} object representing the type of the * serializable field */ + @SuppressWarnings("removal") @CallerSensitive public Class getType() { if (System.getSecurityManager() != null) { diff --git a/src/java.base/share/classes/java/io/RandomAccessFile.java b/src/java.base/share/classes/java/io/RandomAccessFile.java index 5f6bcfaa6ac..5443018ca8b 100644 --- a/src/java.base/share/classes/java/io/RandomAccessFile.java +++ b/src/java.base/share/classes/java/io/RandomAccessFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -239,6 +239,7 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { + "\" must be one of " + "\"r\", \"rw\", \"rws\"," + " or \"rwd\""); + @SuppressWarnings("removal") SecurityManager security = System.getSecurityManager(); if (security != null) { security.checkRead(name); diff --git a/src/java.base/share/classes/java/lang/CharacterName.java b/src/java.base/share/classes/java/lang/CharacterName.java index 7dd83feecd1..4807635802b 100644 --- a/src/java.base/share/classes/java/lang/CharacterName.java +++ b/src/java.base/share/classes/java/lang/CharacterName.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -48,7 +48,7 @@ class CharacterName { private final int[] hsIndices; // chain heads, hash indices into "cps" private CharacterName() { - try (DataInputStream dis = new DataInputStream(new InflaterInputStream( + try (@SuppressWarnings("removal") DataInputStream dis = new DataInputStream(new InflaterInputStream( AccessController.doPrivileged(new PrivilegedAction<>() { public InputStream run() { return getClass().getResourceAsStream("uniName.dat"); diff --git a/src/java.base/share/classes/java/lang/Class.java b/src/java.base/share/classes/java/lang/Class.java index e30db2c4d86..b8bf7de250e 100644 --- a/src/java.base/share/classes/java/lang/Class.java +++ b/src/java.base/share/classes/java/lang/Class.java @@ -450,6 +450,7 @@ public final class Class implements java.io.Serializable, throws ClassNotFoundException { Class caller = null; + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { // Reflective call to get caller class is only needed if a security manager @@ -519,6 +520,7 @@ public final class Class implements java.io.Serializable, * @jls 12.3 Linking of Classes and Interfaces * @since 9 */ + @SuppressWarnings("removal") @CallerSensitive public static Class forName(Module module, String name) { Objects.requireNonNull(module); @@ -599,6 +601,7 @@ public final class Class implements java.io.Serializable, * s.checkPackageAccess()} denies access to the package * of this class. */ + @SuppressWarnings("removal") @CallerSensitive @Deprecated(since="9") public T newInstance() @@ -892,6 +895,7 @@ public final class Class implements java.io.Serializable, ClassLoader cl = getClassLoader0(); if (cl == null) return null; + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { ClassLoader.checkClassLoaderPermission(cl, Reflection.getCallerClass()); @@ -1357,6 +1361,7 @@ public final class Class implements java.io.Serializable, // Perform access check final Class enclosingCandidate = enclosingInfo.getEnclosingClass(); + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { enclosingCandidate.checkMemberAccess(sm, Member.DECLARED, @@ -1513,6 +1518,7 @@ public final class Class implements java.io.Serializable, // Perform access check final Class enclosingCandidate = enclosingInfo.getEnclosingClass(); + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { enclosingCandidate.checkMemberAccess(sm, Member.DECLARED, @@ -1560,6 +1566,7 @@ public final class Class implements java.io.Serializable, final Class candidate = getDeclaringClass0(); if (candidate != null) { + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { candidate.checkPackageAccess(sm, @@ -1614,6 +1621,7 @@ public final class Class implements java.io.Serializable, } if (enclosingCandidate != null) { + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { enclosingCandidate.checkPackageAccess(sm, @@ -1840,6 +1848,7 @@ public final class Class implements java.io.Serializable, * * @since 1.1 */ + @SuppressWarnings("removal") @CallerSensitive public Class[] getClasses() { SecurityManager sm = System.getSecurityManager(); @@ -1911,6 +1920,7 @@ public final class Class implements java.io.Serializable, */ @CallerSensitive public Field[] getFields() throws SecurityException { + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { checkMemberAccess(sm, Member.PUBLIC, Reflection.getCallerClass(), true); @@ -2001,6 +2011,7 @@ public final class Class implements java.io.Serializable, */ @CallerSensitive public Method[] getMethods() throws SecurityException { + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { checkMemberAccess(sm, Member.PUBLIC, Reflection.getCallerClass(), true); @@ -2041,6 +2052,7 @@ public final class Class implements java.io.Serializable, */ @CallerSensitive public Constructor[] getConstructors() throws SecurityException { + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { checkMemberAccess(sm, Member.PUBLIC, Reflection.getCallerClass(), true); @@ -2095,6 +2107,7 @@ public final class Class implements java.io.Serializable, public Field getField(String name) throws NoSuchFieldException, SecurityException { Objects.requireNonNull(name); + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { checkMemberAccess(sm, Member.PUBLIC, Reflection.getCallerClass(), true); @@ -2204,6 +2217,7 @@ public final class Class implements java.io.Serializable, public Method getMethod(String name, Class... parameterTypes) throws NoSuchMethodException, SecurityException { Objects.requireNonNull(name); + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { checkMemberAccess(sm, Member.PUBLIC, Reflection.getCallerClass(), true); @@ -2248,6 +2262,7 @@ public final class Class implements java.io.Serializable, public Constructor getConstructor(Class... parameterTypes) throws NoSuchMethodException, SecurityException { + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { checkMemberAccess(sm, Member.PUBLIC, Reflection.getCallerClass(), true); @@ -2295,6 +2310,7 @@ public final class Class implements java.io.Serializable, */ @CallerSensitive public Class[] getDeclaredClasses() throws SecurityException { + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { checkMemberAccess(sm, Member.DECLARED, Reflection.getCallerClass(), false); @@ -2347,6 +2363,7 @@ public final class Class implements java.io.Serializable, */ @CallerSensitive public Field[] getDeclaredFields() throws SecurityException { + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { checkMemberAccess(sm, Member.DECLARED, Reflection.getCallerClass(), true); @@ -2408,6 +2425,7 @@ public final class Class implements java.io.Serializable, */ @CallerSensitive public RecordComponent[] getRecordComponents() { + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { checkMemberAccess(sm, Member.DECLARED, Reflection.getCallerClass(), true); @@ -2478,6 +2496,7 @@ public final class Class implements java.io.Serializable, */ @CallerSensitive public Method[] getDeclaredMethods() throws SecurityException { + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { checkMemberAccess(sm, Member.DECLARED, Reflection.getCallerClass(), true); @@ -2528,6 +2547,7 @@ public final class Class implements java.io.Serializable, */ @CallerSensitive public Constructor[] getDeclaredConstructors() throws SecurityException { + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { checkMemberAccess(sm, Member.DECLARED, Reflection.getCallerClass(), true); @@ -2580,6 +2600,7 @@ public final class Class implements java.io.Serializable, public Field getDeclaredField(String name) throws NoSuchFieldException, SecurityException { Objects.requireNonNull(name); + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { checkMemberAccess(sm, Member.DECLARED, Reflection.getCallerClass(), true); @@ -2644,6 +2665,7 @@ public final class Class implements java.io.Serializable, public Method getDeclaredMethod(String name, Class... parameterTypes) throws NoSuchMethodException, SecurityException { Objects.requireNonNull(name); + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { checkMemberAccess(sm, Member.DECLARED, Reflection.getCallerClass(), true); @@ -2722,6 +2744,7 @@ public final class Class implements java.io.Serializable, public Constructor getDeclaredConstructor(Class... parameterTypes) throws NoSuchMethodException, SecurityException { + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { checkMemberAccess(sm, Member.DECLARED, Reflection.getCallerClass(), true); @@ -2968,6 +2991,7 @@ public final class Class implements java.io.Serializable, * @since 1.2 */ public java.security.ProtectionDomain getProtectionDomain() { + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(SecurityConstants.GET_PD_PERMISSION); @@ -3013,7 +3037,7 @@ public final class Class implements java.io.Serializable, * *

NOTE: should only be called if a SecurityManager is installed */ - private void checkMemberAccess(SecurityManager sm, int which, + private void checkMemberAccess(@SuppressWarnings("removal") SecurityManager sm, int which, Class caller, boolean checkProxyInterfaces) { /* Default policy allows access to all {@link Member#PUBLIC} members, * as well as access to classes that have the same class loader as the caller. @@ -3037,7 +3061,7 @@ public final class Class implements java.io.Serializable, * * NOTE: this method should only be called if a SecurityManager is active */ - private void checkPackageAccess(SecurityManager sm, final ClassLoader ccl, + private void checkPackageAccess(@SuppressWarnings("removal") SecurityManager sm, final ClassLoader ccl, boolean checkProxyInterfaces) { final ClassLoader cl = getClassLoader0(); @@ -3066,7 +3090,7 @@ public final class Class implements java.io.Serializable, * all classes provided must be loaded by the same ClassLoader * NOTE: this method does not support Proxy classes */ - private static void checkPackageAccessForPermittedSubclasses(SecurityManager sm, + private static void checkPackageAccessForPermittedSubclasses(@SuppressWarnings("removal") SecurityManager sm, final ClassLoader ccl, Class[] subClasses) { final ClassLoader cl = subClasses[0].getClassLoader0(); @@ -3762,6 +3786,7 @@ public final class Class implements java.io.Serializable, } // Fetches the factory for reflective objects + @SuppressWarnings("removal") private static ReflectionFactory getReflectionFactory() { if (reflectionFactory == null) { reflectionFactory = @@ -3794,6 +3819,7 @@ public final class Class implements java.io.Serializable, * identical to getEnumConstants except that the result is * uncloned, cached, and shared by all callers. */ + @SuppressWarnings("removal") T[] getEnumConstantsShared() { T[] constants = enumConstants; if (constants == null) { @@ -4204,6 +4230,7 @@ public final class Class implements java.io.Serializable, return this; } // returning a different class requires a security check + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { checkPackageAccess(sm, @@ -4296,6 +4323,7 @@ public final class Class implements java.io.Serializable, if (members.length > 1) { // If we return anything other than the current class we need // a security check + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { checkPackageAccess(sm, @@ -4492,6 +4520,7 @@ public final class Class implements java.io.Serializable, } if (subClasses.length > 0) { // If we return some classes we need a security check: + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { checkPackageAccessForPermittedSubclasses(sm, diff --git a/src/java.base/share/classes/java/lang/ClassLoader.java b/src/java.base/share/classes/java/lang/ClassLoader.java index 7a17a678389..9c249df4ff8 100644 --- a/src/java.base/share/classes/java/lang/ClassLoader.java +++ b/src/java.base/share/classes/java/lang/ClassLoader.java @@ -365,6 +365,7 @@ public abstract class ClassLoader { throw new IllegalArgumentException("name must be non-empty or null"); } + @SuppressWarnings("removal") SecurityManager security = System.getSecurityManager(); if (security != null) { security.checkCreateClassLoader(); @@ -671,6 +672,7 @@ public abstract class ClassLoader { } // Invoked by the VM after loading class with this loader. + @SuppressWarnings("removal") private void checkPackageAccess(Class cls, ProtectionDomain pd) { final SecurityManager sm = System.getSecurityManager(); if (sm != null) { @@ -1791,6 +1793,7 @@ public abstract class ClassLoader { public final ClassLoader getParent() { if (parent == null) return null; + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { // Check access to the parent class loader @@ -1834,6 +1837,7 @@ public abstract class ClassLoader { */ @CallerSensitive public static ClassLoader getPlatformClassLoader() { + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); ClassLoader loader = getBuiltinPlatformClassLoader(); if (sm != null) { @@ -1933,6 +1937,7 @@ public abstract class ClassLoader { default: // system fully initialized assert VM.isBooted() && scl != null; + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { checkClassLoaderPermission(scl, Reflection.getCallerClass()); @@ -2041,6 +2046,7 @@ public abstract class ClassLoader { * is not the same as or an ancestor of the given cl argument. */ static void checkClassLoaderPermission(ClassLoader cl, Class caller) { + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { // caller can be null if the VM is requesting it diff --git a/src/java.base/share/classes/java/lang/LiveStackFrame.java b/src/java.base/share/classes/java/lang/LiveStackFrame.java index aada8c8639c..7507bbc8877 100644 --- a/src/java.base/share/classes/java/lang/LiveStackFrame.java +++ b/src/java.base/share/classes/java/lang/LiveStackFrame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -177,6 +177,7 @@ interface LiveStackFrame extends StackFrame { * and it denies access to {@code RuntimePermission("getStackWalkerWithClassReference")}. */ public static StackWalker getStackWalker(Set options) { + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(new RuntimePermission("liveStackFrames")); diff --git a/src/java.base/share/classes/java/lang/Module.java b/src/java.base/share/classes/java/lang/Module.java index 62b5e671843..ab7d2103850 100644 --- a/src/java.base/share/classes/java/lang/Module.java +++ b/src/java.base/share/classes/java/lang/Module.java @@ -204,6 +204,7 @@ public final class Module implements AnnotatedElement { * If denied by the security manager */ public ClassLoader getClassLoader() { + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(SecurityConstants.GET_CLASSLOADER_PERMISSION); @@ -1471,6 +1472,7 @@ public final class Module implements AnnotatedElement { // cached class file with annotations private volatile Class moduleInfoClass; + @SuppressWarnings("removal") private Class moduleInfoClass() { Class clazz = this.moduleInfoClass; if (clazz != null) diff --git a/src/java.base/share/classes/java/lang/ModuleLayer.java b/src/java.base/share/classes/java/lang/ModuleLayer.java index 86fde6c7f13..6cecfe6d388 100644 --- a/src/java.base/share/classes/java/lang/ModuleLayer.java +++ b/src/java.base/share/classes/java/lang/ModuleLayer.java @@ -699,12 +699,14 @@ public final class ModuleLayer { } private static void checkCreateClassLoaderPermission() { + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkPermission(SecurityConstants.CREATE_CLASSLOADER_PERMISSION); } private static void checkGetClassLoaderPermission() { + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkPermission(SecurityConstants.GET_CLASSLOADER_PERMISSION); diff --git a/src/java.base/share/classes/java/lang/Package.java b/src/java.base/share/classes/java/lang/Package.java index 500f22cebf2..22a32c36894 100644 --- a/src/java.base/share/classes/java/lang/Package.java +++ b/src/java.base/share/classes/java/lang/Package.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -425,6 +425,7 @@ public class Package extends NamedPackage implements java.lang.reflect.Annotated String cn = packageName() + ".package-info"; Module module = module(); PrivilegedAction pa = module::getClassLoader; + @SuppressWarnings("removal") ClassLoader loader = AccessController.doPrivileged(pa); Class c; if (loader != null) { diff --git a/src/java.base/share/classes/java/lang/ProcessBuilder.java b/src/java.base/share/classes/java/lang/ProcessBuilder.java index c909ca6789f..d096bdad7b0 100644 --- a/src/java.base/share/classes/java/lang/ProcessBuilder.java +++ b/src/java.base/share/classes/java/lang/ProcessBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -348,6 +348,7 @@ public final class ProcessBuilder * @see System#getenv() */ public Map environment() { + @SuppressWarnings("removal") SecurityManager security = System.getSecurityManager(); if (security != null) security.checkPermission(new RuntimePermission("getenv.*")); @@ -1092,6 +1093,7 @@ public final class ProcessBuilder // Throws IndexOutOfBoundsException if command is empty String prog = cmdarray[0]; + @SuppressWarnings("removal") SecurityManager security = System.getSecurityManager(); if (security != null) security.checkExec(prog); diff --git a/src/java.base/share/classes/java/lang/ProcessHandleImpl.java b/src/java.base/share/classes/java/lang/ProcessHandleImpl.java index 883a15ebb02..81397e24959 100644 --- a/src/java.base/share/classes/java/lang/ProcessHandleImpl.java +++ b/src/java.base/share/classes/java/lang/ProcessHandleImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ package java.lang; import java.lang.annotation.Native; +import java.security.AccessController; import java.security.PrivilegedAction; import java.time.Duration; import java.time.Instant; @@ -40,8 +41,6 @@ import java.util.concurrent.ThreadLocalRandom; import java.util.stream.IntStream; import java.util.stream.Stream; -import static java.security.AccessController.doPrivileged; - /** * ProcessHandleImpl is the implementation of ProcessHandle. * @@ -83,8 +82,9 @@ final class ProcessHandleImpl implements ProcessHandle { /** * The thread pool of "process reaper" daemon threads. */ + @SuppressWarnings("removal") private static final Executor processReaperExecutor = - doPrivileged((PrivilegedAction) () -> { + AccessController.doPrivileged((PrivilegedAction) () -> { // Initialize ThreadLocalRandom now to avoid using the smaller stack // of the processReaper threads. ThreadLocalRandom.current(); @@ -238,6 +238,7 @@ final class ProcessHandleImpl implements ProcessHandle { * @throws SecurityException if RuntimePermission("manageProcess") is not granted */ static Optional get(long pid) { + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(new RuntimePermission("manageProcess")); @@ -278,6 +279,7 @@ final class ProcessHandleImpl implements ProcessHandle { * @throws SecurityException if RuntimePermission("manageProcess") is not granted */ public static ProcessHandleImpl current() { + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(new RuntimePermission("manageProcess")); @@ -301,6 +303,7 @@ final class ProcessHandleImpl implements ProcessHandle { * security policy */ public Optional parent() { + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(new RuntimePermission("manageProcess")); @@ -419,6 +422,7 @@ final class ProcessHandleImpl implements ProcessHandle { * @return a stream of ProcessHandles */ static Stream children(long pid) { + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(new RuntimePermission("manageProcess")); @@ -439,6 +443,7 @@ final class ProcessHandleImpl implements ProcessHandle { @Override public Stream descendants() { + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(new RuntimePermission("manageProcess")); diff --git a/src/java.base/share/classes/java/lang/PublicMethods.java b/src/java.base/share/classes/java/lang/PublicMethods.java index 31e87873387..b9851e2f049 100644 --- a/src/java.base/share/classes/java/lang/PublicMethods.java +++ b/src/java.base/share/classes/java/lang/PublicMethods.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -88,6 +88,7 @@ final class PublicMethods { * Method (name, parameter types) tuple. */ private static final class Key { + @SuppressWarnings("removal") private static final ReflectionFactory reflectionFactory = AccessController.doPrivileged( new ReflectionFactory.GetReflectionFactoryAction()); diff --git a/src/java.base/share/classes/java/lang/Runtime.java b/src/java.base/share/classes/java/lang/Runtime.java index 5348bf4d7d4..ba6e82af703 100644 --- a/src/java.base/share/classes/java/lang/Runtime.java +++ b/src/java.base/share/classes/java/lang/Runtime.java @@ -107,6 +107,7 @@ public class Runtime { * @see #halt(int) */ public void exit(int status) { + @SuppressWarnings("removal") SecurityManager security = System.getSecurityManager(); if (security != null) { security.checkExit(status); @@ -207,6 +208,7 @@ public class Runtime { * @since 1.3 */ public void addShutdownHook(Thread hook) { + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(new RuntimePermission("shutdownHooks")); @@ -235,6 +237,7 @@ public class Runtime { * @since 1.3 */ public boolean removeShutdownHook(Thread hook) { + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(new RuntimePermission("shutdownHooks")); @@ -270,6 +273,7 @@ public class Runtime { * @since 1.3 */ public void halt(int status) { + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkExit(status); @@ -734,6 +738,7 @@ public class Runtime { } void load0(Class fromClass, String filename) { + @SuppressWarnings("removal") SecurityManager security = System.getSecurityManager(); if (security != null) { security.checkLink(filename); @@ -797,6 +802,7 @@ public class Runtime { } void loadLibrary0(Class fromClass, String libname) { + @SuppressWarnings("removal") SecurityManager security = System.getSecurityManager(); if (security != null) { security.checkLink(libname); diff --git a/src/java.base/share/classes/java/lang/SecurityManager.java b/src/java.base/share/classes/java/lang/SecurityManager.java index 45b1431ece2..2facf5ff9e6 100644 --- a/src/java.base/share/classes/java/lang/SecurityManager.java +++ b/src/java.base/share/classes/java/lang/SecurityManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -79,9 +79,9 @@ import sun.security.util.SecurityConstants; * permitted. *

* Environments using a security manager will typically set the security - * manager at startup. In the JDK implementation, this is done by setting - * the system property {@code java.security.manager} on the command line to - * the class name of the security manager. It can also be set to the empty + * manager at startup. In the JDK implementation, this is done by setting the + * system property {@systemProperty java.security.manager} on the command line + * to the class name of the security manager. It can also be set to the empty * String ("") or the special token "{@code default}" to use the * default {@code java.lang.SecurityManager}. If a class name is specified, * it must be {@code java.lang.SecurityManager} or a public subclass and have @@ -313,7 +313,12 @@ import sun.security.util.SecurityConstants; * @see java.security.ProtectionDomain * * @since 1.0 + * @deprecated The Security Manager is deprecated and subject to removal in a + * future release. There is no replacement for the Security Manager. + * See JEP 411 for + * discussion and alternatives. */ +@Deprecated(since="17", forRemoval=true) public class SecurityManager { /* @@ -340,6 +345,7 @@ public class SecurityManager { */ public SecurityManager() { synchronized(SecurityManager.class) { + @SuppressWarnings("removal") SecurityManager sm = System.getSecurityManager(); if (sm != null) { // ask the currently installed security manager if we @@ -385,6 +391,7 @@ public class SecurityManager { * java.lang.Object) checkRead * @see java.security.AccessControlContext AccessControlContext */ + @SuppressWarnings("removal") public Object getSecurityContext() { return AccessController.getContext(); } @@ -404,6 +411,7 @@ public class SecurityManager { * {@code null}. * @since 1.2 */ + @SuppressWarnings("removal") public void checkPermission(Permission perm) { java.security.AccessController.checkPermission(perm); } @@ -439,6 +447,7 @@ public class SecurityManager { * @see java.security.AccessControlContext#checkPermission(java.security.Permission) * @since 1.2 */ + @SuppressWarnings("removal") public void checkPermission(Permission perm, Object context) { if (context instanceof AccessControlContext) { ((AccessControlContext)context).checkPermission(perm); @@ -1081,10 +1090,9 @@ public class SecurityManager { * @throws NullPointerException if the address argument is * {@code null}. * @since 1.1 - * @deprecated Use #checkPermission(java.security.Permission) instead * @see #checkPermission(java.security.Permission) checkPermission */ - @Deprecated(since="1.4") + @Deprecated(since="1.4", forRemoval=true) public void checkMulticast(InetAddress maddr, byte ttl) { String host = maddr.getHostAddress(); if (!host.startsWith("[") && host.indexOf(':') != -1) { @@ -1332,6 +1340,7 @@ public class SecurityManager { * Do we need to update our property array? */ if (!packageAccessValid) { + @SuppressWarnings("removal") String tmpPropertyStr = AccessController.doPrivileged( new PrivilegedAction<>() { @@ -1431,6 +1440,7 @@ public class SecurityManager { * Do we need to update our property array? */ if (!packageDefinitionValid) { + @SuppressWarnings("removal") String tmpPropertyStr = AccessController.doPrivileged( new PrivilegedAction<>() { diff --git a/src/java.base/share/classes/java/lang/StackWalker.java b/src/java.base/share/classes/java/lang/StackWalker.java index d1d28b83cc5..9f8a24f1e9e 100644 --- a/src/java.base/share/classes/java/lang/StackWalker.java +++ b/src/java.base/share/classes/java/lang/StackWalker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -418,6 +418,7 @@ public final class StackWalker { private static void checkPermission(Set