The last few days, I was looking into whether we could just ditch support for
Object. To find out if we can, I first scanned for synchronized methods, and then started looking at synchronized blocks.
Unfortunately, after putting in some work to simulate the types of values on the stack and in local variables, I realized that I have to keep track of the types in fields as well. Finding out if any of the synchronized blocks use the monitors of the
Object classes essentially amounts to performing type unification on the entire Java API and user application. I’m not willing to do that. It seems too ancillary to my project.
Now I’m thinking about how to subclass
Object while hiding it from
instanceof and reflection.