classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A java DEBUG flag


From: Bryce McKinlay
Subject: A java DEBUG flag
Date: Thu, 23 Nov 2000 18:06:12 +1300

I think it would be useful to have a java file somewhere that defines
constants which can be used to enable/disable bits of java code at
compile time. The serialized object dumping facility in
ObjectInputStream, for example, currently adds a lot of overhead even
when its turned off, because the java code makes calls into native code
regardless of whether debugging is enabled or not. By setting a constant
somewhere, the compiler can optimize it out when not doing a debug
build.

I propose an interface (this ensures that only constants can be defined)
called gnu.classpath.Flags (or CompileSettings? DebugFlags?) which would
be generated at configure time from a Flags.java.in, and would change
based on whether "--enable-libgcj-debug" (or the classpath equivilant)
was specified at configure time.

Initially it will look something like this:

package gnu.classpath;

public interface Flags
{
  boolean SERIALIZATION_DEBUGGING = true;
}

Comments?

regards

  [ bryce ]





reply via email to

[Prev in Thread] Current Thread [Next in Thread]