If it's public static final then javac could remove that call. But since
it's copied you would need a clean build to get it working. public static
final values are copied into the class so changing them and recompiling
isn't enough.
--
You received this message because you are subscribed to th
whoops i meant
if (1==2)
{
_("hello");//this surely would be redundant code and removed?
doSomeWork();//this surely would be redundant code and removed?
}
On Wednesday, March 20, 2019 at 10:24:01 PM UTC+8, Gareth Murfin wrote:
>
> Thanks for the answer. Oh shame, I thought proguard already did
Thanks for the answer. Oh shame, I thought proguard already did this a
decade ago? I mean if the compiler is even slightly smart and a variable is
declared *final*, then its not really runtime state I would have thought
and therefore should be removed. Would it be the same if you did something
Build-time pruning does not make use of any runtime state for determining
code paths. Therefore changing the value of Prefs.DEBUG would have no
effect.
On Wed, Mar 20, 2019 at 1:31 AM Gareth Murfin
wrote:
> So I always make a method like this:
>
> //for printing
> private static void _(Stri
So I always make a method like this:
//for printing
private static void _(String s)
{
if (Prefs.DEBUG)
{
com.codename1.io.Log.p(Prefs.ANSI_GREEN+"StateMachine "+s);
}
}
then when it comes to release I set Prefs.DEBUG (which is final) to false,