Search code examples
javaeclipseannotationssuppress-warnings

Unsupported SuppressWarnings CloneDoesntCallSuperClone, FieldCanBeLocal, ObjectAllocationInLoop, UnusedAssignment, WeakerAccess


I imported a project into eclipse and get the following warnings:

  • Unsupported @SuppressWarnings("CloneDoesntCallSuperClone")
  • Unsupported @SuppressWarnings("FieldCanBeLocal")
  • Unsupported @SuppressWarnings("ObjectAllocationInLoop")
  • Unsupported @SuppressWarnings("UnusedAssignment")
  • Unsupported @SuppressWarnings("UnusedParameters")
  • Unsupported @SuppressWarnings("UnusedReturnValue")
  • Unsupported @SuppressWarnings("WeakerAccess")

Examples of these annotations can be found here and here. I tried jdk 1.5-1.7 but no change. Sow how do I get rid of those?


Solution

  • These warnings are from Android Studio and are not supported by Eclipse.

    You can turn of the message in 'Preferences > Java > Compiler > Errors/Warnings', expand the 'Annotations' section and change 'Unhandled token in @SuppressWarnings' to Ignore.