Skip to content

Commit ba677a9

Browse files
committed
more robust application of the JavaBean naming convention
1 parent a7098ce commit ba677a9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

hibernate4/src/main/java/com/fasterxml/jackson/datatype/hibernate4/HibernateProxySerializer.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.fasterxml.jackson.datatype.hibernate4;
22

3+
import java.beans.Introspector;
34
import java.io.IOException;
45
import java.lang.reflect.Field;
56
import java.lang.reflect.Method;
@@ -228,10 +229,10 @@ static String getIdentifierPropertyName(LazyInitializer init) {
228229
}
229230
String name = idGetter.getName();
230231
if (name.startsWith("get")) {
231-
name = Character.toLowerCase(name.charAt(3)) + name.substring(4);
232+
name = Introspector.decapitalize(name.substring(3));
232233
}
233234
return name;
234-
} catch (Exception e) {
235+
} catch (IllegalAccessException e) {
235236
throw new RuntimeException(e);
236237
}
237238
}

0 commit comments

Comments
 (0)