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 251097

Summary: Wrong macro value in Full Remote project
Product: cnd Reporter: soldatov <soldatov>
Component: Code ModelAssignee: Vladimir Kvashin <vkvashin>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.1   
Hardware: PC   
OS: Solaris   
Issue Type: DEFECT Exception Reporter:

Description soldatov 2015-03-11 12:52:59 UTC
newfile.h:
======================================================================

#ifndef NEWFILE_H
#define	NEWFILE_H

#if AA == 0
#define BB 111
#else
#define BB 222
#endif

#endif	/* NEWFILE_H */

======================================================================
main.cpp:
======================================================================

#define AA 0
#include <cstdio>
#include "newfile.h"

int main(int argc, char** argv) {
    printf("%d\n", BB);
    return 0;
}

======================================================================

Scenario:
- Open Full Remote project with newfile.h and main.cpp
- Reparse project
- Open main.cpp file
- Press Ctrl+Alt and move cursor on BB
==> "BB expands to: 111" tooltip appears (ok)
- Replace "#define AA 0" on "#define AA 1"
- Save file
- Press Ctrl+Alt and move cursor on BB
==> "BB expands to: 222" tooltip appears (ok)
- Open newfile.h file <-- important step
- Wait 3 seconds
- Select main.cpp file again
- Replace "#define AA 1" on "#define AA 0"
- Save file
- Press Ctrl+Alt and move cursor on BB
==> "BB expands to: 222" tooltip appears (wrong value)
Comment 1 Vladimir Kvashin 2015-04-01 10:44:08 UTC
I see exactly the same behavior locally. So it's a code model issue.
I would expect that something sticks in cache?
Comment 2 Vladimir Kvashin 2015-04-01 10:46:14 UTC
In both local and remote, once I switch to header.h and then back to main.cpp, 
macro expansion in tooltip in main.cpp stops reacting on changes in main.cpp.

This does not depend on whether main.cpp is saved or not.