diff options
| author | Sean Owen <srowen@gmail.com> | 2014-04-23 01:20:58 +0400 |
|---|---|---|
| committer | Sean Owen <srowen@gmail.com> | 2014-04-23 01:20:58 +0400 |
| commit | 4050f5c2f3102be625e614fbe7bda6ef262fa799 (patch) | |
| tree | 77135d684058a790dc0f9b27a4b80a5bc90fc470 /android | |
| parent | 391e85ea51c9e4073d6dc2ff41cfcc400cf3bfb0 (diff) | |
| download | zxing-4050f5c2f3102be625e614fbe7bda6ef262fa799.tar.xz | |
Fix some issues flagged by Coverity static analysis
Diffstat (limited to 'android')
| -rwxr-xr-x | android/src/com/google/zxing/client/android/encode/EncodeActivity.java | 5 | ||||
| -rw-r--r-- | android/src/com/google/zxing/client/android/result/supplement/SupplementalInfoRetriever.java | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/android/src/com/google/zxing/client/android/encode/EncodeActivity.java b/android/src/com/google/zxing/client/android/encode/EncodeActivity.java index f05aa9228..cc433dd51 100755 --- a/android/src/com/google/zxing/client/android/encode/EncodeActivity.java +++ b/android/src/com/google/zxing/client/android/encode/EncodeActivity.java @@ -146,7 +146,10 @@ public final class EncodeActivity extends Activity { return; } File barcodeFile = new File(barcodesRoot, makeBarcodeFileName(contents) + ".png"); - barcodeFile.delete(); + if (!barcodeFile.delete()) { + Log.w(TAG, "Could not delete " + barcodeFile); + // continue anyway + } FileOutputStream fos = null; try { fos = new FileOutputStream(barcodeFile); diff --git a/android/src/com/google/zxing/client/android/result/supplement/SupplementalInfoRetriever.java b/android/src/com/google/zxing/client/android/result/supplement/SupplementalInfoRetriever.java index 787e7525e..a9f479ab3 100644 --- a/android/src/com/google/zxing/client/android/result/supplement/SupplementalInfoRetriever.java +++ b/android/src/com/google/zxing/client/android/result/supplement/SupplementalInfoRetriever.java @@ -55,8 +55,7 @@ public abstract class SupplementalInfoRetriever extends AsyncTask<Object,Object, } else if (result instanceof ProductParsedResult) { ProductParsedResult productParsedResult = (ProductParsedResult) result; String productID = productParsedResult.getProductID(); - String normalizedProductID = productParsedResult.getNormalizedProductID(); - SupplementalInfoRetriever productRetriever = + SupplementalInfoRetriever productRetriever = new ProductResultInfoRetriever(textView, productID, historyManager, context); productRetriever.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); } else if (result instanceof ISBNParsedResult) { |
