Skip to content

Commit

Permalink
Lint cleanup, made compatible with min SDK 13
Browse files Browse the repository at this point in the history
  • Loading branch information
bosik committed Jan 7, 2019
1 parent e2736d1 commit 141e376
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.atomic.AtomicBoolean;
Expand Down Expand Up @@ -98,7 +97,12 @@ private static class FoodLoadingTask extends AsyncTask<Void, Progress, Boolean>

public FoodLoadingTask(Context context, long retryTime, long maxRetryTime)
{
this.context = Objects.requireNonNull(context);
if (context == null)
{
throw new NullPointerException("Context is null");
}

this.context = context;
this.retryTimeout = retryTime;
this.maxRetryTimeout = maxRetryTime;
this.notificationManager = (NotificationManager) context.getSystemService(NOTIFICATION_SERVICE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ public static void importData(Context context, ProgressCallback callback)

// download data
progress(callback, Progress.LOADING);
try (InputStream stream = client.loadStream(URL_EXPORT_PLAIN))
final InputStream stream = client.loadStream(URL_EXPORT_PLAIN);
try
{
Log.i(TAG, "Loaded in " + (p.sinceLastCheck() / 1000000) + " ms");

Expand All @@ -116,7 +117,8 @@ public static void importData(Context context, ProgressCallback callback)
{
if (entry.getName() != null)
{
try (InputStream data = new ByteArrayInputStream(entry.getContent()))
final InputStream data = new ByteArrayInputStream(entry.getContent());
try
{
switch (entry.getName())
{
Expand Down Expand Up @@ -159,9 +161,17 @@ public static void importData(Context context, ProgressCallback callback)
}
}
}
finally
{
data.close();
}
}
}
}
finally
{
stream.close();
}
}
catch (IOException e)
{
Expand Down
2 changes: 1 addition & 1 deletion portable/comp-android/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
<item>@string/common_unit_mass_bu</item>
</string-array>

<string-array name="meal_format_keys">
<string-array name="meal_format_keys" tools:ignore="MissingTranslation">
<item>9daabf78ed994e268f2e8c905564c82d</item>
<item>7a0c32c15c6e4ac6bf2b2b0d350810df</item>
<item>d3e249c5fb7f4d40872d4a1538be495f</item>
Expand Down

0 comments on commit 141e376

Please sign in to comment.