From f6d9b5d748432a6765e508447b2cc954bd45d807 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 10 Oct 2014 22:24:14 +0200 Subject: [PATCH] Use statially imported valueOf(). --- src/main/java/net/pterodactylus/sone/template/ImageLinkFilter.java | 6 +++--- src/main/java/net/pterodactylus/sone/template/ParserFilter.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/template/ImageLinkFilter.java b/src/main/java/net/pterodactylus/sone/template/ImageLinkFilter.java index 15881db..9ede851 100644 --- a/src/main/java/net/pterodactylus/sone/template/ImageLinkFilter.java +++ b/src/main/java/net/pterodactylus/sone/template/ImageLinkFilter.java @@ -79,11 +79,11 @@ public class ImageLinkFilter implements Filter { if (image == null) { return null; } - String imageClass = String.valueOf(parameters.get("class")); + String imageClass = valueOf(parameters.get("class")); int maxWidth = parseInt(valueOf(parameters.get("max-width")), MAX_VALUE); int maxHeight = parseInt(valueOf(parameters.get("max-height")), MAX_VALUE); - String mode = String.valueOf(parameters.get("mode")); - String title = String.valueOf(parameters.get("title")); + String mode = valueOf(parameters.get("mode")); + String title = valueOf(parameters.get("title")); TemplateContext linkTemplateContext = templateContextFactory.createTemplateContext(); linkTemplateContext.set("class", imageClass); diff --git a/src/main/java/net/pterodactylus/sone/template/ParserFilter.java b/src/main/java/net/pterodactylus/sone/template/ParserFilter.java index f402a41..ec35e2e 100644 --- a/src/main/java/net/pterodactylus/sone/template/ParserFilter.java +++ b/src/main/java/net/pterodactylus/sone/template/ParserFilter.java @@ -91,7 +91,7 @@ public class ParserFilter implements Filter { */ @Override public Object format(TemplateContext templateContext, Object data, Map parameters) { - String text = String.valueOf(data); + String text = valueOf(data); int length = parseInt(valueOf(parameters.get("length")), -1); int cutOffLength = parseInt(valueOf(parameters.get("cut-off-length")), length); Object sone = parameters.get("sone"); -- 2.7.4