@@ -96,7 +96,7 @@ protected HeapViewerNode createNode(JavaClass javaClass) {
96
96
}
97
97
protected ProgressIterator <JavaClass > objectsIterator (int index , Progress progress ) {
98
98
Iterator <JavaClass > iterator = heap .getAllClasses ().listIterator (index );
99
- return new ProgressIterator (iterator , index , false , progress );
99
+ return new ProgressIterator <> (iterator , index , false , progress );
100
100
}
101
101
protected String getMoreNodesString (String moreNodesCount ) {
102
102
return Classes_Messages .getMoreNodesString (moreNodesCount );
@@ -115,8 +115,8 @@ protected String getNodesContainerString(String firstNodeIdx, String lastNodeIdx
115
115
116
116
117
117
public static HeapViewerNode [] getHeapPackages (HeapViewerNode parent , Heap heap , String viewID , HeapViewerNodeFilter viewFilter , List <DataType > dataTypes , List <SortOrder > sortOrders , Progress progress ) throws InterruptedException {
118
- List <HeapViewerNode > nodes = new ArrayList ();
119
- Map <String , ClassesContainer .Objects > packages = new HashMap ();
118
+ List <HeapViewerNode > nodes = new ArrayList <> ();
119
+ Map <String , ClassesContainer .Objects > packages = new HashMap <> ();
120
120
121
121
Thread worker = Thread .currentThread ();
122
122
@@ -187,7 +187,7 @@ protected HeapViewerNode createNode(Instance gcRootInstance) {
187
187
}
188
188
protected ProgressIterator <Instance > objectsIterator (int index , Progress progress ) {
189
189
Iterator <Instance > iterator = gcrootInstances .listIterator (index );
190
- return new ProgressIterator (iterator , index , false , progress );
190
+ return new ProgressIterator <> (iterator , index , false , progress );
191
191
}
192
192
protected String getMoreNodesString (String moreNodesCount ) {
193
193
return GCRoots_Messages .getMoreNodesString (moreNodesCount );
@@ -210,11 +210,11 @@ protected String getNodesContainerString(String firstNodeIdx, String lastNodeIdx
210
210
}
211
211
212
212
if (aggregation == 3 ) {
213
- List <GCTypeNode > tnodes = new ArrayList ();
214
- Map <String , GCTypeNode > types = new HashMap ();
213
+ List <GCTypeNode > tnodes = new ArrayList <> ();
214
+ Map <String , GCTypeNode > types = new HashMap <> ();
215
215
for (Instance instance : gcrootInstances ) {
216
- Collection <GCRoot > igcroots = ( Collection < GCRoot >) heap .getGCRoots (instance );
217
- Set <String > typeSet = new HashSet ();
216
+ Collection <GCRoot > igcroots = heap .getGCRoots (instance );
217
+ Set <String > typeSet = new HashSet <> ();
218
218
for (GCRoot gcroot : igcroots ) {
219
219
String tname = gcroot .getKind ();
220
220
if (typeSet .add (tname )) {
@@ -231,8 +231,8 @@ protected String getNodesContainerString(String firstNodeIdx, String lastNodeIdx
231
231
return tnodes .isEmpty () ? new HeapViewerNode [] { new TextNode (GCRoots_Messages .getNoItemsString (viewFilter )) } :
232
232
tnodes .toArray (HeapViewerNode .NO_NODES );
233
233
} else {
234
- List <InstancesContainer .Objects > cnodes = new ArrayList ();
235
- Map <String , InstancesContainer .Objects > classes = new HashMap ();
234
+ List <InstancesContainer .Objects > cnodes = new ArrayList <> ();
235
+ Map <String , InstancesContainer .Objects > classes = new HashMap <> ();
236
236
for (Instance instance : gcrootInstances ) {
237
237
JavaClass javaClass = instance .getJavaClass ();
238
238
String className = javaClass .getName ();
@@ -260,8 +260,8 @@ protected String getNodesContainerString(String firstNodeIdx, String lastNodeIdx
260
260
cnodes .toArray (HeapViewerNode .NO_NODES );
261
261
}
262
262
263
- List <HeapViewerNode > pnodes = new ArrayList ();
264
- Map <String , ClassesContainer .ContainerNodes > packages = new HashMap ();
263
+ List <HeapViewerNode > pnodes = new ArrayList <> ();
264
+ Map <String , ClassesContainer .ContainerNodes > packages = new HashMap <> ();
265
265
for (InstancesContainer .Objects cnode : cnodes ) {
266
266
String className = cnode .getName ();
267
267
int nameIdx = className .lastIndexOf ('.' ); // NOI18N
@@ -313,7 +313,7 @@ public static HeapViewerNode[] getHeapDominators(HeapViewerNode parent, Heap hea
313
313
if (!DataType .RETAINED_SIZE .valuesAvailable (heap ))
314
314
return new HeapViewerNode [] { new TextNode (Bundle .Dominators_Messages_NoRetainedSizes ()) };
315
315
316
- List <Instance > dominators = new ArrayList (getDominatorRoots (heap ));
316
+ List <Instance > dominators = new ArrayList <> (getDominatorRoots (heap ));
317
317
318
318
if (aggregation == 0 ) {
319
319
NodesComputer <Instance > computer = new NodesComputer <Instance >(dominators .size (), UIThresholds .MAX_TOPLEVEL_INSTANCES ) {
@@ -325,7 +325,7 @@ protected HeapViewerNode createNode(Instance instance) {
325
325
}
326
326
protected ProgressIterator <Instance > objectsIterator (int index , Progress progress ) {
327
327
Iterator <Instance > iterator = dominators .listIterator (index );
328
- return new ProgressIterator (iterator , index , false , progress );
328
+ return new ProgressIterator <> (iterator , index , false , progress );
329
329
}
330
330
protected String getMoreNodesString (String moreNodesCount ) {
331
331
return Dominators_Messages .getMoreNodesString (moreNodesCount );
@@ -347,8 +347,8 @@ protected String getNodesContainerString(String firstNodeIdx, String lastNodeIdx
347
347
dominatorsI .remove ();
348
348
}
349
349
350
- List <InstancesContainer .Objects > cnodes = new ArrayList ();
351
- Map <String , InstancesContainer .Objects > classes = new HashMap ();
350
+ List <InstancesContainer .Objects > cnodes = new ArrayList <> ();
351
+ Map <String , InstancesContainer .Objects > classes = new HashMap <> ();
352
352
for (Instance instance : dominators ) {
353
353
JavaClass javaClass = instance .getJavaClass ();
354
354
String className = javaClass .getName ();
@@ -376,8 +376,8 @@ protected String getNodesContainerString(String firstNodeIdx, String lastNodeIdx
376
376
cnodes .toArray (HeapViewerNode .NO_NODES );
377
377
}
378
378
379
- List <HeapViewerNode > pnodes = new ArrayList ();
380
- Map <String , ClassesContainer .ContainerNodes > packages = new HashMap ();
379
+ List <HeapViewerNode > pnodes = new ArrayList <> ();
380
+ Map <String , ClassesContainer .ContainerNodes > packages = new HashMap <> ();
381
381
for (InstancesContainer .Objects cnode : cnodes ) {
382
382
String className = cnode .getName ();
383
383
int nameIdx = className .lastIndexOf ('.' ); // NOI18N
@@ -404,8 +404,8 @@ static Set<Instance> getDominatorRoots(Heap heap) {
404
404
int searchScope = 1000 ;
405
405
List <Instance > searchInstances = heap .getBiggestObjectsByRetainedSize (searchScope );
406
406
407
- Set <Instance > dominators = new HashSet (searchInstances );
408
- Set <Instance > removed = new HashSet ();
407
+ Set <Instance > dominators = new HashSet <> (searchInstances );
408
+ Set <Instance > removed = new HashSet <> ();
409
409
410
410
for (Instance instance : searchInstances ) {
411
411
if (dominators .contains (instance )) {
0 commit comments