Remove calls to deprecated methods.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 16 Jan 2011 13:45:44 +0000 (14:45 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 16 Jan 2011 13:45:44 +0000 (14:45 +0100)
src/main/java/net/pterodactylus/sone/template/GetPagePlugin.java
src/main/java/net/pterodactylus/sone/template/PostAccessor.java
src/main/java/net/pterodactylus/sone/template/ReplyAccessor.java
src/main/java/net/pterodactylus/sone/template/RequestChangeFilter.java
src/main/java/net/pterodactylus/sone/template/SoneAccessor.java
src/main/java/net/pterodactylus/sone/web/ajax/GetPostAjaxPage.java
src/main/java/net/pterodactylus/sone/web/ajax/GetReplyAjaxPage.java

index c57932e..1b36c05 100644 (file)
@@ -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);
        }
 
 }
index 95dc614..ef8577d 100644 (file)
@@ -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);
index db6c528..de0c9c3 100644 (file)
@@ -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);
index 380027b..c4c2277 100644 (file)
@@ -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");
index 0cb92ff..7eaf085 100644 (file)
@@ -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);
index 92d5da6..a0aa6e2 100644 (file)
@@ -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) {
index e589191..15e4ef5 100644 (file)
@@ -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) {