Bug 512814 - Various cleanups

Lamba usages and generification.

Change-Id: I224645c54dd2cdd3793fc6f417b13584888f7dfb
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
diff --git a/org.eclipse.ui.cheatsheets/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.ui.cheatsheets/.settings/org.eclipse.jdt.core.prefs
index 35d82ea..f860a49 100644
--- a/org.eclipse.ui.cheatsheets/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.ui.cheatsheets/.settings/org.eclipse.jdt.core.prefs
@@ -2,8 +2,11 @@
 org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
 org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
 org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
 org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
 org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
 org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
 org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
@@ -50,19 +53,21 @@
 org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
 org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=error
 org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
 org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
 org.eclipse.jdt.core.compiler.problem.nullReference=ignore
 org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
 org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
 org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
 org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
 org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
 org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
 org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
 org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
 org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
 org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
 org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
 org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
@@ -73,7 +78,7 @@
 org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
 org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
 org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
 org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
 org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
 org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/cheatsheets/OpenCheatSheetFromHelpAction.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/cheatsheets/OpenCheatSheetFromHelpAction.java
index 7527c52..843f96d 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/cheatsheets/OpenCheatSheetFromHelpAction.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/cheatsheets/OpenCheatSheetFromHelpAction.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2015 IBM Corporation and others.
+ * Copyright (c) 2004, 2017 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -49,11 +49,6 @@
 	@Override
 	public void run() {
 		// Active help does not run on the UI thread, so we must use syncExec
-		Display.getDefault().syncExec(new Runnable() {
-			@Override
-			public void run() {
-				new OpenCheatSheetAction(cheatsheetID).run();
-			}
-		});
+		Display.getDefault().syncExec(() -> new OpenCheatSheetAction(cheatsheetID).run());
 	}
 }
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/ActionRunner.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/ActionRunner.java
index f0c0f11..46c4099 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/ActionRunner.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/ActionRunner.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2015 IBM Corporation and others.
+ * Copyright (c) 2005, 2017 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,7 +16,6 @@
 import org.eclipse.core.runtime.Status;
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
 import org.eclipse.osgi.util.NLS;
 import org.eclipse.ui.cheatsheets.ICheatSheetAction;
 import org.eclipse.ui.internal.cheatsheets.data.Action;
@@ -38,7 +37,7 @@
 			String message = NLS.bind(Messages.ERROR_FINDING_PLUGIN_FOR_ACTION, (new Object[] {pluginId}));
 			return new Status(IStatus.ERROR, ICheatSheetResource.CHEAT_SHEET_PLUGIN_ID, IStatus.OK, message, null);
 		}
