Bug 313514

Summary: Dead code by constant
Product: [Eclipse Project] JDT Reporter: Marvin Fröhlich <eclipse>
Component: CoreAssignee: Stephan Herrmann <stephan.herrmann>
Status: RESOLVED DUPLICATE QA Contact:
Severity: enhancement    
Priority: P3 CC: Olivier_Thomann, stephan.herrmann
Version: 3.5   
Target Milestone: 3.5 M4   
Hardware: PC   
OS: Linux   
Whiteboard: To be verified for 4.6 M5

Description Marvin Fröhlich CLA 2010-05-19 08:37:45 EDT
Build Identifier: 20090920-1017

I have code like this.

##############
class C
{
    private static final boolean B = true;
    
    public void test()
    {
        if ( B )
        {
            System.out.println( "yes" );
        }
        else
        {
            System.out.println( "no" );
        }
    }
}
##############

The else block together with its braces is marked as dead code and warnings are produced.

I would like to mark the static boolean variable, so that all dead code, that depends on it, is not warned about, since it is not "really" dead code.

Reproducible: Always
Comment 1 Stephan Herrmann CLA 2016-01-14 14:17:29 EST
No longer relevant since bug 256463.

I only see one problem: that change was released for 3.5M4, whereas this report claims the issue existed in 3.5. Hm? Marking as duplicate anyway.

*** This bug has been marked as a duplicate of bug 256463 ***