On Jun 16, 12:26 am, A Curious Developer <[email protected]> wrote:
> But ... I noticed that assert statements bloat the .apk, which seems
> like a bad thing. So I am now using a pattern of checking a static
> final constant: if(ASSERTS) { asserts( someCondition, "Some
> explanation" ); }

Java-language assert statements turn into something like:

  static final boolean assertionsDisabled = desiredAssertionStatus()

  if (!assertionsDisabled) {
      test assert
  }

The code is always there, but it gets stepped around if assertions are
disabled.  You'll pay for the static lookup in any code that doesn't
get compiled by the JIT.

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

Reply via email to