I've got Java code that is subclassing com.sun.javafx.scene.control.skin.TextFieldSkin
. (Yes, I know that I'm supposed to beware using sun.com.*
.) Consider me appropriately chastized.
With Java 9, this class is now in the mainstream, available as javafx.scene.control.skin.TextFieldSkin
. I'd like my code to be buildable on Java 8 and higher. But since the code has moved, I need different imports depending on the version.
I can't do conditional inheritance based on Java version, because it happens at compile time. I'm using Maven, so I could use the Munge plugin to do conditional compilation; that appears as though it will work, though it will cause annoying errors to be flagged in my development environment in realtime as I code because the import in either case will be enclosed in comments away.
What's the right way to handle this?