Closed
Bug 1047971
Opened 11 years ago
Closed 11 years ago
Drop even more redundant field initialisers
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 34
People
(Reporter: ckitching, Assigned: ckitching)
References
Details
Attachments
(4 files)
|
26.71 KB,
patch
|
rnewman
:
review+
|
Details | Diff | Splinter Review |
|
2.14 KB,
patch
|
rnewman
:
review+
|
Details | Diff | Splinter Review |
|
11.46 KB,
patch
|
rnewman
:
review+
|
Details | Diff | Splinter Review |
|
2.61 KB,
patch
|
lucasr
:
review+
|
Details | Diff | Splinter Review |
See bug 1041836.
Two things occurred to me:
1) I found a regex bug that caused some of the problems detected by the analyser to be omitted from the patch, so I'm providing a patch here to finish the job.
2) I gave the analyser the ability to detect equivalently-redundant assignments given explicitly in constructors (also not fixable by proguard, as this is to what the other sort of initialiser is converted at compile-time anyway).
It turns out we have quite a few of these: http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/Tab.java#96
| Assignee | ||
Comment 1•11 years ago
|
||
Attachment #8466754 -
Flags: review?(rnewman)
| Assignee | ||
Comment 2•11 years ago
|
||
Attachment #8466755 -
Flags: review?(rnewman)
| Assignee | ||
Comment 3•11 years ago
|
||
Attachment #8466756 -
Flags: review?(rnewman)
| Assignee | ||
Comment 4•11 years ago
|
||
Updated•11 years ago
|
Attachment #8466756 -
Flags: review?(rnewman) → review+
Comment 5•11 years ago
|
||
Comment on attachment 8466754 [details] [diff] [review]
Part 1/3: Delete redundant initialisers-to-default-values from constructors
Review of attachment 8466754 [details] [diff] [review]:
-----------------------------------------------------------------
r+ except for TwoWayView.
::: mobile/android/base/widget/TwoWayView.java
@@ -316,5 @@
> public TwoWayView(Context context, AttributeSet attrs) {
> this(context, attrs, 0);
> }
>
> public TwoWayView(Context context, AttributeSet attrs, int defStyle) {
Please split out the TwoWayView changes into a separate patch, and ask lucasr for review; it's effectively a third-party dependency.
Attachment #8466754 -
Flags: review?(rnewman) → review+
Updated•11 years ago
|
OS: All → Android
Hardware: ARM → All
Comment 6•11 years ago
|
||
Comment on attachment 8466755 [details] [diff] [review]
Part 2/3: Delete redundant initialisers-to-default-values from constructors (android-sync)
Review of attachment 8466755 [details] [diff] [review]:
-----------------------------------------------------------------
Don't forget uplift (either by sending a pull request, or asking me as you land this).
Attachment #8466755 -
Flags: review?(rnewman) → review+
| Assignee | ||
Comment 7•11 years ago
|
||
Splitting out changes to TwoWayView.
Lucas: Explicit initialisation of fields to zero, null, or false are redundant and not stripped during any compilation or optimisation phase. This patch removes them, slightly reducing binary size and cleaning up code.
In general, Java guarantees that all non-final fields are initialised to zero, null, or false.
Attachment #8466866 -
Flags: review?(lucasr.at.mozilla)
Comment 8•11 years ago
|
||
Comment on attachment 8466866 [details] [diff] [review]
Part 4/3: Delete redundant initialisers-to-default-values from constructors in TwoWayView
Review of attachment 8466866 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good. For future patches, you should submit changes to TwoWayView directly to the upstream project in: https://github.com/lucasr/twoway-view/
I've already pushed these changes there: https://github.com/lucasr/twoway-view/commit/de9082db9824c38c7c7e52947170e6312d0a594b
Attachment #8466866 -
Flags: review?(lucasr.at.mozilla) → review+
| Assignee | ||
Comment 9•11 years ago
|
||
Comment 10•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/c092f9e4310d
https://hg.mozilla.org/mozilla-central/rev/4bd09430f063
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 34
Comment 11•11 years ago
|
||
(In reply to Lucas Rocha (:lucasr) from comment #8)
> Comment on attachment 8466866 [details] [diff] [review]
> Part 4/3: Delete redundant initialisers-to-default-values from constructors
> in TwoWayView
>
> Review of attachment 8466866 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> Looks good. For future patches, you should submit changes to TwoWayView
> directly to the upstream project in: https://github.com/lucasr/twoway-view/
>
> I've already pushed these changes there:
> https://github.com/lucasr/twoway-view/commit/
> de9082db9824c38c7c7e52947170e6312d0a594b
Just to be clear: I pushed the patch to the upstream repo but you still have to land it in m-c.
Flags: needinfo?(chriskitching)
| Assignee | ||
Comment 12•11 years ago
|
||
Comment 14•11 years ago
|
||
(In reply to Chris Kitching [:ckitching] from comment #9)
> https://hg.mozilla.org/integration/fx-team/rev/c092f9e4310d
> https://hg.mozilla.org/integration/fx-team/rev/4bd09430f063
One of these two caused bug 1037617 to go perma-orange - attempts to back these out lead to conflicts - could you either fix the failure or back this out? :-)
Status: RESOLVED → REOPENED
Flags: needinfo?(chriskitching)
Resolution: FIXED → ---
Comment 15•11 years ago
|
||
Comment 16•11 years ago
|
||
The failures can also be seen in the try run:
https://tbpl.mozilla.org/?tree=Try&rev=23795b78bd58
(though since they match a known intermittent it's easily missed)
Comment 18•11 years ago
|
||
Status: REOPENED → RESOLVED
Closed: 11 years ago → 11 years ago
Resolution: --- → FIXED
Comment 19•11 years ago
|
||
(In reply to Chris Kitching [:ckitching] from comment #17)
> Righto: working on it now.
Thank you :-)
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
•