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 254876 - IDE has unresolved identifiers in refactored code ("Introduce Function" action)
Summary: IDE has unresolved identifiers in refactored code ("Introduce Function" action)
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Project (show other bugs)
Version: 8.1
Hardware: PC Solaris
: P2 normal (vote)
Assignee: Alexander Simon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-31 13:56 UTC by soldatov
Modified: 2015-09-04 01:24 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 2015-08-31 13:56:12 UTC
Often in automatic tests we create empty project and add existing file from external directory. In this case "Introduce Function" action breaks code assistance.

C++ code:
int main(int argc, char** argv) {
    int i = 1;
    i++;
    i++;
    return 0;
}

Scenario:
- Create empty C++ Application in /export/files/NB (/export/files/NB/CppApplication_1 folder will appear)
- Add existing /export/files/test.cpp file via "Add Existing Item..." menu item
- Select "i++;" line and press Alt-Shift-M (Introduce Function)
- Press Refactor button
==> a lot of unresolved identifiers
Comment 1 soldatov 2015-08-31 14:07:00 UTC
Other related bug.

C++ code:
int foo1() {
    return 0;
}

int main(int argc, char** argv) {
    foo1();
    return 0;
}

Scenario:
- Create empty C++ Application in /export/files/NB (/export/files/NB/CppApplication_1 folder will appear)
- Add existing /export/files/test.cpp file via "Add Existing Item..." menu item
- Select "foo1();" line and press Ctrl-R
- Type foo2 and Press Refactor button
==> ok
- Select "foo2();" line and press Ctrl-R
- Type foo3 and Press Refactor button
==> old code in editor
Comment 2 Alexander Simon 2015-09-02 14:00:02 UTC
The cause of the bug is:
- the added item is not located under source root.
Indexing/Parsing API does not support files that do not belong source root.
Comment 3 Alexander Simon 2015-09-03 08:42:06 UTC
fixed, change set:
http://hg.netbeans.org/cnd-main/rev/6576d639ca3e
Comment 4 Quality Engineering 2015-09-04 01:24:52 UTC
Integrated into 'main-silver', will be available in build *201509040002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/6576d639ca3e
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixed Bug #254876 IDE has unresolved identifiers in refactored code ("Introduce Function" action)