From: David ‘Bombe’ Roden Date: Wed, 16 Jan 2013 10:54:33 +0000 (+0100) Subject: Replace utils’ MapBuilder by Guava’s ImmutableMap.Builder. X-Git-Tag: 0.8.5^2~3^2~129 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=2076d1e91d695ca41a1f925ee42e79f237df7e9c;p=Sone.git Replace utils’ MapBuilder by Guava’s ImmutableMap.Builder. --- diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/EditImageAjaxPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/EditImageAjaxPage.java index 4a1689b..f6f0e56 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/EditImageAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/EditImageAjaxPage.java @@ -22,10 +22,11 @@ import net.pterodactylus.sone.template.ParserFilter; import net.pterodactylus.sone.text.TextFilter; import net.pterodactylus.sone.web.WebInterface; import net.pterodactylus.sone.web.page.FreenetRequest; -import net.pterodactylus.util.collection.MapBuilder; import net.pterodactylus.util.json.JsonObject; import net.pterodactylus.util.template.TemplateContext; +import com.google.common.collect.ImmutableMap; + /** * Page that stores a user’s image modifications. * @@ -80,7 +81,7 @@ public class EditImageAjaxPage extends JsonPage { String description = request.getHttpRequest().getParam("description").trim(); image.setTitle(title).setDescription(TextFilter.filter(request.getHttpRequest().getHeader("host"), description)); webInterface.getCore().touchConfiguration(); - return createSuccessJsonObject().put("imageId", image.getId()).put("title", image.getTitle()).put("description", image.getDescription()).put("parsedDescription", (String) parserFilter.format(new TemplateContext(), image.getDescription(), new MapBuilder().put("sone", image.getSone()).get())); + return createSuccessJsonObject().put("imageId", image.getId()).put("title", image.getTitle()).put("description", image.getDescription()).put("parsedDescription", (String) parserFilter.format(new TemplateContext(), image.getDescription(), ImmutableMap. builder().put("sone", image.getSone()).build())); } }