everything sun.* is not portable - what about replacing with UnsupportedOperationException, or even creating a small custom exception (non-checked)?