Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Issue 2416963005: Fix chrome_java FindBugs errors found when switching to n sdk. (Closed)

Created:
4 years, 2 months ago by agrieve
Modified:
4 years ago
CC:
chromium-reviews, kalyank, sadrul, asvitkine+watch_chromium.org, agrieve+watch_chromium.org, ghost stip (do not use)
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix chrome_java FindBugs errors found when switching to n sdk. (with some simplification of CrashFileManager.java) FindBugs reported the following issues: NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE: Possible null pointer dereference due to return value of called method In class org.chromium.chrome.browser.crash.CrashFileManager In method org.chromium.chrome.browser.crash.CrashFileManager.getAllFilesSorted() Method invoked at CrashFileManager.java:[line 258] Known null at CrashFileManager.java:[line 257] OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE: Method may fail to clean up stream or resource on checked exception In class org.chromium.chrome.browser.share.ShareHelper$3 In method org.chromium.chrome.browser.share.ShareHelper$3.doInBackground(Void[]) Reference type java.io.OutputStream Obligation to clean up resource created at ShareHelper.java:[line 398] is not discharged Path continues at ShareHelper.java:[line 399] REC_CATCH_EXCEPTION: Exception is caught when Exception is not thrown In class org.chromium.chrome.test.ChromeActivityTestCaseBase In method org.chromium.chrome.test.ChromeActivityTestCaseBase.prepareUrlIntent(Intent, String) At ChromeActivityTestCaseBase.java:[line 486] REC_CATCH_EXCEPTION: Exception is caught when Exception is not thrown In class org.chromium.chrome.test.ChromeActivityTestCaseBase In method org.chromium.chrome.test.ChromeActivityTestCaseBase.endPerfTest(String) At ChromeActivityTestCaseBase.java:[line 859] OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE: Method may fail to clean up stream or resource on checked exception In class org.chromium.chrome.test.util.RenderUtils In method org.chromium.chrome.test.util.RenderUtils.saveBitmap(Bitmap, File) Reference type java.io.OutputStream Obligation to clean up resource created at RenderUtils.java:[line 179] is not discharged Path continues at RenderUtils.java:[line 180] NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE: Possible null pointer dereference due to return value of called method In class org.chromium.chrome.browser.crash.CrashTestCase In method org.chromium.chrome.browser.crash.CrashTestCase.tearDown() Method invoked at CrashTestCase.java:[line 41] Known null at CrashTestCase.java:[line 41] RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT: Return value of method without side effect is ignored In class org.chromium.chrome.browser.customtabs.CustomTabFromChromeExternalNavigationTest In method org.chromium.chrome.browser.customtabs.CustomTabFromChromeExternalNavigationTest.testIntentWithRedirectToApp() Called method org.chromium.content.browser.test.util.Criteria.equals(Object, Callable) At CustomTabFromChromeExternalNavigationTest.java:[line 121] BUG=623989 Committed: https://crrev.com/90b4cf429c7e73e94f04a43bf573d98f03b80477 Cr-Commit-Position: refs/heads/master@{#425384}

Patch Set 1 #

Patch Set 2 : whoop #

Patch Set 3 : whomp #

Patch Set 4 : whup #

Patch Set 5 : seriously, last time. #

Patch Set 6 : Fix crash test file ordering now that more getters are sorted #

Patch Set 7 : rebase #

Total comments: 7

Messages

