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.
Steps to reproduce problem: 1. Download litesql project from http://litesql.sourceforge.net/ 2. Create new Application Project (C/C++ development category) 3. Add all source files using context menu Add Exisitng Items to logical folder "Source Files" from all folders/subfolders 4. Add all header files using context menu Add Exisitng Items to logical folder "Header Files" from all folders/subfolders 5. Open ClassView 6. Look at the item s "litesql|atoi(const std :: string& s)" "litesql|atoi(const string& s)" These are doubled function: its declarion and definition are differen but it is one function, should be displayed once in class view
ClassView component doubles function in Freeway project and in this sample: Create in 'Source Files' folder file.c file: ------------------------------------------------ #include "file.h" int main() { some_func(1, 2, 3); return(0); } void some_func(int a, int b, int c ) { } ------------------------------------------------ Create in 'Header Files' folder file.h file: ------------------------------------------------ #ifndef FILE_H #define FILE_H extern void some_func(int a, int b, int c ); #endif ------------------------------------------------ Close 'file.c' and 'file.h' editor tabs Reopen project ==>Class View tab duplicates 'main()' or 'some_func(int a, int b, int c )' item
Use case in additional comments isn't repeatable. It was fixed when IZs: IZ#87516:'HelloApp' sample project has wrong Class View IZ#86911:sometimes class view contains duplicated declarations. was fixed.
*** Issue 94947 has been marked as a duplicate of this issue. ***
I tried to repeat the issue but wasn't able to. I believe it was fixed some time ago.
Original bug is not fixed. I see 2 'atoi' functions in 'Class View' Other scenario: - Add such source file into project: ----------------------------------------------------- #include <string> namespace litesql { using namespace std; int atoi(const string &s) { return ::atoi(s.c_str()); } } ----------------------------------------------------- - Add such header file into project: ----------------------------------------------------- #include <string> namespace litesql { int atoi(const std::string &s); } ----------------------------------------------------- ==> I see 2 items in Class View ("litesql|atoi(const std :: string& s)" and "litesql|atoi(const string& s)")
Thanks for clear example. Problem is not in class view. Model cannot resolve string. I see problems: - wrong unique name of definition. Model returns: f:litesql::atoi(const string&) It is a very strange because type "string" has a hyperlink. - right unique name of declaration by a fluke. Model returns: F:litesql::atoi(const std :: string&) But type "string" has not a hyperlink. As result class view show two nodes. It is right for class view point of view. I think it is a serious model problem and vote for upgrading to P2.
Upgraded to P2.
It is "const" modifier that causes this issue. Without it std::string is resolved correctly.
Partial fix + test: http://hg.netbeans.org/main/rev/6024ca3035bd After this fix parameter types with "const" prefix are treated correctly: they are resolved, and hyperlinks and completion work for them. Remaining issue is that model does not resolve types when creating canonical function signature, which may lead to doubling functions in Class View.
High code model accuracy is crucial for refactoring.
This bug was reported against NetBeans IDE 6.0 or an older release, or against a non-maintained module. NetBeans team does not have enough resources to get to this issue, therefore we are closing the issue as a WONTFIX. If you are interested in providing a patch for this bug, please see our NetFIX guidelines for how to proceed. We apologize for any inconvenience. Thank you. The NetBeans Team