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 247190 - Incorrect offer to replace isEmpty body to recursive call
Summary: Incorrect offer to replace isEmpty body to recursive call
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 8.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
: 252979 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-09-17 02:37 UTC by rafo
Modified: 2015-06-15 09:04 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Demonstation of the bug (13.42 KB, image/png)
2014-09-17 02:37 UTC, rafo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rafo 2014-09-17 02:37:08 UTC
Created attachment 149276 [details]
Demonstation of the bug

There's a method:

    public boolean isEmpty() {
        return (this.size() == 0);
    }

Netbeans 8.0 offers to replace "(this.size() == 0)" to "isEmpty()" which is incorrect suggestion and will lead to stack overflow.

Check attached picture.
Comment 1 Svata Dedic 2015-03-26 15:19:23 UTC
Fixed in jet-main#9d1c0c54a5ea
Comment 2 Quality Engineering 2015-04-03 03:06:15 UTC
Integrated into 'main-silver', will be available in build *201504030001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/9d1c0c54a5ea
User: Svata Dedic <sdedic@netbeans.org>
Log: #247190: avoid recursion in isEmpty implementation itself
Comment 3 rafo 2015-06-14 08:54:27 UTC
The issue still persists in version 8.0.2

https://netbeans.org/bugzilla/show_bug.cgi?id=252979
Comment 4 Jiri Prox 2015-06-15 09:03:34 UTC
*** Bug 252979 has been marked as a duplicate of this bug. ***
Comment 5 Jiri Prox 2015-06-15 09:04:20 UTC
The issue is fixed in dev build only