Closed Bug 727121 Opened 8 years ago Closed 8 years ago

Java 1.7 build warnings

Categories

(Firefox for Android :: Android Sync, defect)

ARM
Android
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla13

People

(Reporter: rnewman, Assigned: rnewman)

References

Details

Attachments

(1 file, 1 obsolete file)

/home/bgirard/mozilla/kiwifox/tree/mobile/android/base/sync/setup/activities/SetupSyncActivity.java:304: warning: [unchecked] unchecked call to put(K,V) as a member of the raw type HashMap
    jAccount.put(Constants.JSON_KEY_SYNCKEY,  syncKey);
                ^
  where K,V are type-variables:
    K extends Object declared in class HashMap
    V extends Object declared in class HashMap
/home/bgirard/mozilla/kiwifox/tree/mobile/android/base/sync/setup/activities/SetupSyncActivity.java:305: warning: [unchecked] unchecked call to put(K,V) as a member of the raw type HashMap
    jAccount.put(Constants.JSON_KEY_ACCOUNT,  username);
                ^
  where K,V are type-variables:
    K extends Object declared in class HashMap
    V extends Object declared in class HashMap
/home/bgirard/mozilla/kiwifox/tree/mobile/android/base/sync/setup/activities/SetupSyncActivity.java:306: warning: [unchecked] unchecked call to put(K,V) as a member of the raw type HashMap
    jAccount.put(Constants.JSON_KEY_PASSWORD, password);
                ^
  where K,V are type-variables:
    K extends Object declared in class HashMap
    V extends Object declared in class HashMap
/home/bgirard/mozilla/kiwifox/tree/mobile/android/base/sync/setup/activities/SetupSyncActivity.java:307: warning: [unchecked] unchecked call to put(K,V) as a member of the raw type HashMap
    jAccount.put(Constants.JSON_KEY_SERVER,   serverURL);
                ^
  where K,V are type-variables:
    K extends Object declared in class HashMap
    V extends Object declared in class HashMap
Attached patch Proposed patch. v1 (obsolete) — Splinter Review
Here's the version that's already in android-sync, and will land in the next drop. Feel free to land before then if you're blocked.
Assignee: nobody → rnewman
Status: NEW → ASSIGNED
Attachment #597062 - Flags: review+
Here's another awful hack.
Attachment #597062 - Attachment is obsolete: true
Comment on attachment 597107 [details] [diff] [review]
Proposed patch. v2

Review of attachment 597107 [details] [diff] [review]:
-----------------------------------------------------------------

This seems needlessly complicated. Was suppressing the unchecked warnings insufficient? I'm assuming we don't want to change org.json.simple.JSONObject.
> This seems needlessly complicated. Was suppressing the unchecked warnings
> insufficient?

For Java 7, yes. It seems to ignore that annotation in some circumstances. This is me and kats leaping around like madmen trying to find an incantation that will trick it.
I pushed a modified version of Kartikaya's patch, because nothing else worked:

https://hg.mozilla.org/integration/mozilla-inbound/rev/85085eefcac8
Whiteboard: [inbound]
https://hg.mozilla.org/mozilla-central/rev/85085eefcac8
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Whiteboard: [inbound]
Target Milestone: --- → mozilla13
Product: Mozilla Services → Android Background Services
Product: Android Background Services → Firefox for Android
You need to log in before you can comment on or make changes to this bug.