|
hi,
i have a general Java compiling question. the
app i'm writing has a debug build and release build (basically toggling of a
static final DEBUG variable - debug code is encased inside the if ( DEBUG )
conditionals). i understand that if DEBUG = false, all the code inside the
scope of the conditional is not compiled into the class file. but i found
that the compiler still compiles the class files of the Objects i instantiate
inside the if ( DEBUG ). is there a way around this - i know there isn't
any pre compiler syntax (ie C's #ifdef) in Java? is there harm in just
deleting the compiled .class files which will never be used in a release build
(and the code shouldn't be compiled in the .class file to use them
anywayz).
an example is:
class Test {
public static final boolean
DEBUG = false;
Test () {
if ( DEBUG )
{
NewObject a = new NewObject();
}
}
}
Test.class gets compiled as well as NewObject.class
gets compiled - but theoretically the code inside if (DEBUG) isn't.
thanks.
jack
|
- Re: [JAVA3D] Java compiling question Jack Pien
- Re: [JAVA3D] Java compiling question Pondrom, Pierre L
- Re: [JAVA3D] Java compiling question Yazel, David J.
