List of usage examples for java.text Collator getClass
@HotSpotIntrinsicCandidate public final native Class<?> getClass();
From source file:dk.statsbiblioteket.util.CachedCollator.java
private static Collator fixCollator(Collator collator, boolean check) { if (!(collator instanceof RuleBasedCollator)) { log.warn(String.format("fixCollator expected a RuleBasedCollator but got %s. Unable to update Collator", collator.getClass())); return collator; }/* w w w.j ava 2 s .c o m*/ String rules = ((RuleBasedCollator) collator).getRules(); if (check && !rules.contains("<' '<'\u005f'")) { log.debug("fixCollator: The received Collator already sorts spaces first"); return collator; } try { RuleBasedCollator newCollator = new RuleBasedCollator(rules.replace("<'\u005f'", "<' '<'\u005f'")); log.trace("Successfully updated Collator to prioritize spaces before other characters"); return newCollator; } catch (ParseException e) { throw new RuntimeException("ParseException while parsing\n" + rules, e); } }