Total messages: 32 (21 generated)
agrieve
4 years, 2 months ago (2016-10-14 01:04:56 UTC) #2
agrieve
On 2016/10/14 01:04:56, agrieve wrote: +gsennton & Maria since I see you've just changed CrashFileManager ...
4 years, 2 months ago (2016-10-14 15:31:44 UTC) #17
Ted C
lgtm but I didn't look at the crash changes as I'll defer to people that ...
4 years, 2 months ago (2016-10-14 16:12:26 UTC) #20
Alexei Svitkine (slow)
+isherman for crash stuff as well
4 years, 2 months ago (2016-10-14 16:15:07 UTC) #22
Maria
lgtm
4 years, 2 months ago (2016-10-14 17:06:10 UTC) #23
agrieve
https://codereview.chromium.org/2416963005/diff/120001/chrome/android/java/src/org/chromium/chrome/browser/share/ShareHelper.java File chrome/android/java/src/org/chromium/chrome/browser/share/ShareHelper.java (left): https://codereview.chromium.org/2416963005/diff/120001/chrome/android/java/src/org/chromium/chrome/browser/share/ShareHelper.java#oldcode400 chrome/android/java/src/org/chromium/chrome/browser/share/ShareHelper.java:400: fOut.flush(); On 2016/10/14 16:12:26, Ted C wrote: > i ...
4 years, 2 months ago (2016-10-14 17:47:15 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2416963005/120001
4 years, 2 months ago (2016-10-14 17:48:08 UTC) #26
commit-bot: I haz the power
Committed patchset #7 (id:120001)
4 years, 2 months ago (2016-10-14 17:55:17 UTC) #28
commit-bot: I haz the power
Patchset 7 (id:??) landed as https://crrev.com/90b4cf429c7e73e94f04a43bf573d98f03b80477 Cr-Commit-Position: refs/heads/master@{#425384}
4 years, 2 months ago (2016-10-14 17:57:11 UTC) #30
Ilya Sherman
https://codereview.chromium.org/2416963005/diff/120001/chrome/android/java/src/org/chromium/chrome/browser/crash/CrashFileManager.java File chrome/android/java/src/org/chromium/chrome/browser/crash/CrashFileManager.java (right): https://codereview.chromium.org/2416963005/diff/120001/chrome/android/java/src/org/chromium/chrome/browser/crash/CrashFileManager.java#newcode295 chrome/android/java/src/org/chromium/chrome/browser/crash/CrashFileManager.java:295: List<File> filesBelowMaxTries = new ArrayList<>(unfilteredFiles.length); nit: This change seems ...
4 years, 2 months ago (2016-10-15 00:02:53 UTC) #31
agrieve
4 years, 1 month ago (2016-11-02 19:16:32 UTC) #32
Message was sent while issue was closed.
On 2016/10/15 00:02:53, Ilya Sherman wrote:
>
https://codereview.chromium.org/2416963005/diff/120001/chrome/android/java/sr...
> File
>
chrome/android/java/src/org/chromium/chrome/browser/crash/CrashFileManager.java
> (right):
> 
>
https://codereview.chromium.org/2416963005/diff/120001/chrome/android/java/sr...
>
chrome/android/java/src/org/chromium/chrome/browser/crash/CrashFileManager.java:295:
> List<File> filesBelowMaxTries = new ArrayList<>(unfilteredFiles.length);
> nit: This change seems unrelated to the rest of the CL, and didn't seem to be
> mentioned in the CL description.  Or, did I miss the reason for this?
> 
>
https://codereview.chromium.org/2416963005/diff/120001/chrome/android/java/sr...
>
chrome/android/java/src/org/chromium/chrome/browser/crash/CrashFileManager.java:305:
> File[] listCrashFiles(@Nullable final Pattern pattern) {
> What does the "crash" in this method name mean?
> 
>
https://codereview.chromium.org/2416963005/diff/120001/chrome/android/java/sr...
>
chrome/android/java/src/org/chromium/chrome/browser/crash/CrashFileManager.java:305:
> File[] listCrashFiles(@Nullable final Pattern pattern) {
> Please add documentation for this method.  In particular, it's not obvious
that
> the returned values are sorted.  (And, it's not really clear to me why you
> decided to make all calls to this method return files in sorted order -- just
to
> share more code?)
> 
>
https://codereview.chromium.org/2416963005/diff/120001/chrome/android/java/sr...
>
chrome/android/java/src/org/chromium/chrome/browser/crash/CrashFileManager.java:317:
> File[] minidumps = crashDir.listFiles(filter);
> It's not really correct to name this variable "minidumps" -- there are
> non-minidump files present in the crash directory as well.
> 
>
https://codereview.chromium.org/2416963005/diff/120001/chrome/android/javates...
> File
>
chrome/android/javatests/src/org/chromium/chrome/browser/crash/CrashTestCase.java
> (right):
> 
>
https://codereview.chromium.org/2416963005/diff/120001/chrome/android/javates...
>
chrome/android/javatests/src/org/chromium/chrome/browser/crash/CrashTestCase.java:41:
> return;
> Please log an error for this case.

comments addressed in follow-up: https://codereview.chromium.org/2469403002#

Powered by Google App Engine
This is Rietveld 408576698