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 271021

Summary: Bug in ide triggered by using the increment after (i++) operator in while loop condition
Product: ide Reporter: zenithy
Component: CodeAssignee: issues@ide <issues>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.2   
Hardware: PC   
OS: Windows 10   
Issue Type: DEFECT Exception Reporter:
Attachments: IDE log

Description zenithy 2017-07-02 14:34:48 UTC
Product Version = NetBeans IDE 8.2 (Build 201705191307)
Operating System = Windows 10 version 10.0 running on amd64
Java; VM; Vendor = 1.8.0_101
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.101-b13

Reproducibility: Happens every time

Using the increment after operator i.e i++ in a while loop condition causes the ide to exhibit defective behavior by expecting semicolons after every closing brace ({), and hence incorrectly reports syntax errors on all closing braces. Refactoring the code to place the increment after operator inside the while block instead of in the while condition fixes the false syntax error reports

//sample of code that causes the bug to show up, notice the increment after operator i++ in the while condition
while (i++ < ct) {
               
            }

Thanks
Comment 1 zenithy 2017-07-02 14:34:57 UTC
Created attachment 164677 [details]
IDE log