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 - Incorrect warning message
Summary: Incorrect warning message
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 8.0.2
Hardware: PC Windows 7
: P4 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-03 21:54 UTC by xarax
Modified: 2015-03-18 09:38 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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");
        }
    }
}