Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A comment's full text content is serialized with the default platform encoding #2138

Open
ThorbenLindhauer opened this issue Nov 7, 2014 · 2 comments
Labels
scope:core-api Changes to the core API: engine, dmn-engine, feel-engine, REST API, OpenAPI type:bug Issues that describe a user-facing bug in the project.

Comments

@ThorbenLindhauer
Copy link
Member

This issue was imported from JIRA:

Field Value
JIRA Link CAM-3035
Reporter zZ6Eda
What is this name? This pseudonym name was generated based on the user name in JIRA to protect the personal data of our JIRA users. You can use this identifier to search for issues by the same reporter.
Has restricted visibility comments false

CommentEntity#getFullMessageBytes and CommentEntity#setFullMessageBytes (see https://github.com/camunda/camunda-bpm-platform/blob/master/engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/CommentEntity.java#L54-L60) use the default platform encoding to serialize a String as a byte array. Should use the engine's default encoding instead.

Links:

@ThorbenLindhauer
Copy link
Member Author

This comment was imported from JIRA and written by user @ThorbenLindhauer


For example:
CommentEntity uses String#getBytes() (without encoding) to write the comment content to the database. Similarly, it retrieves the String by calling "new String(byte<])". Both cases use the platform encoding, which means that a value serialized on Windows will likely not be deserialized correctly on Linux. For backwards compatibility, we cannot easily enforce that always the engine's default charset is used.

In general: Check whether there exist other occurrences of this way of converting String to byte[> and check whether they can be changed to a charset-safe way without breaking API.

@ThorbenLindhauer
Copy link
Member Author

This comment was imported from JIRA and written by user @ThorbenLindhauer


To "fix" the above example with comments, one option could be to add a CLOB field to the Comment table that takes all the new comment values and deprecrate the old field. When deserializing a comment, it is then clear which field contains CLOBs and which must be deserialized in the current fashion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope:core-api Changes to the core API: engine, dmn-engine, feel-engine, REST API, OpenAPI type:bug Issues that describe a user-facing bug in the project.
Projects
None yet
Development

No branches or pull requests

1 participant