Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up some warnings in org.eclipse.ui.dialogs package #968

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ protected Control createDialogArea(Composite parent) {
@Override
protected void okPressed() {

List chosenContainerPathList = new ArrayList();
List<IPath> chosenContainerPathList = new ArrayList<>();
IPath returnValue = group.getContainerFullPath();
if (returnValue != null) {
chosenContainerPathList.add(returnValue);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.eclipse.ui.dialogs;

import java.util.ArrayList;
import java.util.List;

import org.eclipse.core.resources.IProject;
import org.eclipse.jface.resource.JFaceColors;
Expand Down Expand Up @@ -138,7 +139,7 @@ private IProject getProject() {
@Override
protected void okPressed() {

ArrayList list = new ArrayList();
List<String> list = new ArrayList<>();
list.add(getProject().getName());
list.add(locationArea.getProjectLocation());
setResult(list);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IResource;
Expand Down Expand Up @@ -93,7 +94,7 @@ public ResourceSelectionDialog(Shell parentShell, IAdaptable rootElement, String
* portion of this dialog's resource selection viewer.
*/
private void checkInitialSelections() {
Iterator itemsToCheck = getInitialElementSelections().iterator();
Iterator<?> itemsToCheck = getInitialElementSelections().iterator();

while (itemsToCheck.hasNext()) {
IResource currentElement = (IResource) itemsToCheck.next();
Expand Down Expand Up @@ -132,7 +133,7 @@ protected Control createDialogArea(Composite parent) {

// create the input element, which has the root resource
// as its only child
ArrayList input = new ArrayList();
List<IAdaptable> input = new ArrayList<>();
input.add(root);

createMessageArea(composite);
Expand Down Expand Up @@ -183,7 +184,7 @@ public Object[] getChildren(Object o) {
}

// filter out the desired resource types
ArrayList results = new ArrayList();
List<IResource> results = new ArrayList<>();
for (IResource member : members) {
// And the test bits with the resource types to see if they are what we want
if ((member.getType() & resourceType) > 0) {
Expand All @@ -194,7 +195,7 @@ public Object[] getChildren(Object o) {
}
// input element case
if (o instanceof ArrayList) {
return ((ArrayList) o).toArray();
return ((ArrayList<?>) o).toArray();
}
return new Object[0];
}
Expand Down Expand Up @@ -222,8 +223,8 @@ private void initializeDialog() {
*/
@Override
protected void okPressed() {
Iterator resultEnum = selectionGroup.getAllCheckedListItems();
ArrayList list = new ArrayList();
Iterator<?> resultEnum = selectionGroup.getAllCheckedListItems();
List<Object> list = new ArrayList<>();
while (resultEnum.hasNext()) {
list.add(resultEnum.next());
}
Expand Down