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 - Replace +=1 with ++
Summary: Replace +=1 with ++
Status: REOPENED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 7.0
Hardware: PC Windows 7
: P3 normal with 1 vote (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-08 12:36 UTC by Chiana
Modified: 2016-07-11 11:48 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

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