Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 112949

Summary: Inconsistent handling of index name clashes
Product: [Eclipse Project] JDT Reporter: Keith W. Campbell <keithc>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P5 CC: philippe_mulet
Version: 3.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug
Attachments:
Description Flags
Sample projects
none
Test sequence and trace logs none

Description Keith W. Campbell CLA 2005-10-18 11:20:58 EDT
The use of CRC-32 to generate index names suffers from the birthday paradox.
(See http://en.wikipedia.org/wiki/Birthday_paradox).
When the indexer has to contend with 1000 projects and jars, the
probability of a random clash is only about 0.01%. Small as that probability
is, it will happen to some users: I believe it has happened to me and would
explain why sometimes 'Navigate > Open type...' fails when I know it should
succeed.

A set of sample projects and trace logs to follow.
Comment 1 Keith W. Campbell CLA 2005-10-18 11:31:54 EDT
Created attachment 28394 [details]
Sample projects

Unzip and import into a new workspace.
Comment 2 Keith W. Campbell CLA 2005-10-18 11:33:22 EDT
Created attachment 28395 [details]
Test sequence and trace logs

Describes the test scenario interleaved with trace output.
Comment 3 Philipe Mulet CLA 2005-10-20 09:30:01 EDT
We should change our naming strategy. 
We should use the path of the indexed container, replacing file separators (for
external jars with '%' or something similar).
Comment 4 Jerome Lanneluc CLA 2005-10-20 09:37:57 EDT
Note that we take the risk of hitting the path length limit if we did that.
Also someone can still come up with 2 paths that are equal after replacing path
separators.

We might want to have an indirection instead: an index (of indexes !) that would
map from a number (the name of the index) to the path.
Comment 5 Keith W. Campbell CLA 2005-10-20 10:09:47 EDT
I think using small integers is the way to go. There are comments in
the code that suggest others agree: they make reference to other problems
that would be avoided. To that list I'd like to add bug 102860.

I've begun creating a patch with this strategy in mind.
Comment 6 Eclipse Genie CLA 2020-03-09 14:29:06 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.