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.
NetBeans IDE Dev (Build 200703211900) 1.6.0; Java HotSpot(TM) Client VM 1.6.0-b105 Linux version 2.6.5-1.358 running on i386 en_US (nb); UTF-8 CND Build070322 Code completion return no suggestion for Steps to reproduce: 1) have .h file: class Stack { public: Stack(); int pop(); void push(int val); bool isEmpty(); private: class StackItem { public: int _item; StackItem *_next; StackItem(int item, StackItem *next) { _item = item; _next = next; } }; StackItem *top; }; 2) have a .cc file containing (among others) following method, .h is included. int Stack::pop() { if(top==NULL) throw NULL; else { StackItem *akt = top; top = akt->_next; return akt->_item; } } -> code completion after akt-> returns "No suggestions" -> the whole file is compilable and works fine.
Hello, thank you for reporting! I created empty Application added newfile.h with provided Stack class then created newfile.cc and added #include "newfile.h" int Stack::pop() { if(top==NULL) throw NULL; else { StackItem *akt = top; top = akt->_next; return akt->_item; } } in my case I have completion in both cases after akt. Can you reproduce "No suggestion" with the above scenario in your version? Thanks in advance, Vladimir.
No, it's not reproducible when the whole code is copy&pasted. But when I tried another example it occurred again. I also noticed that there is exception thrown sometimes code completion is invoked. This does not happen in project where completion returns expected items. (stacktrace is attached). After IDE restart it works fine. What I did: 1) create new C++ project 2) create new main file 3) create new header file 4) write class definition in the .h file 5) include <iostream> and "using namespace std;" 6) implement class method in .cc file
Created attachment 39867 [details] stack trace
thanks for stack trace. what about original problem? Does it have any exceptions in log file as well and it is the same?
Seems the mentioned exception is not related to this problem. But in the log, there is different one.
Created attachment 39876 [details] log
thank you! from this log the original problem is visible. Could you please file separate IZ for NPE problem, because it's different problem. Thanks, Vladimir.
Could you, please, attach the content of file Application_3/header.h there was class called "Inner" as seen in exception message
Created attachment 40183 [details] Header file
Header file is attached
Ok. I see the problem. you don't have ";" in line:14 int top //<= no trailing ; => parser didn't recover correctly
the following incorrect code (no trailing ";" in declaration "int a") generates funny class view class A1 { int a }; class A2 { int a }; class A3 { int a }; class A4 { int a }; class A5 { int a }; see attachment
Created attachment 40189 [details] class view for missed ";"
Created attachment 40190 [details] class view for missed ";"
we fixed some recovering problems and now class view and completion handle this example correctly