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 271299 - Clank hints: replace works wrongly (breaks code)
Summary: Clank hints: replace works wrongly (breaks code)
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: Dev
Hardware: PC Linux
: P3 normal (vote)
Assignee: Maria Tishkova
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-15 12:31 UTC by soldatov
Modified: 2017-09-01 02:15 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 soldatov 2017-08-15 12:31:50 UTC
C++ code:
struct S {
    int aaa;
} s;

int main(int argc, char** argv) {
    s.aab = 2;
    return 0;
}

Scenario:
- Switch on Clank hints
- Open file in editor
- Push Clank hint
- Select "no member named 'aab' in S; Did you mean 'aaa'?" menu item
==> Now I see 's.aaaab = 2;' in editor
Comment 1 soldatov 2017-08-15 13:07:30 UTC
#include <cstdio>

int main(int argc, char** argv) {
    int i = 0;
    printf("%f", i);
    return 0;
}

- Push Clank hint
- Select "format specifies type 'double' but the argument has type 'int'" menu item
==>
Expected: printf("%d", i);
Real: printf("%d, i);

" symbol disappeared
Comment 2 Maria Tishkova 2017-08-18 14:04:54 UTC
fixed, new clank.zip is uploaded 
see 

changeset:   304462:36f9c615d425
user:        Maria Dalmatova <mromashova@netbeans.org>
date:        Fri Aug 18 17:02:44 2017 +0300
Comment 3 Maria Tishkova 2017-08-30 14:38:18 UTC
added fix to cnd-main 

changeset:   304483:ced71e837798
tag:         tip
user:        Maria Dalmatova <mromashova@netbeans.org>
date:        Wed Aug 30 17:37:42 2017 +0300
summary:     added fix to bz#271299 - Clank hints: replace works wrongly (breaks code)
Comment 4 Quality Engineering 2017-09-01 02:15:56 UTC
Integrated into 'main-silver', will be available in build *201709010001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/ced71e837798
User: Maria Dalmatova <mromashova@netbeans.org>
Log: added fix to bz#271299 - Clank hints: replace works wrongly (breaks code)
incorrect length of removed text was used