🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #1944

Re: com.borland.primetime

#1944
From: Joi Ellis [TeamB]
Date: Mon, 16 Jul 2001 13:31
40 lines
2270 bytes
DATURA <info@datura.ch> wrote:
> Thanks, now I have included JBCL and I can use Diagnostic. Additional
> question:

> When compiled in "release"-mode, will the lines using Diagnostic-Methods be
> removed from the source or will only the sentence be ignored? When I compile
> the source with other products than JBuilder (i.e. TomCat), will I have a
> problem?

The ability to exclude the 'Debug' class is a feature unique to JBuilder.
If you have to compile the code with javac or other compilers, you need to
use a different method.

As I understand it, the specification for compilers requires that if the
compiler encounters something that resolves to:

  if ( FALSE ) { 
     more code here
  }

Then it is required to delete the entire block from the resulting class file.

So, this allows you to do something like:


  private static final boolean DEBUG=false;
  ...
  if (DEBUG) {
    System.out.print("Debug mode: entering method foo");
  }

You could even do a rudimentary form of conditional compilation this way,
but the control variable has to be something the compiler can tell will
be unchanging for the life of the compiled result.  (Hence the 'final'.)

-- 
Joi Ellis (TeamB)               http://www.teamb.com/
No direct email, please.
For best results, post on news server newsgroups.borland.com!
Newsgroup Info: http://www.borland.com/newsgroups/guide.html
Technical Details
Message-ID: <3b52ecad_1@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!195.238.2.15!skynet.be!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews!not-for-mail
References: <3b4b0792$1_2@dnews> <3b4b28f3$1_1@dnews> <3b52912e$2_1@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,b27e4110bfde055a
X-Google-Attributes: gid1089d0,public
X-Google-ArrivalTime: 2001-07-16 06:44:52 PST
Message-ID: <3b52ecad_1@dnews>
From: "Joi Ellis [TeamB]" <joi@aravox.com>
Supersedes: <3b52e8d3_1@dnews>
Subject: Re: com.borland.primetime
Newsgroups: borland.public.jbuilder.java.api
References: <3b4b0792$1_2@dnews> <3b4b28f3$1_1@dnews> <3b52912e$2_1@dnews> 
User-Agent: tin/1.4.2-20000205 ("Possession") (UNIX) (Linux/2.2.16-3 (i686))
NNTP-Posting-Host: 209.46.41.66
Date: 16 Jul 2001 06:31:25 -0700
X-Trace: dnews 995290285 209.46.41.66 (16 Jul 2001 06:31:25 -0700)
Lines: 40
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!195.238.2.15!skynet.be!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews!not-for-mail