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 168360 - code assistance not handling #ifndef directives in header files correctly
Summary: code assistance not handling #ifndef directives in header files correctly
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Completion (show other bugs)
Version: 6.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: Alexander Simon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-09 17:39 UTC by lon8lunch
Modified: 2009-07-24 05:40 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
patch for relise67_fixes (3.92 KB, patch)
2009-07-10 14:54 UTC, Alexander Simon
Details | Diff
A project to reproduce the problem (10.37 KB, application/octet-stream)
2009-07-13 16:52 UTC, Andrew Krasny
Details

Note You need to log in before you can comment on or make changes to this bug.
Description lon8lunch 2009-07-09 17:39:41 UTC
Ubuntu 9.04, x86_64 GNU/Linux 2.6.28-13, g++ 4.1.3

When I first configure code assistance it resolves all my included objects just fine.  But when I edit and save the .cpp
file I'm working on it stops including objects from some of the headers.   When I go to those header files they are
grayed out.  I use the standard macro definition trick to insure headers are only included once. (see example below)  It
seems like the first time code assistant reads my headers the contents are defined.  But, the next time it reads them
the contents are grayed out and class methods are unresolvable in other files.  I guess it sees that the macro is
already defined and doesn't analyze the contents.  This seems appropriate for a normal macro definition, but not in this
case.

--------------- utils.hpp -------------
#ifndef __UTILS_H__
#define __UTILS_H__

class utils
{
  ...
};

#endif //__UTILS_H__

---------------------------------------
Comment 1 Vladimir Voskresensky 2009-07-09 17:46:26 UTC
Sasha, please, prepare the patch for 6.7. This is already the 3rd same issue users have with 6.7.
Thanks.
Vladimir.
Comment 2 Alexander Simon 2009-07-10 14:54:02 UTC
Created attachment 84598 [details]
patch for relise67_fixes
Comment 3 Alexander Simon 2009-07-10 14:55:49 UTC
QA: bug should be fixed in NB6.7.
Comment 4 Alexander Pepin 2009-07-10 15:18:55 UTC
I can not reproduce the issue so I can not verify the fix, please provide an appropriate test project.
As we have a workaround (run NetBeans with -J-Dcnd.cache.file.state=false -J-Dcnd.apt.cache.entry=false) I don't think
it's a critical issue for patch1.
Comment 5 Vladimir Voskresensky 2009-07-13 16:45:44 UTC
we have seen such problem a lot on usability study + a lot of complains in forums. I'd like to see it fixed in 6.7
patch. The provided patch looks to be safe and correct. Andrew could you, please, share your project with Alexander and
confirm how it was in 6.7 and how it could be after applying patch. 
Thanks,
Vladimir.
Comment 6 Andrew Krasny 2009-07-13 16:51:34 UTC
Please try attached project.
Steps to reproduce:

- open project;
- open parallel.c
- open serial.c
- in serial.c add space at the end of any line (don't save it)
- in parallel.c add space at the end of any line (don't save it)
- switch to serial.c and press Ctrl+S

Comment 7 Andrew Krasny 2009-07-13 16:52:43 UTC
Created attachment 84667 [details]
A project to reproduce the problem
Comment 8 Alexander Pepin 2009-07-14 15:10:52 UTC
A special patch org-netbeans-modules-cnd-modelimpl.jar has been made
Comment 9 Alexander Pepin 2009-07-14 15:12:43 UTC
verified in 6.7 build with patched org-netbeans-modules-cnd-modelimpl.jar 
Comment 10 pgebauer 2009-07-14 16:40:13 UTC
The fix has been ported into the release67_fixes repository.
http://hg.netbeans.org/release67_fixes/rev/9584a0ed1c0f
Comment 11 Alexander Simon 2009-07-14 16:58:51 UTC
fix was integrated in release67_fixes, change set:
http://hg.netbeans.org/release67_fixes/rev/3472853b3509
Comment 12 Marian Mirilovic 2009-07-14 17:19:52 UTC
integrated into 67fixes doesn't mean it's fixed for NB 6.7
Comment 13 Alexander Pepin 2009-07-15 15:24:29 UTC
verified in nb6.7.1rc
Comment 14 Quality Engineering 2009-07-24 05:40:29 UTC
Integrated into 'main-golden', will be available in build *200907240201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/1da10a04a677
User: Alexander Simon <alexvsimon@netbeans.org>
Log: import from 6.7.1 fix for #168360 code assistance not handling #ifndef directives in header files