Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 347408 - Single bad entry breaks entire type hierarchy
Summary: Single bad entry breaks entire type hierarchy
Status: CLOSED DUPLICATE of bug 486979
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.8 RC2   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-27 04:24 EDT by Stephan Herrmann CLA
Modified: 2019-01-20 15:04 EST (History)
4 users (show)

See Also:


Attachments
proposed fix (1.21 KB, patch)
2011-05-27 04:26 EDT, Stephan Herrmann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Herrmann CLA 2011-05-27 04:24:39 EDT
In the Object Teams test suite we have a recent regression
which manifests in lots of types missing in a type hierarchy.

I'm still investigating the root cause, but the symptom is much
more drastic than appropriate: inside method
IndexBasedHierarchyBuilder.buildFromPotentialSubtypes(..)
a JavaModelException will cause the loop over allPotentialSubTypes
to get "stuck" on the bad element.

Assume in line 306 an invalid currentProject causes a JavaModelException.
The exception will be caught below, but in that case currentProject will never
be advanced and each subsequent iteration of the surrounding for loop will
hit the same JME, causing all subsequent entries of allPotentialSubTypes to 
be skipped.
Comment 1 Stephan Herrmann CLA 2011-05-27 04:26:26 EDT
Created attachment 196728 [details]
proposed fix

This simple change ensures that the loop properly advances
even in case of a JME.
Comment 2 Ayushman Jain CLA 2011-05-27 06:40:32 EDT
The change is minor and looks safe. Though it may be too late for 3.7. Olivier, what do you think?
Comment 3 Olivier Thomann CLA 2011-05-27 08:39:56 EDT
Is this a regression over 3.6.2 ? I don't think so. So even if this is annoying, I think this is a good candidate for 3.7.1. We are one week away from RC4. So I don't think this is serious enough to be fixed at that point.
Srikanth, what is your call ?
Comment 4 Stephan Herrmann CLA 2011-05-27 09:42:18 EDT
(In reply to comment #3)
> Is this a regression over 3.6.2 ? I don't think so.

I don't thinks so, either.

If there is indeed a regression in JDT/Core the location
in IndexBasedHierarchyBuilder only causes that regression
to escalate.

I'll tell you more, once I found the time to investigate
the root cause. It was s.t. along the lines that the
primary working copy owner still served working copies
from a deleted project. Maybe this already rings a bell?
Any recent change that could produce such effects?
Comment 5 Stephan Herrmann CLA 2011-05-28 12:41:52 EDT
OK, the root cause was not in JDT/Core. The Object Teams code was 
leaking a working copy.

I was just surprised that this leaked working copy would survive even
deletion of the containing project. Is that intended?

After 3.7.0 I will prepare a test case that demonstrates the issue.
Comment 6 Jay Arthanareeswaran CLA 2011-05-30 04:16:08 EDT
(In reply to comment #5)
> I was just surprised that this leaked working copy would survive even
> deletion of the containing project. Is that intended?

I guess so. I found the following documentation from IWorkingCopy:

 * The client that creates a working copy is responsible for
 * destroying the working copy. The Java model will never automatically
 * destroy or close a working copy.
Comment 7 Eclipse Genie CLA 2019-01-12 12:19:09 EST
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.

If you have further information on the current state of the bug, please add it. 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.
Comment 8 Stephan Herrmann CLA 2019-01-20 15:03:42 EST
Looking at the code this was meanwhile fixed via bug 486979.

*** This bug has been marked as a duplicate of bug 486979 ***