This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 23629

Summary: Display compiled-out statements grayed-out
Product: java Reporter: gthb <gthb>
Component: EditorAssignee: Dusan Balek <dbalek>
Status: NEW ---    
Severity: blocker    
Priority: P3    
Version: 3.x   
Hardware: PC   
OS: Windows ME/2000   
Issue Type: ENHANCEMENT Exception Reporter:

Description gthb 2002-05-16 17:39:05 UTC
It is a relatively common and convenient practice to
include/exclude bits of code at compile-time with a
boolean constant, like one might do with #ifdef in C.
Example:

    if(EXTREME_DEBUG) {
        LOG.debug("password = " + passwd);
    }

where EXTREME_DEBUG is defined as

    private static final boolean EXTREME_DEBUG = false;

More complex expressions might be used in the conditional
that still evaluate to false at compile-time.

It would be nice if the editor's syntax highlighting
could detect such code segments and "lowlight" them by
graying them out, similar to comments (but a separate
color of course), when the constant is set to false.
When it is true, they would be displayed as normal code.
Comment 1 Marek Grummich 2002-07-22 10:50:03 UTC
Set target milestone to TBD
Comment 2 Martin Matula 2004-11-12 09:53:47 UTC
Interesting feature. But currently very hard to implement.