Skip to content
This repository has been archived by the owner on Jul 15, 2022. It is now read-only.

Commit

Permalink
Remove some uses of repackaged Google classes with a more recent version
Browse files Browse the repository at this point in the history
of Guava and Apache Commons.
  • Loading branch information
mihaip committed Jan 11, 2012
1 parent 614cff3 commit bb1453b
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .classpath
Expand Up @@ -7,7 +7,8 @@
<classpathentry kind="lib" path="war/WEB-INF/lib/rome-1.0.jar"/>
<classpathentry kind="lib" path="war/WEB-INF/lib/xercesImpl.jar"/>
<classpathentry kind="lib" path="war/WEB-INF/lib/json_simple-1.1.jar"/>
<classpathentry kind="lib" path="war/WEB-INF/lib/google-collect-1.0-rc2.jar"/>
<classpathentry kind="lib" path="war/WEB-INF/lib/rome-opml-0.1-fixed.jar"/>
<classpathentry kind="lib" path="war/WEB-INF/lib/guava-11.0.1.jar"/>
<classpathentry kind="lib" path="war/WEB-INF/lib/commons-lang3-3.1.jar"/>
<classpathentry kind="output" path="war/WEB-INF/classes"/>
</classpath>
12 changes: 7 additions & 5 deletions src/info/persistent/pushbot/PushSubscriberServlet.java
@@ -1,7 +1,7 @@
package info.persistent.pushbot;

import com.google.appengine.api.xmpp.JID;
import com.google.appengine.repackaged.com.google.common.base.StringUtil;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;

import com.sun.syndication.feed.synd.SyndEntry;
Expand All @@ -12,6 +12,8 @@
import info.persistent.pushbot.util.Persistence;
import info.persistent.pushbot.util.Xmpp;

import org.apache.commons.lang3.StringEscapeUtils;

import java.io.IOException;
import java.net.URL;
import java.util.Collections;
Expand Down Expand Up @@ -130,16 +132,16 @@ protected void doPost(HttpServletRequest req, HttpServletResponse resp)
}

StringBuilder message = new StringBuilder("Update from ")
.append(StringUtil.unescapeHTML(feed.getTitle())).append(":");
.append(StringEscapeUtils.unescapeHtml4(feed.getTitle())).append(":");
for (SyndEntry displayEntry : displayEntries) {
String title = displayEntry.getTitle();
if (StringUtil.isEmptyOrWhitespace(title)) {
if (Strings.isNullOrEmpty(title)) {
title = "(title unknown)";
} else {
title = StringUtil.unescapeHTML(title);
title = StringEscapeUtils.unescapeHtml4(title);
}
String link = displayEntry.getLink();
if (StringUtil.isEmptyOrWhitespace(link)) {
if (Strings.isNullOrEmpty(link)) {
link = "<no link>";
}

Expand Down
@@ -1,13 +1,14 @@
package info.persistent.pushbot.commands;

import com.google.appengine.api.xmpp.JID;
import com.google.appengine.repackaged.com.google.common.base.StringUtil;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Multimap;

import info.persistent.pushbot.data.Subscription;
import info.persistent.pushbot.util.Xmpp;

import org.apache.commons.lang3.StringEscapeUtils;

import java.util.List;

public class ListSubscriptionsCommandHandler implements CommandHandler {
Expand Down Expand Up @@ -36,7 +37,7 @@ public void handle(JID user, String... args) {
String title = subscription.getTitle();
if (title != null && !title.isEmpty()) {
message.append(" (")
.append(StringUtil.unescapeHTML(title)).append(")");
.append(StringEscapeUtils.unescapeHtml4(title)).append(")");
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/info/persistent/pushbot/util/Feeds.java
@@ -1,8 +1,8 @@
package info.persistent.pushbot.util;

import com.google.appengine.repackaged.com.google.common.base.Hash;
import com.google.appengine.repackaged.com.google.common.io.ByteStreams;
import com.google.common.collect.Lists;
import com.google.common.io.ByteStreams;

import com.sun.syndication.feed.atom.Entry;
import com.sun.syndication.feed.rss.Guid;
Expand Down
2 changes: 1 addition & 1 deletion war/WEB-INF/appengine-generated/datastore-indexes-auto.xml
@@ -1,4 +1,4 @@
<!-- Indices written at Sun, 11 Oct 2009 22:01:54 UTC -->
<!-- Indices written at Tue, 10 Jan 2012 16:52:47 UTC -->

<datastore-indexes/>

Binary file modified war/WEB-INF/appengine-generated/local_db.bin
Binary file not shown.
Binary file added war/WEB-INF/lib/commons-lang3-3.1.jar
Binary file not shown.
Binary file removed war/WEB-INF/lib/google-collect-1.0-rc2.jar
Binary file not shown.
Binary file added war/WEB-INF/lib/guava-11.0.1.jar
Binary file not shown.

0 comments on commit bb1453b

Please sign in to comment.