mirror of
https://github.com/Akomry/sae302_applicom.git
synced 2025-12-06 08:43:54 +00:00
fix(message): utilisation de JSONObject.put() au lieu d'un format-string pour créer l'objet json
This commit is contained in:
parent
be9522bf8e
commit
d47358c501
1 changed files with 3 additions and 1 deletions
|
|
@ -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() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue