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 195168

Summary: Replace +=1 with ++
Product: java Reporter: Chiana
Component: HintsAssignee: Svata Dedic <sdedic>
Status: REOPENED ---    
Severity: normal CC: markiewb, mprentice
Priority: P3    
Version: 7.0   
Hardware: PC   
OS: Windows 7   
Issue Type: ENHANCEMENT Exception Reporter:

Description Chiana 2011-02-08 12:36:24 UTC
[ BUILD # : beta-2 ]
[ JDK VERSION : 1.6.23 ]

When using the hint "Replace assignment with operator" the statement "a=a+1"
becomes "a+=1".

Why not replace it with "a++" instead?
Comment 1 Chiana 2011-02-08 12:38:24 UTC
I assume that this goes for a=a+1 only, incrementing variables by one is a very common operation, as for other cases as "b=b+10" you probable have to stick with "b+=10"...
Just mentioning this so you know I didn't forget that case...
Comment 2 Martin Balin 2016-07-07 07:28:33 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss
Comment 3 markiewb 2016-07-10 18:26:15 UTC
Still valid in 8.2 dev 
Product Version: NetBeans IDE Dev (Build 201607100002)