Bug 261287 - Includes Grouping can get confused
Summary: Includes Grouping can get confused
Status: ASSIGNED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 6.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
: 267044 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-01-15 17:26 EST by James Blackburn CLA
Modified: 2020-09-04 15:23 EDT (History)
3 users (show)

See Also:


Attachments
confusion in the includes grouping (85.82 KB, image/jpeg)
2009-01-15 17:26 EST, James Blackburn CLA
no flags Details
Fix IncludeReferenceProxy equals and hashCode (1.12 KB, patch)
2009-01-16 06:30 EST, Anton Leherbauer CLA
no flags Details | Diff
I see a slightly different picture when trying in Debug mode from the HEAD. (118.75 KB, image/gif)
2009-01-16 13:09 EST, Andrew Gvozdev CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description James Blackburn CLA 2009-01-15 17:26:08 EST
Created attachment 122751 [details]
confusion in the includes grouping

Build ID: HEAD

Steps To Reproduce:
As described in bug252966 comment 15

The Includes as shown in the attached image was achieved using HEAD CDT.
Comment 1 Anton Leherbauer CLA 2009-01-16 05:30:32 EST
Repeating the steps from bug252966 comment 15:

created cygwin executable project Hello. Then created 2 folders Hello/src/IncD/
and Hello/src/IncR/. Added in Properties/Paths-and-Symbols IncD/ to Debug
configuration GNU C++ language and IncR/ to Release configuration GNU C++
language. Expanded "Includes". Built Release configuration. Now there are weird
things under Includes appearing. I see Hello.cpp there. IncD/ appears twice and
IncR/ (which is empty in reality) keeps C++ std headers such as limits.h and
stddef.h. It was not that weird when I tested from the HEAD and I tried a few
times. Autobuild was enabled in both cases.


I can reproduce, but in my case the wrong includes are almost instantly replaced by the correct ones. I am pretty sure this is a UI problem only (wrong labels are displayed)
A potential culprit could be IncludeReferenceProxy which implements equals() in a non-reflexive way.
Comment 2 Anton Leherbauer CLA 2009-01-16 06:30:17 EST
Created attachment 122788 [details]
Fix IncludeReferenceProxy equals and hashCode

Could you try this patch if it has some effect?
Comment 3 Andrew Gvozdev CLA 2009-01-16 13:09:25 EST
Created attachment 122829 [details]
I see a slightly different picture when trying in Debug mode from the HEAD.

Interesting that I do not observe the problem when running in not Debud but in Run. I wasted some time trying to repeat the problem from HEAD and could do so only running CDT from debugger. This may account for some confusion in bug 252966.

After that I applied the patch and tried to repeat the test case in Debug mode click-by-click. It looks like I upgraded to the situation described by Tony. I can see the same faulty tree label (see attached image) momentarily and then it is changed by the proper one.
Comment 4 Anton Leherbauer CLA 2009-01-23 03:43:59 EST
FYI, I have committed the fix to IncludeReferenceProxy, but I am leaving this bug open for now.
Comment 5 Anton Leherbauer CLA 2009-03-05 03:16:58 EST
*** Bug 267044 has been marked as a duplicate of this bug. ***
Comment 6 Mike Kucera CLA 2009-11-18 16:15:08 EST
(In reply to comment #4)
> FYI, I have committed the fix to IncludeReferenceProxy, but I am leaving this
> bug open for now.

I've backported this fix to the 5.0 stream.