publicstaticvoid main(String[] args) {
Locale[] locales = Locale.getAvailableLocales(); int min = Integer.MAX_VALUE; int max = Integer.MIN_VALUE;
Map<Integer, Locale> map = new HashMap<>(locales.length); int conflicts = 0;
for (int i = 0; i < locales.length; i++) {
Locale loc = locales[i]; int hc = loc.hashCode();
min = Math.min(hc, min);
max = Math.max(hc, max);
Integer key = hc; if (map.containsKey(key)) {
conflicts++;
System.out.println("conflict: " + map.get(key) + ", " + loc);
} else {
map.put(key, loc);
}
}
System.out.println(locales.length + " locales: conflicts=" + conflicts
+ ", min=" + min + ", max=" + max + ", diff=" + (max - min)); if (conflicts >= (locales.length / 10)) { thrownew RuntimeException("too many conflicts: " + conflicts
+ " per " + locales.length + " locales");
}
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.9 Sekunden
(vorverarbeitet am 2026-06-10)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.