Hi,

I have written a few PMD rules to deal with calling super in the
onCreate, onStart, ... methods and also to protect the calls to Log.d
and Log.v (protected by calls to Config.LOGD and Config.LOGV
respectively). This is based on a quick look at some of the SDK source
code.

I'm not too sure about the convention for the onXXX() methods as some
will call Log.d before calling super. So should the rule also accept

public void onXXX(...) {
  if (Config.LOGD) { Log.d(...); }
  super.onXXX();
  ...
}

or should the calls to Log.d be located after the super.onXXX().

The rules are now part of the PMD source tree and a snapshot can be
accessed from my Hudson server located at:

  http://hudson.xlv-labs.com/job/PMD-4.2.x-snapshot/

(the download links for the zip archives are in the middle of the
page)

Please forward any rule suggestions you have that deals with best
practices for the Android platform and I'll try to create rules for it
(or better, submit the rules directly :).

Note that PMD 4.2.5 is probably going to be released in a week or two
so act fast if you want the rules to be part of the release and not
have to use snapshot versions. Of course if there's a lot of interest
in writing new Android rules, I can delay it a little bit.


Best regards,

Xavier Le Vourch

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to