Closed
Bug 1116633
Opened 9 years ago
Closed 9 years ago
Unclosed BufferedReader in GeckoAppShell.getPluginDirectories
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 38
People
(Reporter: rnewman, Assigned: san13692, Mentored)
Details
(Whiteboard: [good first bug][lang=java])
Attachments
(1 file, 1 obsolete file)
2.62 KB,
patch
|
rnewman
:
review+
|
Details | Diff | Splinter Review |
if (vfile.canRead()) { vreader = new FileReader(vfile); String version = new BufferedReader(vreader).readLine(); if (version.indexOf("CM9") != -1 || version.indexOf("cyanogen") != -1 || version.indexOf("Nova") != -1) { Log.w(LOGTAG, "Blocking plugins because of Tegra 2 + unofficial ICS bug (bug 736421)"); return null; } } `vreader` is closed, but not `version`. The BR will close its reader for you, so skip futzing with vreader altogether and just do the BR: if (vfile.canRead()) { final BufferedReader reader = new BufferedReader(new FileReader(vfile)); try { final String version = reader.readLine(); if (...) { /// } } finally { reader.close(); } } See Bug 1105316 for this pattern.
Assignee | ||
Comment 1•9 years ago
|
||
Approval Request Comment [Feature/regressing bug #]: [User impact if declined]: [Describe test coverage new/current, TBPL]: [Risks and why]: [String/UUID change made/needed]:
Attachment #8543284 -
Flags: review?(rnewman)
Assignee | ||
Comment 2•9 years ago
|
||
Hello Richard ,i have attached patch file please review it.
Reporter | ||
Comment 3•9 years ago
|
||
Comment on attachment 8543284 [details] [diff] [review] 1116633.patch Review of attachment 8543284 [details] [diff] [review]: ----------------------------------------------------------------- Thanks for the patch! Let's keep the catch to avoid exceptions. ::: mobile/android/base/GeckoAppShell.java @@ -1876,4 @@ > } > } > - } catch (IOException ex) { > - // nothing We still want to keep the enclosing try..catch around the whole block -- it just doesn't need a `finally`.
Attachment #8543284 -
Flags: review?(rnewman) → feedback+
Assignee | ||
Comment 4•9 years ago
|
||
Please review this patch ,here i have included try and catch around complete block.
Attachment #8545947 -
Flags: review?(rnewman)
Reporter | ||
Comment 5•9 years ago
|
||
Comment on attachment 8545947 [details] [diff] [review] 1116633_4.patch Review of attachment 8545947 [details] [diff] [review]: ----------------------------------------------------------------- Looks good, thanks! I'll land this. ::: mobile/android/base/GeckoAppShell.java @@ +1891,3 @@ > try { > if (vfile.canRead()) { > vreader = new FileReader(vfile); This line can go.
Attachment #8545947 -
Flags: review?(rnewman) → review+
Reporter | ||
Updated•9 years ago
|
Attachment #8543284 -
Attachment is obsolete: true
Reporter | ||
Comment 6•9 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/cc52e6438c2f
Reporter | ||
Updated•9 years ago
|
Assignee: nobody → san13692
Status: NEW → ASSIGNED
Assignee | ||
Comment 7•9 years ago
|
||
Sorry but i dint understand which line needs to be removed here, and do i have to remove it or is it final..
Comment 8•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/cc52e6438c2f
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 37
Updated•9 years ago
|
Target Milestone: Firefox 37 → Firefox 38
Reporter | ||
Comment 9•9 years ago
|
||
(In reply to surabhi anand from comment #7) > Sorry but i dint understand which line needs to be removed here, and do i > have to remove it or is it final.. I took care of it when I landed -- see the commit link above.
Assignee | ||
Comment 10•9 years ago
|
||
Thanx Richard :)
Updated•3 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•