harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikhail Fursov" <mike.fur...@gmail.com>
Subject Re: [classlib] Preprocessor (was Re: [classlib][rmi] Code smell - Thread.sleep() in ActivationGroup method)
Date Tue, 31 Oct 2006 11:53:00 GMT
On 10/30/06, Geir Magnusson Jr. <geir@pobox.com> wrote:
> >     1) The Logging Debate That Won't Die - we don't want to encumber our
> >     "production" code with logging or even with runtime enablement
> checks
> >     for logging i.e.
> >
> >           if (logging.isDebugEnabled())
> >
> >     but it's clear that some people still want to use it for debugging.
> >
> >
> > Just a small idea: Let teach JIT to purge this code unless special
> option is ON
> > ? Doing this we solve performance issue at least .
> Well, then we have a classlibrary that is only good for use with JIT's
> that have been specially trained to find code that looks like very
> common code for logging implementations.
> The results could be hilarious, actually.

More advanced version of the proposal above. I do not say it's ideal but it
solves IDE incompatibility problem of solution with preprocessor.

We can create a special class (Configuration) with final static fields:
public static final boolean isLogEnabled
public static final boolean isJava1_5
public static final boolean isJava1_6

And check these vars in classlib code. Does performance the question? I
think not, we will drop this code during the compilation and this is an easy
task for any JIT.

The only problem is you can't add new methods in a such way. So it's a clean
but not complete solution :(

Mikhail Fursov

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message