[Java] Play! framework + retrofit2 client exception converter, bug fixes (#6543)

* added exception converter

* underscore removal fix

* samples updated

* added test

* test whitespace
This commit is contained in:
lukoyanov
2017-09-26 09:14:04 +03:00
committed by wing328
parent 0a9e3782c5
commit e2916fdc13
19 changed files with 671 additions and 7 deletions

View File

@@ -3255,7 +3255,13 @@ public class DefaultCodegen {
p = Pattern.compile("(_)(.)");
m = p.matcher(word);
while (m.find()) {
word = m.replaceFirst(m.group(2).toUpperCase());
String original = m.group(2);
String upperCase = original.toUpperCase();
if (original.equals(upperCase)) {
word = word.replaceFirst("_", "");
} else {
word = m.replaceFirst(upperCase);
}
m = p.matcher(word);
}