Deprecated API
Contents
-
Deprecated Interfaces Interface and Description org.xml.sax.AttributeList This interface has been replaced by the SAX2Attributes
interface, which includes Namespace support.java.security.Certificate A new certificate handling package is created in the Java platform. This Certificate interface is entirely deprecated and is here to allow for a smooth transition to the new package.org.xml.sax.DocumentHandler This interface has been replaced by the SAX2ContentHandler
interface, which includes Namespace support.org.omg.CORBA.DynAny Use the new DynAny insteadorg.omg.CORBA.DynArray Use the new DynArray insteadorg.omg.CORBA.DynEnum Use the new DynEnum insteadorg.omg.CORBA.DynFixed Use the new DynFixed insteadorg.omg.CORBA.DynSequence Use the new DynSequence insteadorg.omg.CORBA.DynStruct Use the new DynStruct insteadorg.omg.CORBA.DynUnion Use the new DynUnion insteadorg.omg.CORBA.DynValue Use the new DynValue insteadjava.rmi.server.LoaderHandler no replacementorg.xml.sax.Parser This interface has been replaced by the SAX2XMLReader
interface, which includes Namespace support.java.rmi.registry.RegistryHandler no replacementjava.rmi.server.RemoteCall no replacement.java.rmi.server.ServerRef No replacement. This interface is unused and is obsolete.java.rmi.server.Skeleton no replacement. Skeletons are no longer required for remote method calls in the Java 2 platform v1.2 and greater.javax.xml.bind.Validator since JAXB 2.0
-
Deprecated Classes Class and Description javax.accessibility.AccessibleResourceBundle This class is deprecated as of version 1.3 of the Java Platform.org.xml.sax.helpers.AttributeListImpl This class implements a deprecated interface,AttributeList
; that interface has been replaced byAttributes
, which is implemented in theAttributesImpl
helper class.javax.management.DefaultLoaderRepository UseMBeanServer.getClassLoaderRepository()
instead.javax.management.loading.DefaultLoaderRepository UseMBeanServer.getClassLoaderRepository()
} instead.javax.swing.text.DefaultTextUI org.omg.CORBA.DynamicImplementation org.omg.CORBA.DynamicImplementationorg.xml.sax.HandlerBase This class works with the deprecatedDocumentHandler
interface. It has been replaced by the SAX2DefaultHandler
class.java.security.Identity This class is no longer used. Its functionality has been replaced byjava.security.KeyStore
, thejava.security.cert
package, andjava.security.Principal
.java.security.IdentityScope This class is no longer used. Its functionality has been replaced byjava.security.KeyStore
, thejava.security.cert
package, andjava.security.Principal
.java.io.LineNumberInputStream This class incorrectly assumes that bytes adequately represent characters. As of JDK 1.1, the preferred way to operate on character streams is via the new character-stream classes, which include a class for counting line numbers.java.rmi.server.LogStream no replacementjavax.swing.plaf.metal.MetalComboBoxUI.MetalComboPopup As of Java 2 platform v1.4.java.rmi.server.Operation no replacementorg.xml.sax.helpers.ParserFactory This class works with the deprecatedParser
interface.javax.security.auth.Policy as of JDK version 1.4 -- Replaced by java.security.Policy. java.security.Policy has a method:public PermissionCollection getPermissions (java.security.ProtectionDomain pd)
and ProtectionDomain has a constructor:public ProtectionDomain (CodeSource cs, PermissionCollection permissions, ClassLoader loader, Principal[] principals)
These two APIs provide callers the means to query the Policy for Principal-based Permission entries.org.omg.CORBA.Principal Deprecated by CORBA 2.2.org.omg.CORBA.PrincipalHolder Deprecated by CORBA 2.2.java.rmi.server.RemoteStub Statically generated stubs are deprecated, since stubs are generated dynamically. SeeUnicastRemoteObject
for information about dynamic stub generation.java.rmi.RMISecurityManager UseSecurityManager
instead.java.security.Signer This class is no longer used. Its functionality has been replaced byjava.security.KeyStore
, thejava.security.cert
package, andjava.security.Principal
.javax.xml.soap.SOAPElementFactory - Usejavax.xml.soap.SOAPFactory
for creating SOAPElements.java.io.StringBufferInputStream This class does not properly convert characters into bytes. As of JDK 1.1, the preferred way to create a stream from a string is via theStringReader
class.javax.swing.text.TableView.TableCell A table cell can now be any View implementation.
-
Deprecated Exceptions Exceptions and Description java.rmi.RMISecurityException UseSecurityException
instead. Application code should never directly reference this class, andRMISecurityManager
no longer throws this subclass ofjava.lang.SecurityException
.java.rmi.ServerRuntimeException no replacementjava.rmi.server.SkeletonMismatchException no replacement. Skeletons are no longer required for remote method calls in the Java 2 platform v1.2 and greater.java.rmi.server.SkeletonNotFoundException no replacement. Skeletons are no longer required for remote method calls in the Java 2 platform v1.2 and greater.java.rmi.server.SocketSecurityException This class is obsolete. UseExportException
instead.
-
Deprecated Annotation Types Annotation Type and Description javax.jws.soap.InitParam javax.jws.soap.SOAPMessageHandler javax.jws.soap.SOAPMessageHandlers
-
Deprecated Fields Field and Description javax.swing.JComponent.AccessibleJComponent.accessibleFocusHandler javax.management.openmbean.OpenType.ALLOWED_CLASSNAMES UseALLOWED_CLASSNAMES_LIST
instead.javax.management.monitor.Monitor.alreadyNotified equivalent toMonitor.alreadyNotifieds
[0].javax.swing.JViewport.backingStore As of Java 2 platform v1.3javax.swing.plaf.basic.BasicDesktopPaneUI.closeKey As of 1.3.javax.sql.rowset.CachedRowSet.COMMIT_ON_ACCEPT_CHANGES Because this field is final (it is part of an interface), its value cannot be changed.javax.swing.ImageIcon.component since 1.8java.awt.Frame.CROSSHAIR_CURSOR replaced byCursor.CROSSHAIR_CURSOR
.javax.management.monitor.Monitor.dbgTag No replacement.java.awt.Frame.DEFAULT_CURSOR replaced byCursor.DEFAULT_CURSOR
.javax.swing.JRootPane.defaultPressAction As of Java 2 platform v1.3.javax.swing.JRootPane.defaultReleaseAction As of Java 2 platform v1.3.javax.swing.plaf.basic.BasicSplitPaneUI.dividerResizeToggleKey As of Java 2 platform v1.3.javax.swing.plaf.basic.BasicToolBarUI.downKey As of Java 2 platform v1.3.javax.swing.plaf.basic.BasicSplitPaneUI.downKey As of Java 2 platform v1.3.javax.swing.plaf.basic.BasicTabbedPaneUI.downKey As of Java 2 platform v1.3.java.awt.Frame.E_RESIZE_CURSOR replaced byCursor.E_RESIZE_CURSOR
.javax.swing.plaf.basic.BasicSplitPaneUI.endKey As of Java 2 platform v1.3.java.util.jar.Attributes.Name.EXTENSION_INSTALLATION Extension mechanism will be removed in a future release. Use class path instead.java.util.logging.Logger.global Initialization of this field is prone to deadlocks. The field must be initialized by the Logger class initialization which may cause deadlocks with the LogManager class initialization. In such cases two class initialization wait for each other to complete. The preferred way to get the global logger object is via the callLogger.getGlobal()
. For compatibility with old JDK versions where theLogger.getGlobal()
is not available use the callLogger.getLogger(Logger.GLOBAL_LOGGER_NAME)
orLogger.getLogger("global")
.java.awt.Frame.HAND_CURSOR replaced byCursor.HAND_CURSOR
.javax.swing.plaf.basic.BasicSplitPaneUI.homeKey As of Java 2 platform v1.3.java.net.HttpURLConnection.HTTP_SERVER_ERROR it is misplaced and shouldn't have existed.java.util.jar.Attributes.Name.IMPLEMENTATION_URL Extension mechanism will be removed in a future release. Use class path instead.java.util.jar.Attributes.Name.IMPLEMENTATION_VENDOR_ID Extension mechanism will be removed in a future release. Use class path instead.java.lang.SecurityManager.inCheck This type of security checking is not recommended. It is recommended that thecheckPermission
call be used instead.javax.swing.plaf.basic.BasicSplitPaneUI.keyboardDownRightListener As of Java 2 platform v1.3.javax.swing.plaf.basic.BasicSplitPaneUI.keyboardEndListener As of Java 2 platform v1.3.javax.swing.plaf.basic.BasicSplitPaneUI.keyboardHomeListener As of Java 2 platform v1.3.javax.swing.plaf.basic.BasicSplitPaneUI.keyboardResizeToggleListener As of Java 2 platform v1.3.javax.swing.plaf.basic.BasicSplitPaneUI.keyboardUpLeftListener As of Java 2 platform v1.3.javax.swing.plaf.basic.BasicToolBarUI.leftKey As of Java 2 platform v1.3.javax.swing.plaf.basic.BasicSplitPaneUI.leftKey As of Java 2 platform v1.3.javax.swing.plaf.basic.BasicTabbedPaneUI.leftKey As of Java 2 platform v1.3.javax.swing.plaf.basic.BasicDesktopPaneUI.maximizeKey As of 1.3.javax.swing.plaf.basic.BasicDesktopPaneUI.minimizeKey As of 1.3.java.awt.Frame.MOVE_CURSOR replaced byCursor.MOVE_CURSOR
.java.awt.Frame.N_RESIZE_CURSOR replaced byCursor.N_RESIZE_CURSOR
.javax.swing.plaf.basic.BasicDesktopPaneUI.navigateKey As of 1.3.javax.swing.plaf.basic.BasicDesktopPaneUI.navigateKey2 As of 1.3.java.awt.Frame.NE_RESIZE_CURSOR replaced byCursor.NE_RESIZE_CURSOR
.java.awt.Frame.NW_RESIZE_CURSOR replaced byCursor.NW_RESIZE_CURSOR
.javax.swing.plaf.basic.BasicInternalFrameUI.openMenuKey As of Java 2 platform v1.3.java.awt.datatransfer.DataFlavor.plainTextFlavor as of 1.3. UseDataFlavor.getReaderForText(Transferable)
instead ofTransferable.getTransferData(DataFlavor.plainTextFlavor)
.java.awt.Cursor.predefined As of JDK version 1.7, theCursor.getPredefinedCursor(int)
method should be used instead.javax.swing.text.html.FormView.RESET As of 1.3, value comes from UIManager UIManager property FormView.resetButtonTextjavax.swing.table.TableColumn.resizedPostingDisableCount as of Java 2 platform v1.3javax.swing.plaf.basic.BasicToolBarUI.rightKey As of Java 2 platform v1.3.javax.swing.plaf.basic.BasicSplitPaneUI.rightKey As of Java 2 platform v1.3.javax.swing.plaf.basic.BasicTabbedPaneUI.rightKey As of Java 2 platform v1.3.java.awt.Frame.S_RESIZE_CURSOR replaced byCursor.S_RESIZE_CURSOR
.java.awt.Frame.SE_RESIZE_CURSOR replaced byCursor.SE_RESIZE_CURSOR
.javax.imageio.spi.ImageReaderSpi.STANDARD_INPUT_TYPE Instead of using this field, directly create the equivalent array{ ImageInputStream.class }
.javax.imageio.spi.ImageWriterSpi.STANDARD_OUTPUT_TYPE Instead of using this field, directly create the equivalent array{ ImageOutputStream.class }
.javax.swing.text.html.FormView.SUBMIT As of 1.3, value now comes from UIManager property FormView.submitButtonTextjava.lang.Character.UnicodeBlock.SURROGATES_AREA As of J2SE 5, useCharacter.UnicodeBlock.HIGH_SURROGATES
,Character.UnicodeBlock.HIGH_PRIVATE_USE_SURROGATES
, andCharacter.UnicodeBlock.LOW_SURROGATES
. These new constants match the block definitions of the Unicode Standard. TheCharacter.UnicodeBlock.of(char)
andCharacter.UnicodeBlock.of(int)
methods return the new constants, not SURROGATES_AREA.java.awt.Frame.SW_RESIZE_CURSOR replaced byCursor.SW_RESIZE_CURSOR
.java.awt.Frame.TEXT_CURSOR replaced byCursor.TEXT_CURSOR
.javax.swing.ImageIcon.tracker since 1.8javax.swing.plaf.basic.BasicToolBarUI.upKey As of Java 2 platform v1.3.javax.swing.plaf.basic.BasicSplitPaneUI.upKey As of Java 2 platform v1.3.javax.swing.plaf.basic.BasicTabbedPaneUI.upKey As of Java 2 platform v1.3.java.awt.Frame.W_RESIZE_CURSOR replaced byCursor.W_RESIZE_CURSOR
.java.awt.Frame.WAIT_CURSOR replaced byCursor.WAIT_CURSOR
.
-
Deprecated Methods Method and Description java.awt.Component.action(Event, Object) As of JDK version 1.1, should register this component as ActionListener on component which fires action events.java.awt.List.addItem(String) replaced byadd(String)
.java.awt.List.addItem(String, int) replaced byadd(String, int)
.java.awt.CardLayout.addLayoutComponent(String, Component) replaced byaddLayoutComponent(Component, Object)
.java.awt.BorderLayout.addLayoutComponent(String, Component) replaced byaddLayoutComponent(Component, Object)
.java.util.jar.Pack200.Packer.addPropertyChangeListener(PropertyChangeListener) The dependency onPropertyChangeListener
creates a significant impediment to future modularization of the Java platform. This method will be removed in a future release. Applications that need to monitor progress of the packer can poll the value of thePROGRESS
property instead.java.util.jar.Pack200.Unpacker.addPropertyChangeListener(PropertyChangeListener) The dependency onPropertyChangeListener
creates a significant impediment to future modularization of the Java platform. This method will be removed in a future release. Applications that need to monitor progress of the unpacker can poll the value of thePROGRESS
property instead.java.util.logging.LogManager.addPropertyChangeListener(PropertyChangeListener) The dependency onPropertyChangeListener
creates a significant impediment to future modularization of the Java platform. This method will be removed in a future release. The globalLogManager
can detect changes to the logging configuration by overridding thereadConfiguration
method.java.awt.List.allowsMultipleSelections() As of JDK version 1.1, replaced byisMultipleMode()
.java.lang.ThreadGroup.allowThreadSuspension(boolean) The definition of this call depends onThreadGroup.suspend()
, which is deprecated. Further, the behavior of this call was never specified.java.awt.TextArea.appendText(String) As of JDK version 1.1, replaced byappend(String)
.java.awt.Window.applyResourceBundle(ResourceBundle) As of J2SE 1.4, replaced byComponent.applyComponentOrientation
.java.awt.Window.applyResourceBundle(String) As of J2SE 1.4, replaced byComponent.applyComponentOrientation
.java.awt.Component.bounds() As of JDK version 1.1, replaced bygetBounds()
.java.lang.SecurityManager.checkAwtEventQueueAccess() The dependency onAWTPermission
creates an impediment to future modularization of the Java platform. Users of this method should instead invokeSecurityManager.checkPermission(java.security.Permission)
directly. This method will be changed in a future release to check the permissionjava.security.AllPermission
.java.lang.SecurityManager.checkMemberAccess(Class<?>, int) This method relies on the caller being at a stack depth of 4 which is error-prone and cannot be enforced by the runtime. Users of this method should instead invokeSecurityManager.checkPermission(java.security.Permission)
directly. This method will be changed in a future release to check the permissionjava.security.AllPermission
.java.lang.SecurityManager.checkMulticast(InetAddress, byte) Use #checkPermission(java.security.Permission) insteadjava.lang.SecurityManager.checkSystemClipboardAccess() The dependency onAWTPermission
creates an impediment to future modularization of the Java platform. Users of this method should instead invokeSecurityManager.checkPermission(java.security.Permission)
directly. This method will be changed in a future release to check the permissionjava.security.AllPermission
.java.lang.SecurityManager.checkTopLevelWindow(Object) The dependency onAWTPermission
creates an impediment to future modularization of the Java platform. Users of this method should instead invokeSecurityManager.checkPermission(java.security.Permission)
directly. This method will be changed in a future release to check the permissionjava.security.AllPermission
.java.lang.SecurityManager.classDepth(String) This type of security checking is not recommended. It is recommended that thecheckPermission
call be used instead.java.lang.SecurityManager.classLoaderDepth() This type of security checking is not recommended. It is recommended that thecheckPermission
call be used instead.java.awt.List.clear() As of JDK version 1.1, replaced byremoveAll()
.java.awt.image.renderable.RenderContext.concetenateTransform(AffineTransform) replaced byconcatenateTransform(AffineTransform)
.java.awt.Container.countComponents() As of JDK version 1.1, replaced by getComponentCount().java.awt.Choice.countItems() As of JDK version 1.1, replaced bygetItemCount()
.java.awt.List.countItems() As of JDK version 1.1, replaced bygetItemCount()
.java.awt.Menu.countItems() As of JDK version 1.1, replaced bygetItemCount()
.java.awt.MenuBar.countMenus() As of JDK version 1.1, replaced bygetMenuCount()
.java.lang.Thread.countStackFrames() The definition of this call depends onThread.suspend()
, which is deprecated. Further, the results of this call were never well-defined.org.omg.CORBA.ORB.create_basic_dyn_any(TypeCode) Use the new DynAnyFactory API insteadorg.omg.CORBA.ORB.create_dyn_any(Any) Use the new DynAnyFactory API insteadorg.omg.CORBA.ORB.create_dyn_array(TypeCode) Use the new DynAnyFactory API insteadorg.omg.CORBA.ORB.create_dyn_enum(TypeCode) Use the new DynAnyFactory API insteadorg.omg.CORBA.ORB.create_dyn_sequence(TypeCode) Use the new DynAnyFactory API insteadorg.omg.CORBA.ORB.create_dyn_struct(TypeCode) Use the new DynAnyFactory API insteadorg.omg.CORBA.ORB.create_dyn_union(TypeCode) Use the new DynAnyFactory API insteadorg.omg.CORBA.ORB.create_recursive_sequence_tc(int, int) Use a combination of create_recursive_tc and create_sequence_tc insteadjavax.xml.soap.SOAPElementFactory.create(Name) Use javax.xml.soap.SOAPFactory.createElement(javax.xml.soap.Name) insteadjavax.xml.soap.SOAPElementFactory.create(String) Use javax.xml.soap.SOAPFactory.createElement(String localName) insteadjavax.xml.soap.SOAPElementFactory.create(String, String, String) Use javax.xml.soap.SOAPFactory.createElement(String localName, String prefix, String uri) insteadjavax.swing.plaf.basic.BasicSplitPaneUI.createKeyboardDownRightListener() As of Java 2 platform v1.3.javax.swing.plaf.basic.BasicSplitPaneUI.createKeyboardEndListener() As of Java 2 platform v1.3.javax.swing.plaf.basic.BasicSplitPaneUI.createKeyboardHomeListener() As of Java 2 platform v1.3.javax.swing.plaf.basic.BasicSplitPaneUI.createKeyboardResizeToggleListener() As of Java 2 platform v1.3.javax.swing.plaf.basic.BasicSplitPaneUI.createKeyboardUpLeftListener() As of Java 2 platform v1.3.javax.swing.JTable.createScrollPaneForTable(JTable) As of Swing version 1.0.2, replaced bynew JScrollPane(aTable)
.javax.swing.text.TableView.createTableCell(Element) Table cells can now be any arbitrary View implementation and should be produced by the ViewFactory rather than the table.javax.xml.bind.JAXBContext.createValidator() since JAXB2.0java.lang.SecurityManager.currentClassLoader() This type of security checking is not recommended. It is recommended that thecheckPermission
call be used instead.java.lang.SecurityManager.currentLoadedClass() This type of security checking is not recommended. It is recommended that thecheckPermission
call be used instead.java.net.URLDecoder.decode(String) The resulting string may vary depending on the platform's default encoding. Instead, use the decode(String,String) method to specify the encoding.java.lang.ClassLoader.defineClass(byte[], int, int) Replaced bydefineClass(String, byte[], int, int)
java.awt.List.delItem(int) replaced byremove(String)
andremove(int)
.java.awt.List.delItems(int, int) As of JDK version 1.1, Not for public use in the future. This method is expected to be retained only as a package private method.java.awt.Container.deliverEvent(Event) As of JDK version 1.1, replaced bydispatchEvent(AWTEvent e)
java.awt.Component.deliverEvent(Event) As of JDK version 1.1, replaced bydispatchEvent(AWTEvent e)
.javax.management.MBeanServer.deserialize(ObjectName, byte[]) UsegetClassLoaderFor
to obtain the appropriate class loader for deserialization.javax.management.MBeanServer.deserialize(String, byte[]) UseMBeanServer.getClassLoaderRepository()
to obtain the class loader repository and use it to deserialize.javax.management.MBeanServer.deserialize(String, ObjectName, byte[]) UsegetClassLoader
to obtain the class loader for deserialization.java.lang.Thread.destroy() This method was originally designed to destroy this thread without any cleanup. Any monitors it held would have remained locked. However, the method was never implemented. If if were to be implemented, it would be deadlock-prone in much the manner ofThread.suspend()
. If the target thread held a lock protecting a critical system resource when it was destroyed, no thread could ever access this resource again. If another thread ever attempted to lock this resource, deadlock would result. Such deadlocks typically manifest themselves as "frozen" processes. For more information, see Why are Thread.stop, Thread.suspend and Thread.resume Deprecated?.java.awt.MenuItem.disable() As of JDK version 1.1, replaced bysetEnabled(boolean)
.java.awt.Component.disable() As of JDK version 1.1, replaced bysetEnabled(boolean)
.javax.swing.JComponent.disable() As of JDK version 1.1, replaced byjava.awt.Component.setEnabled(boolean)
.javax.swing.table.TableColumn.disableResizedPosting() as of Java 2 platform v1.3javax.swing.FocusManager.disableSwingFocusManager() as of 1.4, replaced byKeyboardFocusManager.setDefaultFocusTraversalPolicy(FocusTraversalPolicy)
java.rmi.server.Skeleton.dispatch(Remote, RemoteCall, int, long) no replacementjava.rmi.server.RemoteCall.done() no replacementjava.rmi.server.RemoteRef.done(RemoteCall) 1.2 style stubs no longer use this method. Instead of using a sequence of method calls to the remote reference (newCall
,invoke
, anddone
), a stub uses a single method,invoke(Remote, Method, Object[], int)
, on the remote reference to carry out parameter marshalling, remote method executing and unmarshalling of the return value.javax.swing.plaf.metal.MetalComboBoxUI.editablePropertyChanged(PropertyChangeEvent) As of Java 2 platform v1.4.java.awt.MenuItem.enable() As of JDK version 1.1, replaced bysetEnabled(boolean)
.java.awt.Component.enable() As of JDK version 1.1, replaced bysetEnabled(boolean)
.javax.swing.JComponent.enable() As of JDK version 1.1, replaced byjava.awt.Component.setEnabled(boolean)
.java.awt.MenuItem.enable(boolean) As of JDK version 1.1, replaced bysetEnabled(boolean)
.java.awt.Component.enable(boolean) As of JDK version 1.1, replaced bysetEnabled(boolean)
.javax.swing.table.TableColumn.enableResizedPosting() as of Java 2 platform v1.3java.net.URLEncoder.encode(String) The resulting string may vary depending on the platform's default encoding. Instead, use the encode(String,String) method to specify the encoding.java.security.SignatureSpi.engineGetParameter(String) java.security.SignatureSpi.engineSetParameter(String, Object) Replaced byengineSetParameter
.java.awt.datatransfer.DataFlavor.equals(String) As inconsistent withhashCode()
contract, useisMimeTypeEqual(String)
instead.org.omg.CORBA.ServerRequest.except(Any) use set_exception()java.rmi.server.RemoteCall.executeCall() no replacementjava.rmi.server.UnicastRemoteObject.exportObject(Remote) This method is deprecated because it supports only static stubs. UseexportObject(Remote, port)
orexportObject(Remote, port, csf, ssf)
instead.org.omg.CORBA.Any.extract_Principal() Deprecated by CORBA 2.2.javax.swing.SwingUtilities.findFocusOwner(Component) As of 1.4, replaced byKeyboardFocusManager.getFocusOwner()
.org.omg.CORBA.ORB.get_current() useresolve_initial_references
.java.security.Security.getAlgorithmProperty(String, String) This method used to return the value of a proprietary property in the master file of the "SUN" Cryptographic Service Provider in order to determine how to parse algorithm-specific parameters. Use the new provider-based and algorithm-independentAlgorithmParameters
andKeyFactory
engine classes (introduced in the J2SE version 1.2 platform) instead.java.sql.CallableStatement.getBigDecimal(int, int) usegetBigDecimal(int parameterIndex)
orgetBigDecimal(String parameterName)
java.sql.ResultSet.getBigDecimal(int, int) UsegetBigDecimal(int columnIndex)
orgetBigDecimal(String columnLabel)
java.sql.ResultSet.getBigDecimal(String, int) UsegetBigDecimal(int columnIndex)
orgetBigDecimal(String columnLabel)
java.awt.Polygon.getBoundingBox() As of JDK version 1.1, replaced bygetBounds()
.java.lang.String.getBytes(int, int, byte[], int) This method does not properly convert characters into bytes. As of JDK 1.1, the preferred way to do this is via theString.getBytes()
method, which uses the platform's default charset.java.awt.Graphics.getClipRect() As of JDK version 1.1, replaced bygetClipBounds()
.javax.swing.JMenuBar.getComponentAtIndex(int) replaced bygetComponent(int i)
javax.swing.JPopupMenu.getComponentAtIndex(int) replaced byContainer.getComponent(int)
java.awt.CheckboxGroup.getCurrent() As of JDK version 1.1, replaced bygetSelectedCheckbox()
.java.awt.Frame.getCursorType() As of JDK version 1.1, replaced byComponent.getCursor()
.java.sql.Time.getDate() java.util.Date.getDate() As of JDK version 1.1, replaced byCalendar.get(Calendar.DAY_OF_MONTH)
.java.sql.Time.getDay() java.util.Date.getDay() As of JDK version 1.1, replaced byCalendar.get(Calendar.DAY_OF_WEEK)
.java.net.URLConnection.getDefaultRequestProperty(String) The instance specific getRequestProperty method should be used after an appropriate instance of URLConnection is obtained.java.rmi.server.LogStream.getDefaultStream() no replacementjavax.management.monitor.CounterMonitor.getDerivedGauge() As of JMX 1.2, replaced byCounterMonitor.getDerivedGauge(ObjectName)
javax.management.monitor.CounterMonitorMBean.getDerivedGauge() As of JMX 1.2, replaced byCounterMonitorMBean.getDerivedGauge(ObjectName)
javax.management.monitor.StringMonitorMBean.getDerivedGauge() As of JMX 1.2, replaced byStringMonitorMBean.getDerivedGauge(ObjectName)
javax.management.monitor.StringMonitor.getDerivedGauge() As of JMX 1.2, replaced byStringMonitor.getDerivedGauge(ObjectName)
javax.management.monitor.GaugeMonitorMBean.getDerivedGauge() As of JMX 1.2, replaced byGaugeMonitorMBean.getDerivedGauge(ObjectName)
javax.management.monitor.GaugeMonitor.getDerivedGauge() As of JMX 1.2, replaced byGaugeMonitor.getDerivedGauge(ObjectName)
javax.management.monitor.CounterMonitor.getDerivedGaugeTimeStamp() As of JMX 1.2, replaced byCounterMonitor.getDerivedGaugeTimeStamp(ObjectName)
javax.management.monitor.CounterMonitorMBean.getDerivedGaugeTimeStamp() As of JMX 1.2, replaced byCounterMonitorMBean.getDerivedGaugeTimeStamp(ObjectName)
javax.management.monitor.StringMonitorMBean.getDerivedGaugeTimeStamp() As of JMX 1.2, replaced byStringMonitorMBean.getDerivedGaugeTimeStamp(ObjectName)
javax.management.monitor.StringMonitor.getDerivedGaugeTimeStamp() As of JMX 1.2, replaced byStringMonitor.getDerivedGaugeTimeStamp(ObjectName)
javax.management.monitor.GaugeMonitorMBean.getDerivedGaugeTimeStamp() As of JMX 1.2, replaced byGaugeMonitorMBean.getDerivedGaugeTimeStamp(ObjectName)
javax.management.monitor.GaugeMonitor.getDerivedGaugeTimeStamp() As of JMX 1.2, replaced byGaugeMonitor.getDerivedGaugeTimeStamp(ObjectName)
javax.swing.plaf.basic.BasicSplitPaneUI.getDividerBorderSize() As of Java 2 platform v1.3, instead set the border on the divider.javax.xml.bind.Validator.getEventHandler() since JAXB2.0java.awt.Toolkit.getFontList() javax.swing.text.LabelView.getFontMetrics() FontMetrics are not used for glyph rendering when running in the JDK.java.awt.Toolkit.getFontMetrics(Font) As of JDK version 1.2, replaced by theFont
methodgetLineMetrics
.java.awt.Toolkit.getFontPeer(String, int) see java.awt.GraphicsEnvironment#getAllFontsjava.sql.Date.getHours() java.util.Date.getHours() As of JDK version 1.1, replaced byCalendar.get(Calendar.HOUR_OF_DAY)
.java.lang.SecurityManager.getInCheck() This type of security checking is not recommended. It is recommended that thecheckPermission
call be used instead.java.rmi.server.RemoteCall.getInputStream() no replacementjavax.swing.KeyStroke.getKeyStroke(char, boolean) use getKeyStroke(char)javax.swing.AbstractButton.getLabel() - Replaced bygetText
java.awt.Scrollbar.getLineIncrement() As of JDK version 1.1, replaced bygetUnitIncrement()
.java.lang.Runtime.getLocalizedInputStream(InputStream) As of JDK 1.1, the preferred way to translate a byte stream in the local encoding into a character stream in Unicode is via theInputStreamReader
andBufferedReader
classes.java.lang.Runtime.getLocalizedOutputStream(OutputStream) As of JDK 1.1, the preferred way to translate a Unicode character stream into a byte stream in the local encoding is via theOutputStreamWriter
,BufferedWriter
, andPrintWriter
classes.java.sql.DriverManager.getLogStream() UsegetLogWriter
java.awt.FontMetrics.getMaxDecent() As of JDK version 1.1.1, replaced bygetMaxDescent()
.javax.swing.JInternalFrame.getMenuBar() As of Swing version 1.0.3, replaced bygetJMenuBar()
.javax.swing.JRootPane.getMenuBar() As of Swing version 1.0.3 replaced bygetJMenuBar()
.java.sql.Date.getMinutes() java.util.Date.getMinutes() As of JDK version 1.1, replaced byCalendar.get(Calendar.MINUTE)
.java.sql.Time.getMonth() java.util.Date.getMonth() As of JDK version 1.1, replaced byCalendar.get(Calendar.MONTH)
.javax.swing.JComponent.getNextFocusableComponent() As of 1.4, replaced byFocusTraversalPolicy
.javax.management.monitor.Monitor.getObservedObject() As of JMX 1.2, replaced byMonitor.getObservedObjects()
javax.management.monitor.MonitorMBean.getObservedObject() As of JMX 1.2, replaced byMonitorMBean.getObservedObjects()
java.rmi.server.Operation.getOperation() no replacementjava.rmi.server.Skeleton.getOperations() no replacementjava.awt.ComponentOrientation.getOrientation(ResourceBundle) As of J2SE 1.4, useComponentOrientation.getOrientation(java.util.Locale)
.java.rmi.server.LogStream.getOutputStream() no replacementjava.rmi.server.RemoteCall.getOutputStream() no replacementjava.awt.Scrollbar.getPageIncrement() As of JDK version 1.1, replaced bygetBlockIncrement()
.java.security.Signature.getParameter(String) java.awt.MenuComponent.getPeer() As of JDK version 1.1, programs should not directly manipulate peers.java.awt.Font.getPeer() Font rendering is now platform independent.java.awt.Component.getPeer() As of JDK version 1.1, programs should not directly manipulate peers; replaced byboolean isDisplayable()
.javax.xml.bind.Validator.getProperty(String) since JAXB2.0java.rmi.server.RemoteCall.getResultStream(boolean) no replacementjava.sql.Date.getSeconds() java.util.Date.getSeconds() As of JDK version 1.1, replaced byCalendar.get(Calendar.SECOND)
.java.rmi.server.RMIClassLoader.getSecurityContext(ClassLoader) no replacement. As of the Java 2 platform v1.2, RMI no longer uses this method to obtain a class loader's security context.java.rmi.server.LoaderHandler.getSecurityContext(ClassLoader) no replacementjavax.swing.JList.getSelectedValues() As of JDK 1.7, replaced byJList.getSelectedValuesList()
javax.swing.JPasswordField.getText() As of Java 2 platform v1.2, replaced bygetPassword
.javax.swing.JPasswordField.getText(int, int) As of Java 2 platform v1.2, replaced bygetPassword
.javax.management.monitor.CounterMonitor.getThreshold() As of JMX 1.2, replaced byCounterMonitor.getThreshold(ObjectName)
javax.management.monitor.CounterMonitorMBean.getThreshold() As of JMX 1.2, replaced byCounterMonitorMBean.getThreshold(ObjectName)
java.util.Date.getTimezoneOffset() As of JDK version 1.1, replaced by-(Calendar.get(Calendar.ZONE_OFFSET) + Calendar.get(Calendar.DST_OFFSET)) / (60 * 1000)
.java.net.MulticastSocket.getTTL() use the getTimeToLive method instead, which returns an int instead of a byte.java.net.DatagramSocketImpl.getTTL() use getTimeToLive instead.java.sql.ResultSet.getUnicodeStream(int) usegetCharacterStream
in place ofgetUnicodeStream
java.sql.ResultSet.getUnicodeStream(String) usegetCharacterStream
insteadjavax.swing.ScrollPaneLayout.getViewportBorderBounds(JScrollPane) As of JDK version Swing1.1 replaced byJScrollPane.getViewportBorderBounds()
.java.awt.Scrollbar.getVisible() As of JDK version 1.1, replaced bygetVisibleAmount()
.java.sql.Time.getYear() java.util.Date.getYear() As of JDK version 1.1, replaced byCalendar.get(Calendar.YEAR) - 1900
.java.awt.Component.gotFocus(Event, Object) As of JDK version 1.1, replaced by processFocusEvent(FocusEvent).java.awt.Component.handleEvent(Event) As of JDK version 1.1 replaced by processEvent(AWTEvent).java.awt.Dialog.hide() As of JDK version 1.5, replaced bysetVisible(boolean)
.java.awt.Window.hide() As of JDK version 1.5, replaced byWindow.setVisible(boolean)
.java.awt.Component.hide() As of JDK version 1.1, replaced bysetVisible(boolean)
.javax.swing.JComponent.hide() java.lang.SecurityManager.inClass(String) This type of security checking is not recommended. It is recommended that thecheckPermission
call be used instead.java.lang.SecurityManager.inClassLoader() This type of security checking is not recommended. It is recommended that thecheckPermission
call be used instead.org.omg.CORBA.Any.insert_Principal(Principal) Deprecated by CORBA 2.2.javax.swing.text.html.HTMLEditorKit.InsertHTMLTextAction.insertAtBoundry(JEditorPane, HTMLDocument, int, Element, String, HTML.Tag, HTML.Tag) As of Java 2 platform v1.3, use insertAtBoundaryjava.awt.TextArea.insertText(String, int) As of JDK version 1.1, replaced byinsert(String, int)
.java.awt.Container.insets() As of JDK version 1.1, replaced bygetInsets()
.java.awt.Polygon.inside(int, int) As of JDK version 1.1, replaced bycontains(int, int)
.java.awt.Rectangle.inside(int, int) As of JDK version 1.1, replaced bycontains(int, int)
.java.awt.Component.inside(int, int) As of JDK version 1.1, replaced by contains(int, int).java.rmi.server.RemoteRef.invoke(RemoteCall) 1.2 style stubs no longer use this method. Instead of using a sequence of method calls to the remote reference (newCall
,invoke
, anddone
), a stub uses a single method,invoke(Remote, Method, Object[], int)
, on the remote reference to carry out parameter marshalling, remote method executing and unmarshalling of the return value.org.omg.CORBA.DynamicImplementation.invoke(ServerRequest) Deprecated by Portable Object Adapterjavax.swing.JViewport.isBackingStoreEnabled() As of Java 2 platform v1.3, replaced bygetScrollMode()
.javax.swing.FocusManager.isFocusManagerEnabled() As of 1.4, replaced byKeyboardFocusManager.getDefaultFocusTraversalPolicy()
java.awt.Component.isFocusTraversable() As of 1.4, replaced byisFocusable()
.java.lang.Character.isJavaLetter(char) Replaced by isJavaIdentifierStart(char).java.lang.Character.isJavaLetterOrDigit(char) Replaced by isJavaIdentifierPart(char).javax.swing.JComponent.isManagingFocus() As of 1.4, replaced byComponent.setFocusTraversalKeys(int, Set)
andContainer.setFocusCycleRoot(boolean)
.java.awt.List.isSelected(int) As of JDK version 1.1, replaced byisIndexSelected(int)
.java.lang.Character.isSpace(char) Replaced by isWhitespace(char).java.rmi.dgc.VMID.isUnique() javax.xml.bind.Unmarshaller.isValidating() since JAXB2.0, please seeUnmarshaller.getSchema()
java.awt.Component.keyDown(Event, int) As of JDK version 1.1, replaced by processKeyEvent(KeyEvent).java.awt.Component.keyUp(Event, int) As of JDK version 1.1, replaced by processKeyEvent(KeyEvent).java.awt.ScrollPane.layout() As of JDK version 1.1, replaced bydoLayout()
.java.awt.Container.layout() As of JDK version 1.1, replaced bydoLayout()
.java.awt.Component.layout() As of JDK version 1.1, replaced bydoLayout()
.java.rmi.server.RMIClassLoader.loadClass(String) replaced byloadClass(String,String)
methodjava.rmi.server.LoaderHandler.loadClass(String) no replacementjava.rmi.server.LoaderHandler.loadClass(URL, String) no replacementjava.awt.Container.locate(int, int) As of JDK version 1.1, replaced bygetComponentAt(int, int)
.java.awt.Component.locate(int, int) As of JDK version 1.1, replaced by getComponentAt(int, int).java.awt.Component.location() As of JDK version 1.1, replaced bygetLocation()
.java.rmi.server.LogStream.log(String) no replacementjava.util.logging.Logger.logrb(Level, String, String, String, String) java.util.logging.Logger.logrb(Level, String, String, String, String, Object) java.util.logging.Logger.logrb(Level, String, String, String, String, Object[]) java.util.logging.Logger.logrb(Level, String, String, String, String, Throwable) java.awt.Component.lostFocus(Event, Object) As of JDK version 1.1, replaced by processFocusEvent(FocusEvent).java.awt.TextArea.minimumSize() As of JDK version 1.1, replaced bygetMinimumSize()
.java.awt.List.minimumSize() As of JDK version 1.1, replaced bygetMinimumSize()
.java.awt.TextField.minimumSize() As of JDK version 1.1, replaced bygetMinimumSize()
.java.awt.Container.minimumSize() As of JDK version 1.1, replaced bygetMinimumSize()
.java.awt.Component.minimumSize() As of JDK version 1.1, replaced bygetMinimumSize()
.java.awt.List.minimumSize(int) As of JDK version 1.1, replaced bygetMinimumSize(int)
.java.awt.TextField.minimumSize(int) As of JDK version 1.1, replaced bygetMinimumSize(int)
.java.awt.TextArea.minimumSize(int, int) As of JDK version 1.1, replaced bygetMinimumSize(int, int)
.javax.swing.text.View.modelToView(int, Shape) java.awt.Component.mouseDown(Event, int, int) As of JDK version 1.1, replaced by processMouseEvent(MouseEvent).java.awt.Component.mouseDrag(Event, int, int) As of JDK version 1.1, replaced by processMouseMotionEvent(MouseEvent).java.awt.Component.mouseEnter(Event, int, int) As of JDK version 1.1, replaced by processMouseEvent(MouseEvent).java.awt.Component.mouseExit(Event, int, int) As of JDK version 1.1, replaced by processMouseEvent(MouseEvent).java.awt.Component.mouseMove(Event, int, int) As of JDK version 1.1, replaced by processMouseMotionEvent(MouseEvent).java.awt.Component.mouseUp(Event, int, int) As of JDK version 1.1, replaced by processMouseEvent(MouseEvent).java.awt.Rectangle.move(int, int) As of JDK version 1.1, replaced bysetLocation(int, int)
.java.awt.Component.move(int, int) As of JDK version 1.1, replaced bysetLocation(int, int)
.org.omg.CORBA.Principal.name() Deprecated by CORBA 2.2.org.omg.CORBA.Principal.name(byte[]) Deprecated by CORBA 2.2.java.rmi.server.RemoteRef.newCall(RemoteObject, Operation[], int, long) 1.2 style stubs no longer use this method. Instead of using a sequence of method calls on the stub's the remote reference (newCall
,invoke
, anddone
), a stub uses a single method,invoke(Remote, Method, Object[], int)
, on the remote reference to carry out parameter marshalling, remote method executing and unmarshalling of the return value.javax.xml.stream.XMLOutputFactory.newInstance(String, ClassLoader) This method has been deprecated because it returns an instance of XMLInputFactory, which is of the wrong class. Use the new methodXMLOutputFactory.newFactory(java.lang.String, java.lang.ClassLoader)
instead.javax.xml.stream.XMLEventFactory.newInstance(String, ClassLoader) This method has been deprecated to maintain API consistency. All newInstance methods have been replaced with corresponding newFactory methods. The replacementXMLEventFactory.newFactory(java.lang.String, java.lang.ClassLoader)
method defines no changes in behavior.javax.xml.stream.XMLInputFactory.newInstance(String, ClassLoader) This method has been deprecated to maintain API consistency. All newInstance methods have been replaced with corresponding newFactory methods. The replacementXMLInputFactory.newFactory(java.lang.String, java.lang.ClassLoader)
method defines no changes in behavior.java.awt.Component.nextFocus() As of JDK version 1.1, replaced by transferFocus().java.awt.datatransfer.DataFlavor.normalizeMimeType(String) javax.activation.ActivationDataFlavor.normalizeMimeType(String) java.awt.datatransfer.DataFlavor.normalizeMimeTypeParameter(String, String) javax.activation.ActivationDataFlavor.normalizeMimeTypeParameter(String, String) javax.swing.tree.DefaultTreeSelectionModel.notifyPathChange(Vector<?>, TreePath) As of JDK version 1.7org.omg.CORBA.ServerRequest.op_name() use operation()org.omg.CORBA.ServerRequest.params(NVList) use the methodarguments
java.util.Date.parse(String) As of JDK version 1.1, replaced byDateFormat.parse(String s)
.java.rmi.server.LogStream.parseLevel(String) no replacementjava.awt.Window.postEvent(Event) As of JDK version 1.1 replaced bydispatchEvent(AWTEvent)
.java.awt.MenuComponent.postEvent(Event) As of JDK version 1.1, replaced bydispatchEvent
.java.awt.MenuContainer.postEvent(Event) As of JDK version 1.1 replaced by dispatchEvent(AWTEvent).java.awt.Component.postEvent(Event) As of JDK version 1.1, replaced by dispatchEvent(AWTEvent).java.awt.image.renderable.RenderContext.preConcetenateTransform(AffineTransform) replaced bypreConcatenateTransform(AffineTransform)
.java.awt.TextArea.preferredSize() As of JDK version 1.1, replaced bygetPreferredSize()
.java.awt.List.preferredSize() As of JDK version 1.1, replaced bygetPreferredSize()
.java.awt.TextField.preferredSize() As of JDK version 1.1, replaced bygetPreferredSize()
.java.awt.Container.preferredSize() As of JDK version 1.1, replaced bygetPreferredSize()
.java.awt.Component.preferredSize() As of JDK version 1.1, replaced bygetPreferredSize()
.java.awt.List.preferredSize(int) As of JDK version 1.1, replaced bygetPreferredSize(int)
.java.awt.TextField.preferredSize(int) As of JDK version 1.1, replaced bygetPreferredSize(int)
.java.awt.TextArea.preferredSize(int, int) As of JDK version 1.1, replaced bygetPreferredSize(int, int)
.org.omg.CORBA.portable.InputStream.read_Principal() Deprecated by CORBA 2.2.java.io.DataInputStream.readLine() This method does not properly convert bytes to characters. As of JDK 1.1, the preferred way to read lines of text is via theBufferedReader.readLine()
method. Programs that use theDataInputStream
class to read lines can be converted to use theBufferedReader
class by replacing code of the form:DataInputStream d = new DataInputStream(in);
BufferedReader d = new BufferedReader(new InputStreamReader(in));
java.io.ObjectInputStream.readLine() This method does not properly convert bytes to characters. see DataInputStream for the details and alternatives.java.rmi.registry.RegistryHandler.registryImpl(int) no replacement. As of the Java 2 platform v1.2, RMI no longer uses theRegistryHandler
to obtain the registry's implementation.java.rmi.registry.RegistryHandler.registryStub(String, int) no replacement. As of the Java 2 platform v1.2, RMI no longer uses theRegistryHandler
to obtain the registry's stub.java.rmi.server.RemoteCall.releaseInputStream() no replacementjava.rmi.server.RemoteCall.releaseOutputStream() no replacementjavax.swing.plaf.metal.MetalComboBoxUI.removeListeners() As of Java 2 platform v1.4.java.util.jar.Pack200.Packer.removePropertyChangeListener(PropertyChangeListener) The dependency onPropertyChangeListener
creates a significant impediment to future modularization of the Java platform. This method will be removed in a future release.java.util.jar.Pack200.Unpacker.removePropertyChangeListener(PropertyChangeListener) The dependency onPropertyChangeListener
creates a significant impediment to future modularization of the Java platform. This method will be removed in a future release.java.util.logging.LogManager.removePropertyChangeListener(PropertyChangeListener) The dependency onPropertyChangeListener
creates a significant impediment to future modularization of the Java platform. This method will be removed in a future release. The globalLogManager
can detect changes to the logging configuration by overridding thereadConfiguration
method.java.awt.TextArea.replaceText(String, int, int) As of JDK version 1.1, replaced byreplaceRange(String, int, int)
.javax.swing.JComponent.requestDefaultFocus() As of 1.4, replaced byFocusTraversalPolicy.getDefaultComponent(Container).requestFocus()
java.awt.Window.reshape(int, int, int, int) As of JDK version 1.1, replaced bysetBounds(int, int, int, int)
.java.awt.Rectangle.reshape(int, int, int, int) As of JDK version 1.1, replaced bysetBounds(int, int, int, int)
.java.awt.Component.reshape(int, int, int, int) As of JDK version 1.1, replaced bysetBounds(int, int, int, int)
.javax.swing.JComponent.reshape(int, int, int, int) As of JDK 5, replaced byComponent.setBounds(int, int, int, int)
.Moves and resizes this component.
java.awt.Component.resize(Dimension) As of JDK version 1.1, replaced bysetSize(Dimension)
.java.awt.Rectangle.resize(int, int) As of JDK version 1.1, replaced bysetSize(int, int)
.java.awt.Component.resize(int, int) As of JDK version 1.1, replaced bysetSize(int, int)
.org.omg.CORBA.ServerRequest.result(Any) use the methodset_result
java.lang.ThreadGroup.resume() This method is used solely in conjunction with Thread.suspend and ThreadGroup.suspend, both of which have been deprecated, as they are inherently deadlock-prone. SeeThread.suspend()
for details.java.lang.Thread.resume() This method exists solely for use withThread.suspend()
, which has been deprecated because it is deadlock-prone. For more information, see Why are Thread.stop, Thread.suspend and Thread.resume Deprecated?.java.lang.Runtime.runFinalizersOnExit(boolean) This method was originally designed to enable or disable running finalizers on exit. Running finalizers on exit was disabled by default. If enabled, then the finalizers of all objects whose finalizers had not yet been automatically invoked were to be run before the Java runtime exits. That behavior is inherently unsafe. It may result in finalizers being called on live objects while other threads are concurrently manipulating those objects, resulting in erratic behavior or deadlock.java.lang.System.runFinalizersOnExit(boolean) This method was originally designed to enable or disable running finalizers on exit. Running finalizers on exit was disabled by default. If enabled, then the finalizers of all objects whose finalizers had not yet been automatically invoked were to be run before the Java runtime exits. That behavior is inherently unsafe. It may result in finalizers being called on live objects while other threads are concurrently manipulating those objects, resulting in erratic behavior or deadlock.java.util.Properties.save(OutputStream, String) This method does not throw an IOException if an I/O error occurs while saving the property list. The preferred way to save a properties list is via thestore(OutputStream out, String comments)
method or thestoreToXML(OutputStream os, String comment)
method.java.net.MulticastSocket.send(DatagramPacket, byte) Use the following code or its equivalent instead: ...... int ttl = mcastSocket.getTimeToLive(); mcastSocket.setTimeToLive(newttl); mcastSocket.send(p); mcastSocket.setTimeToLive(ttl); ......javax.swing.JViewport.setBackingStoreEnabled(boolean) As of Java 2 platform v1.3, replaced bysetScrollMode()
.java.awt.CheckboxGroup.setCurrent(Checkbox) As of JDK version 1.1, replaced bysetSelectedCheckbox(Checkbox)
.java.awt.Frame.setCursor(int) As of JDK version 1.1, replaced byComponent.setCursor(Cursor)
.java.sql.Time.setDate(int) java.util.Date.setDate(int) As of JDK version 1.1, replaced byCalendar.set(Calendar.DAY_OF_MONTH, int date)
.java.net.URLConnection.setDefaultRequestProperty(String, String) The instance specific setRequestProperty method should be used after an appropriate instance of URLConnection is obtained. Invoking this method will have no effect.java.rmi.server.LogStream.setDefaultStream(PrintStream) no replacementjava.awt.TextField.setEchoCharacter(char) As of JDK version 1.1, replaced bysetEchoChar(char)
.javax.xml.bind.Validator.setEventHandler(ValidationEventHandler) since JAXB2.0java.sql.Date.setHours(int) java.util.Date.setHours(int) As of JDK version 1.1, replaced byCalendar.set(Calendar.HOUR_OF_DAY, int hours)
.javax.swing.AbstractButton.setLabel(String) - Replaced bysetText(text)
java.awt.Scrollbar.setLineIncrement(int) As of JDK version 1.1, replaced bysetUnitIncrement(int)
.java.sql.DriverManager.setLogStream(PrintStream) UsesetLogWriter
javax.management.StringValueExp.setMBeanServer(MBeanServer) javax.management.AttributeValueExp.setMBeanServer(MBeanServer) This method has no effect. The MBean Server used to obtain an attribute value isQueryEval.getMBeanServer()
.javax.management.ValueExp.setMBeanServer(MBeanServer) This method is not needed because aValueExp
can access the MBean server in which it is being evaluated by usingQueryEval.getMBeanServer()
.javax.swing.JInternalFrame.setMenuBar(JMenuBar) As of Swing version 1.0.3 replaced bysetJMenuBar(JMenuBar m)
.javax.swing.JRootPane.setMenuBar(JMenuBar) As of Swing version 1.0.3 replaced bysetJMenuBar(JMenuBar menu)
.java.sql.Date.setMinutes(int) java.util.Date.setMinutes(int) As of JDK version 1.1, replaced byCalendar.set(Calendar.MINUTE, int minutes)
.java.awt.event.KeyEvent.setModifiers(int) as of JDK1.1.4java.sql.Time.setMonth(int) java.util.Date.setMonth(int) As of JDK version 1.1, replaced byCalendar.set(Calendar.MONTH, int month)
.java.awt.List.setMultipleSelections(boolean) As of JDK version 1.1, replaced bysetMultipleMode(boolean)
.javax.swing.JComponent.setNextFocusableComponent(Component) As of 1.4, replaced byFocusTraversalPolicy
javax.management.monitor.Monitor.setObservedObject(ObjectName) As of JMX 1.2, replaced byMonitor.addObservedObject(javax.management.ObjectName)
javax.management.monitor.MonitorMBean.setObservedObject(ObjectName) As of JMX 1.2, replaced byMonitorMBean.addObservedObject(javax.management.ObjectName)
java.rmi.server.LogStream.setOutputStream(OutputStream) no replacementjava.awt.Scrollbar.setPageIncrement(int) As of JDK version 1.1, replaced bysetBlockIncrement()
.java.security.Signature.setParameter(String, Object) UsesetParameter
.javax.xml.bind.Validator.setProperty(String, Object) since JAXB2.0java.rmi.server.RemoteStub.setRef(RemoteStub, RemoteRef) No replacement. ThesetRef
method was intended for setting the remote reference of a remote stub. This is unnecessary, sinceRemoteStub
s can be created and initialized with a remote reference through use of theRemoteStub.RemoteStub(RemoteRef)
constructor.java.sql.Date.setSeconds(int) java.util.Date.setSeconds(int) As of JDK version 1.1, replaced byCalendar.set(Calendar.SECOND, int seconds)
.javax.management.monitor.CounterMonitor.setThreshold(Number) As of JMX 1.2, replaced byCounterMonitor.setInitThreshold(java.lang.Number)
javax.management.monitor.CounterMonitorMBean.setThreshold(Number) As of JMX 1.2, replaced byCounterMonitorMBean.setInitThreshold(java.lang.Number)
java.net.MulticastSocket.setTTL(byte) use the setTimeToLive method instead, which uses int instead of byte as the type for ttl.java.net.DatagramSocketImpl.setTTL(byte) use setTimeToLive instead.java.sql.PreparedStatement.setUnicodeStream(int, InputStream, int) UsesetCharacterStream
javax.sql.rowset.BaseRowSet.setUnicodeStream(int, InputStream, int) getCharacterStream should be used in its placejava.net.URLStreamHandler.setURL(URL, String, String, int, String, String) Use setURL(URL, String, String, int, String, String, String, String);javax.xml.bind.Unmarshaller.setValidating(boolean) since JAXB2.0, please seeUnmarshaller.setSchema(javax.xml.validation.Schema)
java.sql.Time.setYear(int) java.util.Date.setYear(int) As of JDK version 1.1, replaced byCalendar.set(Calendar.YEAR, year + 1900)
.java.awt.Dialog.show() As of JDK version 1.5, replaced bysetVisible(boolean)
.java.awt.Window.show() As of JDK version 1.5, replaced byWindow.setVisible(boolean)
.java.awt.Component.show() As of JDK version 1.1, replaced bysetVisible(boolean)
.java.awt.Component.show(boolean) As of JDK version 1.1, replaced bysetVisible(boolean)
.java.awt.Component.size() As of JDK version 1.1, replaced bygetSize()
.javax.swing.JTable.sizeColumnsToFit(boolean) As of Swing version 1.0.3, replaced bydoLayout()
.java.lang.ThreadGroup.stop() This method is inherently unsafe. SeeThread.stop()
for details.java.lang.Thread.stop() This method is inherently unsafe. Stopping a thread with Thread.stop causes it to unlock all of the monitors that it has locked (as a natural consequence of the uncheckedThreadDeath
exception propagating up the stack). If any of the objects previously protected by these monitors were in an inconsistent state, the damaged objects become visible to other threads, potentially resulting in arbitrary behavior. Many uses ofstop
should be replaced by code that simply modifies some variable to indicate that the target thread should stop running. The target thread should check this variable regularly, and return from its run method in an orderly fashion if the variable indicates that it is to stop running. If the target thread waits for long periods (on a condition variable, for example), theinterrupt
method should be used to interrupt the wait. For more information, see Why are Thread.stop, Thread.suspend and Thread.resume Deprecated?.java.lang.Thread.stop(Throwable) This method was originally designed to force a thread to stop and throw a givenThrowable
as an exception. It was inherently unsafe (seeThread.stop()
for details), and furthermore could be used to generate exceptions that the target thread was not prepared to handle. For more information, see Why are Thread.stop, Thread.suspend and Thread.resume Deprecated?.java.lang.ThreadGroup.suspend() This method is inherently deadlock-prone. SeeThread.suspend()
for details.java.lang.Thread.suspend() This method has been deprecated, as it is inherently deadlock-prone. If the target thread holds a lock on the monitor protecting a critical system resource when it is suspended, no thread can access this resource until the target thread is resumed. If the thread that would resume the target thread attempts to lock this monitor prior to callingresume
, deadlock results. Such deadlocks typically manifest themselves as "frozen" processes. For more information, see Why are Thread.stop, Thread.suspend and Thread.resume Deprecated?.java.util.Date.toGMTString() As of JDK version 1.1, replaced byDateFormat.format(Date date)
, using a GMTTimeZone
.java.util.Date.toLocaleString() As of JDK version 1.1, replaced byDateFormat.format(Date date)
.java.rmi.server.LogStream.toString() no replacementjava.rmi.server.Operation.toString() no replacementjava.io.ByteArrayOutputStream.toString(int) This method does not properly convert bytes into characters. As of JDK 1.1, the preferred way to do this is via thetoString(String enc)
method, which takes an encoding-name argument, or thetoString()
method, which uses the platform's default character encoding.java.io.File.toURL() javax.swing.plaf.metal.MetalScrollPaneUI.uninstallListeners(JScrollPane) - Replaced byMetalScrollPaneUI.uninstallListeners(JComponent)
java.util.Date.UTC(int, int, int, int, int, int) As of JDK version 1.1, replaced byCalendar.set(year + 1900, month, date, hrs, min, sec)
orGregorianCalendar(year + 1900, month, date, hrs, min, sec)
, using a UTCTimeZone
, followed byCalendar.getTime().getTime()
.javax.xml.bind.Validator.validate(Object) since JAXB2.0javax.xml.bind.Validator.validateRoot(Object) since JAXB2.0javax.swing.text.View.viewToModel(float, float, Shape) org.omg.CORBA.portable.OutputStream.write_Principal(Principal) Deprecated by CORBA 2.2.java.rmi.server.LogStream.write(byte[], int, int) no replacementjava.rmi.server.LogStream.write(int) no replacementjava.io.ObjectOutputStream.PutField.write(ObjectOutput) This method does not write the values contained by thisPutField
object in a proper format, and may result in corruption of the serialization stream. The correct way to writePutField
data is by calling theObjectOutputStream.writeFields()
method.
-
Deprecated Constructors Constructor and Description javax.management.AttributeValueExp() An instance created with this constructor cannot be used in a query.java.sql.Date(int, int, int) instead use the constructorDate(long date)
java.util.Date(int, int, int) As of JDK version 1.1, replaced byCalendar.set(year + 1900, month, date)
orGregorianCalendar(year + 1900, month, date)
.java.util.Date(int, int, int, int, int) As of JDK version 1.1, replaced byCalendar.set(year + 1900, month, date, hrs, min)
orGregorianCalendar(year + 1900, month, date, hrs, min)
.java.util.Date(int, int, int, int, int, int) As of JDK version 1.1, replaced byCalendar.set(year + 1900, month, date, hrs, min, sec)
orGregorianCalendar(year + 1900, month, date, hrs, min, sec)
.java.util.Date(String) As of JDK version 1.1, replaced byDateFormat.parse(String s)
.java.awt.event.KeyEvent(Component, int, long, int, int) as of JDK1.1java.rmi.server.Operation(String) no replacementjava.rmi.RMISecurityException(String) no replacementjava.rmi.RMISecurityException(String, String) no replacementjava.rmi.ServerRuntimeException(String, Exception) no replacementjava.rmi.server.SkeletonMismatchException(String) no replacementjava.net.Socket(InetAddress, int, boolean) Use DatagramSocket instead for UDP transport.java.net.Socket(String, int, boolean) Use DatagramSocket instead for UDP transport.java.io.StreamTokenizer(InputStream) As of JDK version 1.1, the preferred way to tokenize an input stream is to convert it into a character stream, for example:Reader r = new BufferedReader(new InputStreamReader(is)); StreamTokenizer st = new StreamTokenizer(r);
java.lang.String(byte[], int) This method does not properly convert bytes into characters. As of JDK 1.1, the preferred way to do this is via theString
constructors that take aCharset
, charset name, or that use the platform's default charset.java.lang.String(byte[], int, int, int) This method does not properly convert bytes into characters. As of JDK 1.1, the preferred way to do this is via theString
constructors that take aCharset
, charset name, or that use the platform's default charset.org.omg.CORBA.TCKind(int) Do not use this constructor as this method should be private according to the OMG specification. UseTCKind.from_int(int)
instead.java.sql.Time(int, int, int) Use the constructor that takes a milliseconds value in place of this constructorjava.sql.Timestamp(int, int, int, int, int, int, int) instead use the constructorTimestamp(long millis)
-
Deprecated Annotation Type Elements Annotation Type Element and Description javax.jws.HandlerChain.name
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2022, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.