Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 315283 - Acquire head dump dialog: set a warning when the file already exists
Summary: Acquire head dump dialog: set a warning when the file already exists
Status: RESOLVED FIXED
Alias: None
Product: MAT
Classification: Tools
Component: GUI (show other bugs)
Version: 1.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Andrew Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-01 15:20 EDT by Aurelien Pupier CLA
Modified: 2011-05-12 06:12 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aurelien Pupier CLA 2010-06-01 15:20:42 EDT
Build Identifier: 20100527-0614

In Acquire head dump dialog, if the file (in which we want to save the dump) already exists, a warning pop up on the finish. it would be more user-friendlty if a decoration on the text box warn the user.
This can be useful when we are taking several dump of the memory of the same process(a common usage?)

Another thoughts : we can try to generate a name suffixed with number to avoid to the user to change the name.

In the same time, we can perhaps improve the message and replace folder by file.

Reproducible: Always

Steps to Reproduce:
1.acquire a dump
2. acquire another dump of the same process
3.
Comment 1 Aurelien Pupier CLA 2010-06-01 15:27:29 EDT
> In the same time, we can perhaps improve the message and replace folder by
> file.

Ok. Just replace by file isn't a good idea. As we choose a folder with the browse. But the fact that it writes the file name when selecting a process makes the text a little weird... But I don't have better solution to propose so just keep in mind that it can implies some "troubles" in mind of some user (only mine perhaps :s)
Comment 2 Andrew Johnson CLA 2010-08-03 04:28:30 EDT
I'm experimenting with this.

Perhaps its better to use a DirectoryDialog before a process is chosen and a FileDialog (with overwrite warning) afterwards.
Comment 3 Andrew Johnson CLA 2010-08-03 15:57:47 EDT
Other problems I've seen are:

Next and Finish buttons remain active after 'Refresh' or 'Configure' clears the process list. Clearing the list should clear the dump provider arguments.

With an IBM dump provider, changing the settings on a Heap Dump Provider arguments then going back doesn't show the new suggested dump name in the Acquire Heap Dump Dialog. This is because settings from the table are only copied into the VmInfo just before generating the dump. It would be better if the dump name changed to reflect the new dump type.

If a directory rather than a file name is specified in the folder name box then at the finish stage it offers to delete the file (folder!).
The next button should not allow a directory name only.
Comment 4 Andrew Johnson CLA 2010-08-04 16:08:19 EDT
I've put the changes necessary to fix comment 2 and comment 3.

I've added a warning message if the file exists:
 File exists and will be overwritten by the new snapshot
and an error message if the file is a directory
 File is a directory

I've disabled the finish button as well as the next button if a process is not selected or a dump file is unsuitable.
Comment 5 Andrew Johnson CLA 2010-08-05 05:59:34 EDT
The latest code should be available as an update site from:
https://build.eclipse.org/hudson/job/cbi-mat-nightly/245

Does this solve most of the problems?

As for 'a name suffixed with number to avoid to the user to change the name.'

This might be possible, but would needs to be done the the AcquireDialog, but ideally the dump providers would have some control. How about using a MessageFormat string? Instead of %pid% then the proposed file name could have 3 substitutions, date, pid and sequence number, incremented as required.

java_pid{1,number,0).{2,number,0000}.hprof

The slightly tricky part could be avoiding unwanted locale changes, so the {1,number,0} avoids commas or dots in the PID.

Is this a good idea?
Comment 6 Andrew Johnson CLA 2010-08-10 11:32:25 EDT
I've added a sequence number for acquiring dumps.

Show we make the template file name for HPROF dumps configurable?
Comment 7 Dominik Stadler CLA 2010-08-14 07:06:06 EDT
ad configurable: I wouldn't bother, rather keep it simple, these files are temporary files most of the times anyway.
Comment 8 Andrew Johnson CLA 2010-09-10 09:01:16 EDT
I think the way of acquiring the heap dump might be a little better if the configure heap dump providers dialog was also a wizard page, so you went from

1. Configure Heap Dump Providers
2. Choose target Java process
3. Select heap dump arguments
4. Press finish to generate a dump

and you might skip 1. if it was already configured in some way (and the back button would let you reconfigure the providers).
Comment 9 Andrew Johnson CLA 2011-05-12 05:49:43 EDT
This is fixed. Making configure heap dump providers dialog a wizard page would need to be a separate item.
Comment 10 Aurelien Pupier CLA 2011-05-12 06:12:04 EDT
thanks :)