Removing dependency on Sun-internal class