Re: [codenameone-discussions] Does compilation remove "empty" methods?

2019-03-20 Thread Shai Almog
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

Re: [codenameone-discussions] Does compilation remove "empty" methods?

2019-03-20 Thread Gareth Murfin
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

Re: [codenameone-discussions] Does compilation remove "empty" methods?

2019-03-20 Thread Gareth Murfin
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

Re: [codenameone-discussions] Does compilation remove "empty" methods?

2019-03-20 Thread Steve Hannah
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