This is the mail archive of the
java-discuss@sources.redhat.com
mailing list for the Java project.
A java DEBUG flag
- To: java-discuss at sources dot redhat dot com, classpath at gnu dot org
- Subject: A java DEBUG flag
- From: Bryce McKinlay <bryce at albatross dot co dot nz>
- 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 ]