diff --git a/core/plugins/org.eclipse.dltk.ui/src corext/org/eclipse/dltk/internal/corext/buildpath/BuildpathModifier.java b/core/plugins/org.eclipse.dltk.ui/src corext/org/eclipse/dltk/internal/corext/buildpath/BuildpathModifier.java
index a65e878..144c863 100644
--- a/core/plugins/org.eclipse.dltk.ui/src corext/org/eclipse/dltk/internal/corext/buildpath/BuildpathModifier.java
+++ b/core/plugins/org.eclipse.dltk.ui/src corext/org/eclipse/dltk/internal/corext/buildpath/BuildpathModifier.java
@@ -285,7 +285,7 @@
 		if (monitor == null)
 			monitor = new NullProgressMonitor();
 		IPath[] selected = query.doQuery();
-		List addedEntries = new ArrayList();
+		List<BPListElement> addedEntries = new ArrayList<BPListElement>();
 		try {
 			monitor.beginTask(
 					NewWizardMessages.BuildpathModifier_Monitor_AddToBuildpath,
@@ -298,7 +298,7 @@
 				}
 				monitor.worked(1);
 
-				List existingEntries = getExistingEntries(project);
+				List<BPListElement> existingEntries = getExistingEntries(project);
 				setNewEntry(existingEntries, addedEntries, project,
 						new SubProgressMonitor(monitor, 1));
 				updateBuildpath(existingEntries, project,
@@ -340,14 +340,14 @@
 	 * 
 	 * @see IAddArchivesQuery
 	 */
-	protected List addLibraries(IAddLibrariesQuery query,
+	protected List<BuildPathContainer> addLibraries(IAddLibrariesQuery query,
 			IScriptProject project, IProgressMonitor monitor)
 			throws CoreException {
 		if (monitor == null)
 			monitor = new NullProgressMonitor();
 		IBuildpathEntry[] selected = query.doQuery(project,
 				project.getRawBuildpath());
-		List addedEntries = new ArrayList();
+		List<BPListElement> addedEntries = new ArrayList<BPListElement>();
 		try {
 			monitor.beginTask(
 					NewWizardMessages.BuildpathModifier_Monitor_AddToBuildpath,
@@ -360,13 +360,14 @@
 				}
 				monitor.worked(1);
 
-				List existingEntries = getExistingEntries(project);
+				List<BPListElement> existingEntries = getExistingEntries(project);
 				setNewEntry(existingEntries, addedEntries, project,
 						new SubProgressMonitor(monitor, 1));
 				updateBuildpath(existingEntries, project,
 						new SubProgressMonitor(monitor, 1));
 
-				List result = new ArrayList(addedEntries.size());
+				List<BuildPathContainer> result = new ArrayList<BuildPathContainer>(
+						addedEntries.size());
 				for (int i = 0; i < addedEntries.size(); i++) {
 					result.add(new BuildPathContainer(project, selected[i]));
 				}
@@ -376,7 +377,7 @@
 		} finally {
 			monitor.done();
 		}
-		return new ArrayList();
+		return new ArrayList<BuildPathContainer>();
 	}
 
 	protected List addLibraryEntries(List resources, IScriptProject project,
@@ -852,10 +853,10 @@
 	 *         path entries of the project
 	 * @throws ModelException
 	 */
-	public static List getExistingEntries(IScriptProject project)
+	public static List<BPListElement> getExistingEntries(IScriptProject project)
 			throws ModelException {
 		IBuildpathEntry[] buildpathEntries = project.getRawBuildpath();
-		ArrayList newBuildPath = new ArrayList();
+		ArrayList<BPListElement> newBuildPath = new ArrayList<BPListElement>();
 		for (int i = 0; i < buildpathEntries.length; i++) {
 			IBuildpathEntry curr = buildpathEntries[i];
 			newBuildPath.add(BPListElement.createFromExisting(curr, project));
diff --git a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/wizards/buildpath/BuildPathBasePage.java b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/wizards/buildpath/BuildPathBasePage.java
index 8615341..a31618e 100644
--- a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/wizards/buildpath/BuildPathBasePage.java
+++ b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/wizards/buildpath/BuildPathBasePage.java
@@ -50,7 +50,7 @@
 	}
 
 	public static void fixNestingConflicts(BPListElement[] newEntries,
-			BPListElement[] existing, Set modifiedSourceEntries) {
+			BPListElement[] existing, Set<BPListElement> modifiedSourceEntries) {
 		for (int i = 0; i < newEntries.length; i++) {
 			addExclusionPatterns(newEntries[i], existing, modifiedSourceEntries);
 		}
@@ -66,7 +66,7 @@
 	}
 
 	private static void addExclusionPatterns(BPListElement newEntry,
-			BPListElement[] existing, Set modifiedEntries) {
+			BPListElement[] existing, Set<BPListElement> modifiedEntries) {
 		IPath entryPath = newEntry.getPath();
 		for (int i = 0; i < existing.length; i++) {
 			BPListElement curr = existing[i];
diff --git a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/wizards/buildpath/newsourcepage/AddFolderToBuildpathAction.java b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/wizards/buildpath/newsourcepage/AddFolderToBuildpathAction.java
index 7cf2ad2..964f88f 100644
--- a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/wizards/buildpath/newsourcepage/AddFolderToBuildpathAction.java
+++ b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/wizards/buildpath/newsourcepage/AddFolderToBuildpathAction.java
@@ -31,12 +31,12 @@
 import org.eclipse.dltk.core.IScriptFolder;
 import org.eclipse.dltk.core.IScriptProject;
 import org.eclipse.dltk.internal.corext.buildpath.BuildpathModifier;
-import org.eclipse.dltk.ui.dialogs.StatusInfo;
 import org.eclipse.dltk.internal.ui.wizards.NewWizardMessages;
 import org.eclipse.dltk.internal.ui.wizards.buildpath.BPListElement;
 import org.eclipse.dltk.internal.ui.wizards.buildpath.BuildPathBasePage;
 import org.eclipse.dltk.ui.DLTKPluginImages;
 import org.eclipse.dltk.ui.DLTKUIPlugin;
+import org.eclipse.dltk.ui.dialogs.StatusInfo;
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.dialogs.ErrorDialog;
 import org.eclipse.jface.dialogs.MessageDialog;
@@ -105,16 +105,17 @@
 				public void run(IProgressMonitor monitor)
 						throws InvocationTargetException, InterruptedException {
 					try {
-						List result = addToBuildpath(fSelectedElements,
-								project, removeProjectFromBuildpath, monitor);
+						List<IModelElement> result = addToBuildpath(
+								fSelectedElements, project,
+								removeProjectFromBuildpath, monitor);
 						selectAndReveal(new StructuredSelection(result));
 					} catch (CoreException e) {
 						throw new InvocationTargetException(e);
 					}
 				}
 			};
-			PlatformUI.getWorkbench().getProgressService().run(true, false,
-					runnable);
+			PlatformUI.getWorkbench().getProgressService()
+					.run(true, false, runnable);
 		} catch (final InvocationTargetException e) {
 			if (e.getCause() instanceof CoreException) {
 				showExceptionDialog((CoreException) e.getCause());
@@ -125,9 +126,10 @@
 		}
 	}
 
-	private List addToBuildpath(List elements, IScriptProject project,
-			boolean removeProjectFromBuildpath, IProgressMonitor monitor)
-			throws OperationCanceledException, CoreException {
+	private List<IModelElement> addToBuildpath(List<Object> elements,
+			IScriptProject project, boolean removeProjectFromBuildpath,
+			IProgressMonitor monitor) throws OperationCanceledException,
+			CoreException {
 		if (!DLTKLanguageManager.hasScriptNature(project.getProject())) {
 			StatusInfo rootStatus = new StatusInfo();
 			rootStatus
@@ -142,7 +144,7 @@
 
 			monitor.worked(1);
 
-			List existingEntries = BuildpathModifier
+			List<BPListElement> existingEntries = BuildpathModifier
 					.getExistingEntries(project);
 			if (removeProjectFromBuildpath) {
 				BuildpathModifier.removeFromBuildpath(project, existingEntries,
@@ -151,7 +153,7 @@
 				monitor.worked(1);
 			}
 
-			List newEntries = new ArrayList();
+			List<BPListElement> newEntries = new ArrayList<BPListElement>();
 			for (int i = 0; i < elements.size(); i++) {
 				Object element = elements.get(i);
 				BPListElement entry;
@@ -167,13 +169,11 @@
 				newEntries.add(entry);
 			}
 
-			Set modifiedSourceEntries = new HashSet();
-			BuildPathBasePage
-					.fixNestingConflicts((BPListElement[]) newEntries
-							.toArray(new BPListElement[newEntries.size()]),
-							(BPListElement[]) existingEntries
-									.toArray(new BPListElement[existingEntries
-											.size()]), modifiedSourceEntries);
+			Set<BPListElement> modifiedSourceEntries = new HashSet<BPListElement>();
+			BuildPathBasePage.fixNestingConflicts(newEntries
+					.toArray(new BPListElement[newEntries.size()]),
+					existingEntries.toArray(new BPListElement[existingEntries
+							.size()]), modifiedSourceEntries);
 
 			BuildpathModifier.setNewEntry(existingEntries, newEntries, project,
 					new SubProgressMonitor(monitor, 1));
@@ -181,10 +181,9 @@
 			BuildpathModifier.commitBuildPath(existingEntries, project,
 					new SubProgressMonitor(monitor, 1));
 
-			List result = new ArrayList();
+			List<IModelElement> result = new ArrayList<IModelElement>();
 			for (int i = 0; i < newEntries.size(); i++) {
-				IBuildpathEntry entry = ((BPListElement) newEntries.get(i))
-						.getBuildpathEntry();
+				IBuildpathEntry entry = newEntries.get(i).getBuildpathEntry();
 				IModelElement root;
 				if (entry.getPath().equals(project.getPath()))
 					root = project;
@@ -235,8 +234,8 @@
 					fSelectedElements.add(scriptProject);
 				} else if (element instanceof IScriptFolder) {
 					int type = DialogPackageExplorerActionGroup.getType(
-							element, ((IScriptFolder) element)
-									.getScriptProject());
+							element,
+							((IScriptFolder) element).getScriptProject());
 					if (type != DialogPackageExplorerActionGroup.PACKAGE_FRAGMENT
 							&& type != DialogPackageExplorerActionGroup.INCLUDED_FOLDER)
 						return false;
@@ -280,7 +279,7 @@
 			return;
 
 		// get all the view and editor parts
-		List parts = new ArrayList();
+		List<IWorkbenchPart> parts = new ArrayList<IWorkbenchPart>();
 		IWorkbenchPartReference refs[] = page.getViewReferences();
 		for (int i = 0; i < refs.length; i++) {
 			IWorkbenchPart part = refs[i].getPart(false);
@@ -293,9 +292,7 @@
 				parts.add(refs[i].getPart(false));
 		}
 
-		Iterator itr = parts.iterator();
-		while (itr.hasNext()) {
-			IWorkbenchPart part = (IWorkbenchPart) itr.next();
+		for (IWorkbenchPart part : parts) {
 
 			// get the part's ISetSelectionTarget implementation
 			ISetSelectionTarget target = null;
@@ -308,8 +305,8 @@
 			if (target != null) {
 				// select and reveal resource
 				final ISetSelectionTarget finalTarget = target;
-				page.getWorkbenchWindow().getShell().getDisplay().asyncExec(
-						new Runnable() {
+				page.getWorkbenchWindow().getShell().getDisplay()
+						.asyncExec(new Runnable() {
 							public void run() {
 								finalTarget.selectReveal(selection);
 							}
diff --git a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/wizards/buildpath/newsourcepage/BuildpathModifierDropDownAction.java b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/wizards/buildpath/newsourcepage/BuildpathModifierDropDownAction.java
index 5eec3f3..fb97f7d 100644
--- a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/wizards/buildpath/newsourcepage/BuildpathModifierDropDownAction.java
+++ b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/wizards/buildpath/newsourcepage/BuildpathModifierDropDownAction.java
@@ -34,7 +34,7 @@
     private Menu fMenu;
     /** A list of actions that will be used as 
      * drop down items*/
-    protected List fActions;
+	protected List<BuildpathModifierAction> fActions;
     /** Index of the action that can be executed when clicking directly on the dropdown button.*/
     private int fIndex;
     
@@ -50,7 +50,7 @@
     public BuildpathModifierDropDownAction(BuildpathModifierAction action, String text, String toolTipText) {
         super(action.getOperation(), action.getImageDescriptor(), action.getDisabledImageDescriptor(), 
                 text, toolTipText, IAction.AS_DROP_DOWN_MENU);
-        fActions= new ArrayList();
+		fActions = new ArrayList<BuildpathModifierAction>();
         fActions.add(action);
         fIndex= 0;
     }
@@ -59,7 +59,7 @@
      * Runs the first action of the list of managed actions that is valid.
      */
     public void run() {
-        BuildpathModifierAction action= (BuildpathModifierAction)fActions.get(fIndex);
+		BuildpathModifierAction action = fActions.get(fIndex);
         action.run();
     }
 
@@ -117,7 +117,7 @@
      * @return an array of actions
      */
     public BuildpathModifierAction[] getActions() {
-        return (BuildpathModifierAction[])fActions.toArray(new BuildpathModifierAction[fActions.size()]);
+		return fActions.toArray(new BuildpathModifierAction[fActions.size()]);
     }
     
     /**
@@ -138,7 +138,7 @@
      */
     private void createEntries(Menu menu) {
         for(int i= 0; i < fActions.size(); i++) {
-            IAction action= (IAction)fActions.get(i);
+			IAction action = fActions.get(i);
             addActionToMenu(menu, action);
         }
     }
@@ -160,7 +160,7 @@
      */
     public boolean isValid(List selectedElements, int[] types) throws ModelException {
         for(int i= 0; i < fActions.size(); i++) {
-            BuildpathModifierAction action= (BuildpathModifierAction)fActions.get(i);
+			BuildpathModifierAction action = fActions.get(i);
             if(action.isValid(selectedElements, types)) {
                 fIndex= i;
                 return true;
diff --git a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/wizards/buildpath/newsourcepage/IncludeToBuildpathAction.java b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/wizards/buildpath/newsourcepage/IncludeToBuildpathAction.java
index a3397ec..65647dd 100644
--- a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/wizards/buildpath/newsourcepage/IncludeToBuildpathAction.java
+++ b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/wizards/buildpath/newsourcepage/IncludeToBuildpathAction.java
@@ -21,8 +21,8 @@
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.SubProgressMonitor;
 import org.eclipse.dltk.core.DLTKCore;
-import org.eclipse.dltk.core.IScriptProject;
 import org.eclipse.dltk.core.IProjectFragment;
+import org.eclipse.dltk.core.IScriptProject;
 import org.eclipse.dltk.core.ModelException;
 import org.eclipse.dltk.internal.corext.buildpath.BuildpathModifier;
 import org.eclipse.dltk.internal.ui.wizards.NewWizardMessages;
@@ -172,7 +172,7 @@
 			return;
 
 		// get all the view and editor parts
-		List parts= new ArrayList();
+		List<IWorkbenchPart> parts = new ArrayList<IWorkbenchPart>();
 		IWorkbenchPartReference refs[]= page.getViewReferences();
 		for (int i= 0; i < refs.length; i++) {
 			IWorkbenchPart part= refs[i].getPart(false);
@@ -185,9 +185,7 @@
 				parts.add(refs[i].getPart(false));
 		}
 
-		Iterator itr= parts.iterator();
-		while (itr.hasNext()) {
-			IWorkbenchPart part= (IWorkbenchPart) itr.next();
+		for (IWorkbenchPart part : parts) {
 
 			// get the part's ISetSelectionTarget implementation
 			ISetSelectionTarget target= null;
diff --git a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/wizards/buildpath/newsourcepage/RemoveFromBuildpathAction.java b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/wizards/buildpath/newsourcepage/RemoveFromBuildpathAction.java
index 12f53b1..0882c58 100644
--- a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/wizards/buildpath/newsourcepage/RemoveFromBuildpathAction.java
+++ b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/wizards/buildpath/newsourcepage/RemoveFromBuildpathAction.java
@@ -21,8 +21,8 @@
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.SubProgressMonitor;
 import org.eclipse.dltk.core.IBuildpathEntry;
-import org.eclipse.dltk.core.IScriptProject;
 import org.eclipse.dltk.core.IProjectFragment;
+import org.eclipse.dltk.core.IScriptProject;
 import org.eclipse.dltk.core.ModelException;
 import org.eclipse.dltk.internal.corext.buildpath.BuildpathModifier;
 import org.eclipse.dltk.internal.ui.scriptview.BuildPathContainer;
@@ -246,7 +246,7 @@
 		if (page == null)
 			return;
 		// get all the view and editor parts
-		List parts = new ArrayList();
+		List<IWorkbenchPart> parts = new ArrayList<IWorkbenchPart>();
 		IWorkbenchPartReference refs[] = page.getViewReferences();
 		for (int i = 0; i < refs.length; i++) {
 			IWorkbenchPart part = refs[i].getPart(false);
@@ -258,9 +258,7 @@
 			if (refs[i].getPart(false) != null)
 				parts.add(refs[i].getPart(false));
 		}
-		Iterator itr = parts.iterator();
-		while (itr.hasNext()) {
-			IWorkbenchPart part = (IWorkbenchPart) itr.next();
+		for (IWorkbenchPart part : parts) {
 			// get the part's ISetSelectionTarget implementation
 			ISetSelectionTarget target = null;
 			if (part instanceof ISetSelectionTarget)
