Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/org/adblockplus/android/SubscriptionParser.java

Issue 5697499218051072: Usage of new API, cleanups (reduced) (Closed)
Patch Set: Created April 11, 2014, 1:31 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/org/adblockplus/android/SubscriptionParser.java
diff --git a/src/org/adblockplus/android/SubscriptionParser.java b/src/org/adblockplus/android/SubscriptionParser.java
index 945d190503df39a97ede4d21267944ce908df702..3677c7b7655667d886950ce776fc91420557923b 100755
--- a/src/org/adblockplus/android/SubscriptionParser.java
+++ b/src/org/adblockplus/android/SubscriptionParser.java
@@ -25,54 +25,54 @@ import org.xml.sax.helpers.DefaultHandler;
class SubscriptionParser extends DefaultHandler
{
- private static final String SUBSCRIPTION = "subscription";
- private static final String TITLE = "title";
- private static final String SPECIALIZATION = "specialization";
- private static final String URL = "url";
- private static final String HOMEPAGE = "homepage";
- private static final String PREFIXES = "prefixes";
- private static final String AUTHOR = "author";
+ private final static String SUBSCRIPTION = "subscription";
+ private final static String TITLE = "title";
+ private final static String SPECIALIZATION = "specialization";
+ private final static String URL = "url";
+ private final static String HOMEPAGE = "homepage";
+ private final static String PREFIXES = "prefixes";
+ private final static String AUTHOR = "author";
- private List<Subscription> subscriptions;
+ private final List<Subscription> subscriptions;
private Subscription currentSubscription;
- public SubscriptionParser(List<Subscription> subscriptions)
+ public SubscriptionParser(final List<Subscription> subscriptions)
{
super();
this.subscriptions = subscriptions;
}
@Override
- public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
+ public void startElement(final String uri, final String localName, final String qName, final Attributes attributes) throws SAXException
{
if (localName.equalsIgnoreCase(SUBSCRIPTION))
{
- currentSubscription = new Subscription();
- currentSubscription.title = attributes.getValue(TITLE);
- currentSubscription.specialization = attributes.getValue(SPECIALIZATION);
- currentSubscription.url = attributes.getValue(URL);
- currentSubscription.homepage = attributes.getValue(HOMEPAGE);
- String prefix = attributes.getValue(PREFIXES);
+ this.currentSubscription = new Subscription();
+ this.currentSubscription.title = attributes.getValue(TITLE);
+ this.currentSubscription.specialization = attributes.getValue(SPECIALIZATION);
+ this.currentSubscription.url = attributes.getValue(URL);
+ this.currentSubscription.homepage = attributes.getValue(HOMEPAGE);
+ final String prefix = attributes.getValue(PREFIXES);
if (prefix != null)
{
- String[] prefixes = prefix.split(",");
- currentSubscription.prefixes = prefixes;
+ final String[] prefixes = prefix.split(",");
+ this.currentSubscription.prefixes = prefixes;
}
- currentSubscription.author = attributes.getValue(AUTHOR);
+ this.currentSubscription.author = attributes.getValue(AUTHOR);
}
super.startElement(uri, localName, qName, attributes);
}
@Override
- public void endElement(String uri, String localName, String qName) throws SAXException
+ public void endElement(final String uri, final String localName, final String qName) throws SAXException
{
if (localName.equalsIgnoreCase(SUBSCRIPTION))
{
- if (subscriptions != null && currentSubscription != null)
+ if (this.subscriptions != null && this.currentSubscription != null)
{
- subscriptions.add(currentSubscription);
+ this.subscriptions.add(this.currentSubscription);
}
- currentSubscription = null;
+ this.currentSubscription = null;
}
super.endElement(uri, localName, qName);
}

Powered by Google App Engine
This is Rietveld