#504 Check for autoboxing

Future
closed
nobody
Check (274)
5
2012-10-10
2009-03-05
D Rose
No

As it is sensible for some projects to permit autoboxing completely, it would be nice to have a check for this purpose.

Discussion

  • I don't believe that this is a check that CheckStyle would be able to handle because variable types are hard to determine with any kind of certainty. For example:

    i++; //is i an Integer or int? Before you can figure that out you need to figure out where i is declared and deal with variable shadowing, etc. Then of course i might not be declared in a class accessible to CheckStyle.

    See how this type of Check is difficult? This is the type of Check that is perfect for tools like findbugs because they work on the bytecode level rather than the source code level.

    Correct me if I'm wrong anyone.

    ~Travis

     
  • Oliver Burn
    Oliver Burn
    2009-03-08

    I agree - Checkstyle does not have easy access to the required information for autoboxing checks. This is a job for findbugs.