@@ -83,18 +83,23 @@ protected void remove() {
83
83
protected Image resolveIcon () {
84
84
try {
85
85
int snapshotType = getLoadedSnapshot ().getType ();
86
- if (snapshotType == LoadedSnapshot .SNAPSHOT_TYPE_CPU ) {
87
- return ImageUtilities .mergeImages (CPU_ICON , NODE_BADGE , 0 , 0 );
88
- } else if (snapshotType == LoadedSnapshot .SNAPSHOT_TYPE_MEMORY_LIVENESS
89
- || snapshotType == LoadedSnapshot .SNAPSHOT_TYPE_MEMORY_ALLOCATIONS
90
- || snapshotType == LoadedSnapshot .SNAPSHOT_TYPE_MEMORY_SAMPLED ) {
91
- return ImageUtilities .mergeImages (MEMORY_ICON , NODE_BADGE , 0 , 0 );
92
- } else {
93
- return null ;
86
+ switch (snapshotType ) {
87
+ case LoadedSnapshot .SNAPSHOT_TYPE_CPU :
88
+ return ImageUtilities .mergeImages (CPU_ICON , NODE_BADGE , 0 , 0 );
89
+ case LoadedSnapshot .SNAPSHOT_TYPE_CPU_JDBC :
90
+ return ImageUtilities .mergeImages (JDBC_ICON , NODE_BADGE , 0 , 0 );
91
+ case LoadedSnapshot .SNAPSHOT_TYPE_MEMORY_LIVENESS :
92
+ case LoadedSnapshot .SNAPSHOT_TYPE_MEMORY_ALLOCATIONS :
93
+ case LoadedSnapshot .SNAPSHOT_TYPE_MEMORY_SAMPLED :
94
+ return ImageUtilities .mergeImages (MEMORY_ICON , NODE_BADGE , 0 , 0 );
95
+ default :
96
+ // Fallback icon, cannot return null - throws NPE in DataSourceView
97
+ return ImageUtilities .mergeImages (SNAPSHOT_ICON , NODE_BADGE , 0 , 0 );
94
98
}
95
99
} catch (Exception e ) {
96
100
LOGGER .log (Level .FINE , "Failed to determine profiler snapshot type" , e ); // NOI18N
97
- return null ;
101
+ // Fallback icon, cannot return null - throws NPE in DataSourceView
102
+ return ImageUtilities .mergeImages (SNAPSHOT_ICON , NODE_BADGE , 0 , 0 );
98
103
}
99
104
}
100
105
0 commit comments