-Subproject commit 47ba24f81320001cf29f46e0069e0e7e83ad3553
+Subproject commit 272a7b504cb85b8dc2bba3718725b547750434b1
PackageInfo p = pm.getPackageInfo(getPackageName(), 0);
ver = p.versionName + " (ID " + p.versionCode + ")";
}
- } catch (Exception e) {
+ } catch (Exception ignored) {
}
TextView titleView = findViewById(R.id.titleText);
titleView.setText("QuickDic " + ver);
Log.d(LOG, "Trying to hide soft keyboard.");
final InputMethodManager inputManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
View focus = getCurrentFocus();
- if (focus != null) {
+ if (inputManager != null && focus != null) {
inputManager.hideSoftInputFromWindow(focus.getWindowToken(),
InputMethodManager.HIDE_NOT_ALWAYS);
}
DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm);
scale = dm.density;
- } catch (NullPointerException e)
+ } catch (NullPointerException ignored)
{}
// Convert the dps to pixels, based on density scale
mPaddingDefault = (int) (PADDING_DEFAULT_DP * scale + 0.5f);
}
try {
reader.close();
- } catch (IOException e) {}
+ } catch (IOException ignored) {}
}
public synchronized void init(Context c) {
File efd = null;
try {
efd = appContext.getExternalFilesDir(null);
- } catch (Exception e) {
+ } catch (Exception ignored) {
}
if (efd != null) {
efd.mkdirs();
try {
testfile.delete();
res = testfile.createNewFile() & testfile.delete();
- } catch (Exception e) {
+ } catch (Exception ignored) {
}
return res;
}
}
}
zipFile = new ZipInputStream(new BufferedInputStream(zipFileStream));
- ZipEntry zipEntry = null;
+ ZipEntry zipEntry;
while ((zipEntry = zipFile.getNextEntry()) != null) {
// Note: this check prevents security issues like accidental path
// traversal, which unfortunately ZipInputStream has no protection against.
} finally {
try {
if (zipOut != null) zipOut.close();
- } catch (IOException e) {}
+ } catch (IOException ignored) {}
try {
if (zipFile != null) zipFile.close();
- } catch (IOException e) {}
+ } catch (IOException ignored) {}
try {
if (zipFileStream != null) zipFileStream.close();
- } catch (IOException e) {}
- if (localZipFile != null && delete) localZipFile.delete();
+ } catch (IOException ignored) {}
+ if (localZipFile != null && delete) //noinspection ResultOfMethodCallIgnored
+ localZipFile.delete();
}
return result;
}
DownloadManager downloadManager = (DownloadManager) getSystemService(DOWNLOAD_SERVICE);
+ if (downloadManager == null) {
+ String msg = getString(R.string.downloadManagerQueryFailed);
+ new AlertDialog.Builder(DictionaryManagerActivity.this).setTitle(getString(R.string.error))
+ .setMessage(getString(R.string.downloadFailed, msg))
+ .setNeutralButton("Close", null).show();
+ return;
+ }
+
try {
downloadManager.enqueue(request);
} catch (SecurityException e) {
html = StringUtil.readToString(res);
try {
res.close();
- } catch (IOException e) {
+ } catch (IOException ignored) {
}
} else {
html = getIntent().getStringExtra(HTML);
File efd = null;
try {
efd = getApplicationContext().getExternalFilesDir(null);
- } catch (Exception e) {
+ } catch (Exception ignored) {
}
if (efd != null) {
String externalFilesDir = efd.getAbsolutePath();
package com.hughes.android.dictionary.engine;
+import android.support.annotation.NonNull;
+
import com.hughes.util.StringUtil;
import com.hughes.util.raf.RAFListSerializer;
import com.hughes.util.raf.RAFListSerializerSkippable;
}
@Override
- public int compareTo(HtmlEntry another) {
+ public int compareTo(@NonNull HtmlEntry another) {
if (title.compareTo(another.title) != 0) {
return title.compareTo(another.title);
}
package com.hughes.android.dictionary.engine;
+import android.support.annotation.NonNull;
+
import com.hughes.util.StringUtil;
import com.hughes.util.raf.RAFListSerializerSkippable;
import com.hughes.util.raf.RAFSerializable;
}
@Override
- public int compareTo(final PairEntry that) {
+ public int compareTo(@NonNull final PairEntry that) {
return this.getRawText(false).compareTo(that.getRawText(false));
}
Log.e(getClass().getSimpleName(), "Deserialization failed: " + src, e);
try {
if (in != null) in.close();
- } catch (IOException e2) {}
+ } catch (IOException ignored) {}
return null;
}
objects.put(filename, object);
}
try {
if (out != null) out.close();
- } catch (IOException e) {}
+ } catch (IOException ignored) {}
}
private PersistentObjectCache(final Context context) {