Closed
Bug 1116633
Opened 11 years ago
Closed 11 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•11 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•11 years ago
|
||
Hello Richard ,i have attached patch file please review it.
Reporter | ||
Comment 3•11 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•11 years ago
|
||
Please review this patch ,here i have included try and catch around complete block.
Attachment #8545947 -
Flags: review?(rnewman)
Reporter | ||
Comment 5•11 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•11 years ago
|
Attachment #8543284 -
Attachment is obsolete: true
Reporter | ||
Comment 6•11 years ago
|
||
Reporter | ||
Updated•11 years ago
|
Assignee: nobody → san13692
Status: NEW → ASSIGNED
Assignee | ||
Comment 7•11 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•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 37
Updated•11 years ago
|
Target Milestone: Firefox 37 → Firefox 38
Reporter | ||
Comment 9•11 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•11 years ago
|
||
Thanx Richard :)
Updated•5 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
•