So, I'm making a fullscreen application and ran across something weird.
The Method DisplayMode.equals(DisplayMode dm) is overridden but I don't think it's implemented quite right. The following code prints false to the console:
public static void main(String[] args){
DisplayMode mode = new (1,2,16, DisplayMode.REFRESH_RATE_UNKNOWN);
System.out.println(mode.equals(new DisplayMode(1, 2, 16, 60)));
}
If the display modes are the same save for their refresh rates, and one of them is unknown, then I think they should be equal. Why is that not the case, and can someone suggest a workaround for me to use? Also, why do the online the Java Docs show that there are two overloaded versions of the .equals() method, one with a DisplayMode Object and one with a Java.Lang.Object Object? https://docs.oracle.com/javase/7/docs/api/java/awt/DisplayMode.html