Your choice of action may depend if you are writing code for a one-time personal project, long-term many-user project, commercial product, etc.
I'm guessing you want to do this to fix some of Sun's bugs or change their behavior.
The typical choice would be to override the methods you want to change. Often you can't do that conventionally because of private declarations. Another option might be to copy the core class's source to your own file, change the class's name, and customize the code. This is useful if you can control what instances are used in your program. (E.g. if you fix something in JTextField, you can always choose to use MyTextField, but if you change something in
Thread, you can't control the use of that everywhere.)