-		Class actionClass;
+		Class<?> actionClass;
 		IAction action;
 		try {
 			actionClass = bundle.loadClass(className);
@@ -55,13 +54,10 @@
 
 		final boolean[] listenerFired = { false };
 		final boolean[] listenerResult = { false };
-		IPropertyChangeListener propertyChangeListener = new IPropertyChangeListener() {
-			@Override
-			public void propertyChange(PropertyChangeEvent event) {
-				if(event.getProperty().equals(IAction.RESULT) && event.getNewValue() instanceof Boolean) {
-					listenerFired[0] = true;
-					listenerResult[0] = ((Boolean)event.getNewValue()).booleanValue();
-				}
+		IPropertyChangeListener propertyChangeListener = event -> {
+			if (event.getProperty().equals(IAction.RESULT) && event.getNewValue() instanceof Boolean) {
+				listenerFired[0] = true;
+				listenerResult[0] = ((Boolean) event.getNewValue()).booleanValue();
 			}
 		};
 
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/CheatSheetHistory.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/CheatSheetHistory.java
index b313a80..1051f85 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/CheatSheetHistory.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/CheatSheetHistory.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2002, 2015 IBM Corporation and others.
+ * Copyright (c) 2002, 2017 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -32,7 +32,7 @@
 
 	private ArrayList<CheatSheetElement> history;
 	private CheatSheetRegistryReader reg;
-	private ListenerList listeners = new ListenerList();
+	private ListenerList<IPropertyListener> listeners = new ListenerList<>();
 
 	public CheatSheetHistory(CheatSheetRegistryReader reg) {
 		this.history = new ArrayList<>(DEFAULT_DEPTH);
@@ -48,9 +48,7 @@
 	}
 
 	private void fireChange() {
-		Object[] array = listeners.getListeners();
-		for (int i = 0; i < array.length; i++) {
-			IPropertyListener element = (IPropertyListener)array[i];
+		for (IPropertyListener element : listeners) {
 			element.propertyChanged(this, 0);
 		}
 	}
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/explorer/TreeExplorerMenu.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/explorer/TreeExplorerMenu.java
index 4a05ec9..5c9b750 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/explorer/TreeExplorerMenu.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/explorer/TreeExplorerMenu.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2015 IBM Corporation and others.
+ * Copyright (c) 2005, 2017 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,7 +16,6 @@
  */
 
 import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuListener;
 import org.eclipse.jface.action.IMenuManager;
 import org.eclipse.jface.action.MenuManager;
 import org.eclipse.jface.viewers.ISelection;
@@ -34,12 +33,7 @@
 		this.explorer = explorer;
 		MenuManager menuMgr = new MenuManager(null);
 		menuMgr.setRemoveAllWhenShown(true);
-		menuMgr.addMenuListener(new IMenuListener() {
-			@Override
-			public void menuAboutToShow(IMenuManager manager) {
-				fillContextMenu(manager);
-			}
-		});
+		menuMgr.addMenuListener(manager -> fillContextMenu(manager));
 		Menu menu = menuMgr.createContextMenu(explorer.getControl());
 		explorer.getControl().setMenu(menu);
 	}
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/model/BlockedTaskFinder.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/model/BlockedTaskFinder.java
index 72449ff..9b0cfac 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/model/BlockedTaskFinder.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/model/BlockedTaskFinder.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2006, 2015 IBM Corporation and others.
+ * Copyright (c) 2006, 2017 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -37,7 +37,7 @@
      * <li> Add the successor and its children to the list if not started
 	 */
 
-	public Set findBlockedTaskChanges(Set<ICompositeCheatSheetTask> stateChangedTasks) {
+	public Set<ICompositeCheatSheetTask> findBlockedTaskChanges(Set<ICompositeCheatSheetTask> stateChangedTasks) {
 		this.stateChangedTasks = stateChangedTasks;
 		impactedTasks = new HashSet<>();
 		visitChangedTasks();
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/model/CompositeCheatSheetModel.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/model/CompositeCheatSheetModel.java
index 36e499c..5f6eb3f 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/model/CompositeCheatSheetModel.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/model/CompositeCheatSheetModel.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2015 IBM Corporation and others.
+ * Copyright (c) 2005, 2017 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -113,12 +113,13 @@
 	 * send events for those also.
 	 */
 	public void sendTaskChangeEvents() {
-		Set blockedStateChanged = new BlockedTaskFinder().findBlockedTaskChanges(stateChangedSet);
-		for (Iterator iter = stateChangedSet.iterator(); iter.hasNext();) {
+		Set<ICompositeCheatSheetTask> blockedStateChanged = new BlockedTaskFinder()
+				.findBlockedTaskChanges(stateChangedSet);
+		for (Iterator<ICompositeCheatSheetTask> iter = stateChangedSet.iterator(); iter.hasNext();) {
 			setChanged();
 			notifyObservers(iter.next());
 		}
-		for (Iterator iter = blockedStateChanged.iterator(); iter.hasNext();) {
+		for (Iterator<ICompositeCheatSheetTask> iter = blockedStateChanged.iterator(); iter.hasNext();) {
 			setChanged();
 			notifyObservers(iter.next());
 		}
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/model/TaskDependencies.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/model/TaskDependencies.java
index bb583ac..c59a4fa 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/model/TaskDependencies.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/model/TaskDependencies.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2015 IBM Corporation and others.
+ * Copyright (c) 2005, 2017 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -112,8 +112,8 @@
 	private void checkForCircularities (IStatusContainer status) {
 		Set<ICompositeCheatSheetTask> tasks = new HashSet<>();
 		// Combine steps 1 + 2
-		for (Iterator idIterator = taskIdMap.values().iterator(); idIterator.hasNext(); ) {
-			AbstractTask nextTask = (AbstractTask)idIterator.next();
+		for (Iterator<AbstractTask> idIterator = taskIdMap.values().iterator(); idIterator.hasNext();) {
+			AbstractTask nextTask = idIterator.next();
 			if (nextTask.getRequiredTasks().length > 0) {
 				tasks.add(nextTask);
 			}
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/views/CheatsheetTaskEditor.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/views/CheatsheetTaskEditor.java
index 37967c8..62a367e 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/views/CheatsheetTaskEditor.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/views/CheatsheetTaskEditor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- *  Copyright (c) 2005, 2015 IBM Corporation and others.
+ *  Copyright (c) 2005, 2017 IBM Corporation and others.
  *  All rights reserved. This program and the accompanying materials
  *  are made available under the terms of the Eclipse Public License v1.0
  *  which accompanies this distribution, and is available at
@@ -49,11 +49,11 @@
 	@Override
 	public void setInput(IEditableTask task, IMemento memento) {
 		this.task = task;
-		Dictionary params = task.getParameters();
-		String id = (String)params.get(ICompositeCheatsheetTags.CHEATSHEET_TASK_ID);
-		String path = (String)params.get(ICompositeCheatsheetTags.CHEATSHEET_TASK_PATH);
+		Dictionary<String, String> params = task.getParameters();
+		String id = params.get(ICompositeCheatsheetTags.CHEATSHEET_TASK_ID);
+		String path = params.get(ICompositeCheatsheetTags.CHEATSHEET_TASK_PATH);
 		boolean showIntro = true;
-		String showIntroParam = (String)params.get(ICompositeCheatsheetTags.CHEATSHEET_TASK_SHOW_INTRO);
+		String showIntroParam = params.get(ICompositeCheatsheetTags.CHEATSHEET_TASK_SHOW_INTRO);
 		if (showIntroParam != null) {
 			showIntro = showIntroParam.equalsIgnoreCase("true"); //$NON-NLS-1$
 		}
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/views/CompositeCheatSheetPage.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/views/CompositeCheatSheetPage.java
index 76cddda..8d72475 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/views/CompositeCheatSheetPage.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/views/CompositeCheatSheetPage.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2015 IBM Corporation and others.
+ * Copyright (c) 2005, 2017 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -184,12 +184,12 @@
 		super.dispose();
 	}
 
-	private void setInputModel(CompositeCheatSheetModel model, Map layout) {
+	private void setInputModel(CompositeCheatSheetModel model, Map<String, String> layout) {
 		this.model = model;
 		mform.getForm().setText(ViewUtilities.escapeForLabel(model.getName()));
 		String explorerId = model.getTaskExplorerId();
 		setCurrentExplorerFromId(explorerId);
-		String selectedTaskId = (String) layout.get(ICompositeCheatsheetTags.SELECTED_TASK);
+		String selectedTaskId = layout.get(ICompositeCheatsheetTags.SELECTED_TASK);
 		ICompositeCheatSheetTask selectedTask= null;
 		if (selectedTaskId != null) {
 			selectedTask = model.getDependencies().getTask(selectedTaskId);
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/views/TaskEditorManager.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/views/TaskEditorManager.java
index a181268..a759e50 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/views/TaskEditorManager.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/views/TaskEditorManager.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2015 IBM Corporation and others.
+ * Copyright (c) 2005, 2017 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -60,7 +60,7 @@
 			}
 			try {
 				if (extClass != null) {
-					Constructor c = extClass.getConstructor(new Class[0]);
+					Constructor<?> c = extClass.getConstructor(new Class[0]);
 					editorInstance = (TaskEditor) c.newInstance();
 				}
 			} catch (Exception e) {
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/views/TaskExplorerManager.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/views/TaskExplorerManager.java
index aea2d05..af055f2 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/views/TaskExplorerManager.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/views/TaskExplorerManager.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2015 IBM Corporation and others.
+ * Copyright (c) 2005, 2017 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -65,7 +65,7 @@
 			}
 			try {
 				if (extClass != null) {
-					Constructor c = extClass.getConstructor();
+					Constructor<?> c = extClass.getConstructor();
 					explorerInstance = (TaskExplorer) c.newInstance();
 				}
 			} catch (Exception e) {
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/data/CheatSheetSaveHelper.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/data/CheatSheetSaveHelper.java
index bb33dee..b5668f4 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/data/CheatSheetSaveHelper.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/data/CheatSheetSaveHelper.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2002, 2015 IBM Corporation and others.
+ * Copyright (c) 2002, 2017 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -279,13 +279,13 @@
 	}
 
 	private void addListOfStringsToMemento(IMemento memento, Properties properties, String key) {
-		List list = (List)properties.get(key);
+		List<String> list = (List<String>) properties.get(key);
 		if (list == null) {
 			return;
 		}
-		for (Iterator iter = list.iterator(); iter.hasNext();) {
+		for (Iterator<String> iter = list.iterator(); iter.hasNext();) {
 			IMemento childMemento = memento.createChild(key);
-			childMemento.putString(IParserTags.ITEM,(String)iter.next());
+			childMemento.putString(IParserTags.ITEM, iter.next());
 		}
 	}
 
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/data/Item.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/data/Item.java
index c26b4fa..9ebe927 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/data/Item.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/data/Item.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2002, 2015 IBM Corporation and others.
+ * Copyright (c) 2002, 2017 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,11 +13,13 @@
 import java.util.ArrayList;
 import java.util.Iterator;
 
+import org.eclipse.ui.cheatsheets.AbstractItemExtensionElement;
+
 public class Item extends Intro implements IExecutableItem, IPerformWhenItem, ISubItemItem {
 	private String title;
 	private boolean skip;
 	private boolean dialog;
-	private ArrayList itemExtensions;
+	private ArrayList<AbstractItemExtensionElement[]> itemExtensions;
 
 	private AbstractExecutable executable;
 	private PerformWhen performWhen;
@@ -105,7 +107,7 @@
 	 * Sets the item extensions for this item.
 	 * @param exts the extensions to set
 	 */
-	public void setItemExtensions(ArrayList exts) {
+	public void setItemExtensions(ArrayList<AbstractItemExtensionElement[]> exts) {
 		this.itemExtensions = exts;
 	}
 
@@ -113,7 +115,7 @@
 	 * Returns the item extensions, if any, for this item,.
 	 * @return list of the extensions or <code>null</code>
 	 */
-	public ArrayList getItemExtensions() {
+	public ArrayList<AbstractItemExtensionElement[]> getItemExtensions() {
 		return itemExtensions;
 	}
 
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/dialogs/CheatSheetCategoryBasedSelectionDialog.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/dialogs/CheatSheetCategoryBasedSelectionDialog.java
index a33c554..99efb55 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/dialogs/CheatSheetCategoryBasedSelectionDialog.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/dialogs/CheatSheetCategoryBasedSelectionDialog.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- *  Copyright (c) 2002, 2015 IBM Corporation and others.
+ *  Copyright (c) 2002, 2017 IBM Corporation and others.
  *  All rights reserved. This program and the accompanying materials
  *  are made available under the terms of the Eclipse Public License v1.0
  *  which accompanies this distribution, and is available at
@@ -24,9 +24,7 @@
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.jface.dialogs.IDialogSettings;
 import org.eclipse.jface.dialogs.TrayDialog;
-import org.eclipse.jface.viewers.DoubleClickEvent;
 import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.IDoubleClickListener;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.ISelectionChangedListener;
 import org.eclipse.jface.viewers.IStructuredSelection;
@@ -284,18 +282,14 @@
 			createShowAllButton(outerContainer);
 
 		// Add double-click listener
-		treeViewer.addDoubleClickListener(new IDoubleClickListener() {
-			@Override
-			public void doubleClick(DoubleClickEvent event) {
-				IStructuredSelection selection = (IStructuredSelection)event.getSelection();
-				Object obj = selection.getFirstElement();
-				if (obj instanceof CheatSheetCollectionElement) {
-					boolean state = treeViewer.getExpandedState(obj);
-					treeViewer.setExpandedState(obj, !state);
-				}
-				else {
-					okPressed();
-				}
+		treeViewer.addDoubleClickListener(event -> {
+			IStructuredSelection selection = (IStructuredSelection) event.getSelection();
+			Object obj = selection.getFirstElement();
+			if (obj instanceof CheatSheetCollectionElement) {
+				boolean state = treeViewer.getExpandedState(obj);
+				treeViewer.setExpandedState(obj, !state);
+			} else {
+				okPressed();
 			}
 		});
 
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/registry/CheatSheetCollectionElement.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/registry/CheatSheetCollectionElement.java
index 265bcd0..e640e06 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/registry/CheatSheetCollectionElement.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/registry/CheatSheetCollectionElement.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2002, 2015 IBM Corporation and others.
+ * Copyright (c) 2002, 2017 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -96,8 +96,8 @@
 		}
 		if (!recursive)
 			return null;
-		for (Iterator iterator = childCollections.iterator(); iterator.hasNext();) {
-			CheatSheetCollectionElement child = (CheatSheetCollectionElement) iterator.next();
+		for (Iterator<CheatSheetCollectionElement> iterator = childCollections.iterator(); iterator.hasNext();) {
+			CheatSheetCollectionElement child = iterator.next();
 			CheatSheetElement result = child.findCheatSheet(searchId, true);
 			if (result != null)
 				return result;
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/registry/CheatSheetElement.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/registry/CheatSheetElement.java
index 17ade33..7d621f8 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/registry/CheatSheetElement.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/registry/CheatSheetElement.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2002, 2015 IBM Corporation and others.
+ * Copyright (c) 2002, 2017 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -160,7 +160,7 @@
 			return null;
 		}
 
-		Class extClass = null;
+		Class<?> extClass = null;
 		CheatSheetListener listener = null;
 		String pluginId = configurationElement.getContributor().getName();
 
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/registry/CheatSheetItemExtensionElement.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/registry/CheatSheetItemExtensionElement.java
index 76cf865..626dcb7 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/registry/CheatSheetItemExtensionElement.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/registry/CheatSheetItemExtensionElement.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2002, 2015 IBM Corporation and others.
+ * Copyright (c) 2002, 2017 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -33,7 +33,7 @@
 	private String className;
 	private String itemAttribute;
 	private IConfigurationElement configurationElement;
-	private final Class[] stringArray = { String.class };
+	private final Class<?>[] stringArray = { String.class };
 
 	/**
 	 *	Create a new instance of this class
@@ -123,7 +123,7 @@
 		}
 		try {
 			if (extClass != null) {
-				Constructor c = extClass.getConstructor(stringArray);
+				Constructor<?> c = extClass.getConstructor(stringArray);
 				extElement = (AbstractItemExtensionElement) c.newInstance(itemAttribute);
 			}
 		} catch (Exception e) {
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/registry/CheatSheetRegistryReader.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/registry/CheatSheetRegistryReader.java
index fb2becf..8bece3e 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/registry/CheatSheetRegistryReader.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/registry/CheatSheetRegistryReader.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2002, 2015 IBM Corporation and others.
+ * Copyright (c) 2002, 2017 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -439,9 +439,9 @@
 	 */
 	private void finishCheatSheets() {
 		if (deferCheatSheets != null) {
-			Iterator iter = deferCheatSheets.iterator();
+			Iterator<CheatSheetElement> iter = deferCheatSheets.iterator();
 			while (iter.hasNext()) {
-				CheatSheetElement cheatsheet = (CheatSheetElement) iter.next();
+				CheatSheetElement cheatsheet = iter.next();
 				IConfigurationElement config = cheatsheet.getConfigurationElement();
 				finishCheatSheet(cheatsheet, config, cheatsheets);
 			}
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/CheatSheetPage.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/CheatSheetPage.java
index 25865c8..cbff661 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/CheatSheetPage.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/CheatSheetPage.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2002, 2015 IBM Corporation and others.
+ * Copyright (c) 2002, 2017 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -221,8 +221,8 @@
 
 	@Override
 	public void initialized() {
-		for (Iterator iter = viewItemList.iterator(); iter.hasNext();) {
-			ViewItem item = (ViewItem) iter.next();
+		for (Iterator<ViewItem> iter = viewItemList.iterator(); iter.hasNext();) {
+			ViewItem item = iter.next();
 			item.initialized();
 		}
 	}
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/CheatSheetViewer.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/CheatSheetViewer.java
index 651981d..1cf50ef 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/CheatSheetViewer.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/CheatSheetViewer.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- *  Copyright (c) 2002, 2015 IBM Corporation and others.
+ *  Copyright (c) 2002, 2017 IBM Corporation and others.
  *  All rights reserved. This program and the accompanying materials
  *  are made available under the terms of the Eclipse Public License v1.0
  *  which accompanies this distribution, and is available at
@@ -36,15 +36,12 @@
 import org.eclipse.jface.window.Window;
 import org.eclipse.osgi.util.NLS;
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
 import org.eclipse.swt.graphics.Cursor;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Listener;
 import org.eclipse.swt.widgets.Menu;
@@ -102,7 +99,7 @@
 	private ViewItem currentItem;
 
 	//Lists
-	private ArrayList<String> expandRestoreList = new ArrayList<String>();
+	private ArrayList<String> expandRestoreList = new ArrayList<>();
 	private ArrayList<ViewItem> viewItemList = new ArrayList<>();
 
 	//Composites
@@ -636,12 +633,7 @@
 		layout.numColumns = 1;
 		control.setLayout(layout);
 
-		control.addDisposeListener(new DisposeListener(){
-			@Override
-			public void widgetDisposed(DisposeEvent e) {
-				dispose();
-			}
-		});
+		control.addDisposeListener(e -> dispose());
 
 		showStartPage();
 
@@ -687,18 +679,15 @@
 			control.setVisible(false);
 			Display.getCurrent().removeFilter(SWT.Show, listener);
 
-			helpPart.getControl().addListener(SWT.Dispose, new Listener() {
-				@Override
-				public void handleEvent(Event event) {
-					control.setVisible(true);
-					Display.getCurrent().addFilter(SWT.Show, listener);
-					if (preTrayManager != null) {
-						loadState();   // Load from the tray manager
-						stateManager = preTrayManager;
-						preTrayManager = null;
-					}
-					dialogReturnCode = dialog.getReturnCode();
+			helpPart.getControl().addListener(SWT.Dispose, event -> {
+				control.setVisible(true);
+				Display.getCurrent().addFilter(SWT.Show, listener);
+				if (preTrayManager != null) {
+					loadState(); // Load from the tray manager
+					stateManager = preTrayManager;
+					preTrayManager = null;
 				}
+				dialogReturnCode = dialog.getReturnCode();
 			});
 		}
 	}
@@ -798,12 +787,9 @@
 		 * step is this plugin is present.
 		 */
 		if (!inDialog && isInDialogItem() && (Platform.getBundle("org.eclipse.help.ui") != null)) { //$NON-NLS-1$
-			listener = new Listener() {
-				@Override
-				public void handleEvent(Event event) {
-					if (isTrayDialog(event.widget)) {
-						dialogOpened((TrayDialog)((Shell)event.widget).getData());
-					}
+			listener = event -> {
+				if (isTrayDialog(event.widget)) {
+					dialogOpened((TrayDialog) ((Shell) event.widget).getData());
 				}
 			};
 			Display.getCurrent().addFilter(SWT.Show, listener);
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/CoreItem.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/CoreItem.java
index 43a06a7..037d49f 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/CoreItem.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/CoreItem.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2002, 2015 IBM Corporation and others.
+ * Copyright (c) 2002, 2017 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -360,8 +360,8 @@
 		//loop throught the number of sub items, make a new composite for each sub item.
 		//Add the spacer, the label, then the buttons that are applicable for each sub item.
 		int i=0;
-		for (Iterator iter = item.getSubItems().iterator(); iter.hasNext(); i++) {
-			AbstractSubItem subItem = (AbstractSubItem)iter.next();
+		for (Iterator<AbstractSubItem> iter = item.getSubItems().iterator(); iter.hasNext(); i++) {
+			AbstractSubItem subItem = iter.next();
 			if( subItem instanceof RepeatedSubItem ) {
 
 				//Get the sub item to add.
@@ -451,7 +451,7 @@
 		//Instantiate the list to store the sub item composites.
 		listOfSubItemCompositeHolders = new ArrayList<>(20);
 
-		ArrayList sublist = item.getSubItems();
+		ArrayList<AbstractSubItem> sublist = item.getSubItems();
 
 		createSubItemButtonComposite();
 
@@ -556,10 +556,10 @@
 		super.setIncomplete();
 
 		//check for sub items and reset their icons.
-		ArrayList l = getListOfSubItemCompositeHolders();
+		ArrayList<SubItemCompositeHolder> l = getListOfSubItemCompositeHolders();
 		if(l != null){
 			for(int j=0; j<l.size(); j++){
-				SubItemCompositeHolder s = (SubItemCompositeHolder)l.get(j);
+				SubItemCompositeHolder s = l.get(j);
 				if(s.isCompleted() || s.isSkipped())
 					s.getCheckDoneLabel().setVisible(false); //setImage(null);
 				if(s.getStartButton() != null) {
@@ -672,12 +672,12 @@
 
 	@Override
 	protected void setFocus() {
-		ArrayList list = getListOfSubItemCompositeHolders();
+		ArrayList<SubItemCompositeHolder> list = getListOfSubItemCompositeHolders();
 		Control subitemLabel = null;
 		SubItemCompositeHolder holder = null;
         if (list != null) {
-        	for (Iterator iter = list.iterator(); iter.hasNext() && subitemLabel == null ;) {
-        		holder = (SubItemCompositeHolder)iter.next();
+			for (Iterator<SubItemCompositeHolder> iter = list.iterator(); iter.hasNext() && subitemLabel == null;) {
+				holder = iter.next();
         		if (!holder.isCompleted() && !holder.isSkipped()) {
         			subitemLabel = holder.getSubitemLabel();
         		}
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/ErrorPage.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/ErrorPage.java
index 0bfae11..be44693 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/ErrorPage.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/ErrorPage.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- *  Copyright (c) 2002, 2015 IBM Corporation and others.
+ *  Copyright (c) 2002, 2017 IBM Corporation and others.
  *  All rights reserved. This program and the accompanying materials
  *  are made available under the terms of the Eclipse Public License v1.0
  *  which accompanies this distribution, and is available at
@@ -60,7 +60,7 @@
 		}
 
 		public List<IStatus> getSortedStatus() {
-			List<IStatus> result = new ArrayList<IStatus>();
+			List<IStatus> result = new ArrayList<>();
 			result.addAll(errors);
 			result.addAll(warnings);
 			result.addAll(info);
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/ViewItem.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/ViewItem.java
index 80aa925..fd9b44e 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/ViewItem.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/ViewItem.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2002, 2015 IBM Corporation and others.
+ * Copyright (c) 2002, 2017 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -130,7 +130,7 @@
 		// handle item extensions here
 		// check number of extensions for this item and adjust layout accordingly
 		int number = 0;
-		ArrayList itemExts = item.getItemExtensions();
+		ArrayList<AbstractItemExtensionElement[]> itemExts = item.getItemExtensions();
 
 		if((itemExts != null && itemExts.size() > 0) || item.getContextId() != null || item.getHref() != null) {
 			// Set up the title composite for the item.
@@ -140,7 +140,7 @@
 
 		if(itemExts != null) {
 			for (int g = 0; g < itemExts.size(); g++) {
-				AbstractItemExtensionElement[] eea = (AbstractItemExtensionElement[]) itemExts.get(g);
+				AbstractItemExtensionElement[] eea = itemExts.get(g);
 				number += eea.length;
 				for (int x = 0; x < eea.length; x++) {
 					eea[x].createControl(titleComposite);
@@ -290,10 +290,10 @@
 		if (regularFont != null)
 			regularFont.dispose();
 
-		ArrayList itemExts = item.getItemExtensions();
+		ArrayList<AbstractItemExtensionElement[]> itemExts = item.getItemExtensions();
 		if (itemExts != null) {
 			for (int g = 0; g < itemExts.size(); g++) {
-				AbstractItemExtensionElement[] eea = (AbstractItemExtensionElement[]) itemExts.get(g);
+				AbstractItemExtensionElement[] eea = itemExts.get(g);
 				for (int x = 0; x < eea.length; x++) {
 					eea[x].dispose();
 				}
@@ -470,8 +470,9 @@
 	void setButtonsVisible(boolean isVisible) {
 		if (buttonExpanded != isVisible) {
 			if (listOfSubItemCompositeHolders != null) {
-				for (Iterator iter = listOfSubItemCompositeHolders.iterator(); iter.hasNext(); ){
-					((SubItemCompositeHolder)iter.next()).setButtonsVisible(isVisible);
+				for (Iterator<SubItemCompositeHolder> iter = listOfSubItemCompositeHolders.iterator(); iter
+						.hasNext();) {
+					iter.next().setButtonsVisible(isVisible);
 				}
 			} else if (buttonComposite != null) {
 				buttonComposite.setVisible(isVisible);
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/provisional/cheatsheets/ICompositeCheatSheetTask.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/provisional/cheatsheets/ICompositeCheatSheetTask.java
index 16a8384..9b72609 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/provisional/cheatsheets/ICompositeCheatSheetTask.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/provisional/cheatsheets/ICompositeCheatSheetTask.java
@@ -58,7 +58,7 @@
 	 * @return the parameter names and values as specified in the
 	 * composite cheatsheet content file.
 	 */
-	public Dictionary getParameters();
+	public Dictionary<String, String> getParameters();
 	/**
 	 * Returns the description of the task.
 	 * @return a plain String, or XML markup that can
diff --git a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/CustomizationContentsArea.java b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/CustomizationContentsArea.java
index 2f4d9ab..c0d450b 100644
--- a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/CustomizationContentsArea.java
+++ b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/CustomizationContentsArea.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2006, 2014 IBM Corporation and others.
+ * Copyright (c) 2006, 2017 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -27,23 +27,18 @@
 import org.eclipse.core.runtime.preferences.IEclipsePreferences;
 import org.eclipse.core.runtime.preferences.InstanceScope;
 import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuListener;
 import org.eclipse.jface.action.IMenuManager;
 import org.eclipse.jface.action.MenuManager;
 import org.eclipse.jface.action.Separator;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
 import org.eclipse.jface.viewers.CheckboxTableViewer;
 import org.eclipse.jface.viewers.ComboBoxCellEditor;
 import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
 import org.eclipse.jface.viewers.IStructuredContentProvider;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.ITableLabelProvider;
 import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
 import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.jface.viewers.TableViewer;
 import org.eclipse.jface.viewers.Viewer;
@@ -57,8 +52,6 @@
 import org.eclipse.swt.dnd.DragSourceListener;
 import org.eclipse.swt.dnd.Transfer;
 import org.eclipse.swt.dnd.TransferData;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.graphics.Image;
@@ -728,12 +721,7 @@
 
 	public boolean performOk() {
 		saveData();
-		BusyIndicator.showWhile(shell.getDisplay(), new Runnable() {
-			@Override
-			public void run() {
-				restartIntro();
-			}
-		});
+		BusyIndicator.showWhile(shell.getDisplay(), () -> restartIntro());
 		return true;
 	}
 
@@ -874,14 +862,11 @@
 		themes.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
 		themes.setContentProvider(contentProvider);
 		themes.setLabelProvider(labelProvider);
-		themes.addSelectionChangedListener(new ISelectionChangedListener() {
-			@Override
-			public void selectionChanged(SelectionChangedEvent e) {
-				Object sel = ((StructuredSelection) e.getSelection()).getFirstElement();
-				introTheme = (IntroTheme) sel;
-				themePreview.redraw();
-				enableFontsButton();
-			}
+		themes.addSelectionChangedListener(e -> {
+			Object sel = ((StructuredSelection) e.getSelection()).getFirstElement();
+			introTheme = (IntroTheme) sel;
+			themePreview.redraw();
+			enableFontsButton();
 		});
 		loadThemes();
 		Label previewLabel = new Label(rightColumn, SWT.NULL);
@@ -891,19 +876,15 @@
 		gd.widthHint = 160+20;
 		gd.heightHint = 120+20;
 		themePreview.setLayoutData(gd);
-		themePreview.addPaintListener(new PaintListener() {
-
-			@Override
-			public void paintControl(PaintEvent e) {
-				if (introTheme == null)
-					return;
-				Image bgImage = introTheme.getPreviewImage();
-				if (bgImage == null)
-					return;
-				//Rectangle carea = themePreview.getClientArea();
-				Rectangle ibounds = bgImage.getBounds();
-				e.gc.drawImage(bgImage, 0, 0, ibounds.width, ibounds.height, 10, 10, 160, 120);
-			}
+		themePreview.addPaintListener(e -> {
+			if (introTheme == null)
+				return;
+			Image bgImage = introTheme.getPreviewImage();
+			if (bgImage == null)
+				return;
+			//Rectangle carea = themePreview.getClientArea();
+			Rectangle ibounds = bgImage.getBounds();
+			e.gc.drawImage(bgImage, 0, 0, ibounds.width, ibounds.height, 10, 10, 160, 120);
 		});
 		Label label = new Label(container, SWT.NULL);
 		label.setText(Messages.WelcomeCustomizationPreferencePage_rootpages);
@@ -932,14 +913,10 @@
 		gd = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
 		gd.horizontalSpan = 2;
 		rootPages.getControl().setLayoutData(gd);
-		rootPages.addCheckStateListener(new ICheckStateListener() {
-
-			@Override
-			public void checkStateChanged(CheckStateChangedEvent event) {
-				RootPage page = (RootPage) event.getElement();
-				boolean checked = event.getChecked();
-				onPageChecked(page.id, checked);
-			}
+		rootPages.addCheckStateListener(event -> {
+			RootPage page = (RootPage) event.getElement();
+			boolean checked = event.getChecked();
+			onPageChecked(page.id, checked);
 		});
 		item.setControl(container);
 	}
@@ -1013,13 +990,7 @@
 		manager.createContextMenu(viewer.getControl());
 		viewer.getControl().setMenu(manager.getMenu());
 		manager.setRemoveAllWhenShown(true);
-		manager.addMenuListener(new IMenuListener() {
-
-			@Override
-			public void menuAboutToShow(IMenuManager manager) {
-				fillPopupMenu(manager, viewer);
-			}
-		});
+		manager.addMenuListener(manager1 -> fillPopupMenu(manager1, viewer));
 	}
 
 	private void addDNDSupport(TableViewer viewer) {