Bug 102645 - [open type] Open Type history shows stale visibility info in type history
Summary: [open type] Open Type history shows stale visibility info in type history
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.1.1   Edit
Assignee: Dirk Baeumer CLA Friend
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-04 08:21 EDT by Tobias Widmer CLA Friend
Modified: 2005-09-26 05:39 EDT (History)
3 users (show)

See Also:


Attachments
The patch (1.97 KB, patch)
2005-09-07 08:56 EDT, Dirk Baeumer CLA Friend
no flags Details | Diff
Complete patch ;-) (2.40 KB, patch)
2005-09-07 08:58 EDT, Dirk Baeumer CLA Friend
no flags Details | Diff
optimized patch (2.56 KB, patch)
2005-09-07 10:54 EDT, Markus Keller CLA Friend
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Widmer CLA Friend 2005-07-04 08:21:54 EDT
3.1

Steps to reproduce:
- Open a public source type using Open Type
- Change visibility of the type to default
- Open the type again

-> Type history displays the type as public, the workspace type match is 
correctly displayed as default
Comment 1 Dirk Baeumer CLA Friend 2005-09-07 08:56:18 EDT
Thanks to a tip from Markus there is an easy fix for this problem now that we
are listening to Java element deltas.

I will attach the patch. Dani, Markus can you please comment on whether you
think this is important for 3.1.1 (as a developer of a feature you are mostly
biased) and if yes comment on the patch.

The problem is that the stale history doesn't go away even if you shutdown
Eclipse since the history gets persisted.
Comment 2 Dirk Baeumer CLA Friend 2005-09-07 08:56:49 EDT
Created attachment 26898 [details]
The patch
Comment 3 Dirk Baeumer CLA Friend 2005-09-07 08:58:28 EDT
Created attachment 26899 [details]
Complete patch ;-)
Comment 4 Dirk Baeumer CLA Friend 2005-09-07 09:00:34 EDT
One additional note: makeing fModifiers not final isn't a problem since it isn't
involved in equals and hashCode.
Comment 5 Dani Megert CLA Friend 2005-09-07 10:40:09 EDT
It looks quite strange and the fix is easy.
+1
Comment 6 Markus Keller CLA Friend 2005-09-07 10:54:52 EDT
Created attachment 26903 [details]
optimized patch

> The problem is that the stale history doesn't go away even if you shutdown
> Eclipse since the history gets persisted.

That's the point which makes me say +1 for 3.1.1.

The patch looks good, except for one spot that could be optimized for
performance:
In processDelta(..), the added test
    (isChanged && (delta.getFlags() & IJavaElementDelta.F_MODIFIERS) != 0)
is currently executed for IJavaElement.JAVA_MODEL,
JavaElement.PACKAGE_FRAGMENT, and IJavaElement.CLASS_FILE as well, but it only
makes sense for JavaElement.TYPE.

The attached patch has already been reviewed by Dani.
Comment 7 Dirk Baeumer CLA Friend 2005-09-07 11:55:48 EDT
Thanks for the review and the optimized performance.

Fix released to 3.1.1 and HEAD.
Comment 8 Tom Hofmann CLA Friend 2005-09-26 05:39:02 EDT
verified fixed in M20050923-1430