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 76032 - ClassView component doubles function in some cases
Summary: ClassView component doubles function in some cases
Status: RESOLVED WONTFIX
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 5.x
Hardware: All All
: P4 blocker (vote)
Assignee: Vladimir Voskresensky
URL:
Keywords:
: 94947 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-05-06 13:32 UTC by Maria Tishkova
Modified: 2009-12-21 05:18 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maria Tishkova 2006-05-06 13:32:17 UTC
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
Comment 1 soldatov 2006-09-18 12:45:54 UTC
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
Comment 2 Alexander Simon 2006-10-20 09:24:38 UTC
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.
Comment 3 Alexander Ioffe 2007-02-08 16:09:25 UTC
*** Issue 94947 has been marked as a duplicate of this issue. ***
Comment 4 Vladimir Kvashin 2008-02-14 15:38:37 UTC
I tried to repeat the issue but wasn't able to.
I believe it was fixed some time ago.
Comment 5 soldatov 2008-03-27 12:03:22 UTC
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)")
Comment 6 Alexander Simon 2008-03-27 13:07:45 UTC
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.
Comment 7 Jesse Grodnik 2008-05-08 17:05:11 UTC
Upgraded to P2.
Comment 8 Alexey Vladykin 2008-06-19 11:19:05 UTC
It is "const" modifier that causes this issue. Without it std::string is resolved correctly.
Comment 9 Alexey Vladykin 2008-06-20 09:22:43 UTC
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.
Comment 10 Alexey Vladykin 2008-11-13 14:14:59 UTC
High code model accuracy is crucial for refactoring.
Comment 11 Quality Engineering 2009-12-21 05:18:19 UTC
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