From: David ‘Bombe’ Roden Date: Sun, 16 Jan 2011 13:45:44 +0000 (+0100) Subject: Remove calls to deprecated methods. X-Git-Tag: 0.4.2^2~50 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=e22ec3673d5b9ced3522395d936def235a4b0505;p=Sone.git Remove calls to deprecated methods. --- diff --git a/src/main/java/net/pterodactylus/sone/template/GetPagePlugin.java b/src/main/java/net/pterodactylus/sone/template/GetPagePlugin.java index c57932e..1b36c05 100644 --- a/src/main/java/net/pterodactylus/sone/template/GetPagePlugin.java +++ b/src/main/java/net/pterodactylus/sone/template/GetPagePlugin.java @@ -50,7 +50,7 @@ public class GetPagePlugin implements Plugin { pageKey = "page"; } - Request request = (Request) dataProvider.getData(requestKey); + Request request = (Request) dataProvider.get(requestKey); String pageString = request.getHttpRequest().getParam(parameter); int page = 0; try { @@ -58,7 +58,7 @@ public class GetPagePlugin implements Plugin { } catch (NumberFormatException nfe1) { /* ignore. */ } - dataProvider.setData(pageKey, page); + dataProvider.set(pageKey, page); } } diff --git a/src/main/java/net/pterodactylus/sone/template/PostAccessor.java b/src/main/java/net/pterodactylus/sone/template/PostAccessor.java index 95dc614..ef8577d 100644 --- a/src/main/java/net/pterodactylus/sone/template/PostAccessor.java +++ b/src/main/java/net/pterodactylus/sone/template/PostAccessor.java @@ -70,7 +70,7 @@ public class PostAccessor extends ReflectionAccessor { } else if (member.equals("likes")) { return core.getLikes(post); } else if (member.equals("liked")) { - Sone currentSone = (Sone) dataProvider.getData("currentSone"); + Sone currentSone = (Sone) dataProvider.get("currentSone"); return (currentSone != null) && (currentSone.isLikedPostId(post.getId())); } else if (member.equals("new")) { return core.isNewPost(post.getId(), false); diff --git a/src/main/java/net/pterodactylus/sone/template/ReplyAccessor.java b/src/main/java/net/pterodactylus/sone/template/ReplyAccessor.java index db6c528..de0c9c3 100644 --- a/src/main/java/net/pterodactylus/sone/template/ReplyAccessor.java +++ b/src/main/java/net/pterodactylus/sone/template/ReplyAccessor.java @@ -66,7 +66,7 @@ public class ReplyAccessor extends ReflectionAccessor { if ("likes".equals(member)) { return core.getLikes(reply); } else if (member.equals("liked")) { - Sone currentSone = (Sone) dataProvider.getData("currentSone"); + Sone currentSone = (Sone) dataProvider.get("currentSone"); return (currentSone != null) && (currentSone.isLikedReplyId(reply.getId())); } else if (member.equals("new")) { return core.isNewReply(reply.getId(), false); diff --git a/src/main/java/net/pterodactylus/sone/template/RequestChangeFilter.java b/src/main/java/net/pterodactylus/sone/template/RequestChangeFilter.java index 380027b..c4c2277 100644 --- a/src/main/java/net/pterodactylus/sone/template/RequestChangeFilter.java +++ b/src/main/java/net/pterodactylus/sone/template/RequestChangeFilter.java @@ -49,12 +49,12 @@ public class RequestChangeFilter implements Filter { String name = parameters.get("name"); String nameKey = parameters.get("nameKey"); if (nameKey != null) { - name = String.valueOf(dataProvider.getData(nameKey)); + name = String.valueOf(dataProvider.get(nameKey)); } String key = parameters.get("key"); String value = null; if (key != null) { - value = String.valueOf(dataProvider.getData(key)); + value = String.valueOf(dataProvider.get(key)); } if (value == null) { value = parameters.get("value"); diff --git a/src/main/java/net/pterodactylus/sone/template/SoneAccessor.java b/src/main/java/net/pterodactylus/sone/template/SoneAccessor.java index 0cb92ff..7eaf085 100644 --- a/src/main/java/net/pterodactylus/sone/template/SoneAccessor.java +++ b/src/main/java/net/pterodactylus/sone/template/SoneAccessor.java @@ -69,10 +69,10 @@ public class SoneAccessor extends ReflectionAccessor { } else if (member.equals("local")) { return sone.getInsertUri() != null; } else if (member.equals("friend")) { - Sone currentSone = (Sone) dataProvider.getData("currentSone"); + Sone currentSone = (Sone) dataProvider.get("currentSone"); return (currentSone != null) && currentSone.hasFriend(sone.getId()); } else if (member.equals("current")) { - Sone currentSone = (Sone) dataProvider.getData("currentSone"); + Sone currentSone = (Sone) dataProvider.get("currentSone"); return (currentSone != null) && currentSone.equals(sone); } else if (member.equals("modified")) { return core.isModifiedSone(sone); @@ -91,7 +91,7 @@ public class SoneAccessor extends ReflectionAccessor { } else if (member.equals("locked")) { return core.isLocked(sone); } else if (member.equals("trust")) { - Sone currentSone = (Sone) dataProvider.getData("currentSone"); + Sone currentSone = (Sone) dataProvider.get("currentSone"); Trust trust = core.getTrust(currentSone, sone); if (trust == null) { return new Trust(null, null, null); diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/GetPostAjaxPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/GetPostAjaxPage.java index 92d5da6..a0aa6e2 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/GetPostAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/GetPostAjaxPage.java @@ -95,8 +95,8 @@ public class GetPostAjaxPage extends JsonPage { jsonPost.put("time", post.getTime()); StringWriter stringWriter = new StringWriter(); DataProvider dataProvider = postTemplate.createDataProvider(); - dataProvider.setData("post", post); - dataProvider.setData("currentSone", currentSone); + dataProvider.set("post", post); + dataProvider.set("currentSone", currentSone); try { postTemplate.render(dataProvider, stringWriter); } catch (TemplateException te1) { diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/GetReplyAjaxPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/GetReplyAjaxPage.java index e589191..15e4ef5 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/GetReplyAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/GetReplyAjaxPage.java @@ -97,8 +97,8 @@ public class GetReplyAjaxPage extends JsonPage { jsonReply.put("time", reply.getTime()); StringWriter stringWriter = new StringWriter(); DataProvider dataProvider = replyTemplate.createDataProvider(); - dataProvider.setData("reply", reply); - dataProvider.setData("currentSone", currentSone); + dataProvider.set("reply", reply); + dataProvider.set("currentSone", currentSone); try { replyTemplate.render(dataProvider, stringWriter); } catch (TemplateException te1) {