Community
Participate
Working Groups
Consider the following type interface I { String S = "stringValue"; } For field "S", IField#getConstant() returns "stringValue" (i.e. with quotes) when the type is source, and stringValue without quotes if I is a binary type. I expect the same value, regardless if the field is source or binary.
Also see bug 449244, though that one requires lot more effort. This has a much narrow scope and can be fixed without much effort. I prefer the constant _not_ to have the enclosing quotes.
As said in bug 449244, it's not only about the double-quotes. The result of SourceField#getConstant() is currently the initializer source, which doesn't even have to start and end with a double-quote character: static final String CONST = "Hello\tWorld: \"" + 4 + '2'; Touching this will inevitably break existing clients, so we either leave it as is or provide a complete fix. *** This bug has been marked as a duplicate of bug 449244 ***