Bug 3248 - Creating a new class creates 3 entries in local history (1GE4TOC)
Summary: Creating a new class creates 3 entries in local history (1GE4TOC)
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: All Windows 2000
: P3 minor (vote)
Target Milestone: 2.1 M2   Edit
Assignee: Martin Aeschlimann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 17599 (view as bug list)
Depends on:
Blocks:
 
Reported: 2001-10-10 22:51 EDT by Andre Weinand CLA
Modified: 2002-10-11 09:40 EDT (History)
3 users (show)

See Also:


Attachments
Code containing fix for bug 3248 (60.13 KB, text/plain)
2002-10-09 08:41 EDT, Martin Aeschlimann CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andre Weinand CLA 2001-10-10 22:51:58 EDT
Creating a new class with the class wizard creates 3 entries in the local history.
The oldest is empty, the others have the same content.

NOTES:
EG (5/23/2001 11:35:43 AM)
	is the wizard setting the contents 3 times?

MA (5/25/01 10:10:32 AM)
	JDOM automatically saves the content
	2 times add import: I have to save, otherwise create hierarchy does not succeed.

EG (5/30/01 9:43:51 AM)
	JDOM should provide control over the saving behaviour and not do it automatically.
	Moving to JCORE for comment.
Comment 1 Philipe Mulet CLA 2001-10-11 08:59:11 EDT
Optimization
Comment 2 Philipe Mulet CLA 2001-10-11 08:59:52 EDT
Nice to have
Comment 3 DJ Houghton CLA 2001-10-23 23:52:51 EDT
PRODUCT VERSION:
	109

Comment 4 Philipe Mulet CLA 2002-09-20 05:52:46 EDT
Resurrecting, need verification in latest.
Comment 5 Philipe Mulet CLA 2002-09-20 05:59:14 EDT
*** Bug 3315 has been marked as a duplicate of this bug. ***
Comment 6 Jerome Lanneluc CLA 2002-09-20 06:31:34 EDT
Right now, UI is doing a mix of JDOM maninpulation on compilation units and 
explicit commit on working copies.

It should just create a working copy, manipulate this working copy (JDOM 
manipulations won't save the changes to disk until a commit is done), and then 
commit it.

To optimize java element change events, JavaCore.run(IWorkspaceRunnable, 
IProgressMonitor) should be used.

Moving to JDT-UI.
Comment 7 Martin Aeschlimann CLA 2002-09-20 08:15:19 EDT
*** Bug 17599 has been marked as a duplicate of this bug. ***
Comment 8 Martin Aeschlimann CLA 2002-09-20 08:15:54 EDT
I tried that but had to stop as type hierarchies were not build on such a 
working copy
Comment 9 Martin Aeschlimann CLA 2002-09-20 08:17:18 EDT
(it is a working copy without underlying file)
Comment 10 Jerome Lanneluc CLA 2002-09-23 05:11:58 EDT
Martin, what's the bug number for the problem you're having on building a type 
hierarchy on a working copy? We're not aware of any problem in this area.
Comment 11 Martin Aeschlimann CLA 2002-09-23 06:18:04 EDT
there is no bug report yet. 
Comment 12 Martin Aeschlimann CLA 2002-10-09 08:40:09 EDT
Fixed but can't relase due to the mentioned hierarchy problem.
Jerome, can you have a look at it? My fix for the NewTypeWizardPage is attached 
here.
Replace the existing code from HEAD or 20021009 with this one.
- Set a breakpoint in createInheritedMethods at
   ITypeHierarchy hierarchy= type.newSupertypeHierarchy(monitor);
- Create a new class in the wizard, add e.g. 'MouseListener' as interface, 
check 'inherited abstract methods'
- The type passed in createInheritedMethods is from a woking copy which is 
complete (type + superinterfaces + import)
The original CU only contains a package statement. I suspect that this causes 
the problem

Comment 13 Martin Aeschlimann CLA 2002-10-09 08:41:20 EDT
Created attachment 2129 [details]
Code containing fix for bug 3248
Comment 14 Jerome Lanneluc CLA 2002-10-09 09:03:29 EDT
Please enter a separate bug report and don't assign a bug to a developper. Only 
component leads are supposed to assign bugs.
Comment 15 Martin Aeschlimann CLA 2002-10-09 09:26:14 EDT
created bug 24567. 

sorry for not keeping the strict procedure.
Comment 16 Martin Aeschlimann CLA 2002-10-11 09:40:09 EDT
hierarchy problem solved.

fixed > 20021010