Closed Bug 778472 Opened 9 years ago Closed 9 years ago

Clean up Java imports

Categories

(Firefox for Android Graveyard :: General, defect, P4)

ARM
Android
defect

Tracking

(firefox16 wontfix, firefox17 fixed)

RESOLVED FIXED
Firefox 17
Tracking Status
firefox16 --- wontfix
firefox17 --- fixed

People

(Reporter: cpeterson, Assigned: cpeterson)

References

Details

Attachments

(3 files)

No description provided.
Part 1: Remove unused and redundant import statements.
Attachment #646892 - Flags: review?(mark.finkle)
Part 2: Replace wildcard import statements with fully-qualified names, as per Google's style guide for Android Java code. This makes tracking dependencies and finding unused import statements easier.

https://source.android.com/source/code-style.html#fully-qualify-imports
Attachment #646894 - Flags: review?(mark.finkle)
I have a patch part 3 that cleans up our haphazard ordering of import statements, but I am waiting for feedback from m.d.p.m. re the correct order.
Comment on attachment 646892 [details] [diff] [review]
part-1-remove-unused-imports.patch

Are you using a tool to help with this or just eye-balling it? Tools like PMD and FindBugs will find this bad imports too.
Attachment #646892 - Flags: review?(mark.finkle) → review+
Attachment #646894 - Flags: review?(mark.finkle) → review+
(In reply to Mark Finkle (:mfinkle) from comment #4)
> Are you using a tool to help with this or just eye-balling it? Tools like
> PMD and FindBugs will find this bad imports too.

I'm using Checkstyle: http://checkstyle.sourceforge.net/
Whiteboard: [leave open]
Part 3: Standardize order of import statements from most project-specific to least:

 1. Project-specific imports: org.mozilla
 2. Third-party libraries: com, net, org
 3. System libraries: android
 4. Language features: java

I have an opinion on the order of the imports (most-to-least or least-to-most), but I think any standard is better than none. On m.d.p.m., kats concurred that the most-to-least order was reasonable and no one voiced any other opinions or opposition.
Attachment #647681 - Flags: review?(mark.finkle)
Attachment #647681 - Flags: review?(mark.finkle) → review+
https://hg.mozilla.org/mozilla-central/rev/d14731ba12c1
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.