Closed Bug 885298 Opened 6 years ago Closed 6 years ago

warning: [cast] redundant cast to android.os.IInterface android.os.IInterface iin = (android.os.IInterface)obj.queryLocalInterface(DESCRIPTOR); in ISelfBrailleService.java

Categories

(Firefox for Android :: General, defect)

ARM
Android
defect
Not set

Tracking

()

RESOLVED FIXED
Firefox 25
Tracking Status
firefox24 --- fixed
firefox25 --- fixed

People

(Reporter: MarcoZ, Assigned: maxli)

References

Details

Attachments

(1 file)

Reported by Chris Double in bug 876475 comment #32:

This patch landing has broken my Android builds:

JAR gecko-browser.jar
/src/mozilla/android/android/mobile/android/base/braille/com/googlecode/eyesfree/braille/selfbraille/ISelfBrailleService.java:30: warning: [cast] redundant cast to android.os.IInterface
android.os.IInterface iin = (android.os.IInterface)obj.queryLocalInterface(DESCRIPTOR);
                            ^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 warning
make[6]: *** [jars/gecko-browser.jar] Error 1


Kats added in bug 876475 comment #37:

This is likely due to the java compiler version in use. Java 7's compiler is more strict. It would be a good idea to remove the redundant cast pointed out in the warning message.
Chris, what version of the Android SDK do you use? I tried a few of the most recent versions and none of versions of aidl associated with them generated code with that redundant cast.
(In reply to Max Li [:maxli] from comment #1)
> Chris, what version of the Android SDK do you use? I tried a few of the most
> recent versions and none of versions of aidl associated with them generated
> code with that redundant cast.

r20 on Linux. Java version is:

java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
The problem occurs because older versions of the aidl tool generate code with the extraneous cast and since we're building with -Werror, this causes the build to fail.

After talking with kats on irc, he suggested that we could just check-in a generated file that works.
Attached patch PatchSplinter Review
Assignee: nobody → maxli
Attachment #766366 - Flags: review?(bugmail.mozilla)
Comment on attachment 766366 [details] [diff] [review]
Patch

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

::: mobile/android/base/braille/com/googlecode/eyesfree/braille/selfbraille/ISelfBrailleService.java
@@ +1,3 @@
> +/*
> + * This file is auto-generated.  DO NOT MODIFY.
> + * Original file: ISelfBrailleService.aidl

Is the .aidl file expected to change? If not, then remove these comments and add the Mozilla license here instead. Also fix up the indenting in this file so that it is readable. Basically we want to treat it like a regular source file.

If it is expected to change then just update the comment to note that the aidl file is not in the tree, but since this file is periodically re-generated and hand-modifications will be lost.
Attachment #766366 - Flags: review?(bugmail.mozilla) → review+
I don't think the aidl should change, so I went with the first option.

https://hg.mozilla.org/integration/mozilla-inbound/rev/6d6b5492ef06
https://hg.mozilla.org/mozilla-central/rev/6d6b5492ef06
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 25
Comment on attachment 766366 [details] [diff] [review]
Patch

[Approval Request Comment]
Bug caused by (feature/regressing bug #): 876475
User impact if declined: Developers building Firefox for Android locally may encounter warnings which lead to build failures with some combinations of the JDK and Android SDK revision.
Testing completed (on m-c, etc.): m-c.
Risk to taking this patch (and alternatives if risky): None.
String or IDL/UUID changes made by this patch: None.
Attachment #766366 - Flags: approval-mozilla-aurora?
Attachment #766366 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
You need to log in before you can comment on or make changes to this bug.