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

Unified Diff: mobile/android/thirdparty/org/adblockplus/browser/SubscriptionContainer.java

Issue 29572644: Noissue - Lint adjustments
Patch Set: Removing shared prefs editor commit() to apply() change Created Oct. 12, 2017, 9:14 a.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: mobile/android/thirdparty/org/adblockplus/browser/SubscriptionContainer.java
===================================================================
--- a/mobile/android/thirdparty/org/adblockplus/browser/SubscriptionContainer.java
+++ b/mobile/android/thirdparty/org/adblockplus/browser/SubscriptionContainer.java
@@ -44,22 +44,22 @@ final class SubscriptionContainer implem
private final HashMap<String, SubscriptionContainer.Subscription> urlMap = new HashMap<>();
private final List<WeakReference<SubscriptionListener>> subscriptionListeners = new ArrayList<>();
private SubscriptionContainer()
{
// prevent external instantiation
}
- public final static SubscriptionContainer create()
+ public static SubscriptionContainer create()
{
return create(true);
}
- public final static SubscriptionContainer create(final boolean refresh)
+ public static SubscriptionContainer create(final boolean refresh)
{
final SubscriptionContainer sc = new SubscriptionContainer();
AddOnBridge.queryValue(sc, "subscriptionsXml");
sc.entriesReady.acquireUninterruptibly();
for (final SubscriptionContainer.Subscription e : sc.entries)
{
sc.urlMap.put(e.url, e);
@@ -99,17 +99,17 @@ final class SubscriptionContainer implem
ret.add(e);
}
}
return ret;
}
public boolean isSubscriptionListed(final String url)
{
- return this.enableState.containsKey(url) && this.enableState.get(url).booleanValue();
+ return this.enableState.containsKey(url) && this.enableState.get(url);
}
public void changeSubscriptionState(final String url, final boolean enable)
{
final SubscriptionContainer.Subscription e = this.urlMap.get(url);
if (e != null)
{
if (enable)
@@ -173,21 +173,17 @@ final class SubscriptionContainer implem
final String title = parser.getAttributeValue(null, "title");
final String specialization = parser.getAttributeValue(null, "specialization");
final String url = parser.getAttributeValue(null, "url");
this.entries.add(new Subscription(title, specialization, url));
}
parser.next();
}
}
- catch (XmlPullParserException e)
- {
- Log.e(TAG, "Failed to parse subscriptions.xml: " + e.getMessage(), e);
- }
- catch (IOException e)
+ catch (XmlPullParserException | IOException e)
{
Log.e(TAG, "Failed to parse subscriptions.xml: " + e.getMessage(), e);
}
finally
{
this.entriesReady.release();
}
}
@@ -253,17 +249,17 @@ final class SubscriptionContainer implem
public void onApiRequestSucceeded(NativeJSObject jsObject)
{
switch (this.mode)
{
case QUERY_SUBSCRIPTION_ENABLED:
try
{
this.parent.enableState.put(this.subscription.url,
- Boolean.valueOf(AddOnBridge.getBooleanFromJsObject(jsObject, "value", false)));
+ AddOnBridge.getBooleanFromJsObject(jsObject, "value", false));
}
finally
{
this.parent.entriesReady.release();
}
break;
case ENABLE_SUBSCRIPTION:
case DISABLE_SUBSCRIPTION:

Powered by Google App Engine
This is Rietveld