File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
visualvm/heapdump/src/com/sun/tools/visualvm/heapdump Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 29
29
import com .sun .tools .visualvm .core .snapshot .Snapshot ;
30
30
import com .sun .tools .visualvm .core .snapshot .SnapshotsSupport ;
31
31
import java .io .File ;
32
+ import org .graalvm .visualvm .core .datasupport .Utils ;
32
33
import org .openide .util .NbBundle ;
33
34
34
35
/**
39
40
*/
40
41
public abstract class HeapDump extends Snapshot {
41
42
43
+ private static final String HWCACHE_EXT = ".hwcache" ; // NOI18N
44
+
42
45
/**
43
46
* Creates new instance of HeapDump with the data stored in a file.
44
47
*
@@ -65,5 +68,19 @@ public boolean supportsSaveAs() {
65
68
public void saveAs () {
66
69
SnapshotsSupport .getInstance ().saveAs (this , NbBundle .getMessage (HeapDump .class , "LBL_Save_Heap_Dump_As" )); // NOI18N
67
70
}
71
+
72
+ protected void remove () {
73
+ final File f = getFile ();
74
+
75
+ // #GH-111: delete the corresponding .hwcache directory
76
+ if (f != null ) Utils .FILE_QUEUE .post (new Runnable () {
77
+ public void run () {
78
+ File ff = new File (f .getParent (), f .getName () + HWCACHE_EXT );
79
+ if (ff .isDirectory ()) Utils .delete (ff , true );
80
+ }
81
+ });
82
+
83
+ super .remove ();
84
+ }
68
85
69
86
}
You can’t perform that action at this time.
0 commit comments