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 185712 - external modifications breaks dead blocks information in editor
Summary: external modifications breaks dead blocks information in editor
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 6.x
Hardware: PC Linux
: P2 normal (vote)
Assignee: Vladimir Voskresensky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-07 15:53 UTC by Vladimir Voskresensky
Modified: 2010-05-11 05:53 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
broken dead code information after external modifications (52.12 KB, image/png)
2010-05-07 15:56 UTC, Vladimir Voskresensky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Voskresensky 2010-05-07 15:53:13 UTC
create C++ application with code like:

int main(int argc, char** argv) {

    int j = 0;
    int i = 0;
#if 0
    commented out code which
    must be always disabled
#endif
    return 0;
}

go in vi and move #if 0 2 lines up to be:

#if 0
int main(int argc, char** argv) {
    int j = 0;
    int i = 0;
//#if 0
    commented out code which
    must be always disabled
//#endif
    return 0;
}
#endif
return to IDE and see unresolved identifiers i and j (they are not in grayed out block) see attachement

-J-Dcnd.modelimpl.trace.external.changes=true shows that we receive external modification and in fact file was reparsed correctly, because no more main function in navigator

External updates: fileChanged BaseFileObj$FileEventImpl[file=/home/vv159170/NetBeansProjects/CppApplication_6/main.cpp,time=Fri May 07 19:51:26 MSD 2010,expected=false]
External updates: scheduling update for MasterFileObject[/home/vv159170/NetBeansProjects/CppApplication_6/main.cpp@1a850c5:1cf4467,valid=true]
External updates: running update task
Updating for MasterFileObject[/home/vv159170/NetBeansProjects/CppApplication_6/main.cpp@1a850c5:1cf4467,valid=true]
=== Starting parser queue stopwatch CppApplication_6
External updates: update task finished
 parsing /home/vv159170/NetBeansProjects/CppApplication_6/main.cpp 55 ms
 === Stopping parser queue stopwatch CppApplication_6: 	 8688 ms
Slowest Files for CppApplication_6 are:
 file=/home/vv159170/NetBeansProjects/CppApplication_6/main.cpp 368 ms
Comment 1 Vladimir Voskresensky 2010-05-07 15:56:01 UTC
Created attachment 98642 [details]
broken dead code information after external modifications

The same happens if I close IDE, modify file as described, reopen IDE => file is reparsed, but dead code block is on the old place
Comment 2 Vladimir Voskresensky 2010-05-07 16:57:26 UTC
fixed:
http://hg.netbeans.org/cnd-main/rev/bb0fe52c2563
Comment 3 Vladimir Voskresensky 2010-05-07 19:47:15 UTC
test:
http://hg.netbeans.org/cnd-main/rev/650793ed79c1
Comment 4 Quality Engineering 2010-05-11 05:53:06 UTC
Integrated into 'main-golden', will be available in build *201005101712* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/
User: 
Log: