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 250879

Summary: Incorrect warning message
Product: java Reporter: xarax
Component: HintsAssignee: Svata Dedic <sdedic>
Status: NEW ---    
Severity: normal    
Priority: P4    
Version: 8.0.2   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:

Description xarax 2015-03-03 21:54:05 UTC
Product Version = NetBeans IDE 8.0.2 (Build 201411181905)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.8.0
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.0-b70

NetBeans incorrectly warning about a "break" statement in Java source code.

public class TestBreak
{
    @SuppressWarnings ("UseOfSystemOutOrSystemErr")
    public static void main(String[] args)
    {
        int count;

        count = 5;
        try
        {
            count++;
        }
        finally
        {
            do
            {
                System.out.print("Loop ");
                System.out.println(count);
                if(count < 3)
                {
                    break; // NetBeans issues incorrect warning about the break statement
                }
            } while(0 < count--);
            System.out.println("Done");
        }
    }
}