Closed Bug 1116525 Opened 5 years ago Closed 5 years ago

Remove unused local variables in TextSelection


(Firefox for Android :: Text Selection, defect)

Not set



Firefox 37


(Reporter: capella, Assigned: p.calligaris.code, Mentored)


(Whiteboard: [good first bug][lang=java])


(1 file, 2 obsolete files)

This is a very simple bug for a new contributor with basic Java skills, to learn the Mozilla development process.

You should be able to build Firefox Mobile on your desktop. See
for instructions if this is new to you, and ask questions on irc channels #introduction or #mobile.

Also, ideally, you should have an android device for testing your solution locally, but this isn't strictly required.

One of our classes, "TextSelection" has two unused variables, which we want to remove. See,#36

So basically you'll: 1) Remove the code, 2) rebuild the browser, 3) test the browser, 4) get approvals and move it to production.
Hi Mark i want to take this bug.
This is my first time as contributor, and this seems a good starting exercise. The constructor of the class TextSelection require 5 args, the last two of them are unused 

TextSelection(TextSelectionHandle anchorHandle,
                  TextSelectionHandle caretHandle,
                  TextSelectionHandle focusHandle,
                  EventDispatcher eventDispatcher,
                  GeckoApp activity)

But here the constructor TextSelection is called with all the arguments. So we need to take care of this too. Is it right?

Or a better way can be to write two constructors one with the full argument list that call the other constructor with only the used variables?
Attached patch Proposed Patch (obsolete) — Splinter Review
I propose this patch
Comment on attachment 8543255 [details] [diff] [review]
Proposed Patch

Assigning to and requesting feedback on his patch.
Attachment #8543255 - Flags: feedback?(markcapella)
This looks good at first glance. Were you able to build this locally?
Yep, I have done steps 1)-3), and it seems working. 

I tested it locally on my Android device, I selected some text and looking at the logs using 

adb logcat -v time | grep GeckoTextSelection

is it enough?
Fantastic :)

Can you push the patch to the try-server to see if it's successful through our integration test suite? If you can, post a link to it here. If not, I can push it for you ... let me know ...

After we get that done, you'll have to repost your patch with a modified commit message. You'll be flagging r=margaret vs. r=reviewers.

Also, how did you generate that patch? It looks unlike something generated by mercurial.
for an example, and
for instructions.

Again, if you get lost, let me know :)
Attachment #8543255 - Flags: feedback?(markcapella) → feedback+
Attached patch Updated Proposed Patch (obsolete) — Splinter Review
Updated proposed patch.
Attachment #8543255 - Attachment is obsolete: true
Hi Mark,

I have redone all the steps and now the patch seems more similar to the example one in and I flagged it r=margaret.

I am trying to push on the try server using the following

$ hg qref --message "try: -b do -p android,android-x86 -u all -t all"
$ hg push -f ssh://

but the last command fails with:

pushing to ssh://
remote: Permission denied (publickey).
abort: no suitable response from remote hg!

I think I need to be added to the try server, is it right?

Thank you!
For now I'll push to try for you,

For this in the future you'll need L1 commit access, see here:

After you complete a bug or two, you get a couple people to vouch for you and fill out forms :-)
Attached patch bug1116525.diffSplinter Review
The try was successful, so I'll post the patch with the correct commit msg, and ping the proper reviewer.
Attachment #8543491 - Attachment is obsolete: true
Attachment #8543571 - Flags: review?(margaret.leibovic)
Attachment #8543571 - Flags: review?(margaret.leibovic) → review+
Fantastic :-) Now we push to fx-team and your patch is complete \o/

Thanks for helping out, and as I replied to your email, Bug 1117226 - Use sendRequestForResult for reader mode favicon request might be a good followup bug.

Otherwise, you can always check for "Good first bugs" / mentored bugs, and/or ask around in #introduction  :-D
Thank you for the support Mark! :)
Assignee: nobody → p.calligaris.code
Closed: 5 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → Firefox 37
You need to log in before you can comment on or make changes to this bug.