United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6852936 Remove unused classes from sun.misc
JDK-6852936 : Remove unused classes from sun.misc

Details
Type:
Bug
Submit Date:
2009-06-19
Status:
Open
Updated Date:
2014-03-28
Project Name:
JDK
Resolved Date:
Component:
other-libs
OS:
generic
Sub-Component:
other
CPU:
generic
Priority:
P4
Resolution:
Unresolved
Affected Versions:
7
Targeted Versions:
tbd_major

Related Reports
Relates:
Relates:
Relates:
Relates:
Relates:

Sub Tasks

Description
Many of the classes sin sun.misc date back to early JDK releases and may not be used anymore. Others have public replacements. This bug is submitted to check each of the classes in sun.misc and remove any that aren't being used. Further bugs/rfes may be submitted for cases where other code should be updated to use public or more modern replacements (eg: sun.misc.Service -> java.util.ServiceLoader).

                                    

Comments
It appears that the following are no longer used:
        sun.misc.CRC16 \
        sun.misc.Cache \
        sun.misc.CacheEntry \
        sun.misc.CacheEnumerator \
        sun.misc.Compare \
        sun.misc.ConditionLock \
        sun.misc.FIFOQueueEnumeration \
        sun.misc.LIFOQueueEnumeration \
        sun.misc.Lock \
        sun.misc.Regexp
        sun.misc.Request \
        sun.misc.RequestProcessor \
        sun.misc.Sort \
        sun.misc.Timeable \
        sun.misc.TimerThread \
        sun.misc.TimerTickThread \
        sun.misc.UCDecoder \
        sun.misc.UCEncoder \
        sun.misc.UUDecoder \
        sun.misc.UUEncoder \
        sun.misc.VMNotification \

sun.misc.CRC16 is loaded using Class.forName by test/closed/java/lang/SecurityManager/CheckPackagesLock.java. It looks like this test case easily be changed to use another class.
                                     
2009-06-30
EVALUATION

For compatibility reason, these classes may need to remain in the JDK in a separate module.
                                     
2009-10-30
Dependencies on sun.misc.* APIs analyzed from 89299 maven artifacts downloaded in Sep 2012:

class                                                                                unique          total
sun.misc.Unsafe                                                                   70            375
sun.misc.BASE64Encoder                                                    47            217
sun.misc.BASE64Decoder                                                    34            364
sun.misc.Perf                                                                        20            124
sun.misc.URLClassPath                                                       15            268
sun.misc.Signal                                                                     14             55
sun.misc.SignalHandler                                                        14             55
sun.misc.UUEncoder                                                            13            131
sun.misc.CharacterEncoder                                                  11             35
sun.misc.Service                                                                   10            164
sun.misc.CharacterDecoder                                                   4             15
sun.misc.Cleaner                                                                    4              6
sun.misc.Resource                                                                 3             25
sun.misc.UUDecoder                                                             3             19
sun.misc.Perf$GetPerfAction                                                 2             16
sun.misc.UCDecoder                                                             2             18
sun.misc.UCEncoder                                                             2             18
sun.misc.CRC16                                                                    1              1
sun.misc.ClassFileTransformer                                              1              4
sun.misc.CompoundEnumeration                                          1              2
sun.misc.IOUtils                                                                     1              1
sun.misc.JarFilter                                                                   1              1
sun.misc.MessageUtils                                                          1              2
sun.misc.Ref                                                                          1              1
sun.misc.ServiceConfigurationError                                      1              1
sun.misc.SoftCache                                                               1              3

                                     
2014-03-28



Hardware and Software, Engineered to Work Together