On Sun, 2011-08-21 at 00:21 +0200, Dirk Stöcker wrote:
> Sadly I know no other method than comments in Java to have debug code-free 
> release versions. The pre-processor "#define" of C does not exist in Java.
> 
> So after debug code has not been used actively for some time (i.e. 
> related code got mature) commenting out seems the best way I know. I would 
> prefer a compile-time switch, but till today I do not know any option to 
> do so except introducing pre-parsers, which has a lot of drawbacks.

I'd have a really hard time believing that the JVM can't optimize stuff
like this:

    static final bool debug = false;
    void debugfoo(String s)
    {
        if (!debug)
                return;
        print...
    }

It would probably leave remnants like the class files, but it should go
away at runtime for all intents and purposes.  Maybe I give java too
much credit. :)

-- Dave


_______________________________________________
josm-dev mailing list
josm-dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/josm-dev

Reply via email to