19 Dec 2010, 20:18
Generic-user-small

Dave Murray (28 posts)

The app works fine, both in emulator and my Droid. Clean gives the following warning:

Description Resource Path Location Type
The method callAndroid(String) from the type LocalBrowser.AndroidBridge is never used locally LocalBrowser.java /LocalBrowser/src/org/example/localbrowser line 25 Java Problem

I have an aversion to ignoring warnings since they are generally telling you that there is a bug waiting to walk out from under the carpet. Did I do something wrong or is this an expected warning? If expected, is there something that can be done to tell the compiler that it is known to be OK and suppress the warning?

19 Dec 2010, 21:10
Generic-user-small

Dave Murray (28 posts)

More warnings from “Translate” which also works:

AdapterView is a raw type. References to generic type AdapterView should be parameterized Translate.java /Translate/src/org/example/translate line 97 Java Problem
AdapterView is a raw type. References to generic type AdapterView should be parameterized Translate.java /Translate/src/org/example/translate line 101 Java Problem
Future is a raw type. References to generic type Future should be parameterized Translate.java /Translate/src/org/example/translate line 34 Java Problem

20 Dec 2010, 15:59
Burnette_ed_pragsmall

Ed Burnette (1316 posts)

They are expected. callAndroid is not used from Java code because it is called from JavaScript. If you open up the editor and hover your mouse over the yellow squiggly line Eclipse will pop up a window allowing you to suppress the warning. Or you could make the AndroidBridge class public, which will also get rid of the warning.

You’re getting warnings in Translate.java because you have generic type checking enabled. You could do the hover-and-fix method which would insert a bunch of ugly “<?>” parameters to those types, or you could right click on the project and select Properties > Java Compiler > Errors/Warnigs, then Enable project specific settings and then select Generic types > Usage of a raw type: Ignore.

20 Dec 2010, 16:10
Generic-user-small

Dave Murray (28 posts)

Thank you. Experience has taught me to set warning levels to see them all and purposefully shut off the ones that I know are OK. I don’t think that they should be ignored outright but once I know that they are OK, I don’t want to see them any more.

25 Dec 2010, 17:58
Burnette_ed_pragsmall

Ed Burnette (1316 posts)

Sounds like good advice.

  You must be logged in to comment