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

Do not encode booleans with XMLEncoder #306

Closed
wants to merge 5 commits into from
Closed

Conversation

mhdirkse
Copy link
Member

No description provided.

@mhdirkse mhdirkse marked this pull request as draft September 23, 2024 11:59
@mhdirkse mhdirkse marked this pull request as ready for review September 23, 2024 12:09
@mhdirkse mhdirkse requested a review from jacodg September 23, 2024 12:09
@mhdirkse
Copy link
Member Author

Ik vertrouw dit niet helemaal. Maar ik heb gezien dat het success checkpoint in mijn test nu "true" laat zien, geen XML code. Dat was tenminste zo een paar commits geleden. Sindsdien heb ik een paar dingen toegevoegd...

@@ -48,6 +51,7 @@
* @author Jaco de Groot
*/
public class MessageEncoderImpl implements MessageEncoder {
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dit is zonde, je weet immers de classname al...

@@ -69,7 +73,10 @@ public ToStringResult toString(Object message, String charset) {
} else if (message instanceof String) {
toStringResult = new ToStringResult((String)message, null);
} else {
if (message instanceof byte[]) {
if (message instanceof Boolean) {
toStringResult = new ToStringResult(Boolean.toString((Boolean) message), null, Boolean.class.getName());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gewoon direct returnen toch?

Comment on lines +160 to +161
Object rawResult = Boolean.valueOf(message);
return (T) rawResult;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Direct returnen.

@mhdirkse
Copy link
Member Author

Dit ga ik niet afmaken. Hebben we toen uitgebreid over gepraat.

@mhdirkse mhdirkse closed this Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants