SyncDateFormat[] () { DateFormat[] formats = null; try { if (SystemInfo.isMac && JnaLoader.isLoaded()) { formats = getMacFormats(); } else if (SystemInfo.isUnix) { formats = getUnixFormats(); } else if (SystemInfo.isWindows && JnaLoader.isLoaded() ) { formats = getWindowsFormats(); } } catch (Throwable t) { LOG.error(t); } if (formats == null) { LOG.info("cannot load system formats (JNA=" + JnaLoader.isLoaded() + "), resorting to JRE for " + Locale.getDefault(Locale.Category.FORMAT)); formats = new DateFormat[]{ DateFormat.getDateInstance(DateFormat.SHORT), DateFormat.getTimeInstance(DateFormat.SHORT), DateFormat.getTimeInstance(DateFormat.MEDIUM), DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT) }; } SyncDateFormat[] synced = new SyncDateFormat[4]; for (int i = 0; i < formats.length; i++) { synced[i] = new SyncDateFormat(formats[i]); } return synced; }