jaxb-codemodel
jaxb-codemodel copied to clipboard
Forced unicode character escape in com.sun.codemodel.JExpr#quotify
com.sun.codemodel.JExpr#quotify have ancient comment and force unicode characters escape:
// technically Unicode escape shouldn't be done here,
// for it's a lexical level handling.
//
// However, various tools are so broken around this area,
// so just to be on the safe side, it's better to do
// the escaping here (regardless of the actual file encoding)
//
// see bug
if( c<0x20 || 0x7E<c ) {
// not printable. use Unicode escape
sb.append("\\u");
String hex = Integer.toHexString(((int)c)&0xFFFF);
for( int k=hex.length(); k<4; k++ )
sb.append('0');
sb.append(hex);
I want my annotation values became unescaped in generated sources by JCB
. I think in now days most compilers do not have any issues with it. So could you please just remove such block?
Or at least provide option to disable.
If you are willing I could make PR for that.
Just spent a few hours today looking for an answer why the jsonscheme2pojo library, which uses the codemodel for generating java clasess, escapes characters in Jackson annotations.