Closed
Bug 1382049
Opened 7 years ago
Closed 7 years ago
error-prone: make inner classes static when possible
Categories
(Firefox for Android Graveyard :: General, enhancement)
Firefox for Android Graveyard
General
Tracking
(firefox58 fixed)
RESOLVED
FIXED
Firefox 58
Tracking | Status | |
---|---|---|
firefox58 | --- | fixed |
People
(Reporter: andrew, Assigned: andrew)
Details
Attachments
(1 file, 2 obsolete files)
28.04 KB,
patch
|
sebastian
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0 Build ID: 20170718164211
Assignee | ||
Comment 1•7 years ago
|
||
This avoids an implicit this field and can help GC. Found via error-prone.
Assignee | ||
Updated•7 years ago
|
Attachment #8887713 -
Flags: review?(s.kaspari)
Attachment #8887713 -
Flags: review?(nalexander)
Updated•7 years ago
|
Assignee: nobody → andrew
Comment 2•7 years ago
|
||
Comment on attachment 8887713 [details] [diff] [review] Make inner classes static when possible Review of attachment 8887713 [details] [diff] [review]: ----------------------------------------------------------------- In general I'm fine with this, but will defer to Sebastian. Thanks for pushing on this, Andrew!
Attachment #8887713 -
Flags: review?(nalexander) → review+
Comment 3•7 years ago
|
||
Comment on attachment 8887713 [details] [diff] [review] Make inner classes static when possible Review of attachment 8887713 [details] [diff] [review]: ----------------------------------------------------------------- Making inner classes static is great to avoid accidental references. Does error-prone output a reasoning for making some of those classes final? Do you have try[1] access to test your patch? [1] https://wiki.mozilla.org/ReleaseEngineering/TryServer
Attachment #8887713 -
Flags: review?(s.kaspari) → review+
Assignee | ||
Comment 4•7 years ago
|
||
I added final when adding static as a personal preference. error-prone does not do this kind of visibility analysis. I do not have try access as this is my first patch.
Assignee | ||
Updated•7 years ago
|
Flags: needinfo?(s.kaspari)
Updated•7 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(s.kaspari)
Comment 5•7 years ago
|
||
I pushed the patch to try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=08b8b6c92f1320c1a3c78bfbcb82b5bd358d9326 If it passes all tests then we can land the patch. :)
Assignee | ||
Updated•7 years ago
|
Flags: needinfo?(s.kaspari)
Assignee | ||
Comment 6•7 years ago
|
||
Do you need anything more from me to move forward with this?
Comment 7•7 years ago
|
||
(In reply to Andrew Gaul from comment #6) > Do you need anything more from me to move forward with this? Try looks green, so we should be good. I think this just fell off the radar. Would you mind rebasing and pushing a new patch? I'll set checkin-needed. Thanks, Andrew! Sorry for the long delay.
Assignee | ||
Comment 8•7 years ago
|
||
This avoids an implicit this field and can help GC. Found via error-prone.
Assignee | ||
Updated•7 years ago
|
Flags: needinfo?(nalexander)
Updated•7 years ago
|
Attachment #8887713 -
Attachment is obsolete: true
Flags: needinfo?(s.kaspari)
Updated•7 years ago
|
Attachment #8916195 -
Flags: review+
Comment 9•7 years ago
|
||
Thank you, Andrew! I added the "checkin-needed" keyword so that a code tree sheriff can land the patch.
Flags: needinfo?(nalexander)
Keywords: checkin-needed
Comment 10•7 years ago
|
||
Pushed by ryanvm@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/7c264d9bf22a Make inner classes static when possible. r=nalexander, r=sebastian
Keywords: checkin-needed
Comment 11•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/7c264d9bf22a
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox58:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 58
Comment 12•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/7c264d9bf22a
Assignee | ||
Comment 13•7 years ago
|
||
The former autoboxes to an Integer and uses the Integer object cache to avoid allocations.
Attachment #8924221 -
Flags: review?(s.kaspari)
Attachment #8924221 -
Flags: review?(nalexander)
Assignee | ||
Updated•7 years ago
|
Attachment #8924221 -
Flags: review?(s.kaspari)
Attachment #8924221 -
Flags: review?(nalexander)
Assignee | ||
Comment 14•7 years ago
|
||
Sorry copy and paste error I intended to tag bug 1413620.
Comment 15•7 years ago
|
||
Comment on attachment 8924221 [details] [diff] [review] Prefer Integer.parseInt over new Integer Review of attachment 8924221 [details] [diff] [review]: ----------------------------------------------------------------- r- just to revisit. Is the implicit Integer created equivalent to Integer.valueOf. ::: mobile/android/base/java/org/mozilla/gecko/db/LocalURLMetadata.java @@ +81,5 @@ > Iterator<String> keys = icons.keys(); > > ArrayList<Integer> sizes = new ArrayList<Integer>(icons.length()); > while (keys.hasNext()) { > + sizes.add(Integer.parseInt(keys.next())); https://stackoverflow.com/a/31115685 suggests that `Integer.valueOf()` is better yet, since we need an `Integer`.
Assignee | ||
Updated•7 years ago
|
Attachment #8924221 -
Attachment is obsolete: true
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
•