fix(message): utilisation de JSONObject.put() au lieu d'un format-string pour créer l'objet json

This commit is contained in:
bouclyma 2024-12-11 11:42:58 +01:00
parent be9522bf8e
commit d47358c501

View file

@ -37,7 +37,9 @@ public class Message {
/** /**
* Transforme le message courant en objet JSON * Transforme le message courant en objet JSON
*/ */
return new JSONObject("{to:%s,body:%s}".formatted( this.to, this.body)); return new JSONObject()
.put("to", this.to)
.put("body", this.body);
} }
public String toJson() { public String toJson() {