ui util.isRetina: process IllegalArgumentException as well

This commit is contained in:
Sergey Ignatov
2015-04-14 18:22:47 +03:00
parent ac725fbfec
commit 1f9949af28
@@ -314,13 +314,16 @@ public class UIUtil {
}
try {
isRetina = (getScaleFactorMethod == null) || ((Integer)getScaleFactorMethod.invoke(device) != 1);
isRetina = getScaleFactorMethod == null || (Integer)getScaleFactorMethod.invoke(device) != 1;
} catch (IllegalAccessException e) {
LOG.debug("CGraphicsDevice.getScaleFactor(): Access issue");
isRetina = false;
} catch (InvocationTargetException e) {
LOG.debug("CGraphicsDevice.getScaleFactor(): Invocation issue");
isRetina = false;
} catch (IllegalArgumentException e) {
LOG.debug("object is not an instance of declaring class: " + device.getClass().getName());
isRetina = false;
}
devicesToRetinaSupportCacheMap.put(device, isRetina);