highsource/hyperjaxb3 — pull request #11 by pethers (2014-09-18 06:52:40+00:00)
Title: Your solution covered all the cases much better.

Hi,

The first quick fix, didn't work. The current version is almost a copy or your original code with exception from

--
final Matcher camelCaseMatcher = camelCasePattern
.matcher(intermediateName);
while (camelCaseMatcher.find()) {
final String regFusion = camelCaseMatcher.group(0);
intermediateName = intermediateName.replace(regFusion,
regFusion.charAt(0) + "_" + regFusion.charAt(1));
}
---

in the getName method.

Had to duplicate the below

--
private Map nameKeyMap = new TreeMap();
private Map keyNameMap = new TreeMap();
public void afterPropertiesSet() throws Exception {
final Set> entries = getReservedNames()
.entrySet();
for (final Entry entry : entries) {
final Object entryKey = entry.getKey();
if (entryKey != null) {
final String key = entryKey.toString().toUpperCase();
final Object entryValue = entry.getValue();
final String value = entryValue == null
|| "".equals(entryValue.toString().trim()) ? key + "_"
: entryValue.toString();
nameKeyMap.put(key, value);
keyNameMap.put(value, key);
}
}
}
--
.

Migrated all of our services successfully now.

best regards
Pether