Skip to content

Commit 844694d

Browse files
committed
some javac warnings fixed
1 parent 67bf116 commit 844694d

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

visualvm/heapviewer/src/org/graalvm/visualvm/heapviewer/java/impl/JavaClassesProvider.java

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ protected HeapViewerNode createNode(JavaClass javaClass) {
9696
}
9797
protected ProgressIterator<JavaClass> objectsIterator(int index, Progress progress) {
9898
Iterator<JavaClass> iterator = heap.getAllClasses().listIterator(index);
99-
return new ProgressIterator(iterator, index, false, progress);
99+
return new ProgressIterator<>(iterator, index, false, progress);
100100
}
101101
protected String getMoreNodesString(String moreNodesCount) {
102102
return Classes_Messages.getMoreNodesString(moreNodesCount);
@@ -115,8 +115,8 @@ protected String getNodesContainerString(String firstNodeIdx, String lastNodeIdx
115115

116116

117117
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<>();
120120

121121
Thread worker = Thread.currentThread();
122122

@@ -187,7 +187,7 @@ protected HeapViewerNode createNode(Instance gcRootInstance) {
187187
}
188188
protected ProgressIterator<Instance> objectsIterator(int index, Progress progress) {
189189
Iterator<Instance> iterator = gcrootInstances.listIterator(index);
190-
return new ProgressIterator(iterator, index, false, progress);
190+
return new ProgressIterator<>(iterator, index, false, progress);
191191
}
192192
protected String getMoreNodesString(String moreNodesCount) {
193193
return GCRoots_Messages.getMoreNodesString(moreNodesCount);
@@ -210,11 +210,11 @@ protected String getNodesContainerString(String firstNodeIdx, String lastNodeIdx
210210
}
211211

212212
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<>();
215215
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<>();
218218
for (GCRoot gcroot : igcroots) {
219219
String tname = gcroot.getKind();
220220
if (typeSet.add(tname)) {
@@ -231,8 +231,8 @@ protected String getNodesContainerString(String firstNodeIdx, String lastNodeIdx
231231
return tnodes.isEmpty() ? new HeapViewerNode[] { new TextNode(GCRoots_Messages.getNoItemsString(viewFilter)) } :
232232
tnodes.toArray(HeapViewerNode.NO_NODES);
233233
} 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<>();
236236
for (Instance instance : gcrootInstances) {
237237
JavaClass javaClass = instance.getJavaClass();
238238
String className = javaClass.getName();
@@ -260,8 +260,8 @@ protected String getNodesContainerString(String firstNodeIdx, String lastNodeIdx
260260
cnodes.toArray(HeapViewerNode.NO_NODES);
261261
}
262262

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<>();
265265
for (InstancesContainer.Objects cnode : cnodes) {
266266
String className = cnode.getName();
267267
int nameIdx = className.lastIndexOf('.'); // NOI18N
@@ -313,7 +313,7 @@ public static HeapViewerNode[] getHeapDominators(HeapViewerNode parent, Heap hea
313313
if (!DataType.RETAINED_SIZE.valuesAvailable(heap))
314314
return new HeapViewerNode[] { new TextNode(Bundle.Dominators_Messages_NoRetainedSizes()) };
315315

316-
List<Instance> dominators = new ArrayList(getDominatorRoots(heap));
316+
List<Instance> dominators = new ArrayList<>(getDominatorRoots(heap));
317317

318318
if (aggregation == 0) {
319319
NodesComputer<Instance> computer = new NodesComputer<Instance>(dominators.size(), UIThresholds.MAX_TOPLEVEL_INSTANCES) {
@@ -325,7 +325,7 @@ protected HeapViewerNode createNode(Instance instance) {
325325
}
326326
protected ProgressIterator<Instance> objectsIterator(int index, Progress progress) {
327327
Iterator<Instance> iterator = dominators.listIterator(index);
328-
return new ProgressIterator(iterator, index, false, progress);
328+
return new ProgressIterator<>(iterator, index, false, progress);
329329
}
330330
protected String getMoreNodesString(String moreNodesCount) {
331331
return Dominators_Messages.getMoreNodesString(moreNodesCount);
@@ -347,8 +347,8 @@ protected String getNodesContainerString(String firstNodeIdx, String lastNodeIdx
347347
dominatorsI.remove();
348348
}
349349

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<>();
352352
for (Instance instance : dominators) {
353353
JavaClass javaClass = instance.getJavaClass();
354354
String className = javaClass.getName();
@@ -376,8 +376,8 @@ protected String getNodesContainerString(String firstNodeIdx, String lastNodeIdx
376376
cnodes.toArray(HeapViewerNode.NO_NODES);
377377
}
378378

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<>();
381381
for (InstancesContainer.Objects cnode : cnodes) {
382382
String className = cnode.getName();
383383
int nameIdx = className.lastIndexOf('.'); // NOI18N
@@ -404,8 +404,8 @@ static Set<Instance> getDominatorRoots(Heap heap) {
404404
int searchScope = 1000;
405405
List<Instance> searchInstances = heap.getBiggestObjectsByRetainedSize(searchScope);
406406

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<>();
409409

410410
for (Instance instance : searchInstances) {
411411
if (dominators.contains(instance)) {

0 commit comments

Comments
 (0)