Fix warnings in core.manipulation.

Change-Id: I5ec2e13af147eb60d71e0aa59fc123be10ae8002
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
diff --git a/core/plugins/org.eclipse.dltk.core.manipulation/.settings/org.eclipse.jdt.core.prefs b/core/plugins/org.eclipse.dltk.core.manipulation/.settings/org.eclipse.jdt.core.prefs
index 0c68a61..b5c01d7 100644
--- a/core/plugins/org.eclipse.dltk.core.manipulation/.settings/org.eclipse.jdt.core.prefs
+++ b/core/plugins/org.eclipse.dltk.core.manipulation/.settings/org.eclipse.jdt.core.prefs
@@ -1,7 +1,104 @@
 eclipse.preferences.version=1
+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.targetPlatform=1.8
 org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
 org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+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=warning
+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=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=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
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+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.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
+org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
 org.eclipse.jdt.core.compiler.source=1.8
diff --git a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/core/manipulation/ScriptManipulationPlugin.java b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/core/manipulation/ScriptManipulationPlugin.java
index 615e5ee..52c5e12 100644
--- a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/core/manipulation/ScriptManipulationPlugin.java
+++ b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/core/manipulation/ScriptManipulationPlugin.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 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
@@ -22,7 +22,7 @@
  */
 public class ScriptManipulationPlugin extends Plugin {
 
-	//The shared instance.
+	// The shared instance.
 	private static ScriptManipulationPlugin fgDefault;
 
 	/**
@@ -32,16 +32,12 @@
 		fgDefault = this;
 	}
 
-	/* (non-Scriptdoc)
-	 * @see org.eclipse.core.runtime.Plugin#start(org.osgi.framework.BundleContext)
-	 */
+	@Override
 	public void start(BundleContext context) throws Exception {
 		super.start(context);
 	}
 
-	/* (non-Scriptdoc)
-	 * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
-	 */
+	@Override
 	public void stop(BundleContext context) throws Exception {
 		super.stop(context);
 		fgDefault = null;
@@ -73,12 +69,13 @@
 			logErrorMessage(message);
 			return;
 		}
-		MultiStatus multi= new MultiStatus(getPluginId(), IStatusConstants.INTERNAL_ERROR, message, null);
+		MultiStatus multi = new MultiStatus(getPluginId(), IStatusConstants.INTERNAL_ERROR, message, null);
 		multi.add(status);
 		log(multi);
 	}
 
 	public static void log(Throwable e) {
-		log(new Status(IStatus.ERROR, getPluginId(), IStatusConstants.INTERNAL_ERROR, ScriptManipulationMessages.ScriptManipulationMessages_internalError, e));
+		log(new Status(IStatus.ERROR, getPluginId(), IStatusConstants.INTERNAL_ERROR,
+				ScriptManipulationMessages.ScriptManipulationMessages_internalError, e));
 	}
 }
diff --git a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/core/refactoring/descriptors/RefactoringDescriptorUtil.java b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/core/refactoring/descriptors/RefactoringDescriptorUtil.java
index 1a8af0d..f044d76 100644
--- a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/core/refactoring/descriptors/RefactoringDescriptorUtil.java
+++ b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/core/refactoring/descriptors/RefactoringDescriptorUtil.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2016 xored software, Inc. and others.
+ * Copyright (c) 2016, 2017 xored software, Inc. 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,8 +27,8 @@
 
 public class RefactoringDescriptorUtil {
 
-	private static final String LOWER_CASE_FALSE= Boolean.FALSE.toString().toLowerCase();
-	private static final String LOWER_CASE_TRUE= Boolean.TRUE.toString().toLowerCase();
+	private static final String LOWER_CASE_FALSE = Boolean.FALSE.toString().toLowerCase();
+	private static final String LOWER_CASE_TRUE = Boolean.TRUE.toString().toLowerCase();
 
 	/**
 	 * Converts the specified element to an input handle.
@@ -37,15 +37,15 @@
 	 *            the project, or <code>null</code> for the workspace
 	 * @param element
 	 *            the element
-	 * @return a corresponding input handle.
-	 *            Note: if the given project is not the ModelElement's project, then the full handle is returned
+	 * @return a corresponding input handle. Note: if the given project is not the
+	 *         ModelElement's project, then the full handle is returned
 	 */
 	public static String elementToHandle(final String project, final IModelElement element) {
-		final String handle= element.getHandleIdentifier();
-		if (project != null && ! (element instanceof IScriptProject)) {
-			IScriptProject javaProject= element.getScriptProject();
+		final String handle = element.getHandleIdentifier();
+		if (project != null && !(element instanceof IScriptProject)) {
+			IScriptProject javaProject = element.getScriptProject();
 			if (project.equals(javaProject.getElementName())) {
-				final String id= javaProject.getHandleIdentifier();
+				final String id = javaProject.getHandleIdentifier();
 				return handle.substring(id.length());
 			}
 		}
@@ -60,11 +60,11 @@
 	 * @param resourcePath
 	 *            the resource
 	 *
-	 * @return the input handle
-	 *            Note: if the given project is not the resource's project, then the full handle is returned
+	 * @return the input handle Note: if the given project is not the resource's
+	 *         project, then the full handle is returned
 	 */
 	public static String resourcePathToHandle(final String project, final IPath resourcePath) {
-		if (project != null && ! "".equals(project) && resourcePath.segmentCount() != 1) //$NON-NLS-1$
+		if (project != null && !"".equals(project) && resourcePath.segmentCount() != 1) //$NON-NLS-1$
 			if (resourcePath.segment(0).equals(project)) {
 				return resourcePath.removeFirstSegments(1).toPortableString();
 			}
@@ -86,30 +86,32 @@
 	 * @return the corresponding java element, or <code>null</code> if no such
 	 *         element exists
 	 */
-	public static IModelElement handleToElement(final WorkingCopyOwner owner, final String project, final String handle, final boolean check) {
-		IModelElement element= null;
+	public static IModelElement handleToElement(final WorkingCopyOwner owner, final String project, final String handle,
+			final boolean check) {
+		IModelElement element = null;
 		if (owner != null)
-			element= DLTKCore.create(handle, owner);
+			element = DLTKCore.create(handle, owner);
 		else
-			element= DLTKCore.create(handle);
+			element = DLTKCore.create(handle);
 		if (element == null && project != null) {
-			final IScriptProject javaProject= DLTKCore.create(ResourcesPlugin.getWorkspace().getRoot()).getScriptProject(project);
-			final String identifier= javaProject.getHandleIdentifier();
+			final IScriptProject javaProject = DLTKCore.create(ResourcesPlugin.getWorkspace().getRoot())
+					.getScriptProject(project);
+			final String identifier = javaProject.getHandleIdentifier();
 			if (owner != null)
-				element= DLTKCore.create(identifier + handle, owner);
+				element = DLTKCore.create(identifier + handle, owner);
 			else
-				element= DLTKCore.create(identifier + handle);
+				element = DLTKCore.create(identifier + handle);
 		}
 		if (check && element instanceof IMethod) {
 			/*
-			 * Resolve the method based on simple names of parameter types
-			 * (to accommodate for different qualifications when refactoring is e.g.
-			 * recorded in source but applied on binary method):
+			 * Resolve the method based on simple names of parameter types (to accommodate
+			 * for different qualifications when refactoring is e.g. recorded in source but
+			 * applied on binary method):
 			 */
-			final IMethod method= (IMethod) element;
-			final IMethod[] methods= method.getDeclaringType().findMethods(method);
+			final IMethod method = (IMethod) element;
+			final IMethod[] methods = method.getDeclaringType().findMethods(method);
 			if (methods != null && methods.length > 0)
-				element= methods[0];
+				element = methods[0];
 		}
 		if (element != null && (!check || element.exists()))
 			return element;
@@ -118,9 +120,8 @@
 
 	/**
 	 * Converts an input handle with the given prefix back to the corresponding
-	 * resource.
-	 * WARNING: this method resolves the handle in the current workspace, since
-	 * the type of the resource (file/folder) cannot be determined from the
+	 * resource. WARNING: this method resolves the handle in the current workspace,
+	 * since the type of the resource (file/folder) cannot be determined from the
 	 * handle alone (path never has a trailing separator).
 	 *
 	 * @param project
@@ -128,14 +129,14 @@
 	 * @param handle
 	 *            the input handle
 	 *
-	 * @return the corresponding resource, or <code>null</code> if no such
-	 *         resource exists
+	 * @return the corresponding resource, or <code>null</code> if no such resource
+	 *         exists
 	 */
 	public static IResource handleToResource(final String project, final String handle) {
-		final IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot();
+		final IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
 		if ("".equals(handle)) //$NON-NLS-1$
 			return null;
-		final IPath path= Path.fromPortableString(handle);
+		final IPath path = Path.fromPortableString(handle);
 		if (path == null)
 			return null;
 		if (project != null && !"".equals(project)) //$NON-NLS-1$
@@ -152,12 +153,12 @@
 	 * @param handle
 	 *            the input handle
 	 *
-	 * @return the corresponding resource path.
-	 *         Note: if the given handle is absolute, the project is not used to resolve.
+	 * @return the corresponding resource path. Note: if the given handle is
+	 *         absolute, the project is not used to resolve.
 	 */
 	public static IPath handleToResourcePath(final String project, final String handle) {
-		final IPath path= Path.fromPortableString(handle);
-		if (project != null && !"".equals(project) && ! path.isAbsolute()) //$NON-NLS-1$
+		final IPath path = Path.fromPortableString(handle);
+		if (project != null && !"".equals(project) && !path.isAbsolute()) //$NON-NLS-1$
 			return new Path(project).append(path).makeAbsolute();
 		return path;
 	}
@@ -165,56 +166,75 @@
 	/**
 	 * Retrieves a {@link String} attribute from map.
 	 *
-	 * @param map the map with <code>&lt;String, String&gt;</code> mapping
-	 * @param attribute the key in the map
-	 * @param allowNull if <code>true</code> a <code>null</code> will be returned if the attribute does not exist
+	 * @param map
+	 *            the map with <code>&lt;String, String&gt;</code> mapping
+	 * @param attribute
+	 *            the key in the map
+	 * @param allowNull
+	 *            if <code>true</code> a <code>null</code> will be returned if the
+	 *            attribute does not exist
 	 * @return the value of the attribute
 	 *
-	 * @throws IllegalArgumentException if the value of the attribute is not a {@link String} or allowNull is <code>false</code> and the attribute does not exist
+	 * @throws IllegalArgumentException
+	 *             if the value of the attribute is not a {@link String} or
+	 *             allowNull is <code>false</code> and the attribute does not exist
 	 */
-	public static String getString(Map map, String attribute, boolean allowNull) throws IllegalArgumentException {
-		Object object= map.get(attribute);
+	public static String getString(Map<String, String> map, String attribute, boolean allowNull)
+			throws IllegalArgumentException {
+		Object object = map.get(attribute);
 		if (object == null) {
 			if (allowNull)
 				return null;
 			throw new IllegalArgumentException("The map does not contain the attribute '" + attribute + "'"); //$NON-NLS-1$//$NON-NLS-2$
 		}
 		if (object instanceof String) {
-			String value= (String) object;
+			String value = (String) object;
 			return value;
 		}
-		throw new IllegalArgumentException("The provided map does not contain a string for attribute '" + attribute + "'"); //$NON-NLS-1$ //$NON-NLS-2$
+		throw new IllegalArgumentException(
+				"The provided map does not contain a string for attribute '" + attribute + "'"); //$NON-NLS-1$ //$NON-NLS-2$
 	}
 
 	/**
 	 * Retrieves a {@link String} attribute from map.
 	 *
-	 * @param map the map with <code>&lt;String, String&gt;</code> mapping
-	 * @param attribute the key in the map
+	 * @param map
+	 *            the map with <code>&lt;String, String&gt;</code> mapping
+	 * @param attribute
+	 *            the key in the map
 	 * @return the value of the attribute
 	 *
-	 * @throws IllegalArgumentException if the value of the attribute is not a {@link String} or the attribute does not exist
+	 * @throws IllegalArgumentException
+	 *             if the value of the attribute is not a {@link String} or the
+	 *             attribute does not exist
 	 */
-	public static String getString(Map map, String attribute)  throws IllegalArgumentException {
+	public static String getString(Map<String, String> map, String attribute) throws IllegalArgumentException {
 		return getString(map, attribute, false);
 	}
 
 	/**
 	 * Retrieves an <code>String[]</code> attribute from map.
 	 *
-	 * @param map the map with <code>&lt;String, String&gt;</code> mapping
-	 * @param countAttribute the attribute that contains the number of elements
-	 * @param arrayAttribute the attribute name where the values are stored. The index starting from offset is appended to this
-	 * @param offset the starting index for arrayAttribute
+	 * @param map
+	 *            the map with <code>&lt;String, String&gt;</code> mapping
+	 * @param countAttribute
+	 *            the attribute that contains the number of elements
+	 * @param arrayAttribute
+	 *            the attribute name where the values are stored. The index starting
+	 *            from offset is appended to this
+	 * @param offset
+	 *            the starting index for arrayAttribute
 	 * @return the <code>String[]</code>
 	 *
-	 * @throws IllegalArgumentException if any of the attribute does not exist or is not a number
+	 * @throws IllegalArgumentException
+	 *             if any of the attribute does not exist or is not a number
 	 */
-	public static String[] getStringArray(Map map, String countAttribute, String arrayAttribute, int offset) throws IllegalArgumentException{
-		int count= getInt(map, countAttribute);
-		String[] result= new String[count];
-		for (int i= 0; i < count; i++) {
-			result[i]= getString(map, getAttributeName(arrayAttribute, i + offset));
+	public static String[] getStringArray(Map<String, String> map, String countAttribute, String arrayAttribute,
+			int offset) throws IllegalArgumentException {
+		int count = getInt(map, countAttribute);
+		String[] result = new String[count];
+		for (int i = 0; i < count; i++) {
+			result[i] = getString(map, getAttributeName(arrayAttribute, i + offset));
 		}
 		return result;
 	}
@@ -222,57 +242,75 @@
 	/**
 	 * Retrieves an <code>int</code> attribute from map.
 	 *
-	 * @param map the map with <code>&lt;String, String&gt;</code> mapping
-	 * @param attribute the key in the map
+	 * @param map
+	 *            the map with <code>&lt;String, String&gt;</code> mapping
+	 * @param attribute
+	 *            the key in the map
 	 * @return the value of the attribute
 	 *
-	 * @throws IllegalArgumentException if the attribute does not exist or is not a number
+	 * @throws IllegalArgumentException
+	 *             if the attribute does not exist or is not a number
 	 */
-	public static int getInt(Map map, String attribute)  throws IllegalArgumentException{
-		String value= getString(map, attribute);
+	public static int getInt(Map<String, String> map, String attribute) throws IllegalArgumentException {
+		String value = getString(map, attribute);
 		try {
 			return Integer.parseInt(value);
 		} catch (NumberFormatException e) {
-			throw new IllegalArgumentException("The attribute '" + attribute + "' does not contain a valid int '" + value + "'"); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
+			throw new IllegalArgumentException(
+					"The attribute '" + attribute + "' does not contain a valid int '" + value + "'"); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
 		}
 	}
 
 	/**
-	 * Retrieves an <code>int</code> attribute from map. If the attribute does not exist it returns the default value.
+	 * Retrieves an <code>int</code> attribute from map. If the attribute does not
+	 * exist it returns the default value.
 	 *
-	 * @param map the map with <code>&lt;String, String&gt;</code> mapping
-	 * @param attribute the key in the map
-	 * @param defaultValue the default value to use if the attribute does not exist
-	 * @return the <code>int</code> value of the attribute or the specified default value if the attribute does not exist
+	 * @param map
+	 *            the map with <code>&lt;String, String&gt;</code> mapping
+	 * @param attribute
+	 *            the key in the map
+	 * @param defaultValue
+	 *            the default value to use if the attribute does not exist
+	 * @return the <code>int</code> value of the attribute or the specified default
+	 *         value if the attribute does not exist
 	 *
-	 * @throws IllegalArgumentException if the attribute exists but is not a number
+	 * @throws IllegalArgumentException
+	 *             if the attribute exists but is not a number
 	 */
-	public static int getInt(Map map, String attribute, int defaultValue)  throws IllegalArgumentException{
-		String value= getString(map, attribute, true);
+	public static int getInt(Map<String, String> map, String attribute, int defaultValue)
+			throws IllegalArgumentException {
+		String value = getString(map, attribute, true);
 		if (value == null)
 			return defaultValue;
 		try {
 			return Integer.parseInt(value);
 		} catch (NumberFormatException e) {
-			throw new IllegalArgumentException("The attribute '" + attribute + "' does not contain a valid int '" + value + "'"); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
+			throw new IllegalArgumentException(
+					"The attribute '" + attribute + "' does not contain a valid int '" + value + "'"); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
 		}
 	}
 
 	/**
 	 * Retrieves an <code>int[]</code> attribute from map.
 	 *
-	 * @param countAttribute the attribute that contains the number of elements
-	 * @param arrayAttribute the attribute name where the values are stored. The index starting from '0' is appended to this
-	 * @param map the map with <code>&lt;String, String&gt;</code> mapping
+	 * @param countAttribute
+	 *            the attribute that contains the number of elements
+	 * @param arrayAttribute
+	 *            the attribute name where the values are stored. The index starting
+	 *            from '0' is appended to this
+	 * @param map
+	 *            the map with <code>&lt;String, String&gt;</code> mapping
 	 * @return the <code>int[]</code>
 	 *
-	 * @throws IllegalArgumentException if any of the attribute does not exist or is not a number
+	 * @throws IllegalArgumentException
+	 *             if any of the attribute does not exist or is not a number
 	 */
-	public static int[] getIntArray(Map map, String countAttribute, String arrayAttribute)  throws IllegalArgumentException {
-		int count= getInt(map, countAttribute);
-		int[] result= new int[count];
-		for (int i= 0; i < count; i++) {
-			result[i]= getInt(map, getAttributeName(arrayAttribute, i));
+	public static int[] getIntArray(Map<String, String> map, String countAttribute, String arrayAttribute)
+			throws IllegalArgumentException {
+		int count = getInt(map, countAttribute);
+		int[] result = new int[count];
+		for (int i = 0; i < count; i++) {
+			result[i] = getInt(map, getAttributeName(arrayAttribute, i));
 		}
 		return result;
 	}
@@ -280,8 +318,10 @@
 	/**
 	 * Create the name for accessing the ith element of an attribute.
 	 *
-	 * @param attribute the base attribute
-	 * @param index the index that should be accessed
+	 * @param attribute
+	 *            the base attribute
+	 * @param index
+	 *            the index that should be accessed
 	 * @return the attribute name for the ith element of an attribute
 	 */
 	public static String getAttributeName(String attribute, int index) {
@@ -291,121 +331,171 @@
 	/**
 	 * Retrieves an <code>{@link IModelElement}</code> attribute from map.
 	 *
-	 * @param map the map with <code>&lt;String, String&gt;</code> mapping
-	 * @param attribute the key in the map
-	 * @param project the project for resolving the java element. Can be <code>null</code> for workspace
+	 * @param map
+	 *            the map with <code>&lt;String, String&gt;</code> mapping
+	 * @param attribute
+	 *            the key in the map
+	 * @param project
+	 *            the project for resolving the java element. Can be
+	 *            <code>null</code> for workspace
 	 * @return a {@link IModelElement} or <code>null</code>
 	 *
-	 * @throws IllegalArgumentException if the attribute does not exist or is not a java element
+	 * @throws IllegalArgumentException
+	 *             if the attribute does not exist or is not a java element
 	 * @see #handleToElement(WorkingCopyOwner, String, String, boolean)
 	 */
-	public static IModelElement getModelElement(Map map, String attribute, String project)  throws IllegalArgumentException{
+	public static IModelElement getModelElement(Map<String, String> map, String attribute, String project)
+			throws IllegalArgumentException {
 		return getModelElement(map, attribute, project, false);
 	}
 
 	/**
 	 * Retrieves an <code>{@link IModelElement}</code> attribute from map.
 	 *
-	 * @param map the map with <code>&lt;String, String&gt;</code> mapping
-	 * @param attribute the key in the map
-	 * @param project the project for resolving the java element. Can be <code>null</code> for workspace
-	 * @param allowNull if <code>true</code> a <code>null</code> will be returned if the attribute does not exist
+	 * @param map
+	 *            the map with <code>&lt;String, String&gt;</code> mapping
+	 * @param attribute
+	 *            the key in the map
+	 * @param project
+	 *            the project for resolving the java element. Can be
+	 *            <code>null</code> for workspace
+	 * @param allowNull
+	 *            if <code>true</code> a <code>null</code> will be returned if the
+	 *            attribute does not exist
 	 * @return a {@link IModelElement} or <code>null</code>
 	 *
-	 * @throws IllegalArgumentException if the attribute does not existt
+	 * @throws IllegalArgumentException
+	 *             if the attribute does not existt
 	 * @see #handleToElement(WorkingCopyOwner, String, String, boolean)
 	 */
-	public static IModelElement getModelElement(Map map, String attribute, String project, boolean allowNull)  throws IllegalArgumentException{
-		String handle= getString(map, attribute, allowNull);
+	public static IModelElement getModelElement(Map<String, String> map, String attribute, String project,
+			boolean allowNull) throws IllegalArgumentException {
+		String handle = getString(map, attribute, allowNull);
 		if (handle != null)
-			return handleToElement(null, project, handle, false); //TODO: update Scriptdoc
+			return handleToElement(null, project, handle, false); // TODO: update Scriptdoc
 		return null;
 	}
 
 	/**
 	 * Retrieves an <code>IModelElement[]</code> attribute from map.
 	 *
-	 * @param map the map with <code>&lt;String, String&gt;</code> mapping
-	 * @param countAttribute the attribute that contains the number of elements. Can be <code>null</code> to indicate that no count attribute exists
-	 * @param arrayAttribute the attribute name where the values are stored. The index starting from offset is appended to this
-	 * @param offset the starting index for arrayAttribute
-	 * @param project the project for resolving the java element. Can be <code>null</code> for workspace
-	 * @param arrayClass the component type for the resulting array. The resulting array can then be safely casted to arrayClass[]
+	 * @param map
+	 *            the map with <code>&lt;String, String&gt;</code> mapping
+	 * @param countAttribute
+	 *            the attribute that contains the number of elements. Can be
+	 *            <code>null</code> to indicate that no count attribute exists
+	 * @param arrayAttribute
+	 *            the attribute name where the values are stored. The index starting
+	 *            from offset is appended to this
+	 * @param offset
+	 *            the starting index for arrayAttribute
+	 * @param project
+	 *            the project for resolving the java element. Can be
+	 *            <code>null</code> for workspace
+	 * @param arrayClass
+	 *            the component type for the resulting array. The resulting array
+	 *            can then be safely casted to arrayClass[]
 	 * @return the <code>IModelElement[]</code>
 	 *
-	 * @throws IllegalArgumentException if any of the attribute does not exist or is not a number
+	 * @throws IllegalArgumentException
+	 *             if any of the attribute does not exist or is not a number
 	 */
-	public static IModelElement[] getModelElementArray(Map map, String countAttribute, String arrayAttribute, int offset, String project, Class arrayClass)  throws IllegalArgumentException{
+	public static <T> IModelElement[] getModelElementArray(Map<String, String> map, String countAttribute,
+			String arrayAttribute, int offset, String project, Class<T> arrayClass) throws IllegalArgumentException {
 		if (countAttribute != null) {
-			int count= getInt(map, countAttribute);
-			IModelElement[] result= (IModelElement[]) Array.newInstance(arrayClass, count);
-			for (int i= 0; i < count; i++) {
-				result[i]= getModelElement(map, getAttributeName(arrayAttribute, i + offset), project);
+			int count = getInt(map, countAttribute);
+			IModelElement[] result = (IModelElement[]) Array.newInstance(arrayClass, count);
+			for (int i = 0; i < count; i++) {
+				result[i] = getModelElement(map, getAttributeName(arrayAttribute, i + offset), project);
 			}
 			return result;
 		} else {
-			ArrayList<IModelElement> result= new ArrayList<IModelElement>();
-			IModelElement element= null;
-			while ((element= getModelElement(map, arrayAttribute, project, true)) != null){
+			ArrayList<IModelElement> result = new ArrayList<>();
+			IModelElement element = null;
+			while ((element = getModelElement(map, arrayAttribute, project, true)) != null) {
 				result.add(element);
 			}
-			return (IModelElement[]) result.toArray((Object[]) Array.newInstance(arrayClass, result.size()));
+			return result.toArray((IModelElement[]) Array.newInstance(arrayClass, result.size()));
 		}
 	}
 
 	/**
 	 * Retrieves and resolves an <code>{@link IResource}</code> attribute from map.
 	 *
-	 * @param map the map with <code>&lt;String, String&gt;</code> mapping
-	 * @param attribute the key in the map
-	 * @param project the project for resolving the resource. Can be <code>null</code> for workspace
-	 * @return the <code>{@link IResource}</code>, or <code>null</code> if the resource does not exist
+	 * @param map
+	 *            the map with <code>&lt;String, String&gt;</code> mapping
+	 * @param attribute
+	 *            the key in the map
+	 * @param project
+	 *            the project for resolving the resource. Can be <code>null</code>
+	 *            for workspace
+	 * @return the <code>{@link IResource}</code>, or <code>null</code> if the
+	 *         resource does not exist
 	 *
-	 * @throws IllegalArgumentException if the attribute does not exist
+	 * @throws IllegalArgumentException
+	 *             if the attribute does not exist
 	 * @see #handleToResource(String, String)
 	 */
-	public static IPath getResourcePath(Map map, String attribute, String project)  throws IllegalArgumentException {
-		String handle= getString(map, attribute);
+	public static IPath getResourcePath(Map<String, String> map, String attribute, String project)
+			throws IllegalArgumentException {
+		String handle = getString(map, attribute);
 		return handleToResourcePath(project, handle);
 	}
 
 	/**
 	 * Retrieves an <code>IResource[]</code> attribute from map.
 	 *
-	 * @param map the map with <code>&lt;String, String&gt;</code> mapping
-	 * @param countAttribute the attribute that contains the number of elements
-	 * @param arrayAttribute the attribute name where the values are stored. The index starting from offset is appended to this
-	 * @param offset the starting index for arrayAttribute
-	 * @param project the project for resolving the java element. Can be <code>null</code> for workspace
+	 * @param map
+	 *            the map with <code>&lt;String, String&gt;</code> mapping
+	 * @param countAttribute
+	 *            the attribute that contains the number of elements
+	 * @param arrayAttribute
+	 *            the attribute name where the values are stored. The index starting
+	 *            from offset is appended to this
+	 * @param offset
+	 *            the starting index for arrayAttribute
+	 * @param project
+	 *            the project for resolving the java element. Can be
+	 *            <code>null</code> for workspace
 	 * @return the <code>IResource[]</code>
 	 *
-	 * @throws IllegalArgumentException if any of the attribute does not exist or is not a number
+	 * @throws IllegalArgumentException
+	 *             if any of the attribute does not exist or is not a number
 	 */
-	public static IPath[] getResourcePathArray(Map map, String countAttribute, String arrayAttribute, int offset, String project)  throws IllegalArgumentException{
-		int count= getInt(map, countAttribute);
-		IPath[] result= new IPath[count];
-		for (int i= 0; i < count; i++) {
-			result[i]= getResourcePath(map, getAttributeName(arrayAttribute, i + offset), project);
+	public static IPath[] getResourcePathArray(Map<String, String> map, String countAttribute, String arrayAttribute,
+			int offset, String project) throws IllegalArgumentException {
+		int count = getInt(map, countAttribute);
+		IPath[] result = new IPath[count];
+		for (int i = 0; i < count; i++) {
+			result[i] = getResourcePath(map, getAttributeName(arrayAttribute, i + offset), project);
 		}
 		return result;
 	}
 
 	/**
 	 * Retrieves a <code>boolean[]</code> attribute from map.
-	 * @param map the map with <code>&lt;String, String&gt;</code> mapping
-	 * @param countAttribute the attribute that contains the number of elements
-	 * @param arrayAttribute the attribute name where the values are stored. The index starting from '0' is appended to this
-	 * @param offset the starting index for arrayAttribute
+	 *
+	 * @param map
+	 *            the map with <code>&lt;String, String&gt;</code> mapping
+	 * @param countAttribute
+	 *            the attribute that contains the number of elements
+	 * @param arrayAttribute
+	 *            the attribute name where the values are stored. The index starting
+	 *            from '0' is appended to this
+	 * @param offset
+	 *            the starting index for arrayAttribute
 	 *
 	 * @return the <code>boolean[]</code>
 	 *
-	 * @throws IllegalArgumentException if any of the attribute does not exist or is not a boolean
+	 * @throws IllegalArgumentException
+	 *             if any of the attribute does not exist or is not a boolean
 	 */
-	public static boolean[] getBooleanArray(Map map, String countAttribute, String arrayAttribute, int offset) throws IllegalArgumentException {
-		int count= getInt(map, countAttribute);
-		boolean[] result= new boolean[count];
-		for (int i= 0; i < count; i++) {
-			result[i]= getBoolean(map, getAttributeName(arrayAttribute, i + offset));
+	public static boolean[] getBooleanArray(Map<String, String> map, String countAttribute, String arrayAttribute,
+			int offset) throws IllegalArgumentException {
+		int count = getInt(map, countAttribute);
+		boolean[] result = new boolean[count];
+		for (int i = 0; i < count; i++) {
+			result[i] = getBoolean(map, getAttributeName(arrayAttribute, i + offset));
 		}
 		return result;
 	}
@@ -413,79 +503,104 @@
 	/**
 	 * Retrieves a <code>boolean</code> attribute from map.
 	 *
-	 * @param map the map with <code>&lt;String, String&gt;</code> mapping
-	 * @param attribute the key in the map
+	 * @param map
+	 *            the map with <code>&lt;String, String&gt;</code> mapping
+	 * @param attribute
+	 *            the key in the map
 	 * @return the <code>boolean</code> value of the attribute
 	 *
-	 * @throws IllegalArgumentException if the attribute does not exist or is not a boolean
+	 * @throws IllegalArgumentException
+	 *             if the attribute does not exist or is not a boolean
 	 */
-	public static boolean getBoolean(Map map, String attribute)  throws IllegalArgumentException{
-		String value= getString(map, attribute).toLowerCase();
-		//Boolean.valueOf(value) does not complain about wrong values
+	public static boolean getBoolean(Map<String, String> map, String attribute) throws IllegalArgumentException {
+		String value = getString(map, attribute).toLowerCase();
+		// Boolean.valueOf(value) does not complain about wrong values
 		if (LOWER_CASE_TRUE.equals(value))
 			return true;
 		if (LOWER_CASE_FALSE.equals(value))
 			return false;
-		throw new IllegalArgumentException("The attribute '" + attribute + "' does not contain a valid boolean: '" + value + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+		throw new IllegalArgumentException(
+				"The attribute '" + attribute + "' does not contain a valid boolean: '" + value + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 	}
 
 	/**
-	 * @param map the map with <code>&lt;String, String&gt;</code> mapping
-	 * @param attribute the key in the map
-	 * @return <code>true</code> iff the map contains a boolean attribute for the key
+	 * @param map
+	 *            the map with <code>&lt;String, String&gt;</code> mapping
+	 * @param attribute
+	 *            the key in the map
+	 * @return <code>true</code> iff the map contains a boolean attribute for the
+	 *         key
 	 *
-	 * @throws IllegalArgumentException if the attribute exists but is not a boolean
+	 * @throws IllegalArgumentException
+	 *             if the attribute exists but is not a boolean
 	 */
-	public static boolean hasBoolean(Map map, String attribute)  throws IllegalArgumentException{
-		String string= getString(map, attribute, true);
+	public static boolean hasBoolean(Map<String, String> map, String attribute) throws IllegalArgumentException {
+		String string = getString(map, attribute, true);
 		if (string == null)
 			return false;
 
-		//Boolean.valueOf(value) does not complain about wrong values
-		String value= string.toLowerCase();
+		// Boolean.valueOf(value) does not complain about wrong values
+		String value = string.toLowerCase();
 		if (LOWER_CASE_TRUE.equals(value))
 			return true;
 
 		if (LOWER_CASE_FALSE.equals(value))
 			return true;
-		throw new IllegalArgumentException("The attribute '" + attribute + "' does not contain a valid boolean: '" + value + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+		throw new IllegalArgumentException(
+				"The attribute '" + attribute + "' does not contain a valid boolean: '" + value + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 	}
 
 	/**
-	 * Retrieves a <code>boolean</code> attribute from map. If the attribute does not exist it returns the default value
+	 * Retrieves a <code>boolean</code> attribute from map. If the attribute does
+	 * not exist it returns the default value
 	 *
-	 * @param map the map with <code>&lt;String, String&gt;</code> mapping
-	 * @param attribute the key in the map
-	 * @param defaultValue the default value to use if the attribute does not exist
-	 * @return the <code>boolean</code> value of the attribute or the specified default value if the attribute does not exist
+	 * @param map
+	 *            the map with <code>&lt;String, String&gt;</code> mapping
+	 * @param attribute
+	 *            the key in the map
+	 * @param defaultValue
+	 *            the default value to use if the attribute does not exist
+	 * @return the <code>boolean</code> value of the attribute or the specified
+	 *         default value if the attribute does not exist
 	 *
-	 * @throws IllegalArgumentException if the attribute does not contain a valid value
+	 * @throws IllegalArgumentException
+	 *             if the attribute does not contain a valid value
 	 */
-	public static boolean getBoolean(Map map, String attribute, boolean defaultValue) throws IllegalArgumentException {
-		String value= getString(map, attribute, true);
+	public static boolean getBoolean(Map<String, String> map, String attribute, boolean defaultValue)
+			throws IllegalArgumentException {
+		String value = getString(map, attribute, true);
 		if (value == null)
 			return defaultValue;
-		value= value.toLowerCase();
-		//Boolean.valueOf(value) does not complain about wrong values
+		value = value.toLowerCase();
+		// Boolean.valueOf(value) does not complain about wrong values
 		if (LOWER_CASE_TRUE.equals(value))
 			return true;
 		if (LOWER_CASE_FALSE.equals(value))
 			return false;
-		throw new IllegalArgumentException("The attribute '" + attribute + "' does not contain a valid boolean: '" + value + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+		throw new IllegalArgumentException(
+				"The attribute '" + attribute + "' does not contain a valid boolean: '" + value + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 	}
 
 	/**
 	 * Inserts the <code>{@link IModelElement}</code> into the map.
 	 *
-	 * @param arguments the map with <code>&lt;String, String&gt;</code> mapping
-	 * @param attribute the key's name for the map
-	 * @param project the project of the element or <code>null</code>.
-	 *        Note: if the given project is not the ModelElement's project, then the full handle is stored
-	 * @param element the element to store
+	 * @param arguments
+	 *            the map with <code>&lt;String, String&gt;</code> mapping
+	 * @param attribute
+	 *            the key's name for the map
+	 * @param project
+	 *            the project of the element or <code>null</code>. Note: if the
+	 *            given project is not the ModelElement's project, then the full
+	 *            handle is stored
+	 * @param element
+	 *            the element to store
 	 *
-	 * @throws IllegalArgumentException if the attribute name is invalid, or the element is <code>null</code>
+	 * @throws IllegalArgumentException
+	 *             if the attribute name is invalid, or the element is
+	 *             <code>null</code>
 	 */
-	public static void setModelElement(Map arguments, String attribute, String project, IModelElement element)  throws IllegalArgumentException{
+	public static void setModelElement(Map<String, String> arguments, String attribute, String project,
+			IModelElement element) throws IllegalArgumentException {
 		if (element == null)
 			throw new IllegalArgumentException("The element for attribute '" + attribute + "' may not be null"); //$NON-NLS-1$ //$NON-NLS-2$
 		setString(arguments, attribute, elementToHandle(project, element));
@@ -494,63 +609,90 @@
 	/**
 	 * Inserts the <code>{@link IPath}</code> into the map.
 	 *
-	 * @param arguments the map with <code>&lt;String, String&gt;</code> mapping
-	 * @param attribute the key's name for the map
-	 * @param project the project of the element or <code>null</code>.
-	 *        Note: if the given project is not the resource's project, then the full handle is stored
-	 * @param resourcePath the resource to store
+	 * @param arguments
+	 *            the map with <code>&lt;String, String&gt;</code> mapping
+	 * @param attribute
+	 *            the key's name for the map
+	 * @param project
+	 *            the project of the element or <code>null</code>. Note: if the
+	 *            given project is not the resource's project, then the full handle
+	 *            is stored
+	 * @param resourcePath
+	 *            the resource to store
 	 *
-	 * @throws IllegalArgumentException if the attribute name is invalid, or the resource is <code>null</code>
+	 * @throws IllegalArgumentException
+	 *             if the attribute name is invalid, or the resource is
+	 *             <code>null</code>
 	 */
-	public static void setResourcePath(Map arguments, String attribute, String project, IPath resourcePath)  throws IllegalArgumentException{
+	public static void setResourcePath(Map<String, String> arguments, String attribute, String project,
+			IPath resourcePath) throws IllegalArgumentException {
 		if (resourcePath == null)
-			throw new IllegalArgumentException("The resource for attribute '" + attribute + "' may not be null");  //$NON-NLS-1$//$NON-NLS-2$
+			throw new IllegalArgumentException("The resource for attribute '" + attribute + "' may not be null"); //$NON-NLS-1$//$NON-NLS-2$
 		setString(arguments, attribute, resourcePathToHandle(project, resourcePath));
 	}
 
 	/**
 	 * Inserts the <code>int</code> into the map.
 	 *
-	 * @param arguments the map with <code>&lt;String, String&gt;</code> mapping
-	 * @param attribute the key's name for the map
-	 * @param value the <code>int</code> to store
+	 * @param arguments
+	 *            the map with <code>&lt;String, String&gt;</code> mapping
+	 * @param attribute
+	 *            the key's name for the map
+	 * @param value
+	 *            the <code>int</code> to store
 	 *
-	 * @throws IllegalArgumentException if the attribute name is invalid
+	 * @throws IllegalArgumentException
+	 *             if the attribute name is invalid
 	 */
-	public static void setInt(Map arguments, String attribute, int value)  throws IllegalArgumentException{
+	public static void setInt(Map<String, String> arguments, String attribute, int value)
+			throws IllegalArgumentException {
 		setString(arguments, attribute, Integer.toString(value));
 	}
 
 	/**
 	 * Inserts the <code>boolean</code> into the map.
 	 *
-	 * @param arguments the map with <code>&lt;String, String&gt;</code> mapping
-	 * @param attribute the key's name for the map
-	 * @param value the <code>boolean</code> to store
+	 * @param arguments
+	 *            the map with <code>&lt;String, String&gt;</code> mapping
+	 * @param attribute
+	 *            the key's name for the map
+	 * @param value
+	 *            the <code>boolean</code> to store
 	 *
-	 * @throws IllegalArgumentException if the attribute name is invalid
+	 * @throws IllegalArgumentException
+	 *             if the attribute name is invalid
 	 */
-	public static void setBoolean(Map arguments, String attribute, boolean value)  throws IllegalArgumentException{
+	public static void setBoolean(Map<String, String> arguments, String attribute, boolean value)
+			throws IllegalArgumentException {
 		setString(arguments, attribute, value ? LOWER_CASE_TRUE : LOWER_CASE_FALSE);
 	}
 
 	/**
 	 * Inserts the booleans into the map.
 	 *
-	 * @param arguments arguments the map with <code>&lt;String, String&gt;</code> mapping
-	 * @param countAttribute the attribute where the number of resources will be stored. Can be <code>null</code> if no count attribute should be created
-	 * @param arrayAttribute the attribute where the resources will be stored
-	 * @param value the booleans to store
-	 * @param offset the offset to start at
+	 * @param arguments
+	 *            arguments the map with <code>&lt;String, String&gt;</code> mapping
+	 * @param countAttribute
+	 *            the attribute where the number of resources will be stored. Can be
+	 *            <code>null</code> if no count attribute should be created
+	 * @param arrayAttribute
+	 *            the attribute where the resources will be stored
+	 * @param value
+	 *            the booleans to store
+	 * @param offset
+	 *            the offset to start at
 	 *
-	 * @throws IllegalArgumentException if the attribute name is invalid or any of the booleans are null
+	 * @throws IllegalArgumentException
+	 *             if the attribute name is invalid or any of the booleans are null
 	 */
-	public static void setBooleanArray(Map arguments, String countAttribute, String arrayAttribute, boolean[] value, int offset) {
+	public static void setBooleanArray(Map<String, String> arguments, String countAttribute, String arrayAttribute,
+			boolean[] value, int offset) {
 		if (value == null)
-			throw new IllegalArgumentException("The values for arrayAttribute '" + arrayAttribute + "' may not be null"); //$NON-NLS-1$ //$NON-NLS-2$
+			throw new IllegalArgumentException(
+					"The values for arrayAttribute '" + arrayAttribute + "' may not be null"); //$NON-NLS-1$ //$NON-NLS-2$
 		if (countAttribute != null)
 			setInt(arguments, countAttribute, value.length);
-		for (int i= 0; i < value.length; i++) {
+		for (int i = 0; i < value.length; i++) {
 			setBoolean(arguments, getAttributeName(arrayAttribute, i + offset), value[i]);
 		}
 	}
@@ -558,13 +700,19 @@
 	/**
 	 * Inserts the <code>{@link String}</code> into the map.
 	 *
-	 * @param arguments the map with <code>&lt;String, String&gt;</code> mapping
-	 * @param attribute the key's name for the map
-	 * @param value the <code>{@link String}</code> to store. If <code>null</code> no insertion is performed
+	 * @param arguments
+	 *            the map with <code>&lt;String, String&gt;</code> mapping
+	 * @param attribute
+	 *            the key's name for the map
+	 * @param value
+	 *            the <code>{@link String}</code> to store. If <code>null</code> no
+	 *            insertion is performed
 	 *
-	 * @throws IllegalArgumentException if the attribute name is invalid
+	 * @throws IllegalArgumentException
+	 *             if the attribute name is invalid
 	 */
-	public static void setString(Map arguments, String attribute, String value)  throws IllegalArgumentException{
+	public static void setString(Map<String, String> arguments, String attribute, String value)
+			throws IllegalArgumentException {
 		if (attribute == null || "".equals(attribute) || attribute.indexOf(' ') != -1) //$NON-NLS-1$
 			throw new IllegalArgumentException("Attribute '" + attribute + "' is not valid: '" + value + "'"); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
 		if (value != null)
@@ -576,21 +724,30 @@
 	/**
 	 * Inserts the Strings into the map.
 	 *
-	 * @param arguments arguments the map with <code>&lt;String, String&gt;</code> mapping
-	 * @param countAttribute the attribute where the number of resources will be stored. Can be <code>null</code> if no count attribute should be created
-	 * @param arrayAttribute the attribute where the resources will be stored
-	 * @param value the strings to store
-	 * @param offset the offset to start at
+	 * @param arguments
+	 *            arguments the map with <code>&lt;String, String&gt;</code> mapping
+	 * @param countAttribute
+	 *            the attribute where the number of resources will be stored. Can be
+	 *            <code>null</code> if no count attribute should be created
+	 * @param arrayAttribute
+	 *            the attribute where the resources will be stored
+	 * @param value
+	 *            the strings to store
+	 * @param offset
+	 *            the offset to start at
 	 *
-	 * @throws IllegalArgumentException if the attribute name is invalid or any of the strings are null
+	 * @throws IllegalArgumentException
+	 *             if the attribute name is invalid or any of the strings are null
 	 */
-	public static void setStringArray(Map arguments, String countAttribute, String arrayAttribute, String[] value, int offset) {
+	public static void setStringArray(Map<String, String> arguments, String countAttribute, String arrayAttribute,
+			String[] value, int offset) {
 		if (value == null)
-			throw new IllegalArgumentException("The values for arrayAttribute '" + arrayAttribute + "' may not be null"); //$NON-NLS-1$ //$NON-NLS-2$
+			throw new IllegalArgumentException(
+					"The values for arrayAttribute '" + arrayAttribute + "' may not be null"); //$NON-NLS-1$ //$NON-NLS-2$
 		if (countAttribute != null)
 			setInt(arguments, countAttribute, value.length);
-		for (int i= 0; i < value.length; i++) {
-			String string= value[i];
+		for (int i = 0; i < value.length; i++) {
+			String string = value[i];
 			setString(arguments, getAttributeName(arrayAttribute, i + offset), string);
 		}
 	}
@@ -598,37 +755,53 @@
 	/**
 	 * Inserts the selection into the map.
 	 *
-	 * @param arguments the map with <code>&lt;String, String&gt;</code> mapping
-	 * @param attribute the key's name for the map
-	 * @param offset the offset of the selection
-	 * @param length the length of the selection
+	 * @param arguments
+	 *            the map with <code>&lt;String, String&gt;</code> mapping
+	 * @param attribute
+	 *            the key's name for the map
+	 * @param offset
+	 *            the offset of the selection
+	 * @param length
+	 *            the length of the selection
 	 *
-	 * @throws IllegalArgumentException if the attribute name is invalid
+	 * @throws IllegalArgumentException
+	 *             if the attribute name is invalid
 	 */
-	public static void setSelection(Map arguments, String attribute, int offset, int length)  throws IllegalArgumentException{
-		String value= Integer.toString(offset) + " " + Integer.toString(length); //$NON-NLS-1$
+	public static void setSelection(Map<String, String> arguments, String attribute, int offset, int length)
+			throws IllegalArgumentException {
+		String value = Integer.toString(offset) + " " + Integer.toString(length); //$NON-NLS-1$
 		setString(arguments, attribute, value);
 	}
 
 	/**
 	 * Inserts the resources into the map.
 	 *
-	 * @param arguments arguments the map with <code>&lt;String, String&gt;</code> mapping
-	 * @param countAttribute the attribute where the number of resources will be stored. Can be <code>null</code> if no count attribute should be created
-	 * @param arrayAttribute the attribute where the resources will be stored
-	 * @param project the project of the resources or <code>null</code>
-	 * @param resourcePaths the resource paths to store
-	 * @param offset the offset to start at
+	 * @param arguments
+	 *            arguments the map with <code>&lt;String, String&gt;</code> mapping
+	 * @param countAttribute
+	 *            the attribute where the number of resources will be stored. Can be
+	 *            <code>null</code> if no count attribute should be created
+	 * @param arrayAttribute
+	 *            the attribute where the resources will be stored
+	 * @param project
+	 *            the project of the resources or <code>null</code>
+	 * @param resourcePaths
+	 *            the resource paths to store
+	 * @param offset
+	 *            the offset to start at
 	 *
-	 * @throws IllegalArgumentException if the attribute name is invalid or any of the resources are null
+	 * @throws IllegalArgumentException
+	 *             if the attribute name is invalid or any of the resources are null
 	 */
-	public static void setResourcePathArray(Map arguments, String countAttribute, String arrayAttribute, String project, IPath[] resourcePaths, int offset)  throws IllegalArgumentException{
+	public static void setResourcePathArray(Map<String, String> arguments, String countAttribute, String arrayAttribute,
+			String project, IPath[] resourcePaths, int offset) throws IllegalArgumentException {
 		if (resourcePaths == null)
-			throw new IllegalArgumentException("The resources for arrayAttribute '" + arrayAttribute + "' may not be null"); //$NON-NLS-1$ //$NON-NLS-2$
+			throw new IllegalArgumentException(
+					"The resources for arrayAttribute '" + arrayAttribute + "' may not be null"); //$NON-NLS-1$ //$NON-NLS-2$
 		if (countAttribute != null)
 			setInt(arguments, countAttribute, resourcePaths.length);
-		for (int i= 0; i < resourcePaths.length; i++) {
-			IPath resourcePath= resourcePaths[i];
+		for (int i = 0; i < resourcePaths.length; i++) {
+			IPath resourcePath = resourcePaths[i];
 			setResourcePath(arguments, getAttributeName(arrayAttribute, offset + i), project, resourcePath);
 		}
 	}
@@ -636,22 +809,34 @@
 	/**
 	 * Inserts the resources into the map.
 	 *
-	 * @param arguments arguments the map with <code>&lt;String, String&gt;</code> mapping
-	 * @param countAttribute the attribute where the number of elements will be stored. Can be <code>null</code> if no count attribute should be created
-	 * @param arrayAttributePrefix the name prefix of the attributes where the elements will be stored
-	 * @param project the project of the elements or <code>null</code>
-	 * @param elements the elements to store
-	 * @param offset the offset to start at (usually 1)
+	 * @param arguments
+	 *            arguments the map with <code>&lt;String, String&gt;</code> mapping
+	 * @param countAttribute
+	 *            the attribute where the number of elements will be stored. Can be
+	 *            <code>null</code> if no count attribute should be created
+	 * @param arrayAttributePrefix
+	 *            the name prefix of the attributes where the elements will be
+	 *            stored
+	 * @param project
+	 *            the project of the elements or <code>null</code>
+	 * @param elements
+	 *            the elements to store
+	 * @param offset
+	 *            the offset to start at (usually 1)
 	 *
-	 * @throws IllegalArgumentException if the attribute name is invalid or any of the elements are null
+	 * @throws IllegalArgumentException
+	 *             if the attribute name is invalid or any of the elements are null
 	 */
-	public static void setModelElementArray(Map arguments, String countAttribute, String arrayAttributePrefix, String project, IModelElement[] elements, int offset)  throws IllegalArgumentException{
+	public static void setModelElementArray(Map<String, String> arguments, String countAttribute,
+			String arrayAttributePrefix, String project, IModelElement[] elements, int offset)
+			throws IllegalArgumentException {
 		if (elements == null)
-			throw new IllegalArgumentException("The elements for arrayAttribute '" + arrayAttributePrefix + "' may not be null"); //$NON-NLS-1$ //$NON-NLS-2$
+			throw new IllegalArgumentException(
+					"The elements for arrayAttribute '" + arrayAttributePrefix + "' may not be null"); //$NON-NLS-1$ //$NON-NLS-2$
 		if (countAttribute != null)
 			setInt(arguments, countAttribute, elements.length);
-		for (int i= 0; i < elements.length; i++) {
-			IModelElement element= elements[i];
+		for (int i = 0; i < elements.length; i++) {
+			IModelElement element = elements[i];
 			setModelElement(arguments, getAttributeName(arrayAttributePrefix, offset + i), project, element);
 		}
 	}
diff --git a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/core/refactoring/descriptors/RenameModelElementDescriptor.java b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/core/refactoring/descriptors/RenameModelElementDescriptor.java
index c6768fc..4ee9154 100644
--- a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/core/refactoring/descriptors/RenameModelElementDescriptor.java
+++ b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/core/refactoring/descriptors/RenameModelElementDescriptor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2006, 2008 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,102 +37,68 @@
  */
 public final class RenameModelElementDescriptor extends ScriptRefactoringDescriptor {
 
-	/** The delegate attribute */
-	private static final String ATTRIBUTE_DELEGATE= "delegate"; //$NON-NLS-1$
-
-	/** The deprecate attribute */
-	private static final String ATTRIBUTE_DEPRECATE= "deprecate"; //$NON-NLS-1$
-
-	/** The hierarchical attribute */
-	private static final String ATTRIBUTE_HIERARCHICAL= "hierarchical"; //$NON-NLS-1$
-
-	/** The match strategy attribute */
-	private static final String ATTRIBUTE_MATCH_STRATEGY= "matchStrategy"; //$NON-NLS-1$
-
-	/** The parameter attribute */
-	private static final String ATTRIBUTE_PARAMETER= "parameter"; //$NON-NLS-1$
-
-	/** The patterns attribute */
-	private static final String ATTRIBUTE_PATTERNS= "patterns"; //$NON-NLS-1$
-
-	/** The qualified attribute */
-	private static final String ATTRIBUTE_QUALIFIED= "qualified"; //$NON-NLS-1$
-
-	/** The rename getter attribute */
-	private static final String ATTRIBUTE_RENAME_GETTER= "getter"; //$NON-NLS-1$
-
-	/** The rename setter attribute */
-	private static final String ATTRIBUTE_RENAME_SETTER= "setter"; //$NON-NLS-1$
-
-	/** The similar declarations attribute */
-	private static final String ATTRIBUTE_SIMILAR_DECLARATIONS= "similarDeclarations"; //$NON-NLS-1$
-
-	/** The textual matches attribute */
-	private static final String ATTRIBUTE_TEXTUAL_MATCHES= "textual"; //$NON-NLS-1$
+	/**
+	 * Similar declaration updating strategy which finds exact names and embedded
+	 * names as well (value: <code>2</code>).
+	 */
+	public static final int STRATEGY_EMBEDDED = 2;
 
 	/**
-	 * Similar declaration updating strategy which finds exact names and
-	 * embedded names as well (value: <code>2</code>).
+	 * Similar declaration updating strategy which finds exact names only (value:
+	 * <code>1</code>).
 	 */
-	public static final int STRATEGY_EMBEDDED= 2;
+	public static final int STRATEGY_EXACT = 1;
 
 	/**
-	 * Similar declaration updating strategy which finds exact names only
-	 * (value: <code>1</code>).
+	 * Similar declaration updating strategy which finds exact names, embedded names
+	 * and name suffixes (value: <code>3</code>).
 	 */
-	public static final int STRATEGY_EXACT= 1;
+	public static final int STRATEGY_SUFFIX = 3;
 
-	/**
-	 * Similar declaration updating strategy which finds exact names, embedded
-	 * names and name suffixes (value: <code>3</code>).
-	 */
-	public static final int STRATEGY_SUFFIX= 3;
-
-	//private static final String RENAME_RESOURCE= IJavascriptRefactorings.RENAME_RESOURCE;
-
+	// private static final String RENAME_RESOURCE=
+	// IJavascriptRefactorings.RENAME_RESOURCE;
 
 	/** The delegate attribute */
-	//private boolean fDelegate= false;
+	// private boolean fDelegate= false;
 
 	/** The deprecate attribute */
-	//private boolean fDeprecate= false;
+	// private boolean fDeprecate= false;
 
 	/** The hierarchical attribute */
-	//private boolean fHierarchical= false;
+	// private boolean fHierarchical= false;
 
 	/**
-	 * The java element attribute.
-	 * WARNING: may not exist, see comment in
+	 * The java element attribute. WARNING: may not exist, see comment in
 	 * {@link ScriptRefactoringDescriptor#handleToElement(org.eclipse.jdt.core.WorkingCopyOwner, String, String, boolean)}.
 	 */
-	private IModelElement fModelElement= null;
+	private IModelElement fModelElement = null;
 
 	/** The match strategy */
-	//private int fMatchStrategy= STRATEGY_EXACT;
+	// private int fMatchStrategy= STRATEGY_EXACT;
 
 	/** The name attribute */
-	private String fName= null;
+	private String fName = null;
 
 	/** The patterns attribute */
-	//private String fPatterns= null;
+	// private String fPatterns= null;
 
 	/** The qualified attribute */
-	//private boolean fQualified= false;
+	// private boolean fQualified= false;
 
 	/** The references attribute */
-	private boolean fReferences= false;
+	private boolean fReferences = false;
 
 	/** The rename getter attribute */
-	//private boolean fRenameGetter= false;
+	// private boolean fRenameGetter= false;
 
 	/** The rename setter attribute */
-	//private boolean fRenameSetter= false;
+	// private boolean fRenameSetter= false;
 
 	/** The similar declarations attribute */
-	//private boolean fSimilarDeclarations= false;
+	// private boolean fSimilarDeclarations= false;
 
 	/** The textual attribute */
-	//private boolean fTextual= false;
+	// private boolean fTextual= false;
 
 	/**
 	 * Creates a new refactoring descriptor.
@@ -153,88 +119,69 @@
 	 *            the ID of this descriptor
 	 * @param project
 	 *            the non-empty name of the project associated with this
-	 *            refactoring, or <code>null</code> for a workspace
-	 *            refactoring
+	 *            refactoring, or <code>null</code> for a workspace refactoring
 	 * @param description
 	 *            a non-empty human-readable description of the particular
 	 *            refactoring instance
 	 * @param comment
-	 *            the human-readable comment of the particular refactoring
-	 *            instance, or <code>null</code> for no comment
+	 *            the human-readable comment of the particular refactoring instance,
+	 *            or <code>null</code> for no comment
 	 * @param arguments
-	 * 			  a map of arguments that will be persisted and describes
-	 * 			  all settings for this refactoring
+	 *            a map of arguments that will be persisted and describes all
+	 *            settings for this refactoring
 	 * @param flags
 	 *            the flags of the refactoring descriptor
 	 *
-	 * @throws IllegalArgumentException if the argument map contains invalid keys/values
+	 * @throws IllegalArgumentException
+	 *             if the argument map contains invalid keys/values
 	 *
 	 * @since 1.2
 	 */
-	public RenameModelElementDescriptor(String id, String project, String description, String comment, Map arguments, int flags) {
+	public RenameModelElementDescriptor(String id, String project, String description, String comment,
+			Map<String, String> arguments, int flags) {
 		super(id, project, description, comment, arguments, flags);
 		Assert.isLegal(checkId(id), "Refactoring id is not a rename refactoring id"); //$NON-NLS-1$
-		fName= RefactoringDescriptorUtil.getString(fArguments, ATTRIBUTE_NAME);
-		/*if (getID().equals(IJavascriptRefactorings.RENAME_TYPE_PARAMETER)) {
-			fModelElement= RefactoringDescriptorUtil.getModelElement(fArguments, ATTRIBUTE_INPUT, getProject());
-			String parameterName= RefactoringDescriptorUtil.getString(fArguments, ATTRIBUTE_PARAMETER);
-			if (fModelElement instanceof IType) {
-				fModelElement= ((IType) fModelElement).getTypeParameter(parameterName);
-			}
-			if (fModelElement instanceof IMethod) {
-				fModelElement=((IMethod) fModelElement).getTypeParameter(parameterName);
-			}
-		} else*/
-			fModelElement= RefactoringDescriptorUtil.getModelElement(fArguments, ATTRIBUTE_INPUT, getProject());
-		//final int type= fModelElement.getElementType();
-		//if (type != IModelElement.SCRIPT_FOLDER)
-			fReferences= RefactoringDescriptorUtil.getBoolean(fArguments, ATTRIBUTE_REFERENCES, fReferences);
-		/*if (type == IModelElement.FIELD) {
-			fRenameGetter= RefactoringDescriptorUtil.getBoolean(fArguments, ATTRIBUTE_RENAME_GETTER, fRenameGetter);
-			fRenameSetter= RefactoringDescriptorUtil.getBoolean(fArguments, ATTRIBUTE_RENAME_SETTER, fRenameSetter);
-		}
-		switch (type) {
-			case IModelElement.PROJECT_FRAGMENT:
-			case IModelElement.TYPE:
-			case IModelElement.FIELD:
-				fTextual= RefactoringDescriptorUtil.getBoolean(fArguments, ATTRIBUTE_TEXTUAL_MATCHES, fTextual);
-				break;
-			default:
-				break;
-		}
-		switch (type) {
-			case IModelElement.METHOD:
-			case IModelElement.FIELD:
-				fDeprecate= RefactoringDescriptorUtil.getBoolean(fArguments, ATTRIBUTE_DEPRECATE, fDeprecate);
-				fDelegate= RefactoringDescriptorUtil.getBoolean(fArguments, ATTRIBUTE_DELEGATE, fDelegate);
-				break;
-			default:
-				break;
-		}
-		switch (type) {
-			case IModelElement.PROJECT_FRAGMENT:
-			case IModelElement.TYPE:
-				fQualified= RefactoringDescriptorUtil.getBoolean(fArguments, ATTRIBUTE_QUALIFIED, fQualified);
-				fPatterns= RefactoringDescriptorUtil.getString(fArguments, ATTRIBUTE_PATTERNS, true);
-				break;
-			default:
-				break;
-		}
-		switch (type) {
-			case IModelElement.TYPE:
-				fSimilarDeclarations= RefactoringDescriptorUtil.getBoolean(fArguments, ATTRIBUTE_SIMILAR_DECLARATIONS, fSimilarDeclarations);
-				fMatchStrategy= RefactoringDescriptorUtil.getInt(fArguments, ATTRIBUTE_MATCH_STRATEGY, fMatchStrategy);
-				break;
-			default:
-				break;
-		}
-		switch (type) {
-			case IModelElement.PROJECT_FRAGMENT:
-				fHierarchical= RefactoringDescriptorUtil.getBoolean(fArguments, ATTRIBUTE_HIERARCHICAL, fHierarchical);
-				break;
-			default:
-				break;
-		}*/
+		fName = RefactoringDescriptorUtil.getString(fArguments, ATTRIBUTE_NAME);
+		/*
+		 * if (getID().equals(IJavascriptRefactorings.RENAME_TYPE_PARAMETER)) {
+		 * fModelElement= RefactoringDescriptorUtil.getModelElement(fArguments,
+		 * ATTRIBUTE_INPUT, getProject()); String parameterName=
+		 * RefactoringDescriptorUtil.getString(fArguments, ATTRIBUTE_PARAMETER); if
+		 * (fModelElement instanceof IType) { fModelElement= ((IType)
+		 * fModelElement).getTypeParameter(parameterName); } if (fModelElement
+		 * instanceof IMethod) { fModelElement=((IMethod)
+		 * fModelElement).getTypeParameter(parameterName); } } else
+		 */
+		fModelElement = RefactoringDescriptorUtil.getModelElement(fArguments, ATTRIBUTE_INPUT, getProject());
+		// final int type= fModelElement.getElementType();
+		// if (type != IModelElement.SCRIPT_FOLDER)
+		fReferences = RefactoringDescriptorUtil.getBoolean(fArguments, ATTRIBUTE_REFERENCES, fReferences);
+		/*
+		 * if (type == IModelElement.FIELD) { fRenameGetter=
+		 * RefactoringDescriptorUtil.getBoolean(fArguments, ATTRIBUTE_RENAME_GETTER,
+		 * fRenameGetter); fRenameSetter=
+		 * RefactoringDescriptorUtil.getBoolean(fArguments, ATTRIBUTE_RENAME_SETTER,
+		 * fRenameSetter); } switch (type) { case IModelElement.PROJECT_FRAGMENT: case
+		 * IModelElement.TYPE: case IModelElement.FIELD: fTextual=
+		 * RefactoringDescriptorUtil.getBoolean(fArguments, ATTRIBUTE_TEXTUAL_MATCHES,
+		 * fTextual); break; default: break; } switch (type) { case
+		 * IModelElement.METHOD: case IModelElement.FIELD: fDeprecate=
+		 * RefactoringDescriptorUtil.getBoolean(fArguments, ATTRIBUTE_DEPRECATE,
+		 * fDeprecate); fDelegate= RefactoringDescriptorUtil.getBoolean(fArguments,
+		 * ATTRIBUTE_DELEGATE, fDelegate); break; default: break; } switch (type) { case
+		 * IModelElement.PROJECT_FRAGMENT: case IModelElement.TYPE: fQualified=
+		 * RefactoringDescriptorUtil.getBoolean(fArguments, ATTRIBUTE_QUALIFIED,
+		 * fQualified); fPatterns= RefactoringDescriptorUtil.getString(fArguments,
+		 * ATTRIBUTE_PATTERNS, true); break; default: break; } switch (type) { case
+		 * IModelElement.TYPE: fSimilarDeclarations=
+		 * RefactoringDescriptorUtil.getBoolean(fArguments,
+		 * ATTRIBUTE_SIMILAR_DECLARATIONS, fSimilarDeclarations); fMatchStrategy=
+		 * RefactoringDescriptorUtil.getInt(fArguments, ATTRIBUTE_MATCH_STRATEGY,
+		 * fMatchStrategy); break; default: break; } switch (type) { case
+		 * IModelElement.PROJECT_FRAGMENT: fHierarchical=
+		 * RefactoringDescriptorUtil.getBoolean(fArguments, ATTRIBUTE_HIERARCHICAL,
+		 * fHierarchical); break; default: break; }
+		 */
 	}
 
 	/**
@@ -246,111 +193,86 @@
 	 */
 	private boolean checkId(final String id) {
 		Assert.isNotNull(id);
-/*		if (id.equals(IJavascriptRefactorings.RENAME_COMPILATION_UNIT))
-			return true;
-		else if (id.equals(IJavascriptRefactorings.RENAME_ENUM_CONSTANT))
-			return true;
-		else if (id.equals(IJavascriptRefactorings.RENAME_FIELD))
-			return true;
-		else if (id.equals(IJavascriptRefactorings.RENAME_JAVA_PROJECT))
-			return true;
-		else if (id.equals(IJavascriptRefactorings.RENAME_LOCAL_VARIABLE))
-			return true;
-		else if (id.equals(IJavascriptRefactorings.RENAME_METHOD))
-			return true;
-		else if (id.equals(IJavascriptRefactorings.RENAME_PACKAGE))
-			return true;
-		else if (id.equals(RENAME_RESOURCE))
-			return true;
-		else if (id.equals(IJavascriptRefactorings.RENAME_SOURCE_FOLDER))
-			return true;
-		else if (id.equals(IJavascriptRefactorings.RENAME_TYPE))
-			return true;
-		else if (id.equals(IJavascriptRefactorings.RENAME_TYPE_PARAMETER))
-			return true;
-		return false;*/
+		/*
+		 * if (id.equals(IJavascriptRefactorings.RENAME_COMPILATION_UNIT)) return true;
+		 * else if (id.equals(IJavascriptRefactorings.RENAME_ENUM_CONSTANT)) return
+		 * true; else if (id.equals(IJavascriptRefactorings.RENAME_FIELD)) return true;
+		 * else if (id.equals(IJavascriptRefactorings.RENAME_JAVA_PROJECT)) return true;
+		 * else if (id.equals(IJavascriptRefactorings.RENAME_LOCAL_VARIABLE)) return
+		 * true; else if (id.equals(IJavascriptRefactorings.RENAME_METHOD)) return true;
+		 * else if (id.equals(IJavascriptRefactorings.RENAME_PACKAGE)) return true; else
+		 * if (id.equals(RENAME_RESOURCE)) return true; else if
+		 * (id.equals(IJavascriptRefactorings.RENAME_SOURCE_FOLDER)) return true; else
+		 * if (id.equals(IJavascriptRefactorings.RENAME_TYPE)) return true; else if
+		 * (id.equals(IJavascriptRefactorings.RENAME_TYPE_PARAMETER)) return true;
+		 * return false;
+		 */
 		return true;
 	}
 
 	/**
 	 * {@inheritDoc}
 	 */
+	@Override
 	protected void populateArgumentMap() {
 		super.populateArgumentMap();
 		RefactoringDescriptorUtil.setString(fArguments, ATTRIBUTE_NAME, fName);
-		/*if (getID().equals(IJavascriptRefactorings.RENAME_TYPE_PARAMETER)) {
-			final ITypeParameter parameter= (ITypeParameter) fModelElement;
-			ScriptRefactoringDescriptor.setModelElement(fArguments, ATTRIBUTE_INPUT, getProject(), parameter.getDeclaringMember());
-			ScriptRefactoringDescriptor.setString(fArguments, ATTRIBUTE_PARAMETER, parameter.getElementName());
-		} else*/
-			RefactoringDescriptorUtil.setModelElement(fArguments, ATTRIBUTE_INPUT, getProject(), fModelElement);
-		/*final int type= fModelElement.getElementType();
-		if (type != IModelElement.SCRIPT_FOLDER)*/
-			RefactoringDescriptorUtil.setBoolean(fArguments, ATTRIBUTE_REFERENCES, fReferences);
-		/*if (type == IModelElement.FIELD) {
-			RefactoringDescriptorUtil.setBoolean(fArguments, ATTRIBUTE_RENAME_GETTER, fRenameGetter);
-			RefactoringDescriptorUtil.setBoolean(fArguments, ATTRIBUTE_RENAME_SETTER, fRenameSetter);
-		}
-		switch (type) {
-			case IModelElement.PROJECT_FRAGMENT:
-			case IModelElement.TYPE:
-			case IModelElement.FIELD:
-				ScriptRefactoringDescriptor.setBoolean(fArguments, ATTRIBUTE_TEXTUAL_MATCHES, fTextual);
-				break;
-			default:
-				break;
-		}
-		switch (type) {
-			case IModelElement.METHOD:
-			case IModelElement.FIELD:
-				ScriptRefactoringDescriptor.setBoolean(fArguments, ATTRIBUTE_DEPRECATE, fDeprecate);
-				ScriptRefactoringDescriptor.setBoolean(fArguments, ATTRIBUTE_DELEGATE, fDelegate);
-				break;
-			default:
-				break;
-		}
-		switch (type) {
-			case IModelElement.PROJECT_FRAGMENT:
-			case IModelElement.TYPE:
-				ScriptRefactoringDescriptor.setBoolean(fArguments, ATTRIBUTE_QUALIFIED, fQualified);
-				ScriptRefactoringDescriptor.setString(fArguments, ATTRIBUTE_PATTERNS, fPatterns);
-				break;
-			default:
-				break;
-		}
-		switch (type) {
-			case IModelElement.TYPE:
-				ScriptRefactoringDescriptor.setBoolean(fArguments, ATTRIBUTE_SIMILAR_DECLARATIONS, fSimilarDeclarations);
-				ScriptRefactoringDescriptor.setInt(fArguments, ATTRIBUTE_MATCH_STRATEGY, fMatchStrategy);
-				break;
-			default:
-				break;
-		}
-		switch (type) {
-			case IModelElement.PROJECT_FRAGMENT:
-				ScriptRefactoringDescriptor.setBoolean(fArguments, ATTRIBUTE_HIERARCHICAL, fHierarchical);
-				break;
-			default:
-				break;
-		}*/
+		/*
+		 * if (getID().equals(IJavascriptRefactorings.RENAME_TYPE_PARAMETER)) { final
+		 * ITypeParameter parameter= (ITypeParameter) fModelElement;
+		 * ScriptRefactoringDescriptor.setModelElement(fArguments, ATTRIBUTE_INPUT,
+		 * getProject(), parameter.getDeclaringMember());
+		 * ScriptRefactoringDescriptor.setString(fArguments, ATTRIBUTE_PARAMETER,
+		 * parameter.getElementName()); } else
+		 */
+		RefactoringDescriptorUtil.setModelElement(fArguments, ATTRIBUTE_INPUT, getProject(), fModelElement);
+		/*
+		 * final int type= fModelElement.getElementType(); if (type !=
+		 * IModelElement.SCRIPT_FOLDER)
+		 */
+		RefactoringDescriptorUtil.setBoolean(fArguments, ATTRIBUTE_REFERENCES, fReferences);
+		/*
+		 * if (type == IModelElement.FIELD) {
+		 * RefactoringDescriptorUtil.setBoolean(fArguments, ATTRIBUTE_RENAME_GETTER,
+		 * fRenameGetter); RefactoringDescriptorUtil.setBoolean(fArguments,
+		 * ATTRIBUTE_RENAME_SETTER, fRenameSetter); } switch (type) { case
+		 * IModelElement.PROJECT_FRAGMENT: case IModelElement.TYPE: case
+		 * IModelElement.FIELD: ScriptRefactoringDescriptor.setBoolean(fArguments,
+		 * ATTRIBUTE_TEXTUAL_MATCHES, fTextual); break; default: break; } switch (type)
+		 * { case IModelElement.METHOD: case IModelElement.FIELD:
+		 * ScriptRefactoringDescriptor.setBoolean(fArguments, ATTRIBUTE_DEPRECATE,
+		 * fDeprecate); ScriptRefactoringDescriptor.setBoolean(fArguments,
+		 * ATTRIBUTE_DELEGATE, fDelegate); break; default: break; } switch (type) { case
+		 * IModelElement.PROJECT_FRAGMENT: case IModelElement.TYPE:
+		 * ScriptRefactoringDescriptor.setBoolean(fArguments, ATTRIBUTE_QUALIFIED,
+		 * fQualified); ScriptRefactoringDescriptor.setString(fArguments,
+		 * ATTRIBUTE_PATTERNS, fPatterns); break; default: break; } switch (type) { case
+		 * IModelElement.TYPE: ScriptRefactoringDescriptor.setBoolean(fArguments,
+		 * ATTRIBUTE_SIMILAR_DECLARATIONS, fSimilarDeclarations);
+		 * ScriptRefactoringDescriptor.setInt(fArguments, ATTRIBUTE_MATCH_STRATEGY,
+		 * fMatchStrategy); break; default: break; } switch (type) { case
+		 * IModelElement.PROJECT_FRAGMENT:
+		 * ScriptRefactoringDescriptor.setBoolean(fArguments, ATTRIBUTE_HIERARCHICAL,
+		 * fHierarchical); break; default: break; }
+		 */
 	}
 
 	/**
 	 * Determines whether the delegate for a Script element should be declared as
 	 * deprecated.
 	 * <p>
-	 * Note: Deprecation of the delegate is currently applicable to the Script elements
-	 * {@link IMethod} and {@link IField}. The default is to not deprecate the
-	 * delegate.
+	 * Note: Deprecation of the delegate is currently applicable to the Script
+	 * elements {@link IMethod} and {@link IField}. The default is to not deprecate
+	 * the delegate.
 	 * </p>
 	 *
 	 * @param deprecate
-	 *            <code>true</code> to deprecate the delegate,
-	 *            <code>false</code> otherwise
+	 *            <code>true</code> to deprecate the delegate, <code>false</code>
+	 *            otherwise
 	 */
-//	public void setDeprecateDelegate(final boolean deprecate) {
-//		fDeprecate= deprecate;
-//	}
+	// public void setDeprecateDelegate(final boolean deprecate) {
+	// fDeprecate= deprecate;
+	// }
 
 	/**
 	 * Sets the file name patterns to use during qualified name updating.
@@ -360,23 +282,24 @@
 	 * string) and '?' (any character) may be used.
 	 * </p>
 	 * <p>
-	 * Note: If file name patterns are set, qualified name updating must be
-	 * enabled by calling {@link #setUpdateQualifiedNames(boolean)}.
+	 * Note: If file name patterns are set, qualified name updating must be enabled
+	 * by calling {@link #setUpdateQualifiedNames(boolean)}.
 	 * </p>
 	 * <p>
 	 * Note: Qualified name updating is currently applicable to the Script elements
-	 * {@link IPackageFragment} and {@link IType}. The default is to use no
-	 * file name patterns (meaning that all files are processed).
+	 * {@link IPackageFragment} and {@link IType}. The default is to use no file
+	 * name patterns (meaning that all files are processed).
 	 * </p>
 	 *
 	 * @param patterns
 	 *            the non-empty file name patterns string
 	 */
-//	public void setFileNamePatterns(final String patterns) {
-//		Assert.isNotNull(patterns);
-//		Assert.isLegal(!"".equals(patterns), "Pattern must not be empty"); //$NON-NLS-1$ //$NON-NLS-2$
-//		fPatterns= patterns;
-//	}
+	// public void setFileNamePatterns(final String patterns) {
+	// Assert.isNotNull(patterns);
+	// Assert.isLegal(!"".equals(patterns), "Pattern must not be empty");
+	// //$NON-NLS-1$ //$NON-NLS-2$
+	// fPatterns= patterns;
+	// }
 
 	/**
 	 * Sets the Script element to be renamed.
@@ -391,46 +314,46 @@
 	 */
 	public void setModelElement(final IModelElement element) {
 		Assert.isNotNull(element);
-		fModelElement= element;
+		fModelElement = element;
 	}
 
 	/**
-	 * Determines whether the the original Script element should be kept as
-	 * delegate to the renamed one.
+	 * Determines whether the the original Script element should be kept as delegate
+	 * to the renamed one.
 	 * <p>
-	 * Note: Keeping of original elements as delegates is currently applicable to the Script
-	 * elements {@link IMethod} and {@link IField}. The default is to not keep
-	 * the original as delegate.
+	 * Note: Keeping of original elements as delegates is currently applicable to
+	 * the Script elements {@link IMethod} and {@link IField}. The default is to not
+	 * keep the original as delegate.
 	 * </p>
 	 *
 	 * @param delegate
 	 *            <code>true</code> to keep the original, <code>false</code>
 	 *            otherwise
 	 */
-//	public void setKeepOriginal(final boolean delegate) {
-//		fDelegate= delegate;
-//	}
+	// public void setKeepOriginal(final boolean delegate) {
+	// fDelegate= delegate;
+	// }
 
 	/**
-	 * Determines which strategy should be used during similar declaration
-	 * updating.
+	 * Determines which strategy should be used during similar declaration updating.
 	 * <p>
-	 * Valid arguments are {@link #STRATEGY_EXACT}, {@link #STRATEGY_EMBEDDED}
-	 * or {@link #STRATEGY_SUFFIX}.
+	 * Valid arguments are {@link #STRATEGY_EXACT}, {@link #STRATEGY_EMBEDDED} or
+	 * {@link #STRATEGY_SUFFIX}.
 	 * </p>
 	 * <p>
-	 * Note: Similar declaration updating is currently applicable to Script elements of type
-	 * {@link IType}. The default is to use the {@link #STRATEGY_EXACT} match
-	 * strategy.
+	 * Note: Similar declaration updating is currently applicable to Script elements
+	 * of type {@link IType}. The default is to use the {@link #STRATEGY_EXACT}
+	 * match strategy.
 	 * </p>
 	 *
 	 * @param strategy
 	 *            the match strategy to use
 	 */
-//	public void setMatchStrategy(final int strategy) {
-//		Assert.isLegal(strategy == STRATEGY_EXACT || strategy == STRATEGY_EMBEDDED || strategy == STRATEGY_SUFFIX, "Wrong match strategy argument"); //$NON-NLS-1$
-//		fMatchStrategy= strategy;
-//	}
+	// public void setMatchStrategy(final int strategy) {
+	// Assert.isLegal(strategy == STRATEGY_EXACT || strategy == STRATEGY_EMBEDDED ||
+	// strategy == STRATEGY_SUFFIX, "Wrong match strategy argument"); //$NON-NLS-1$
+	// fMatchStrategy= strategy;
+	// }
 
 	/**
 	 * Sets the new name to rename the Script element to.
@@ -441,7 +364,7 @@
 	public void setNewName(final String name) {
 		Assert.isNotNull(name);
 		Assert.isLegal(!"".equals(name), "Name must not be empty"); //$NON-NLS-1$//$NON-NLS-2$
-		fName= name;
+		fName = name;
 	}
 
 	/**
@@ -456,11 +379,12 @@
 	 * </p>
 	 *
 	 * @param project
-	 *            the non-empty project name to set, or <code>null</code> for
-	 *            the workspace
+	 *            the non-empty project name to set, or <code>null</code> for the
+	 *            workspace
 	 *
 	 * @see #getProject()
 	 */
+	@Override
 	public void setProject(final String project) {
 		super.setProject(project);
 	}
@@ -468,59 +392,59 @@
 	/**
 	 * Determines whether getter methods for the Script element should be renamed.
 	 * <p>
-	 * Note: Renaming of getter methods is applicable for {@link IField}
-	 * elements which do not represent enum constants only. The default is to
-	 * not rename any getter methods.
+	 * Note: Renaming of getter methods is applicable for {@link IField} elements
+	 * which do not represent enum constants only. The default is to not rename any
+	 * getter methods.
 	 * </p>
 	 *
 	 * @param rename
-	 *            <code>true</code> to rename getter methods,
-	 *            <code>false</code> otherwise
+	 *            <code>true</code> to rename getter methods, <code>false</code>
+	 *            otherwise
 	 */
-//	public void setRenameGetters(final boolean rename) {
-//		fRenameGetter= rename;
-//	}
+	// public void setRenameGetters(final boolean rename) {
+	// fRenameGetter= rename;
+	// }
 
 	/**
 	 * Determines whether setter methods for the Script element should be renamed.
 	 * <p>
-	 * Note: Renaming of setter methods is applicable for {@link IField}
-	 * elements which do not represent enum constants only. The default is to
-	 * not rename any setter methods.
+	 * Note: Renaming of setter methods is applicable for {@link IField} elements
+	 * which do not represent enum constants only. The default is to not rename any
+	 * setter methods.
 	 * </p>
 	 *
 	 * @param rename
-	 *            <code>true</code> to rename setter methods,
-	 *            <code>false</code> otherwise
+	 *            <code>true</code> to rename setter methods, <code>false</code>
+	 *            otherwise
 	 */
-//	public void setRenameSetters(final boolean rename) {
-//		fRenameSetter= rename;
-//	}
+	// public void setRenameSetters(final boolean rename) {
+	// fRenameSetter= rename;
+	// }
 
 	/**
 	 * Determines whether other Script elements in the hierarchy of the input
 	 * element should be renamed as well.
 	 * <p>
 	 * Note: Hierarchical updating is currently applicable for Script elements of
-	 * type {@link IPackageFragment}. The default is to not update Script
-	 * elements hierarchically.
+	 * type {@link IPackageFragment}. The default is to not update Script elements
+	 * hierarchically.
 	 * </p>
 	 *
 	 * @param update
-	 *            <code>true</code> to update hierarchically,
-	 *            <code>false</code> otherwise
+	 *            <code>true</code> to update hierarchically, <code>false</code>
+	 *            otherwise
 	 */
-//	public void setUpdateHierarchy(final boolean update) {
-//		fHierarchical= update;
-//	}
+	// public void setUpdateHierarchy(final boolean update) {
+	// fHierarchical= update;
+	// }
 
 	/**
 	 * Determines whether qualified names of the Script element should be renamed.
 	 * <p>
-	 * Qualified name updating adapts fully qualified names of the Script element
-	 * to be renamed in non-Script text files. Clients may specify file name
-	 * patterns by calling {@link #setFileNamePatterns(String)} to constrain the
-	 * set of text files to be processed.
+	 * Qualified name updating adapts fully qualified names of the Script element to
+	 * be renamed in non-Script text files. Clients may specify file name patterns
+	 * by calling {@link #setFileNamePatterns(String)} to constrain the set of text
+	 * files to be processed.
 	 * </p>
 	 * <p>
 	 * Note: Qualified name updating is currently applicable to the Script elements
@@ -529,18 +453,18 @@
 	 * </p>
 	 *
 	 * @param update
-	 *            <code>true</code> to update qualified names,
-	 *            <code>false</code> otherwise
+	 *            <code>true</code> to update qualified names, <code>false</code>
+	 *            otherwise
 	 */
-//	public void setUpdateQualifiedNames(final boolean update) {
-//		fQualified= update;
-//	}
+	// public void setUpdateQualifiedNames(final boolean update) {
+	// fQualified= update;
+	// }
 
 	/**
 	 * Determines whether references to the Script element should be renamed.
 	 * <p>
-	 * Note: Reference updating is currently applicable to all Script element types except
-	 * {@link IPackageFragmentRoot}. The default is to not update references.
+	 * Note: Reference updating is currently applicable to all Script element types
+	 * except {@link IPackageFragmentRoot}. The default is to not update references.
 	 * </p>
 	 *
 	 * @param update
@@ -548,119 +472,89 @@
 	 *            otherwise
 	 */
 	public void setUpdateReferences(final boolean update) {
-		fReferences= update;
+		fReferences = update;
 	}
 
 	/**
 	 * Determines whether similar declarations of the Script element should be
 	 * updated.
 	 * <p>
-	 * Note: Similar declaration updating is currently applicable to Script elements of type
-	 * {@link IType}. The default is to not update similar declarations.
+	 * Note: Similar declaration updating is currently applicable to Script elements
+	 * of type {@link IType}. The default is to not update similar declarations.
 	 * </p>
 	 *
 	 * @param update
 	 *            <code>true</code> to update similar declarations,
 	 *            <code>false</code> otherwise
 	 */
-//	public void setUpdateSimilarDeclarations(final boolean update) {
-//		fSimilarDeclarations= update;
-//	}
+	// public void setUpdateSimilarDeclarations(final boolean update) {
+	// fSimilarDeclarations= update;
+	// }
 
 	/**
 	 * Determines whether textual occurrences of the Script element should be
 	 * renamed.
 	 * <p>
-	 * Textual occurrence updating adapts textual occurrences of the Script
-	 * element to be renamed in Script comments and Script strings.
+	 * Textual occurrence updating adapts textual occurrences of the Script element
+	 * to be renamed in Script comments and Script strings.
 	 * </p>
 	 * <p>
-	 * Note: Textual occurrence updating is currently applicable to the Script elements
-	 * {@link IPackageFragment}, {@link IType} and {@link IField}. The default
-	 * is to not rename textual occurrences.
+	 * Note: Textual occurrence updating is currently applicable to the Script
+	 * elements {@link IPackageFragment}, {@link IType} and {@link IField}. The
+	 * default is to not rename textual occurrences.
 	 * </p>
 	 *
 	 * @param update
 	 *            <code>true</code> to update occurrences, <code>false</code>
 	 *            otherwise
 	 */
-//	public void setUpdateTextualOccurrences(final boolean update) {
-//		fTextual= update;
-//	}
+	// public void setUpdateTextualOccurrences(final boolean update) {
+	// fTextual= update;
+	// }
 
 	/**
 	 * {@inheritDoc}
 	 */
-/*	public RefactoringStatus validateDescriptor() {
-		RefactoringStatus status=new RefactoringStatus();
-		if (fName == null || "".equals(fName)) //$NON-NLS-1$
-			status.merge(RefactoringStatus.createFatalErrorStatus(DescriptorMessages.RenameResourceDescriptor_no_new_name));
-		if (fModelElement == null)
-			status.merge(RefactoringStatus.createFatalErrorStatus(DescriptorMessages.RenameModelElementDescriptor_no_java_element));
-		else {
-			final int type= fModelElement.getElementType();
-			if (type == IModelElement.JAVA_PROJECT && getProject() != null)
-				status.merge(RefactoringStatus.createFatalErrorStatus(DescriptorMessages.RenameModelElementDescriptor_project_constraint));
-			if (type == IModelElement.PACKAGE_FRAGMENT_ROOT && fReferences)
-				status.merge(RefactoringStatus.createFatalErrorStatus(DescriptorMessages.RenameModelElementDescriptor_reference_constraint));
-			if (fTextual) {
-				switch (type) {
-					case IModelElement.PACKAGE_FRAGMENT:
-					case IModelElement.TYPE:
-					case IModelElement.FIELD:
-						break;
-					default:
-						status.merge(RefactoringStatus.createFatalErrorStatus(DescriptorMessages.RenameModelElementDescriptor_textual_constraint));
-				}
-			}
-			if (fDeprecate) {
-				switch (type) {
-					case IModelElement.METHOD:
-					case IModelElement.FIELD:
-						break;
-					default:
-						status.merge(RefactoringStatus.createFatalErrorStatus(DescriptorMessages.RenameModelElementDescriptor_deprecation_constraint));
-				}
-			}
-			if (fDelegate) {
-				switch (type) {
-					case IModelElement.METHOD:
-					case IModelElement.FIELD:
-						break;
-					default:
-						status.merge(RefactoringStatus.createFatalErrorStatus(DescriptorMessages.RenameModelElementDescriptor_delegate_constraint));
-				}
-			}
-			if (fRenameGetter || fRenameSetter) {
-				if (type != IModelElement.FIELD)
-					status.merge(RefactoringStatus.createFatalErrorStatus(DescriptorMessages.RenameModelElementDescriptor_accessor_constraint));
-			}
-			if (fQualified) {
-				switch (type) {
-					case IModelElement.PACKAGE_FRAGMENT:
-					case IModelElement.TYPE:
-						break;
-					default:
-						status.merge(RefactoringStatus.createFatalErrorStatus(DescriptorMessages.RenameModelElementDescriptor_qualified_constraint));
-				}
-			}
-			if (fSimilarDeclarations) {
-				switch (type) {
-					case IModelElement.TYPE:
-						break;
-					default:
-						status.merge(RefactoringStatus.createFatalErrorStatus(DescriptorMessages.RenameModelElementDescriptor_similar_constraint));
-				}
-			}
-			if (fHierarchical) {
-				switch (type) {
-					case IModelElement.PACKAGE_FRAGMENT:
-						break;
-					default:
-						status.merge(RefactoringStatus.createFatalErrorStatus(DescriptorMessages.RenameModelElementDescriptor_hierarchical_constraint));
-				}
-			}
-		}
-		return status;
-	}*/
+	/*
+	 * public RefactoringStatus validateDescriptor() { RefactoringStatus status=new
+	 * RefactoringStatus(); if (fName == null || "".equals(fName)) //$NON-NLS-1$
+	 * status.merge(RefactoringStatus.createFatalErrorStatus(DescriptorMessages.
+	 * RenameResourceDescriptor_no_new_name)); if (fModelElement == null)
+	 * status.merge(RefactoringStatus.createFatalErrorStatus(DescriptorMessages.
+	 * RenameModelElementDescriptor_no_java_element)); else { final int type=
+	 * fModelElement.getElementType(); if (type == IModelElement.JAVA_PROJECT &&
+	 * getProject() != null)
+	 * status.merge(RefactoringStatus.createFatalErrorStatus(DescriptorMessages.
+	 * RenameModelElementDescriptor_project_constraint)); if (type ==
+	 * IModelElement.PACKAGE_FRAGMENT_ROOT && fReferences)
+	 * status.merge(RefactoringStatus.createFatalErrorStatus(DescriptorMessages.
+	 * RenameModelElementDescriptor_reference_constraint)); if (fTextual) { switch
+	 * (type) { case IModelElement.PACKAGE_FRAGMENT: case IModelElement.TYPE: case
+	 * IModelElement.FIELD: break; default:
+	 * status.merge(RefactoringStatus.createFatalErrorStatus(DescriptorMessages.
+	 * RenameModelElementDescriptor_textual_constraint)); } } if (fDeprecate) {
+	 * switch (type) { case IModelElement.METHOD: case IModelElement.FIELD: break;
+	 * default:
+	 * status.merge(RefactoringStatus.createFatalErrorStatus(DescriptorMessages.
+	 * RenameModelElementDescriptor_deprecation_constraint)); } } if (fDelegate) {
+	 * switch (type) { case IModelElement.METHOD: case IModelElement.FIELD: break;
+	 * default:
+	 * status.merge(RefactoringStatus.createFatalErrorStatus(DescriptorMessages.
+	 * RenameModelElementDescriptor_delegate_constraint)); } } if (fRenameGetter ||
+	 * fRenameSetter) { if (type != IModelElement.FIELD)
+	 * status.merge(RefactoringStatus.createFatalErrorStatus(DescriptorMessages.
+	 * RenameModelElementDescriptor_accessor_constraint)); } if (fQualified) {
+	 * switch (type) { case IModelElement.PACKAGE_FRAGMENT: case IModelElement.TYPE:
+	 * break; default:
+	 * status.merge(RefactoringStatus.createFatalErrorStatus(DescriptorMessages.
+	 * RenameModelElementDescriptor_qualified_constraint)); } } if
+	 * (fSimilarDeclarations) { switch (type) { case IModelElement.TYPE: break;
+	 * default:
+	 * status.merge(RefactoringStatus.createFatalErrorStatus(DescriptorMessages.
+	 * RenameModelElementDescriptor_similar_constraint)); } } if (fHierarchical) {
+	 * switch (type) { case IModelElement.PACKAGE_FRAGMENT: break; default:
+	 * status.merge(RefactoringStatus.createFatalErrorStatus(DescriptorMessages.
+	 * RenameModelElementDescriptor_hierarchical_constraint)); } } } return status;
+	 * }
+	 */
 }
diff --git a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/CollectingSearchRequestor.java b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/CollectingSearchRequestor.java
index 8b65db3..cb1bc69 100644
--- a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/CollectingSearchRequestor.java
+++ b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/CollectingSearchRequestor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 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
@@ -22,9 +22,9 @@
 import org.eclipse.dltk.core.search.SearchRequestor;
 
 /**
- * Collects the results returned by a <code>SearchEngine</code>.
- * If a {@link ReferencesInBinaryContext} is passed, matches that are
- * inside a binary element are not collected (but added to the context if they are accurate).
+ * Collects the results returned by a <code>SearchEngine</code>. If a
+ * {@link ReferencesInBinaryContext} is passed, matches that are inside a binary
+ * element are not collected (but added to the context if they are accurate).
  */
 public class CollectingSearchRequestor extends SearchRequestor {
 	private final List<SearchMatch> fFound;
@@ -33,23 +33,25 @@
 	public CollectingSearchRequestor() {
 		this(false);
 	}
-	
+
 	public CollectingSearchRequestor(boolean binaryRefs) {
-		fFound = new ArrayList<SearchMatch>();
-		fBinaryRefs = binaryRefs ? new ArrayList<SearchMatch>() : null;
+		fFound = new ArrayList<>();
+		fBinaryRefs = binaryRefs ? new ArrayList<>() : null;
 	}
 
 	/**
-	 * The default implementation calls {@link #collectMatch(SearchMatch)} for
-	 * all matches that make it through {@link #filterMatch(SearchMatch)}.
+	 * The default implementation calls {@link #collectMatch(SearchMatch)} for all
+	 * matches that make it through {@link #filterMatch(SearchMatch)}.
 	 *
-	 * @param match the found match
+	 * @param match
+	 *            the found match
 	 * @throws CoreException
 	 *
 	 * @see org.eclipse.jdt.core.search.SearchRequestor#acceptSearchMatch(org.eclipse.jdt.core.search.SearchMatch)
 	 */
+	@Override
 	public void acceptSearchMatch(SearchMatch match) throws CoreException {
-		if (! filterMatch(match))
+		if (!filterMatch(match))
 			collectMatch(match);
 	}
 
@@ -58,13 +60,16 @@
 	}
 
 	/**
-	 * Returns whether the given match should be filtered out.
-	 * The default implementation filters out matches in binaries iff
-	 * {@link #CollectingSearchRequestor(ReferencesInBinaryContext)} has been called with a
-	 * non-<code>null</code> argument. Accurate binary matches are added to the {@link ReferencesInBinaryContext}.
+	 * Returns whether the given match should be filtered out. The default
+	 * implementation filters out matches in binaries iff
+	 * {@link #CollectingSearchRequestor(ReferencesInBinaryContext)} has been called
+	 * with a non-<code>null</code> argument. Accurate binary matches are added to
+	 * the {@link ReferencesInBinaryContext}.
 	 *
-	 * @param match the match to test
-	 * @return <code>true</code> iff the given match should <em>not</em> be collected
+	 * @param match
+	 *            the match to test
+	 * @return <code>true</code> iff the given match should <em>not</em> be
+	 *         collected
 	 * @throws CoreException
 	 */
 	public boolean filterMatch(SearchMatch match) throws CoreException {
@@ -72,7 +77,8 @@
 			return false;
 
 		if (match.getAccuracy() == SearchMatch.A_ACCURATE && isBinaryElement(match.getElement())) {
-			// binary classpaths are often incomplete -> avoiding false positives from inaccurate matches
+			// binary classpaths are often incomplete -> avoiding false positives from
+			// inaccurate matches
 			fBinaryRefs.add(match);
 			return true;
 		}
@@ -82,11 +88,11 @@
 
 	private static boolean isBinaryElement(Object element) throws ModelException {
 		if (element instanceof IMember) {
-			return ((IMember)element).getSourceModule().isBinary();
+			return ((IMember) element).getSourceModule().isBinary();
 		} else if (element instanceof ISourceModule) {
-			return ((ISourceModule)element).isBinary();
+			return ((ISourceModule) element).isBinary();
 		} else if (element instanceof IProjectFragment) {
-			return ((IProjectFragment)element).isBinary();
+			return ((IProjectFragment) element).isBinary();
 		}
 		return false;
 
@@ -99,5 +105,3 @@
 		return fFound;
 	}
 }
-
-
diff --git a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/RefactoringScopeFactory.java b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/RefactoringScopeFactory.java
index 5ef12b5..ad0d97a 100644
--- a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/RefactoringScopeFactory.java
+++ b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/RefactoringScopeFactory.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 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,15 +32,18 @@
 public class RefactoringScopeFactory {
 
 	/*
-	 * Adds to <code> projects </code> ImodelProject objects for all projects directly or indirectly referencing focus. @param projects ImodelProjects will be added to this set
+	 * Adds to <code> projects </code> ImodelProject objects for all projects
+	 * directly or indirectly referencing focus. @param projects ImodelProjects will
+	 * be added to this set
 	 */
-	private static void addReferencingProjects(IScriptProject focus, Set<IScriptProject> projects) throws ModelException {
-		IProject[] referencingProjects= focus.getProject().getReferencingProjects();
-		for (int i= 0; i < referencingProjects.length; i++) {
-			IScriptProject candidate= DLTKCore.create(referencingProjects[i]);
+	private static void addReferencingProjects(IScriptProject focus, Set<IScriptProject> projects)
+			throws ModelException {
+		IProject[] referencingProjects = focus.getProject().getReferencingProjects();
+		for (int i = 0; i < referencingProjects.length; i++) {
+			IScriptProject candidate = DLTKCore.create(referencingProjects[i]);
 			if (candidate == null || projects.contains(candidate) || !candidate.exists())
 				continue; // break cycle
-			IBuildpathEntry entry= getReferencingClassPathEntry(candidate, focus);
+			IBuildpathEntry entry = getReferencingClassPathEntry(candidate, focus);
 			if (entry != null) {
 				projects.add(candidate);
 				if (entry.isExported())
@@ -50,12 +53,12 @@
 	}
 
 	private static void addRelatedReferencing(IScriptProject focus, Set<IScriptProject> projects) throws CoreException {
-		IProject[] referencingProjects= focus.getProject().getReferencingProjects();
-		for (int i= 0; i < referencingProjects.length; i++) {
-			IScriptProject candidate= DLTKCore.create(referencingProjects[i]);
+		IProject[] referencingProjects = focus.getProject().getReferencingProjects();
+		for (int i = 0; i < referencingProjects.length; i++) {
+			IScriptProject candidate = DLTKCore.create(referencingProjects[i]);
 			if (candidate == null || projects.contains(candidate) || !candidate.exists())
 				continue; // break cycle
-			IBuildpathEntry entry= getReferencingClassPathEntry(candidate, focus);
+			IBuildpathEntry entry = getReferencingClassPathEntry(candidate, focus);
 			if (entry != null) {
 				projects.add(candidate);
 				if (entry.isExported()) {
@@ -67,12 +70,12 @@
 	}
 
 	private static void addRelatedReferenced(IScriptProject focus, Set<IScriptProject> projects) throws CoreException {
-		IProject[] referencedProjects= focus.getProject().getReferencedProjects();
-		for (int i= 0; i < referencedProjects.length; i++) {
-			IScriptProject candidate= DLTKCore.create(referencedProjects[i]);
+		IProject[] referencedProjects = focus.getProject().getReferencedProjects();
+		for (int i = 0; i < referencedProjects.length; i++) {
+			IScriptProject candidate = DLTKCore.create(referencedProjects[i]);
 			if (candidate == null || projects.contains(candidate) || !candidate.exists())
 				continue; // break cycle
-			IBuildpathEntry entry= getReferencingClassPathEntry(focus, candidate);
+			IBuildpathEntry entry = getReferencingClassPathEntry(focus, candidate);
 			if (entry != null) {
 				projects.add(candidate);
 				if (entry.isExported()) {
@@ -84,56 +87,69 @@
 	}
 
 	/**
-	 * Creates a new search scope with all compilation units possibly referencing <code>modelElement</code>,
-	 * considering the visibility of the element, references only from source
+	 * Creates a new search scope with all compilation units possibly referencing
+	 * <code>modelElement</code>, considering the visibility of the element,
+	 * references only from source
 	 *
-	 * @param modelElement the model element
+	 * @param modelElement
+	 *            the model element
 	 * @return the search scope
-	 * @throws ModelException if an error occurs
+	 * @throws ModelException
+	 *             if an error occurs
 	 */
 	public static IDLTKSearchScope create(IModelElement modelElement) throws ModelException {
 		return RefactoringScopeFactory.create(modelElement, true, true);
 	}
 
 	/**
-	 * Creates a new search scope with all compilation units possibly referencing <code>modelElement</code>,
-	 * references only from source
+	 * Creates a new search scope with all compilation units possibly referencing
+	 * <code>modelElement</code>, references only from source
 	 *
-	 * @param modelElement the model element
-	 * @param considerVisibility consider visibility of modelElement iff <code>true</code>
+	 * @param modelElement
+	 *            the model element
+	 * @param considerVisibility
+	 *            consider visibility of modelElement iff <code>true</code>
 	 * @return the search scope
-	 * @throws ModelException if an error occurs
+	 * @throws ModelException
+	 *             if an error occurs
 	 */
-	public static IDLTKSearchScope create(IModelElement modelElement, boolean considerVisibility) throws ModelException {
+	public static IDLTKSearchScope create(IModelElement modelElement, boolean considerVisibility)
+			throws ModelException {
 		return RefactoringScopeFactory.create(modelElement, considerVisibility, true);
 	}
 
-
 	/**
-	 * Creates a new search scope with all compilation units possibly referencing <code>modelElement</code>.
+	 * Creates a new search scope with all compilation units possibly referencing
+	 * <code>modelElement</code>.
 	 *
-	 * @param modelElement the model element
-	 * @param considerVisibility consider visibility of modelElement iff <code>true</code>
-	 * @param sourceReferencesOnly consider references in source only (no references in binary)
+	 * @param modelElement
+	 *            the model element
+	 * @param considerVisibility
+	 *            consider visibility of modelElement iff <code>true</code>
+	 * @param sourceReferencesOnly
+	 *            consider references in source only (no references in binary)
 	 * @return the search scope
-	 * @throws ModelException if an error occurs
+	 * @throws ModelException
+	 *             if an error occurs
 	 */
-	public static IDLTKSearchScope create(IModelElement modelElement, boolean considerVisibility, boolean sourceReferencesOnly) throws ModelException {
+	public static IDLTKSearchScope create(IModelElement modelElement, boolean considerVisibility,
+			boolean sourceReferencesOnly) throws ModelException {
 		if (considerVisibility & modelElement instanceof IMember) {
-			/*IMember member= (IMember) modelElement;
-			if (JdtFlags.isPrivate(member)) {
-				if (member.getCompilationUnit() != null)
-					return SearchEngine.createmodelSearchScope(new ImodelElement[] { member.getCompilationUnit()});
-				else
-					return SearchEngine.createmodelSearchScope(new ImodelElement[] { member});
-			}*/
-			// Removed code that does some optimizations regarding package visible members. The problem is that
-			// there can be a package fragment with the same name in a different source folder or project. So we
+			/*
+			 * IMember member= (IMember) modelElement; if (JdtFlags.isPrivate(member)) { if
+			 * (member.getCompilationUnit() != null) return
+			 * SearchEngine.createmodelSearchScope(new ImodelElement[] {
+			 * member.getCompilationUnit()}); else return
+			 * SearchEngine.createmodelSearchScope(new ImodelElement[] { member}); }
+			 */
+			// Removed code that does some optimizations regarding package visible members.
+			// The problem is that
+			// there can be a package fragment with the same name in a different source
+			// folder or project. So we
 			// have to treat package visible members like public or protected members.
 		}
 
-
-		IScriptProject modelProject= modelElement.getScriptProject();
+		IScriptProject modelProject = modelElement.getScriptProject();
 		return SearchEngine.createSearchScope(getAllScopeElements(modelProject, sourceReferencesOnly), false,
 				modelProject.getLanguageToolkit());
 	}
@@ -141,9 +157,11 @@
 	/**
 	 * Creates a new search scope comprising <code>members</code>.
 	 *
-	 * @param members the members
+	 * @param members
+	 *            the members
 	 * @return the search scope
-	 * @throws modelModelException if an error occurs
+	 * @throws modelModelException
+	 *             if an error occurs
 	 */
 	public static IDLTKSearchScope create(IMember[] members) throws ModelException {
 		return create(members, true);
@@ -152,87 +170,95 @@
 	/**
 	 * Creates a new search scope comprising <code>members</code>.
 	 *
-	 * @param members the members
-	 * @param sourceReferencesOnly consider references in source only (no references in binary)
+	 * @param members
+	 *            the members
+	 * @param sourceReferencesOnly
+	 *            consider references in source only (no references in binary)
 	 * @return the search scope
-	 * @throws modelModelException if an error occurs
+	 * @throws modelModelException
+	 *             if an error occurs
 	 */
 	public static IDLTKSearchScope create(IMember[] members, boolean sourceReferencesOnly) throws ModelException {
-		/*Assert.isTrue(members != null && members.length > 0);
-		IMember candidate= members[0];
-		int visibility= getVisibility(candidate);
-		for (int i= 1; i < members.length; i++) {
-			int mv= getVisibility(members[i]);
-			if (mv > visibility) {
-				visibility= mv;
-				candidate= members[i];
-			}
-		}
-		return create(candidate, true, sourceReferencesOnly);*/
+		/*
+		 * Assert.isTrue(members != null && members.length > 0); IMember candidate=
+		 * members[0]; int visibility= getVisibility(candidate); for (int i= 1; i <
+		 * members.length; i++) { int mv= getVisibility(members[i]); if (mv >
+		 * visibility) { visibility= mv; candidate= members[i]; } } return
+		 * create(candidate, true, sourceReferencesOnly);
+		 */
 		return create(members[0], true, sourceReferencesOnly);
 	}
 
 	/**
-	 * Creates a new search scope with all projects possibly referenced
-	 * from the given <code>modelElements</code>.
+	 * Creates a new search scope with all projects possibly referenced from the
+	 * given <code>modelElements</code>.
 	 *
-	 * @param modelElements the model elements
+	 * @param modelElements
+	 *            the model elements
 	 * @return the search scope
 	 */
 	public static IDLTKSearchScope createReferencedScope(IModelElement[] modelElements) {
-		Set<IScriptProject> projects= new HashSet<IScriptProject>();
-		for (int i= 0; i < modelElements.length; i++) {
+		Set<IScriptProject> projects = new HashSet<>();
+		for (int i = 0; i < modelElements.length; i++) {
 			projects.add(modelElements[i].getScriptProject());
 		}
-		IScriptProject[] prj= projects.toArray(new IScriptProject[projects.size()]);
-		return SearchEngine.createSearchScope(prj, true,
-				prj.length > 0 ? prj[0].getLanguageToolkit() : null);
+		IScriptProject[] prj = projects.toArray(new IScriptProject[projects.size()]);
+		return SearchEngine.createSearchScope(prj, true, prj.length > 0 ? prj[0].getLanguageToolkit() : null);
 	}
 
 	/**
-	 * Creates a new search scope with all projects possibly referenced
-	 * from the given <code>modelElements</code>.
+	 * Creates a new search scope with all projects possibly referenced from the
+	 * given <code>modelElements</code>.
 	 *
-	 * @param modelElements the model elements
-	 * @param includeMask the include mask
+	 * @param modelElements
+	 *            the model elements
+	 * @param includeMask
+	 *            the include mask
 	 * @return the search scope
 	 */
 	public static IDLTKSearchScope createReferencedScope(IModelElement[] modelElements, int includeMask) {
-		Set<IScriptProject> projects= new HashSet<IScriptProject>();
-		for (int i= 0; i < modelElements.length; i++) {
+		Set<IScriptProject> projects = new HashSet<>();
+		for (int i = 0; i < modelElements.length; i++) {
 			projects.add(modelElements[i].getScriptProject());
 		}
-		IScriptProject[] prj= projects.toArray(new IScriptProject[projects.size()]);
-		return SearchEngine.createSearchScope(prj, true,
-				prj.length > 0 ? prj[0].getLanguageToolkit() : null);
+		IScriptProject[] prj = projects.toArray(new IScriptProject[projects.size()]);
+		return SearchEngine.createSearchScope(prj, true, prj.length > 0 ? prj[0].getLanguageToolkit() : null);
 	}
 
 	/**
-	 * Creates a new search scope containing all projects which reference or are referenced by the specified project.
+	 * Creates a new search scope containing all projects which reference or are
+	 * referenced by the specified project.
 	 *
-	 * @param project the project
-	 * @param includeMask the include mask
+	 * @param project
+	 *            the project
+	 * @param includeMask
+	 *            the include mask
 	 * @return the search scope
-	 * @throws CoreException if a referenced project could not be determined
+	 * @throws CoreException
+	 *             if a referenced project could not be determined
 	 */
-	public static IDLTKSearchScope createRelatedProjectsScope(IScriptProject project, int includeMask) throws CoreException {
-		IScriptProject[] projects= getRelatedProjects(project);
+	public static IDLTKSearchScope createRelatedProjectsScope(IScriptProject project, int includeMask)
+			throws CoreException {
+		IScriptProject[] projects = getRelatedProjects(project);
 		return SearchEngine.createSearchScope(projects, true,
 				projects.length > 0 ? projects[0].getLanguageToolkit() : null);
 	}
 
 	/*
 	 * @param projects a collection of ImodelProject
-	 * @return Array of IPackageFragmentRoot, one element for each packageFragmentRoot which lies within a project in <code> projects </code> .
+	 * 
+	 * @return Array of IPackageFragmentRoot, one element for each
+	 * packageFragmentRoot which lies within a project in <code> projects </code> .
 	 */
-	private static IProjectFragment[] getAllScopeElements(IScriptProject project, boolean onlySourceRoots) throws ModelException {
-		Collection<IScriptProject> referencingProjects= getReferencingProjects(project);
-		List<IProjectFragment> result= new ArrayList<IProjectFragment>();
+	private static IProjectFragment[] getAllScopeElements(IScriptProject project, boolean onlySourceRoots)
+			throws ModelException {
+		Collection<IScriptProject> referencingProjects = getReferencingProjects(project);
+		List<IProjectFragment> result = new ArrayList<>();
 		for (IScriptProject scriptProject : referencingProjects) {
-			IProjectFragment[] roots= scriptProject.getProjectFragments();
+			IProjectFragment[] roots = scriptProject.getProjectFragments();
 			// Add all package fragment roots except archives
-			for (int i= 0; i < roots.length; i++) {
-				IProjectFragment root= roots[i];
+			for (int i = 0; i < roots.length; i++) {
+				IProjectFragment root = roots[i];
 				if (!onlySourceRoots || root.getKind() == IProjectFragment.K_SOURCE)
 					result.add(root);
 			}
@@ -241,27 +267,31 @@
 	}
 
 	/*
-	 * Finds, if possible, a classpathEntry in one given project such that this classpath entry references another given project. If more than one entry exists for the referenced project and at least one is exported, then an exported entry will be returned.
+	 * Finds, if possible, a classpathEntry in one given project such that this
+	 * classpath entry references another given project. If more than one entry
+	 * exists for the referenced project and at least one is exported, then an
+	 * exported entry will be returned.
 	 */
-	private static IBuildpathEntry getReferencingClassPathEntry(IScriptProject referencingProject, IScriptProject referencedProject) throws ModelException {
-		IBuildpathEntry result= null;
-		IPath path= referencedProject.getProject().getFullPath();
-		IBuildpathEntry[] classpath= referencingProject.getResolvedBuildpath(true);
-		for (int i= 0; i < classpath.length; i++) {
-			IBuildpathEntry entry= classpath[i];
+	private static IBuildpathEntry getReferencingClassPathEntry(IScriptProject referencingProject,
+			IScriptProject referencedProject) throws ModelException {
+		IBuildpathEntry result = null;
+		IPath path = referencedProject.getProject().getFullPath();
+		IBuildpathEntry[] classpath = referencingProject.getResolvedBuildpath(true);
+		for (int i = 0; i < classpath.length; i++) {
+			IBuildpathEntry entry = classpath[i];
 			if (entry.getEntryKind() == IBuildpathEntry.BPE_PROJECT && path.equals(entry.getPath())) {
 				if (entry.isExported())
 					return entry;
 				// Consider it as a candidate. May be there is another entry that is
 				// exported.
-				result= entry;
+				result = entry;
 			}
 		}
 		return result;
 	}
 
 	private static IScriptProject[] getRelatedProjects(IScriptProject focus) throws CoreException {
-		final Set<IScriptProject> projects= new HashSet<IScriptProject>();
+		final Set<IScriptProject> projects = new HashSet<>();
 
 		addRelatedReferencing(focus, projects);
 		addRelatedReferenced(focus, projects);
@@ -271,22 +301,18 @@
 	}
 
 	private static Collection<IScriptProject> getReferencingProjects(IScriptProject focus) throws ModelException {
-		Set<IScriptProject> projects= new HashSet<IScriptProject>();
+		Set<IScriptProject> projects = new HashSet<>();
 
 		addReferencingProjects(focus, projects);
 		projects.add(focus);
 		return projects;
 	}
 
-	/*private static int getVisibility(IMember member) throws ModelException {
-		if (JdtFlags.isPrivate(member))
-			return 0;
-		if (JdtFlags.isPackageVisible(member))
-			return 1;
-		if (JdtFlags.isProtected(member))
-			return 2;
-		return 4;
-	}*/
+	/*
+	 * private static int getVisibility(IMember member) throws ModelException { if
+	 * (JdtFlags.isPrivate(member)) return 0; if (JdtFlags.isPackageVisible(member))
+	 * return 1; if (JdtFlags.isProtected(member)) return 2; return 4; }
+	 */
 
 	private RefactoringScopeFactory() {
 		// no instances
diff --git a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/ScriptRefactoringArguments.java b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/ScriptRefactoringArguments.java
index e59029d..8b820b5 100644
--- a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/ScriptRefactoringArguments.java
+++ b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/ScriptRefactoringArguments.java
@@ -1,11 +1,10 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2007 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
  * http://www.eclipse.org/legal/epl-v10.html
  *
- 
  *******************************************************************************/
 package org.eclipse.dltk.internal.corext.refactoring;
 
@@ -20,45 +19,45 @@
 /**
  * Refactoring arguments which provide the ability to set arguments using
  * key-value pairs of strings.
- * 
+ *
  * @see RefactoringContribution
  * @see RefactoringDescriptor
- * 
-	 *
+ *
+ *
  */
 public final class ScriptRefactoringArguments extends RefactoringArguments {
 
 	/** The attribute map (element type: <code>&lt;String, String&gt;</code>) */
-	private final Map fAttributes= new HashMap(2);
+	private final Map<String, String> fAttributes = new HashMap<>(2);
 
 	/** The name of the project, or <code>null</code> for the workspace */
 	private String fProject;
 
 	/**
 	 * Creates a new script refactoring arguments.
-	 * 
+	 *
 	 * @param project
 	 *            the project, or <code>null</code> for the workspace
 	 */
 	public ScriptRefactoringArguments(final String project) {
 		Assert.isTrue(project == null || !"".equals(project)); //$NON-NLS-1$
-		fProject= project;
+		fProject = project;
 	}
 
 	/**
 	 * Returns the attribute with the specified name.
-	 * 
+	 *
 	 * @param name
 	 *            the name of the attribute
 	 * @return the attribute value, or <code>null</code>
 	 */
 	public String getAttribute(final String name) {
-		return (String) fAttributes.get(name);
+		return fAttributes.get(name);
 	}
 
 	/**
 	 * Returns the name of the project.
-	 * 
+	 *
 	 * @return the name of the project, or <code>null</code> for the workspace
 	 */
 	public String getProject() {
@@ -67,7 +66,7 @@
 
 	/**
 	 * Sets the attribute with the specified name to the indicated value.
-	 * 
+	 *
 	 * @param name
 	 *            the name of the attribute
 	 * @param value
@@ -81,19 +80,16 @@
 
 	/**
 	 * Sets the name of the project.
-	 * 
+	 *
 	 * @param project
-	 *            the name of the project, or <code>null</code> for the
-	 *            workspace
+	 *            the name of the project, or <code>null</code> for the workspace
 	 */
 	public void setProject(final String project) {
 		Assert.isTrue(project == null || !"".equals(project)); //$NON-NLS-1$
-		fProject= project;
+		fProject = project;
 	}
 
-	/**
-	 * {@inheritDoc}
-	 */
+	@Override
 	public String toString() {
 		return getClass().getName() + fAttributes.toString();
 	}
diff --git a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/ScriptRefactoringContribution.java b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/ScriptRefactoringContribution.java
index 6129dc0..44caf9b 100644
--- a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/ScriptRefactoringContribution.java
+++ b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/ScriptRefactoringContribution.java
@@ -1,11 +1,10 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2007 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
  * http://www.eclipse.org/legal/epl-v10.html
  *
- 
  *******************************************************************************/
 package org.eclipse.dltk.internal.corext.refactoring;
 
@@ -18,22 +17,19 @@
 import org.eclipse.ltk.core.refactoring.RefactoringDescriptor;
 
 /**
- * Partial implementation of ascriptrefactoring contribution.
- * 
-	 *
+ * Partial implementation of a script refactoring contribution.
  */
 public abstract class ScriptRefactoringContribution extends RefactoringContribution {
 
-	/**
-	 * {@inheritDoc}
-	 */
-	public final RefactoringDescriptor createDescriptor(final String id, final String project, final String description, final String comment, final Map arguments, final int flags) {
+	@Override
+	public final RefactoringDescriptor createDescriptor(final String id, final String project, final String description,
+			final String comment, final Map<String, String> arguments, final int flags) {
 		return new ScriptRefactoringDescriptor(this, id, project, description, comment, arguments, flags);
 	}
 
 	/**
 	 * Creates the a new refactoring instance.
-	 * 
+	 *
 	 * @param descriptor
 	 *            the refactoring descriptor
 	 * @return the refactoring, or <code>null</code>
@@ -42,10 +38,8 @@
 	 */
 	public abstract Refactoring createRefactoring(RefactoringDescriptor descriptor) throws CoreException;
 
-	/**
-	 * {@inheritDoc}
-	 */
-	public final Map retrieveArgumentMap(final RefactoringDescriptor descriptor) {
+	@Override
+	public final Map<String, String> retrieveArgumentMap(final RefactoringDescriptor descriptor) {
 		Assert.isNotNull(descriptor);
 		if (descriptor instanceof ScriptRefactoringDescriptor)
 			return ((ScriptRefactoringDescriptor) descriptor).getArguments();
diff --git a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/ScriptRefactoringDescriptor.java b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/ScriptRefactoringDescriptor.java
index 862b443..b3dce05 100644
--- a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/ScriptRefactoringDescriptor.java
+++ b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/ScriptRefactoringDescriptor.java
@@ -1,18 +1,16 @@
 /*******************************************************************************
- * Copyright (c) 2006, 2007 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
  * http://www.eclipse.org/legal/epl-v10.html
  *
- 
  *******************************************************************************/
 package org.eclipse.dltk.internal.corext.refactoring;
 
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
-import java.util.Map.Entry;
 
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.resources.IWorkspaceRoot;
@@ -38,112 +36,111 @@
 import org.eclipse.ltk.core.refactoring.RefactoringStatus;
 import org.eclipse.ltk.core.refactoring.participants.RefactoringArguments;
 
-
 /**
  * Descriptor object of a script refactoring.
- * 
-	 *
+ *
+ *
  */
 public class ScriptRefactoringDescriptor extends RefactoringDescriptor {
 
 	/**
 	 * Predefined argument called <code>element&lt;Number&gt;</code>.
 	 * <p>
-	 * This argument should be used to describe the elements being refactored.
-	 * The value of this argument does not necessarily have to uniquely identify
-	 * the elements. However, it must be possible to uniquely identify the
-	 * elements using the value of this argument in conjunction with the values
-	 * of the other user-defined attributes.
+	 * This argument should be used to describe the elements being refactored. The
+	 * value of this argument does not necessarily have to uniquely identify the
+	 * elements. However, it must be possible to uniquely identify the elements
+	 * using the value of this argument in conjunction with the values of the other
+	 * user-defined attributes.
 	 * </p>
 	 * <p>
-	 * The element arguments are simply distinguished by appending a number to
-	 * the argument name, e.g. element1. The indices of this argument are non
+	 * The element arguments are simply distinguished by appending a number to the
+	 * argument name, e.g. element1. The indices of this argument are non
 	 * zero-based.
 	 * </p>
 	 */
-	public static final String ATTRIBUTE_ELEMENT= "element"; //$NON-NLS-1$
+	public static final String ATTRIBUTE_ELEMENT = "element"; //$NON-NLS-1$
 
 	/**
 	 * Predefined argument called <code>input</code>.
 	 * <p>
-	 * This argument should be used to describe the element being refactored.
-	 * The value of this argument does not necessarily have to uniquely identify
-	 * the input element. However, it must be possible to uniquely identify the
-	 * input element using the value of this argument in conjunction with the
-	 * values of the other user-defined attributes.
+	 * This argument should be used to describe the element being refactored. The
+	 * value of this argument does not necessarily have to uniquely identify the
+	 * input element. However, it must be possible to uniquely identify the input
+	 * element using the value of this argument in conjunction with the values of
+	 * the other user-defined attributes.
 	 * </p>
 	 */
-	public static final String ATTRIBUTE_INPUT= "input"; //$NON-NLS-1$
+	public static final String ATTRIBUTE_INPUT = "input"; //$NON-NLS-1$
 
 	/**
 	 * Predefined argument called <code>name</code>.
 	 * <p>
-	 * This argument should be used to name the element being refactored. The
-	 * value of this argument may be shown in the user interface.
+	 * This argument should be used to name the element being refactored. The value
+	 * of this argument may be shown in the user interface.
 	 * </p>
 	 */
-	public static final String ATTRIBUTE_NAME= "name"; //$NON-NLS-1$
+	public static final String ATTRIBUTE_NAME = "name"; //$NON-NLS-1$
 
 	/**
 	 * Predefined argument called <code>references</code>.
 	 * <p>
-	 * This argument should be used to describe whether references to the
-	 * elements being refactored should be updated as well. The value of this
-	 * argument is either <code>"true"</code> or <code>"false"</code>.
+	 * This argument should be used to describe whether references to the elements
+	 * being refactored should be updated as well. The value of this argument is
+	 * either <code>"true"</code> or <code>"false"</code>.
 	 * </p>
 	 */
-	public static final String ATTRIBUTE_REFERENCES= "references"; //$NON-NLS-1$
+	public static final String ATTRIBUTE_REFERENCES = "references"; //$NON-NLS-1$
 
 	/**
 	 * Predefined argument called <code>selection</code>.
 	 * <p>
-	 * This argument should be used to describe user input selections within a
-	 * text file. The value of this argument has the format "offset length".
+	 * This argument should be used to describe user input selections within a text
+	 * file. The value of this argument has the format "offset length".
 	 * </p>
 	 */
-	public static final String ATTRIBUTE_SELECTION= "selection"; //$NON-NLS-1$
+	public static final String ATTRIBUTE_SELECTION = "selection"; //$NON-NLS-1$
 
 	/** The version attribute */
-	private static final String ATTRIBUTE_VERSION= "version"; //$NON-NLS-1$
+	private static final String ATTRIBUTE_VERSION = "version"; //$NON-NLS-1$
 
 	/**
 	 * Constant describing the deprecation resolving flag.
 	 * <p>
 	 * Clients should set this flag to indicate that the refactoring can used to
-	 * resolve deprecation problems of members. Refactorings which can run on
-	 * binary targets, but require a source attachment to work correctly, should
-	 * set the <code>ARCHIVE_SOURCE_ATTACHMENT</code> flag as well.
+	 * resolve deprecation problems of members. Refactorings which can run on binary
+	 * targets, but require a source attachment to work correctly, should set the
+	 * <code>ARCHIVE_SOURCE_ATTACHMENT</code> flag as well.
 	 * </p>
 	 */
-	public static final int DEPRECATION_RESOLVING= 1 << 17;
+	public static final int DEPRECATION_RESOLVING = 1 << 17;
 
 	/**
 	 * Constant describing the archive importable flag.
 	 * <p>
-	 * Clients should set this flag to indicate that the refactoring can be
-	 * imported from a archive file. If this flag is set,
-	 * <code>ARCHIVE_REFACTORABLE</code> should be set as well.
+	 * Clients should set this flag to indicate that the refactoring can be imported
+	 * from a archive file. If this flag is set, <code>ARCHIVE_REFACTORABLE</code>
+	 * should be set as well.
 	 * </p>
 	 */
-	public static final int ARCHIVE_IMPORTABLE= 1 << 16;
+	public static final int ARCHIVE_IMPORTABLE = 1 << 16;
 
 	/**
 	 * Constant describing the jar refactorable flag.
 	 * <p>
 	 * Clients should set this flag to indicate that the refactoring can be
-	 * performed on a JAR file. Refactorings which can run on binary targets,
-	 * but require a source attachment to work correctly, should set the
+	 * performed on a JAR file. Refactorings which can run on binary targets, but
+	 * require a source attachment to work correctly, should set the
 	 * <code>JAR_SOURCE_ATTACHMENT</code> flag as well.
 	 * </p>
 	 */
-	public static final int ARCHIVE_REFACTORABLE= 1 << 19;
-	
+	public static final int ARCHIVE_REFACTORABLE = 1 << 19;
+
 	/** The version value 1.0 */
-	private static final String VALUE_VERSION_1_0= "1.0"; //$NON-NLS-1$
+	private static final String VALUE_VERSION_1_0 = "1.0"; //$NON-NLS-1$
 
 	/**
 	 * Converts the specified element to an input handle.
-	 * 
+	 *
 	 * @param project
 	 *            the project, or <code>null</code> for the workspace
 	 * @param element
@@ -151,9 +148,9 @@
 	 * @return a corresponding input handle
 	 */
 	public static String elementToHandle(final String project, final IModelElement element) {
-		final String handle= element.getHandleIdentifier();
+		final String handle = element.getHandleIdentifier();
 		if (project != null && !(element instanceof IScriptProject)) {
-			final String id= element.getScriptProject().getHandleIdentifier();
+			final String id = element.getScriptProject().getHandleIdentifier();
 			return handle.substring(id.length());
 		}
 		return handle;
@@ -161,7 +158,7 @@
 
 	/**
 	 * Converts an input handle back to the corresponding script element.
-	 * 
+	 *
 	 * @param project
 	 *            the project, or <code>null</code> for the workspace
 	 * @param handle
@@ -175,7 +172,7 @@
 
 	/**
 	 * Converts an input handle back to the corresponding script element.
-	 * 
+	 *
 	 * @param project
 	 *            the project, or <code>null</code> for the workspace
 	 * @param handle
@@ -192,7 +189,7 @@
 
 	/**
 	 * Converts an input handle back to the corresponding script element.
-	 * 
+	 *
 	 * @param owner
 	 *            the working copy owner
 	 * @param project
@@ -205,29 +202,31 @@
 	 * @return the corresponding script element, or <code>null</code> if no such
 	 *         element exists
 	 */
-	public static IModelElement handleToElement(final WorkingCopyOwner owner, final String project, final String handle, final boolean check) {
-		IModelElement element= null;
+	public static IModelElement handleToElement(final WorkingCopyOwner owner, final String project, final String handle,
+			final boolean check) {
+		IModelElement element = null;
 		if (owner != null)
-			element= DLTKCore.create(handle, owner);
+			element = DLTKCore.create(handle, owner);
 		else
-			element= DLTKCore.create(handle);
+			element = DLTKCore.create(handle);
 		if (element == null && project != null) {
-			final IScriptProject scriptProject= DLTKCore.create(ResourcesPlugin.getWorkspace().getRoot()).getScriptProject(project);
-			final String identifier= scriptProject.getHandleIdentifier();
+			final IScriptProject scriptProject = DLTKCore.create(ResourcesPlugin.getWorkspace().getRoot())
+					.getScriptProject(project);
+			final String identifier = scriptProject.getHandleIdentifier();
 			if (owner != null)
-				element= DLTKCore.create(identifier + handle, owner);
+				element = DLTKCore.create(identifier + handle, owner);
 			else
-				element= DLTKCore.create(identifier + handle);
+				element = DLTKCore.create(identifier + handle);
 		}
 		if (DLTKCore.DEBUG) {
 			System.err.println("TODo: ScriptRefactoringDescriptor add find Methods member in types..."); //$NON-NLS-1$
 		}
-//		if (check && element instanceof IMethod) {
-//			final IMethod method= (IMethod) element;
-//			final IMethod[] methods= method.getDeclaringType().findMethods(method);
-//			if (methods != null && methods.length > 0)
-//				element= methods[0];
-//		}
+		// if (check && element instanceof IMethod) {
+		// final IMethod method= (IMethod) element;
+		// final IMethod[] methods= method.getDeclaringType().findMethods(method);
+		// if (methods != null && methods.length > 0)
+		// element= methods[0];
+		// }
 		if (element != null && (!check || element.exists()))
 			return element;
 		return null;
@@ -236,20 +235,20 @@
 	/**
 	 * Converts an input handle with the given prefix back to the corresponding
 	 * resource.
-	 * 
+	 *
 	 * @param project
 	 *            the project, or <code>null</code> for the workspace
 	 * @param handle
 	 *            the input handle
-	 * 
-	 * @return the corresponding resource, or <code>null</code> if no such
-	 *         resource exists
+	 *
+	 * @return the corresponding resource, or <code>null</code> if no such resource
+	 *         exists
 	 */
 	public static IResource handleToResource(final String project, final String handle) {
-		final IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot();
+		final IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
 		if ("".equals(handle)) //$NON-NLS-1$
 			return null;
-		final IPath path= Path.fromPortableString(handle);
+		final IPath path = Path.fromPortableString(handle);
 		if (path == null)
 			return null;
 		if (project != null && !"".equals(project)) //$NON-NLS-1$
@@ -259,12 +258,12 @@
 
 	/**
 	 * Converts the specified resource to an input handle.
-	 * 
+	 *
 	 * @param project
 	 *            the project, or <code>null</code> for the workspace
 	 * @param resource
 	 *            the resource
-	 * 
+	 *
 	 * @return the input handle
 	 */
 	public static String resourceToHandle(final String project, final IResource resource) {
@@ -274,14 +273,14 @@
 	}
 
 	/** The map of arguments (element type: &lt;String, String&gt;) */
-	protected final Map fArguments;
+	protected final Map<String, String> fArguments;
 
 	/** The refactoring contribution, or <code>null</code> */
 	private ScriptRefactoringContribution fContribution;
 
 	/**
 	 * Creates a new script refactoring descriptor.
-	 * 
+	 *
 	 * @param contribution
 	 *            the refactoring contribution, or <code>null</code>
 	 * @param id
@@ -297,11 +296,13 @@
 	 * @param flags
 	 *            the flags
 	 */
-	public ScriptRefactoringDescriptor(final ScriptRefactoringContribution contribution, final String id, final String project, final String description, final String comment, final Map arguments, final int flags) {
+	public ScriptRefactoringDescriptor(final ScriptRefactoringContribution contribution, final String id,
+			final String project, final String description, final String comment, final Map<String, String> arguments,
+			final int flags) {
 		super(id, project, description, comment, flags);
 		Assert.isNotNull(arguments);
-		fContribution= contribution;
-		fArguments= arguments;
+		fContribution = contribution;
+		fArguments = arguments;
 	}
 
 	/**
@@ -311,12 +312,13 @@
 	 *            the unique id of the refactoring
 	 */
 	protected ScriptRefactoringDescriptor(final String id) {
-		this(id, null, DescriptorMessages.ScriptRefactoringDescriptor_not_available, null, new HashMap(), RefactoringDescriptor.STRUCTURAL_CHANGE | RefactoringDescriptor.MULTI_CHANGE);
+		this(id, null, DescriptorMessages.ScriptRefactoringDescriptor_not_available, null, new HashMap<>(),
+				RefactoringDescriptor.STRUCTURAL_CHANGE | RefactoringDescriptor.MULTI_CHANGE);
 	}
 
 	/**
 	 * Creates a new script refactoring descriptor.
-	 * 
+	 *
 	 * @param id
 	 *            the unique id of the refactoring
 	 * @param project
@@ -330,56 +332,60 @@
 	 * @param flags
 	 *            the flags
 	 */
-	public ScriptRefactoringDescriptor(final String id, final String project, final String description, final String comment, final Map arguments, final int flags) {
+	public ScriptRefactoringDescriptor(final String id, final String project, final String description,
+			final String comment, final Map<String, String> arguments, final int flags) {
 		this(null, id, project, description, comment, arguments, flags);
 	}
 
 	/**
 	 * Creates refactoring arguments for this refactoring descriptor.
-	 * 
+	 *
 	 * @return the refactoring arguments
 	 */
 	public RefactoringArguments createArguments() {
-		final ScriptRefactoringArguments arguments= new ScriptRefactoringArguments(getProject());
-		for (final Iterator iterator= fArguments.entrySet().iterator(); iterator.hasNext();) {
-			final Map.Entry entry= (Entry) iterator.next();
-			final String name= (String) entry.getKey();
-			final String value= (String) entry.getValue();
+		final ScriptRefactoringArguments arguments = new ScriptRefactoringArguments(getProject());
+		for (final Iterator<Map.Entry<String, String>> iterator = fArguments.entrySet().iterator(); iterator
+				.hasNext();) {
+			final Map.Entry<String, String> entry = iterator.next();
+			final String name = entry.getKey();
+			final String value = entry.getValue();
 			if (name != null && !"".equals(name) && value != null) //$NON-NLS-1$
 				arguments.setAttribute(name, value);
 		}
 		return arguments;
 	}
 
-	/**
-	 * {@inheritDoc}
-	 */
+	@Override
 	public Refactoring createRefactoring(final RefactoringStatus status) throws CoreException {
-		Refactoring refactoring= null;
+		Refactoring refactoring = null;
 		if (fContribution != null)
-			refactoring= fContribution.createRefactoring(this);
+			refactoring = fContribution.createRefactoring(this);
 		else {
-			final RefactoringContribution contribution= RefactoringCore.getRefactoringContribution(getID());
+			final RefactoringContribution contribution = RefactoringCore.getRefactoringContribution(getID());
 			if (contribution instanceof ScriptRefactoringContribution) {
-				fContribution= (ScriptRefactoringContribution) contribution;
-				refactoring= fContribution.createRefactoring(this);
+				fContribution = (ScriptRefactoringContribution) contribution;
+				refactoring = fContribution.createRefactoring(this);
 			}
 		}
 		if (refactoring != null) {
 			if (refactoring instanceof IScriptableRefactoring) {
-				final RefactoringStatus result= ((IScriptableRefactoring) refactoring).initialize(createArguments());
+				final RefactoringStatus result = ((IScriptableRefactoring) refactoring).initialize(createArguments());
 				if (result.hasFatalError())
-					throw new CoreException(new Status(IStatus.ERROR, ScriptManipulation.ID_PLUGIN, 0, result.getMessageMatchingSeverity(RefactoringStatus.FATAL), null));
+					throw new CoreException(new Status(IStatus.ERROR, ScriptManipulation.ID_PLUGIN, 0,
+							result.getMessageMatchingSeverity(RefactoringStatus.FATAL), null));
 				status.merge(result);
 			} else
-				throw new CoreException(new Status(IStatus.ERROR, ScriptManipulation.ID_PLUGIN, 0, Messages.format(DescriptorMessages.ScriptRefactoringDescriptor_no_resulting_descriptor, getDescription()), null));
+				throw new CoreException(new Status(IStatus.ERROR, ScriptManipulation.ID_PLUGIN, 0,
+						Messages.format(DescriptorMessages.ScriptRefactoringDescriptor_no_resulting_descriptor,
+								getDescription()),
+						null));
 		}
 		return refactoring;
 	}
 
 	/**
 	 * Converts the specified element to an input handle.
-	 * 
+	 *
 	 * @param element
 	 *            the element
 	 * @return a corresponding input handle
@@ -391,17 +397,18 @@
 
 	/**
 	 * Returns the argument map
-	 * 
+	 *
 	 * @return the argument map.
 	 */
-	public Map getArguments() {
+	public Map<String, String> getArguments() {
 		populateArgumentMap();
-		return new HashMap(fArguments);
+		return new HashMap<>(fArguments);
 	}
-	
+
 	/**
 	 * Populates the refactoring descriptor argument map based on the specified
-	 * arguments. Subclasses should extend and add their arguments to {@link #fArguments}.
+	 * arguments. Subclasses should extend and add their arguments to
+	 * {@link #fArguments}.
 	 */
 	protected void populateArgumentMap() {
 		fArguments.put(ATTRIBUTE_VERSION, VALUE_VERSION_1_0);
@@ -409,7 +416,7 @@
 
 	/**
 	 * Returns the refactoring contribution.
-	 * 
+	 *
 	 * @return the refactoring contribution, or <code>null</code>
 	 */
 	public ScriptRefactoringContribution getContribution() {
diff --git a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/SearchResultGroup.java b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/SearchResultGroup.java
index 2b4ac9e..9ad2002 100644
--- a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/SearchResultGroup.java
+++ b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/SearchResultGroup.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 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
@@ -29,10 +29,10 @@
 	private final IResource fResource;
 	private final List<SearchMatch> fSearchMatches;
 
-	public SearchResultGroup(IResource res, SearchMatch[] matches){
+	public SearchResultGroup(IResource res, SearchMatch[] matches) {
 		Assert.isNotNull(matches);
-		fResource= res;
-		fSearchMatches= new ArrayList<SearchMatch>(Arrays.asList(matches));
+		fResource = res;
+		fSearchMatches = new ArrayList<>(Arrays.asList(matches));
 	}
 
 	public void add(SearchMatch match) {
@@ -48,25 +48,26 @@
 		return Collections.unmodifiableList(fSearchMatches);
 	}
 
-	public static IResource[] getResources(SearchResultGroup[] searchResultGroups){
-		Set<IResource> resourceSet= new HashSet<IResource>(searchResultGroups.length);
-		for (int i= 0; i < searchResultGroups.length; i++) {
+	public static IResource[] getResources(SearchResultGroup[] searchResultGroups) {
+		Set<IResource> resourceSet = new HashSet<>(searchResultGroups.length);
+		for (int i = 0; i < searchResultGroups.length; i++) {
 			resourceSet.add(searchResultGroups[i].getResource());
 		}
 		return resourceSet.toArray(new IResource[resourceSet.size()]);
 	}
 
-	public ISourceModule getSourceModule(){
+	public ISourceModule getSourceModule() {
 		if (getSearchResults() == null || getSearchResults().size() == 0)
 			return null;
 		return SearchUtils.getSourceModule(getSearchResults().get(0));
 	}
 
+	@Override
 	public String toString() {
-		StringBuffer buf= new StringBuffer(fResource.getFullPath().toString());
+		StringBuffer buf = new StringBuffer(fResource.getFullPath().toString());
 		buf.append('\n');
-		for (int i= 0; i < fSearchMatches.size(); i++) {
-			SearchMatch match= fSearchMatches.get(i);
+		for (int i = 0; i < fSearchMatches.size(); i++) {
+			SearchMatch match = fSearchMatches.get(i);
 			buf.append("  ").append(match.getOffset()).append(", ").append(match.getLength()); //$NON-NLS-1$//$NON-NLS-2$
 			buf.append(match.getAccuracy() == SearchMatch.A_ACCURATE ? "; acc" : "; inacc"); //$NON-NLS-1$//$NON-NLS-2$
 			if (match.isInsideDocComment())
diff --git a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/base/ScriptStatusContext.java b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/base/ScriptStatusContext.java
index cb6352a..3eb3de0 100644
--- a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/base/ScriptStatusContext.java
+++ b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/base/ScriptStatusContext.java
@@ -1,11 +1,10 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 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
  * http://www.eclipse.org/legal/epl-v10.html
  *
- 
  *******************************************************************************/
 package org.eclipse.dltk.internal.corext.refactoring.base;
 
@@ -17,127 +16,125 @@
 import org.eclipse.dltk.core.SourceRange;
 import org.eclipse.ltk.core.refactoring.RefactoringStatusContext;
 
-
 /**
- * A Script element context that can be used to annotate a </code>RefactoringStatusEntry<code> 
+ * A Script element context that can be used to annotate a
+ * </code>RefactoringStatusEntry<code>
  * with detailed information about an error detected in an <code>IScriptElement</code>.
  */
 public abstract class ScriptStatusContext extends RefactoringStatusContext {
 
 	private static class MemberSourceContext extends ScriptStatusContext {
 		private IMember fMember;
+
 		private MemberSourceContext(IMember member) {
-			fMember= member;
+			fMember = member;
 		}
+
+		@Override
 		public boolean isBinary() {
-			//return fMember.isBinary();
+			// return fMember.isBinary();
 			return false;
 		}
+
+		@Override
 		public ISourceModule getSourceModule() {
 			return fMember.getSourceModule();
-		}		
+		}
+
+		@Override
 		public ISourceRange getSourceRange() {
 			try {
 				return fMember.getSourceRange();
-			} catch (ModelException e) {			
-				return new SourceRange(0,0);
+			} catch (ModelException e) {
+				return new SourceRange(0, 0);
 			}
 		}
 	}
-	
-//	private static class ImportDeclarationSourceContext extends ScriptStatusContext {
-//		private IImportDeclaration fImportDeclartion;
-//		private ImportDeclarationSourceContext(IImportDeclaration declaration) {
-//			fImportDeclartion= declaration;
-//		}
-//		public boolean isBinary() {
-//			return false;
-//		}
-//		public ISourceModule getSourceModule() {
-//			return (ISourceModule)fImportDeclartion.getParent().getParent();
-//		}
-//		public IClassFile getClassFile() {
-//			return null;
-//		}
-//		public ISourceRange getSourceRange() {
-//			try {
-//				return fImportDeclartion.getSourceRange();
-//			} catch (ModelException e) {
-//				return new SourceRange(0,0);
-//			}
-//		}
-//	}
-	
+
 	private static class SourceModuleSourceContext extends ScriptStatusContext {
 		private ISourceModule fCUnit;
 		private ISourceRange fSourceRange;
+
 		private SourceModuleSourceContext(ISourceModule cunit, ISourceRange range) {
-			fCUnit= cunit;
-			fSourceRange= range;
+			fCUnit = cunit;
+			fSourceRange = range;
 			if (fSourceRange == null)
-				fSourceRange= new SourceRange(0,0);
+				fSourceRange = new SourceRange(0, 0);
 		}
+
+		@Override
 		public boolean isBinary() {
 			return false;
 		}
+
+		@Override
 		public ISourceModule getSourceModule() {
 			return fCUnit;
 		}
+
+		@Override
 		public ISourceRange getSourceRange() {
 			return fSourceRange;
 		}
+
+		@Override
 		public String toString() {
 			return getSourceRange() + " in " + super.toString(); //$NON-NLS-1$
 		}
-	}	
-	
+	}
+
 	/**
 	 * Creates an status entry context for the given member
-	 * 
-	 * @param member thescriptmember for which the context is supposed 
-	 *  to be created
-	 * @return the status entry context or <code>null</code> if the
-	 * 	context cannot be created
+	 *
+	 * @param member
+	 *            thescriptmember for which the context is supposed to be created
+	 * @return the status entry context or <code>null</code> if the context cannot
+	 *         be created
 	 */
 	public static RefactoringStatusContext create(IMember member) {
 		if (member == null || !member.exists())
 			return null;
 		return new MemberSourceContext(member);
 	}
-	
-//	/**
-//	 * Creates an status entry context for the given import declaration
-//	 * 
-//	 * @param declaration the import declaration for which the context is 
-//	 *  supposed to be created
-//	 * @return the status entry context or <code>null</code> if the
-//	 * 	context cannot be created
-//	 */
-//	public static RefactoringStatusContext create(IImportDeclaration declaration) {
-//		if (declaration == null || !declaration.exists())
-//			return null;
-//		return new ImportDeclarationSourceContext(declaration);
-//	}	
+
+	// /**
+	// * Creates an status entry context for the given import declaration
+	// *
+	// * @param declaration the import declaration for which the context is
+	// * supposed to be created
+	// * @return the status entry context or <code>null</code> if the
+	// * context cannot be created
+	// */
+	// public static RefactoringStatusContext create(IImportDeclaration declaration)
+	// {
+	// if (declaration == null || !declaration.exists())
+	// return null;
+	// return new ImportDeclarationSourceContext(declaration);
+	// }
 
 	/**
 	 * Creates an status entry context for the given compilation unit.
-	 * 
-	 * @param cunit the compilation unit containing the error
+	 *
+	 * @param cunit
+	 *            the compilation unit containing the error
 	 * @return the status entry context or <code>Context.NULL_CONTEXT</code> if the
-	 * 	context cannot be created
+	 *         context cannot be created
 	 */
 	public static RefactoringStatusContext create(ISourceModule cunit) {
-		return create(cunit, (ISourceRange)null);
+		return create(cunit, (ISourceRange) null);
 	}
 
 	/**
-	 * Creates an status entry context for the given compilation unit and source range.
-	 * 
-	 * @param cunit the compilation unit containing the error
-	 * @param range the source range that has caused the error or 
-	 *  <code>null</code> if the source range is unknown
-	 * @return the status entry context or <code>null</code> if the
-	 * 	context cannot be created
+	 * Creates an status entry context for the given compilation unit and source
+	 * range.
+	 *
+	 * @param cunit
+	 *            the compilation unit containing the error
+	 * @param range
+	 *            the source range that has caused the error or <code>null</code> if
+	 *            the source range is unknown
+	 * @return the status entry context or <code>null</code> if the context cannot
+	 *         be created
 	 */
 	public static RefactoringStatusContext create(ISourceModule cunit, ISourceRange range) {
 		if (cunit == null)
@@ -147,65 +144,62 @@
 
 	/**
 	 * Creates an status entry context for the given compilation unit and AST node.
-	 * 
-	 * @param cunit the compilation unit containing the error
-	 * @param node an astNode denoting the source range that has caused the error
-	 * 
+	 *
+	 * @param cunit
+	 *            the compilation unit containing the error
+	 * @param node
+	 *            an astNode denoting the source range that has caused the error
+	 *
 	 * @return the status entry context or <code>Context.NULL_CONTEXT</code> if the
-	 * 	context cannot be created
+	 *         context cannot be created
 	 */
 	public static RefactoringStatusContext create(ISourceModule cunit, ASTNode node) {
-		ISourceRange range= null;
+		ISourceRange range = null;
 		if (node != null)
-			range= new SourceRange(node.sourceStart(), node.sourceEnd());
+			range = new SourceRange(node.sourceStart(), node.sourceEnd());
 		return create(cunit, range);
 	}
 
 	/**
 	 * Creates an status entry context for the given compilation unit and selection.
-	 * 
-	 * @param cunit the compilation unit containing the error
-	 * @param selection a selection denoting the source range that has caused the error
-	 * 
-	 * @return the status entry context or <code>Context.NULL_CONTEXT</code> if the
-	 * 	context cannot be created
 	 *
-	public static RefactoringStatusContext create(ISourceModule cunit, Selection selection) {
-		ISourceRange range= null;
-		if (selection != null)
-			range= new SourceRange(selection.getOffset(), selection.getLength());
-		return create(cunit, range);
-	}
-
-	/**
-	 * Returns whether this context is for a class file.
+	 * @param cunit
+	 *            the compilation unit containing the error
+	 * @param selection
+	 *            a selection denoting the source range that has caused the error
+	 *
+	 * @return the status entry context or <code>Context.NULL_CONTEXT</code> if the
+	 *         context cannot be created
+	 *
+	 *         public static RefactoringStatusContext create(ISourceModule cunit,
+	 *         Selection selection) { ISourceRange range= null; if (selection !=
+	 *         null) range= new SourceRange(selection.getOffset(),
+	 *         selection.getLength()); return create(cunit, range); }
+	 *
+	 *         /** Returns whether this context is for a class file.
 	 *
 	 * @return <code>true</code> if from a class file, and <code>false</code> if
-	 *   from a compilation unit
+	 *         from a compilation unit
 	 */
 	public abstract boolean isBinary();
-	
+
 	/**
-	 * Returns the compilation unit this context is working on. Returns <code>null</code>
-	 * if the context is a binary context.
-	 * 
+	 * Returns the compilation unit this context is working on. Returns
+	 * <code>null</code> if the context is a binary context.
+	 *
 	 * @return the compilation unit
 	 */
 	public abstract ISourceModule getSourceModule();
-	
-	
+
 	/**
 	 * Returns the source range associated with this element.
 	 *
 	 * @return the source range
 	 */
 	public abstract ISourceRange getSourceRange();
-	
-	/* (non-Javadoc)
-	 * Method declared on Context.
-	 */
+
+	@Override
 	public Object getCorrespondingElement() {
 		return getSourceModule();
-	}	
+	}
 }
-
diff --git a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/changes/DynamicValidationRefactoringChange.java b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/changes/DynamicValidationRefactoringChange.java
index 7575313..75b1743 100644
--- a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/changes/DynamicValidationRefactoringChange.java
+++ b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/changes/DynamicValidationRefactoringChange.java
@@ -1,11 +1,10 @@
 /*******************************************************************************
- * Copyright (c) 2006, 2007 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
  * http://www.eclipse.org/legal/epl-v10.html
  *
- 
  *******************************************************************************/
 package org.eclipse.dltk.internal.corext.refactoring.changes;
 
@@ -18,7 +17,7 @@
 /**
  * Dynamic validation state change with support for refactoring descriptors.
  * 
-	 *
+ *
  */
 public final class DynamicValidationRefactoringChange extends DynamicValidationStateChange {
 
@@ -27,7 +26,7 @@
 
 	/**
 	 * Creates a new dynamic validation refactoring change.
-	 * 
+	 *
 	 * @param descriptor
 	 *            the refactoring descriptor
 	 * @param name
@@ -36,12 +35,12 @@
 	public DynamicValidationRefactoringChange(final RefactoringDescriptor descriptor, final String name) {
 		super(name);
 		Assert.isNotNull(descriptor);
-		fDescriptor= descriptor;
+		fDescriptor = descriptor;
 	}
 
 	/**
 	 * Creates a new dynamic validation refactoring change.
-	 * 
+	 *
 	 * @param descriptor
 	 *            the refactoring descriptor
 	 * @param name
@@ -49,15 +48,14 @@
 	 * @param changes
 	 *            the changes
 	 */
-	public DynamicValidationRefactoringChange(final RefactoringDescriptor descriptor, final String name, final Change[] changes) {
+	public DynamicValidationRefactoringChange(final RefactoringDescriptor descriptor, final String name,
+			final Change[] changes) {
 		super(name, changes);
 		Assert.isNotNull(descriptor);
-		fDescriptor= descriptor;
+		fDescriptor = descriptor;
 	}
 
-	/**
-	 * {@inheritDoc}
-	 */
+	@Override
 	public ChangeDescriptor getDescriptor() {
 		return new RefactoringChangeDescriptor(fDescriptor);
 	}
diff --git a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/changes/UndoSourceModuleChange.java b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/changes/UndoSourceModuleChange.java
index 0204ee3..003d9bc 100644
--- a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/changes/UndoSourceModuleChange.java
+++ b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/changes/UndoSourceModuleChange.java
@@ -1,11 +1,10 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 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
  * http://www.eclipse.org/legal/epl-v10.html
  *
- 
  *******************************************************************************/
 package org.eclipse.dltk.internal.corext.refactoring.changes;
 
@@ -24,53 +23,41 @@
 import org.eclipse.ltk.core.refactoring.UndoTextFileChange;
 import org.eclipse.text.edits.UndoEdit;
 
-
 public class UndoSourceModuleChange extends UndoTextFileChange {
-	
+
 	private ISourceModule fCUnit;
 
-	public UndoSourceModuleChange(String name, ISourceModule unit, UndoEdit undo, ContentStamp stampToRestore, int saveMode) throws CoreException {
+	public UndoSourceModuleChange(String name, ISourceModule unit, UndoEdit undo, ContentStamp stampToRestore,
+			int saveMode) throws CoreException {
 		super(name, getFile(unit), undo, stampToRestore, saveMode);
-		fCUnit= unit;
+		fCUnit = unit;
 	}
 
 	private static IFile getFile(ISourceModule cunit) throws CoreException {
-		IFile file= (IFile)cunit.getResource();
+		IFile file = (IFile) cunit.getResource();
 		if (file == null)
-			throw new CoreException(new Status(
-				IStatus.ERROR, 
-				ScriptManipulationPlugin.getPluginId(), 
-				IStatus.ERROR, 
-				Messages.format(
-					RefactoringCoreMessages.UndoSourceModuleChange_no_resource, 
-					cunit.getElementName()), 
-				null)
-			);
+			throw new CoreException(new Status(IStatus.ERROR, ScriptManipulationPlugin.getPluginId(), IStatus.ERROR,
+					Messages.format(RefactoringCoreMessages.UndoSourceModuleChange_no_resource, cunit.getElementName()),
+					null));
 		return file;
 	}
-	
-	/**
-	 * {@inheritDoc}
-	 */
+
+	@Override
 	public Object getModifiedElement() {
 		return fCUnit;
 	}
-	
-	/**
-	 * {@inheritDoc}
-	 */
+
+	@Override
 	protected Change createUndoChange(UndoEdit edit, ContentStamp stampToRestore) throws CoreException {
 		return new UndoSourceModuleChange(getName(), fCUnit, edit, stampToRestore, getSaveMode());
 	}
-	
-	/**
-	 * {@inheritDoc}
-	 */
+
+	@Override
 	public Change perform(IProgressMonitor pm) throws CoreException {
 		pm.beginTask("", 2); //$NON-NLS-1$
-		fCUnit.becomeWorkingCopy(null, new SubProgressMonitor(pm,1));
+		fCUnit.becomeWorkingCopy(null, new SubProgressMonitor(pm, 1));
 		try {
-			return super.perform(new SubProgressMonitor(pm,1));
+			return super.perform(new SubProgressMonitor(pm, 1));
 		} finally {
 			fCUnit.discardWorkingCopy();
 		}
diff --git a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/code/ScriptableRefactoring.java b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/code/ScriptableRefactoring.java
index 38401a8..a9abf34 100644
--- a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/code/ScriptableRefactoring.java
+++ b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/code/ScriptableRefactoring.java
@@ -1,11 +1,10 @@
 /*******************************************************************************
- * Copyright (c) 2006, 2007 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
  * http://www.eclipse.org/legal/epl-v10.html
  *
- 
  *******************************************************************************/
 package org.eclipse.dltk.internal.corext.refactoring.code;
 
@@ -20,15 +19,13 @@
 /**
  * Partial implementation of a scriptable refactoring which provides a comment
  * for the history.
- * 
-	 *
+ *
  */
 public abstract class ScriptableRefactoring extends Refactoring implements IScriptableRefactoring, ICommentProvider {
 
 	/**
-	 * Creates a fatal error status telling that the input element does not
-	 * exist.
-	 * 
+	 * Creates a fatal error status telling that the input element does not exist.
+	 *
 	 * @param element
 	 *            the input element, or <code>null</code>
 	 * @param name
@@ -40,12 +37,13 @@
 	public static RefactoringStatus createInputFatalStatus(final Object element, final String name, final String id) {
 		Assert.isNotNull(name);
 		Assert.isNotNull(id);
-		return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_inputs_do_not_exist, new String[] { name, id}));
+		return RefactoringStatus.createFatalErrorStatus(Messages.format(
+				RefactoringCoreMessages.InitializableRefactoring_inputs_do_not_exist, new String[] { name, id }));
 	}
 
 	/**
 	 * Creates a warning status telling that the input element does not exist.
-	 * 
+	 *
 	 * @param element
 	 *            the input element, or <code>null</code>
 	 * @param name
@@ -58,25 +56,28 @@
 		Assert.isNotNull(name);
 		Assert.isNotNull(id);
 		if (element != null)
-			return RefactoringStatus.createWarningStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_input_not_exists, new String[] { /*ScriptElementLabels.getDefault().getTextLabel(element, ScriptElementLabels.ALL_FULLY_QUALIFIED),*/ name, id}));
+			return RefactoringStatus.createWarningStatus(
+					Messages.format(RefactoringCoreMessages.InitializableRefactoring_input_not_exists,
+							new String[] { /*
+											 * ScriptElementLabels.getDefault().getTextLabel(element,
+											 * ScriptElementLabels.ALL_FULLY_QUALIFIED),
+											 */ name, id }));
 		else
-			return RefactoringStatus.createWarningStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_inputs_do_not_exist, new String[] { name, id}));
+			return RefactoringStatus.createWarningStatus(Messages.format(
+					RefactoringCoreMessages.InitializableRefactoring_inputs_do_not_exist, new String[] { name, id }));
 	}
 
 	/** The comment */
 	private String fComment;
 
-	/**
-	 * {@inheritDoc}
-	 */
+	@Override
 	public boolean canEnableComment() {
 		return true;
 	}
 
 	/**
-	 * Creates a fatal error status telling that the input element does not
-	 * exist.
-	 * 
+	 * Creates a fatal error status telling that the input element does not exist.
+	 *
 	 * @param element
 	 *            the input element, or <code>null</code>
 	 * @param id
@@ -89,7 +90,7 @@
 
 	/**
 	 * Creates a warning status telling that the input element does not exist.
-	 * 
+	 *
 	 * @param element
 	 *            the input element, or <code>null</code>
 	 * @param id
@@ -100,17 +101,13 @@
 		return createInputWarningStatus(element, getName(), id);
 	}
 
-	/**
-	 * {@inheritDoc}
-	 */
+	@Override
 	public String getComment() {
 		return fComment;
 	}
 
-	/**
-	 * {@inheritDoc}
-	 */
+	@Override
 	public void setComment(String comment) {
-		fComment= comment;
+		fComment = comment;
 	}
 }
diff --git a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/participants/ResourceModifications.java b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/participants/ResourceModifications.java
index 7b7c64a..55078c4 100644
--- a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/participants/ResourceModifications.java
+++ b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/participants/ResourceModifications.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 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
@@ -34,169 +34,198 @@
 import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
 import org.eclipse.ltk.core.refactoring.participants.SharableParticipants;
 
-
 /**
  * A data structure to collect resource modifications.
  * 
-	 *
+ *
  */
 public class ResourceModifications {
-	
+
 	private List<IResource> fCreate;
 	private List<IResource> fDelete;
-	
+
 	private List<IResource> fMove;
 	private List<MoveArguments> fMoveArguments;
-	
+
 	private List<IResource> fRename;
 	private List<RenameArguments> fRenameArguments;
-	
+
 	private List<IResource> fCopy;
 	private List<CopyArguments> fCopyArguments;
-	
+
 	private int fIgnoreCount;
 	private List<DeltaDescription> fDeltaDescriptions;
-	
+
 	public static abstract class DeltaDescription {
 		protected IResource fResource;
+
 		public DeltaDescription(IResource resource) {
-			fResource= resource;
+			fResource = resource;
 		}
+
 		public abstract void buildDelta(IResourceChangeDescriptionFactory builder);
+
 		public abstract IPath getDestinationPath();
-		
+
 	}
+
 	public static class DeleteDescription extends DeltaDescription {
 		public DeleteDescription(IResource resource) {
 			super(resource);
 		}
+
+		@Override
 		public void buildDelta(IResourceChangeDescriptionFactory builder) {
 			builder.delete(fResource);
 		}
+
+		@Override
 		public IPath getDestinationPath() {
 			return null;
 		}
 	}
+
 	public static class ChangedDescription extends DeltaDescription {
 		public ChangedDescription(IFile resource) {
 			super(resource);
 		}
+
+		@Override
 		public void buildDelta(IResourceChangeDescriptionFactory builder) {
-			builder.change((IFile)fResource);
+			builder.change((IFile) fResource);
 		}
+
+		@Override
 		public IPath getDestinationPath() {
 			return null;
 		}
 	}
+
 	public static class CreateDescription extends DeltaDescription {
 		public CreateDescription(IResource resource) {
 			super(resource);
 		}
+
+		@Override
 		public void buildDelta(IResourceChangeDescriptionFactory builder) {
 			builder.create(fResource);
 		}
+
+		@Override
 		public IPath getDestinationPath() {
 			return fResource.getFullPath();
 		}
 	}
+
 	public static class MoveDescription extends DeltaDescription {
 		private IPath fDestination;
+
 		public MoveDescription(IResource resource, IPath destination) {
 			super(resource);
-			fDestination= destination;
+			fDestination = destination;
 		}
+
+		@Override
 		public void buildDelta(IResourceChangeDescriptionFactory builder) {
 			builder.move(fResource, fDestination);
 		}
+
+		@Override
 		public IPath getDestinationPath() {
 			return fDestination;
 		}
 	}
+
 	public static class CopyDescription extends DeltaDescription {
 		private IPath fDestination;
+
 		public CopyDescription(IResource resource, IPath destination) {
 			super(resource);
-			fDestination= destination;
+			fDestination = destination;
 		}
+
+		@Override
 		public void buildDelta(IResourceChangeDescriptionFactory builder) {
 			builder.copy(fResource, fDestination);
 		}
+
+		@Override
 		public IPath getDestinationPath() {
 			return fDestination;
 		}
 	}
-	
+
 	/**
-	 * Adds the given file to the list of changed files. 
-	 * 
-	 * @param file the changed file
+	 * Adds the given file to the list of changed files.
+	 *
+	 * @param file
+	 *            the changed file
 	 */
 	public void addChanged(IFile file) {
 		if (fIgnoreCount == 0) {
 			internalAdd(new ChangedDescription(file));
 		}
 	}
-	
+
 	/**
-	 * Adds the given resource to the list of resources 
-	 * to be created.
-	 * 
-	 * @param create the resource to be add to the list of 
-	 *  resources to be created
+	 * Adds the given resource to the list of resources to be created.
+	 *
+	 * @param create
+	 *            the resource to be add to the list of resources to be created
 	 */
 	public void addCreate(IResource create) {
 		if (fCreate == null)
-			fCreate= new ArrayList<IResource>(2);
+			fCreate = new ArrayList<>(2);
 		fCreate.add(create);
 		if (fIgnoreCount == 0) {
 			internalAdd(new CreateDescription(create));
 		}
 	}
-	
+
 	/**
-	 * Adds the given resource to the list of resources 
-	 * to be deleted.
-	 * 
-	 * @param delete the resource to be deleted
+	 * Adds the given resource to the list of resources to be deleted.
+	 *
+	 * @param delete
+	 *            the resource to be deleted
 	 */
 	public void addDelete(IResource delete) {
 		if (fDelete == null)
-			fDelete= new ArrayList<IResource>(2);
+			fDelete = new ArrayList<>(2);
 		fDelete.add(delete);
 		if (fIgnoreCount == 0) {
 			internalAdd(new DeleteDescription(delete));
 		}
 	}
-	
+
 	/**
-	 * Adds the given resource to the list of resources
-	 * to be moved.
-	 * 
-	 * @param move the resource to be moved
+	 * Adds the given resource to the list of resources to be moved.
+	 *
+	 * @param move
+	 *            the resource to be moved
 	 */
 	public void addMove(IResource move, MoveArguments arguments) {
 		if (fMove == null) {
-			fMove= new ArrayList<IResource>(2);
-			fMoveArguments= new ArrayList<MoveArguments>(2);
+			fMove = new ArrayList<>(2);
+			fMoveArguments = new ArrayList<>(2);
 		}
 		fMove.add(move);
 		fMoveArguments.add(arguments);
 		if (fIgnoreCount == 0) {
-			IPath destination= ((IResource)arguments.getDestination()).getFullPath().append(move.getName());
+			IPath destination = ((IResource) arguments.getDestination()).getFullPath().append(move.getName());
 			internalAdd(new MoveDescription(move, destination));
 		}
 	}
-	
+
 	/**
-	 * Adds the given resource to the list of resources
-	 * to be copied.
-	 * 
-	 * @param copy the resource to be copied
+	 * Adds the given resource to the list of resources to be copied.
+	 *
+	 * @param copy
+	 *            the resource to be copied
 	 */
 	public void addCopy(IResource copy, CopyArguments arguments) {
 		if (fCopy == null) {
-			fCopy= new ArrayList<IResource>(2);
-			fCopyArguments= new ArrayList<CopyArguments>(2);
+			fCopy = new ArrayList<>(2);
+			fCopyArguments = new ArrayList<>(2);
 		}
 		fCopy.add(copy);
 		fCopyArguments.add(arguments);
@@ -204,147 +233,148 @@
 	}
 
 	/**
-	 * Adds the given resource to the list of renamed
-	 * resources.
-	 * 
-	 * @param rename the resource to be renamed
-	 * @param arguments the arguments of the rename
+	 * Adds the given resource to the list of renamed resources.
+	 *
+	 * @param rename
+	 *            the resource to be renamed
+	 * @param arguments
+	 *            the arguments of the rename
 	 */
 	public void addRename(IResource rename, RenameArguments arguments) {
 		Assert.isNotNull(rename);
 		Assert.isNotNull(arguments);
 		if (fRename == null) {
-			fRename= new ArrayList<IResource>(2);
-			fRenameArguments= new ArrayList<RenameArguments>(2);
+			fRename = new ArrayList<>(2);
+			fRenameArguments = new ArrayList<>(2);
 		}
 		fRename.add(rename);
 		fRenameArguments.add(arguments);
 		if (fIgnoreCount == 0) {
-			IPath newPath= rename.getFullPath().removeLastSegments(1).append(arguments.getNewName());
+			IPath newPath = rename.getFullPath().removeLastSegments(1).append(arguments.getNewName());
 			internalAdd(new MoveDescription(rename, newPath));
 		}
 	}
-	
-	public RefactoringParticipant[] getParticipants(RefactoringStatus status, RefactoringProcessor processor, String[] natures, SharableParticipants shared) {
-		List<RefactoringParticipant> result= new ArrayList<RefactoringParticipant>(5);
+
+	public RefactoringParticipant[] getParticipants(RefactoringStatus status, RefactoringProcessor processor,
+			String[] natures, SharableParticipants shared) {
+		List<RefactoringParticipant> result = new ArrayList<>(5);
 		if (fDelete != null) {
-			DeleteArguments arguments= new DeleteArguments();
-			for (Iterator<IResource> iter= fDelete.iterator(); iter.hasNext();) {
-				DeleteParticipant[] deletes= ParticipantManager.loadDeleteParticipants(status, 
-					processor, iter.next(), 
-					arguments, natures, shared);
+			DeleteArguments arguments = new DeleteArguments();
+			for (Iterator<IResource> iter = fDelete.iterator(); iter.hasNext();) {
+				DeleteParticipant[] deletes = ParticipantManager.loadDeleteParticipants(status, processor, iter.next(),
+						arguments, natures, shared);
 				result.addAll(Arrays.asList(deletes));
 			}
 		}
 		if (fCreate != null) {
-			CreateArguments arguments= new CreateArguments();
-			for (Iterator<IResource> iter= fCreate.iterator(); iter.hasNext();) {
-				CreateParticipant[] creates= ParticipantManager.loadCreateParticipants(status, 
-					processor, iter.next(), 
-					arguments, natures, shared);
+			CreateArguments arguments = new CreateArguments();
+			for (Iterator<IResource> iter = fCreate.iterator(); iter.hasNext();) {
+				CreateParticipant[] creates = ParticipantManager.loadCreateParticipants(status, processor, iter.next(),
+						arguments, natures, shared);
 				result.addAll(Arrays.asList(creates));
 			}
 		}
 		if (fMove != null) {
-			for (int i= 0; i < fMove.size(); i++) {
-				Object element= fMove.get(i);
-				MoveArguments arguments= fMoveArguments.get(i);
-				MoveParticipant[] moves= ParticipantManager.loadMoveParticipants(status, 
-					processor, element, 
-					arguments, natures, shared);
+			for (int i = 0; i < fMove.size(); i++) {
+				Object element = fMove.get(i);
+				MoveArguments arguments = fMoveArguments.get(i);
+				MoveParticipant[] moves = ParticipantManager.loadMoveParticipants(status, processor, element, arguments,
+						natures, shared);
 				result.addAll(Arrays.asList(moves));
-				
+
 			}
 		}
 		if (fCopy != null) {
-			for (int i= 0; i < fCopy.size(); i++) {
-				Object element= fCopy.get(i);
-				CopyArguments arguments= fCopyArguments.get(i);
-				CopyParticipant[] copies= ParticipantManager.loadCopyParticipants(status,
-					processor, element, 
-					arguments, natures, shared);
+			for (int i = 0; i < fCopy.size(); i++) {
+				Object element = fCopy.get(i);
+				CopyArguments arguments = fCopyArguments.get(i);
+				CopyParticipant[] copies = ParticipantManager.loadCopyParticipants(status, processor, element,
+						arguments, natures, shared);
 				result.addAll(Arrays.asList(copies));
 			}
 		}
 		if (fRename != null) {
-			for (int i= 0; i < fRename.size(); i++) {
-				Object resource= fRename.get(i);
-				RenameArguments arguments= fRenameArguments.get(i);
-				RenameParticipant[] renames= ParticipantManager.loadRenameParticipants(status, 
-					processor, resource, 
-					arguments, natures, shared);
+			for (int i = 0; i < fRename.size(); i++) {
+				Object resource = fRename.get(i);
+				RenameArguments arguments = fRenameArguments.get(i);
+				RenameParticipant[] renames = ParticipantManager.loadRenameParticipants(status, processor, resource,
+						arguments, natures, shared);
 				result.addAll(Arrays.asList(renames));
 			}
 		}
 		return result.toArray(new RefactoringParticipant[result.size()]);
 	}
-	
+
 	public void ignoreForDelta() {
 		fIgnoreCount++;
 	}
-	
+
 	public void trackForDelta() {
 		fIgnoreCount--;
 	}
-	
+
 	public void addDelta(DeltaDescription description) {
 		if (fIgnoreCount > 0)
 			return;
 		internalAdd(description);
 	}
-	
+
 	public void addCopyDelta(IResource copy, CopyArguments arguments) {
 		if (fIgnoreCount == 0) {
-			IPath destination= ((IResource)arguments.getDestination()).getFullPath().append(copy.getName());
+			IPath destination = ((IResource) arguments.getDestination()).getFullPath().append(copy.getName());
 			internalAdd(new CopyDescription(copy, destination));
 		}
 	}
-	
+
 	/**
-	 * Checks if the resource will exist in the future based on 
-	 * the recorded resource modifications.
-	 * 
-	 * @param resource the resource to check
+	 * Checks if the resource will exist in the future based on the recorded
+	 * resource modifications.
+	 *
+	 * @param resource
+	 *            the resource to check
 	 * @return whether the resource will exist or not
 	 */
 	public boolean willExist(IResource resource) {
 		if (fDeltaDescriptions == null)
 			return false;
-		IPath fullPath= resource.getFullPath();
-		for (Iterator<DeltaDescription> iter= fDeltaDescriptions.iterator(); iter.hasNext();) {
-			DeltaDescription delta= iter.next();
+		IPath fullPath = resource.getFullPath();
+		for (Iterator<DeltaDescription> iter = fDeltaDescriptions.iterator(); iter.hasNext();) {
+			DeltaDescription delta = iter.next();
 			if (fullPath.equals(delta.getDestinationPath()))
 				return true;
 		}
 		return false;
 	}
-	
+
 	public void buildDelta(IResourceChangeDescriptionFactory builder) {
 		if (fDeltaDescriptions == null)
 			return;
-		for (Iterator<DeltaDescription> iter= fDeltaDescriptions.iterator(); iter.hasNext();) {
+		for (Iterator<DeltaDescription> iter = fDeltaDescriptions.iterator(); iter.hasNext();) {
 			iter.next().buildDelta(builder);
 		}
 	}
-	
-	public static void buildMoveDelta(IResourceChangeDescriptionFactory builder, IResource resource, RenameArguments args) {
-		IPath newPath= resource.getFullPath().removeLastSegments(1).append(args.getNewName());
+
+	public static void buildMoveDelta(IResourceChangeDescriptionFactory builder, IResource resource,
+			RenameArguments args) {
+		IPath newPath = resource.getFullPath().removeLastSegments(1).append(args.getNewName());
 		builder.move(resource, newPath);
 	}
-	
-	public static void buildMoveDelta(IResourceChangeDescriptionFactory builder, IResource resource, MoveArguments args) {
-		IPath destination= ((IResource)args.getDestination()).getFullPath().append(resource.getName());
+
+	public static void buildMoveDelta(IResourceChangeDescriptionFactory builder, IResource resource,
+			MoveArguments args) {
+		IPath destination = ((IResource) args.getDestination()).getFullPath().append(resource.getName());
 		builder.move(resource, destination);
 	}
-	
-	public static void buildCopyDelta(IResourceChangeDescriptionFactory builder, IResource resource, CopyArguments args) {
-		IPath destination= ((IResource)args.getDestination()).getFullPath().append(resource.getName());
+
+	public static void buildCopyDelta(IResourceChangeDescriptionFactory builder, IResource resource,
+			CopyArguments args) {
+		IPath destination = ((IResource) args.getDestination()).getFullPath().append(resource.getName());
 		builder.copy(resource, destination);
 	}
-	
+
 	private void internalAdd(DeltaDescription description) {
 		if (fDeltaDescriptions == null)
-			fDeltaDescriptions= new ArrayList<DeltaDescription>();
+			fDeltaDescriptions = new ArrayList<>();
 		fDeltaDescriptions.add(description);
 	}
 }
diff --git a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/participants/ResourceProcessors.java b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/participants/ResourceProcessors.java
index 3b0cf53..da27f5f 100644
--- a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/participants/ResourceProcessors.java
+++ b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/participants/ResourceProcessors.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 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,34 +16,35 @@
 import org.eclipse.core.runtime.CoreException;
 
 public class ResourceProcessors {
-	
+
 	public static String[] computeAffectedNatures(IResource resource) throws CoreException {
-		IProject project= resource.getProject();
-		Set<String> result= new HashSet<String>();
-		Set visitedProjects= new HashSet();
+		IProject project = resource.getProject();
+		Set<String> result = new HashSet<>();
+		Set<IProject> visitedProjects = new HashSet<>();
 		computeNatures(result, visitedProjects, project);
 		return result.toArray(new String[result.size()]);
 	}
-	
+
 	public static String[] computeAffectedNatures(IResource[] resources) throws CoreException {
-		Set<String> result= new HashSet<String>();
-		Set visitedProjects= new HashSet();
-		for (int i= 0; i < resources.length; i++) {
+		Set<String> result = new HashSet<>();
+		Set<IProject> visitedProjects = new HashSet<>();
+		for (int i = 0; i < resources.length; i++) {
 			computeNatures(result, visitedProjects, resources[i].getProject());
 		}
 		return result.toArray(new String[result.size()]);
 	}
-	
-	private static void computeNatures(Set result, Set visitedProjects, IProject focus) throws CoreException {
+
+	private static void computeNatures(Set<String> result, Set<IProject> visitedProjects, IProject focus)
+			throws CoreException {
 		if (visitedProjects.contains(focus))
 			return;
-		String[] pns= focus.getDescription().getNatureIds();
+		String[] pns = focus.getDescription().getNatureIds();
 		for (int p = 0; p < pns.length; p++) {
 			result.add(pns[p]);
 		}
 		visitedProjects.add(focus);
-		IProject[] referencing= focus.getReferencingProjects();
-		for (int i= 0; i < referencing.length; i++) {
+		IProject[] referencing = focus.getReferencingProjects();
+		for (int i = 0; i < referencing.length; i++) {
 			computeNatures(result, visitedProjects, referencing[i]);
 		}
 	}
diff --git a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/participants/ScriptProcessors.java b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/participants/ScriptProcessors.java
index 94348e0..99fcca7 100644
--- a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/participants/ScriptProcessors.java
+++ b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/participants/ScriptProcessors.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 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
@@ -21,8 +21,7 @@
  */
 public class ScriptProcessors {
 
-	public static String[] computeAffectedNatures(IModelElement element)
-			throws CoreException {
+	public static String[] computeAffectedNatures(IModelElement element) throws CoreException {
 		if (element instanceof IMember) {
 			// IMember member= (IMember)element;
 
@@ -31,9 +30,8 @@
 		return ResourceProcessors.computeAffectedNatures(project.getProject());
 	}
 
-	public static String[] computeAffectedNaturs(IModelElement[] elements)
-			throws CoreException {
-		Set<String> result = new HashSet<String>();
+	public static String[] computeAffectedNaturs(IModelElement[] elements) throws CoreException {
+		Set<String> result = new HashSet<>();
 		for (int i = 0; i < elements.length; i++) {
 			String[] natures = computeAffectedNatures(elements[i]);
 			for (int j = 0; j < natures.length; j++) {
diff --git a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/rename/RenameModelElementProcessor.java b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/rename/RenameModelElementProcessor.java
index a072ac8..9da5b45 100644
--- a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/rename/RenameModelElementProcessor.java
+++ b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/rename/RenameModelElementProcessor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 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,117 +65,136 @@
 	protected IModelElement fModelElement;
 	protected ISourceModule fCu;
 
-	//the following fields are set or modified after the construction
+	// the following fields are set or modified after the construction
 	protected boolean fUpdateReferences;
 	protected String fCurrentName;
-	//private CompilationUnit fCompilationUnitNode;
-	//private VariableDeclaration fTempDeclarationNode;
-	//protected SourceModuleChange fChange;
+	// private CompilationUnit fCompilationUnitNode;
+	// private VariableDeclaration fTempDeclarationNode;
+	// protected SourceModuleChange fChange;
 
-	//private boolean fIsComposite is always false
-	//private GroupCategorySet fCategorySet;
+	// private boolean fIsComposite is always false
+	// private GroupCategorySet fCategorySet;
 	private TextChangeManager fChangeManager;
-	//private RenameAnalyzeUtil.LocalAnalyzePackage fLocalAnalyzePackage;
+	// private RenameAnalyzeUtil.LocalAnalyzePackage fLocalAnalyzePackage;
 	private final IDLTKLanguageToolkit fToolkit;
-	
-    public RenameModelElementProcessor(IModelElement localVariable, IDLTKLanguageToolkit toolkit) {
-        fToolkit = toolkit;
-        fModelElement = localVariable;
-        fCu = (ISourceModule) fModelElement.getAncestor(IModelElement.SOURCE_MODULE);
-        fChangeManager = new TextChangeManager(true);
-    }
 
+	public RenameModelElementProcessor(IModelElement localVariable, IDLTKLanguageToolkit toolkit) {
+		fToolkit = toolkit;
+		fModelElement = localVariable;
+		fCu = (ISourceModule) fModelElement.getAncestor(IModelElement.SOURCE_MODULE);
+		fChangeManager = new TextChangeManager(true);
+	}
+
+	@Override
 	public RefactoringStatus initialize(RefactoringArguments arguments) {
 		if (!(arguments instanceof ScriptRefactoringArguments))
-			return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.InitializableRefactoring_inacceptable_arguments);
-		final ScriptRefactoringArguments extended= (ScriptRefactoringArguments) arguments;
-		final String handle= extended.getAttribute(ScriptRefactoringDescriptor.ATTRIBUTE_INPUT);
+			return RefactoringStatus
+					.createFatalErrorStatus(RefactoringCoreMessages.InitializableRefactoring_inacceptable_arguments);
+		final ScriptRefactoringArguments extended = (ScriptRefactoringArguments) arguments;
+		final String handle = extended.getAttribute(ScriptRefactoringDescriptor.ATTRIBUTE_INPUT);
 		if (handle != null) {
-			final IModelElement element= ScriptRefactoringDescriptor.handleToElement(extended.getProject(), handle, false);
+			final IModelElement element = ScriptRefactoringDescriptor.handleToElement(extended.getProject(), handle,
+					false);
 			if (element != null && element.exists()) {
 				if (element.getElementType() == IModelElement.SOURCE_MODULE) {
 					fCu = (ISourceModule) element;
 				} else if (element.getElementType() == IModelElement.LOCAL_VARIABLE) {
-					fModelElement= element;
+					fModelElement = element;
 					fCu = (ISourceModule) fModelElement.getAncestor(IModelElement.SOURCE_MODULE);
 					if (fCu == null)
-						return ScriptableRefactoring.createInputFatalStatus(element, getProcessorName(), IScriptRefactorings.RENAME_LOCAL_VARIABLE);
+						return ScriptableRefactoring.createInputFatalStatus(element, getProcessorName(),
+								IScriptRefactorings.RENAME_LOCAL_VARIABLE);
 				} else
-					return ScriptableRefactoring.createInputFatalStatus(element, getProcessorName(), IScriptRefactorings.RENAME_LOCAL_VARIABLE);
+					return ScriptableRefactoring.createInputFatalStatus(element, getProcessorName(),
+							IScriptRefactorings.RENAME_LOCAL_VARIABLE);
 			} else
-				return ScriptableRefactoring.createInputFatalStatus(element, getProcessorName(), IScriptRefactorings.RENAME_LOCAL_VARIABLE);
+				return ScriptableRefactoring.createInputFatalStatus(element, getProcessorName(),
+						IScriptRefactorings.RENAME_LOCAL_VARIABLE);
 		} else
-			return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ScriptRefactoringDescriptor.ATTRIBUTE_INPUT));
-		final String name= extended.getAttribute(ScriptRefactoringDescriptor.ATTRIBUTE_NAME);
+			return RefactoringStatus.createFatalErrorStatus(
+					Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist,
+							ScriptRefactoringDescriptor.ATTRIBUTE_INPUT));
+		final String name = extended.getAttribute(ScriptRefactoringDescriptor.ATTRIBUTE_NAME);
 		if (name != null && !"".equals(name)) //$NON-NLS-1$
 			setNewElementName(name);
 		else
-			return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ScriptRefactoringDescriptor.ATTRIBUTE_NAME));
+			return RefactoringStatus.createFatalErrorStatus(
+					Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist,
+							ScriptRefactoringDescriptor.ATTRIBUTE_NAME));
 		if (fCu != null && fModelElement == null) {
-			final String selection= extended.getAttribute(ScriptRefactoringDescriptor.ATTRIBUTE_SELECTION);
+			final String selection = extended.getAttribute(ScriptRefactoringDescriptor.ATTRIBUTE_SELECTION);
 			if (selection != null) {
-				int offset= -1;
-				int length= -1;
-				final StringTokenizer tokenizer= new StringTokenizer(selection);
+				int offset = -1;
+				int length = -1;
+				final StringTokenizer tokenizer = new StringTokenizer(selection);
 				if (tokenizer.hasMoreTokens())
-					offset= Integer.valueOf(tokenizer.nextToken()).intValue();
+					offset = Integer.valueOf(tokenizer.nextToken()).intValue();
 				if (tokenizer.hasMoreTokens())
-					length= Integer.valueOf(tokenizer.nextToken()).intValue();
+					length = Integer.valueOf(tokenizer.nextToken()).intValue();
 				if (offset >= 0 && length >= 0) {
 					try {
-						final IModelElement[] elements= fCu.codeSelect(offset, length);
+						final IModelElement[] elements = fCu.codeSelect(offset, length);
 						if (elements != null) {
-							for (int index= 0; index < elements.length; index++) {
-								final IModelElement element= elements[index];
+							for (int index = 0; index < elements.length; index++) {
+								final IModelElement element = elements[index];
 								if (element instanceof ILocalVariable)
-									fModelElement= element;
+									fModelElement = element;
 							}
 						}
 						if (fModelElement == null)
-							return ScriptableRefactoring.createInputFatalStatus(null, getProcessorName(), IScriptRefactorings.RENAME_LOCAL_VARIABLE);
+							return ScriptableRefactoring.createInputFatalStatus(null, getProcessorName(),
+									IScriptRefactorings.RENAME_LOCAL_VARIABLE);
 					} catch (ModelException exception) {
 						ScriptManipulationPlugin.log(exception);
 					}
 				} else
-					return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] { selection,
-							ScriptRefactoringDescriptor.ATTRIBUTE_SELECTION }));
+					return RefactoringStatus.createFatalErrorStatus(
+							Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument,
+									new Object[] { selection, ScriptRefactoringDescriptor.ATTRIBUTE_SELECTION }));
 			} else
-				return RefactoringStatus
-						.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ScriptRefactoringDescriptor.ATTRIBUTE_SELECTION));
+				return RefactoringStatus.createFatalErrorStatus(
+						Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist,
+								ScriptRefactoringDescriptor.ATTRIBUTE_SELECTION));
 		}
-		final String references= extended.getAttribute(ScriptRefactoringDescriptor.ATTRIBUTE_REFERENCES);
+		final String references = extended.getAttribute(ScriptRefactoringDescriptor.ATTRIBUTE_REFERENCES);
 		if (references != null) {
-			fUpdateReferences= Boolean.valueOf(references).booleanValue();
+			fUpdateReferences = Boolean.valueOf(references).booleanValue();
 		} else
-			return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ScriptRefactoringDescriptor.ATTRIBUTE_REFERENCES));
+			return RefactoringStatus.createFatalErrorStatus(
+					Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist,
+							ScriptRefactoringDescriptor.ATTRIBUTE_REFERENCES));
 		return new RefactoringStatus();
 	}
 
+	@Override
 	public String getCurrentElementName() {
 		return fCurrentName;
 	}
 
+	@Override
 	public boolean canEnableUpdateReferences() {
 		return true;
 	}
 
+	@Override
 	public void setUpdateReferences(boolean update) {
 		fUpdateReferences = update;
 	}
 
+	@Override
 	public boolean getUpdateReferences() {
 		return fUpdateReferences;
 	}
 
 	@Override
-	protected RenameModifications computeRenameModifications()
-			throws CoreException {
-		RenameModifications result= new RenameModifications();
+	protected RenameModifications computeRenameModifications() throws CoreException {
+		RenameModifications result = new RenameModifications();
 		if (fModelElement instanceof ILocalVariable) {
-			result.rename((ILocalVariable)fModelElement, new RenameArguments(getNewElementName(), getUpdateReferences()));
+			result.rename((ILocalVariable) fModelElement,
+					new RenameArguments(getNewElementName(), getUpdateReferences()));
 		} else if (fModelElement instanceof IField) {
 			// TODO: add switching method in RenameModifications
-			result.rename((IField)fModelElement, new RenameArguments(getNewElementName(), getUpdateReferences()));
+			result.rename((IField) fModelElement, new RenameArguments(getNewElementName(), getUpdateReferences()));
 		}
 		return result;
 	}
@@ -184,82 +203,92 @@
 	protected IFile[] getChangedFiles() throws CoreException {
 		return ResourceUtil.getFiles(fChangeManager.getAllSourceModules());
 	}
-	@Override
-	protected RefactoringStatus doCheckFinalConditions(IProgressMonitor pm,
-			CheckConditionsContext context) throws CoreException,
-			OperationCanceledException {
-		try {
-			pm.beginTask("", 1);	 //$NON-NLS-1$
 
-			RefactoringStatus result= checkNewElementName(getNewElementName());
+	@Override
+	protected RefactoringStatus doCheckFinalConditions(IProgressMonitor pm, CheckConditionsContext context)
+			throws CoreException, OperationCanceledException {
+		try {
+			pm.beginTask("", 1); //$NON-NLS-1$
+
+			RefactoringStatus result = checkNewElementName(getNewElementName());
 			if (result.hasFatalError())
 				return result;
 			createEdits(pm);
-			//LocalAnalyzePackage[] localAnalyzePackages= new RenameAnalyzeUtil.LocalAnalyzePackage[] { fLocalAnalyzePackage };
-			//result.merge(RenameAnalyzeUtil.analyzeLocalRenames(localAnalyzePackages, fChange, fCompilationUnitNode, true));
+			// LocalAnalyzePackage[] localAnalyzePackages= new
+			// RenameAnalyzeUtil.LocalAnalyzePackage[] { fLocalAnalyzePackage };
+			// result.merge(RenameAnalyzeUtil.analyzeLocalRenames(localAnalyzePackages,
+			// fChange, fCompilationUnitNode, true));
 			return result;
 		} finally {
 			pm.done();
 		}
 	}
-	
-	private void createEdits(IProgressMonitor pm) throws CoreException{
+
+	private void createEdits(IProgressMonitor pm) throws CoreException {
 		fChangeManager.clear();
 		IDLTKSearchScope scope = SearchEngine.createWorkspaceScope(fToolkit);
 		SearchEngine engine = new SearchEngine();
 		if (fUpdateReferences) {
-			SearchPattern pattern= SearchPattern.createPattern(fModelElement, IDLTKSearchConstants.REFERENCES, SearchUtils.GENERICS_AGNOSTIC_MATCH_RULE, fToolkit);
+			SearchPattern pattern = SearchPattern.createPattern(fModelElement, IDLTKSearchConstants.REFERENCES,
+					SearchUtils.GENERICS_AGNOSTIC_MATCH_RULE, fToolkit);
 			IProgressMonitor monitor = new SubProgressMonitor(pm, 1000);
-			engine.search(pattern, new SearchParticipant[]{ SearchEngine.getDefaultSearchParticipant() }, scope, new SearchRequestor() {
-				@Override
-				public void acceptSearchMatch(SearchMatch match) throws CoreException {
-					if (!(match.getElement() instanceof IModelElement)) return;
-					IModelElement elem = (IModelElement)match.getElement();
-					ISourceModule cu = (ISourceModule)elem.getAncestor(IModelElement.SOURCE_MODULE);
-					if (cu != null) {
-						ReplaceEdit edit = createReplaceEdit(match);
-						addTextEdit(fChangeManager.get(cu), getProcessorName(), edit);
-					}
-					//if (match.getResource().equals(fCu.getCorrespondingResource()))
-					//	edits.add(new ReplaceEdit(match.getOffset(), fCurrentName.length(), getNewElementName()));
-				}
-			}, monitor);
+			engine.search(pattern, new SearchParticipant[] { SearchEngine.getDefaultSearchParticipant() }, scope,
+					new SearchRequestor() {
+						@Override
+						public void acceptSearchMatch(SearchMatch match) throws CoreException {
+							if (!(match.getElement() instanceof IModelElement))
+								return;
+							IModelElement elem = (IModelElement) match.getElement();
+							ISourceModule cu = (ISourceModule) elem.getAncestor(IModelElement.SOURCE_MODULE);
+							if (cu != null) {
+								ReplaceEdit edit = createReplaceEdit(match);
+								addTextEdit(fChangeManager.get(cu), getProcessorName(), edit);
+							}
+							// if (match.getResource().equals(fCu.getCorrespondingResource()))
+							// edits.add(new ReplaceEdit(match.getOffset(), fCurrentName.length(),
+							// getNewElementName()));
+						}
+					}, monitor);
 		}
-		ISourceRange decl=null;
+		ISourceRange decl = null;
 		if (fModelElement instanceof ILocalVariable) {
-			decl = ((ILocalVariable)fModelElement).getNameRange();
+			decl = ((ILocalVariable) fModelElement).getNameRange();
 		} else if (fModelElement instanceof IMember) {
-		decl = ((IMember)fModelElement).getNameRange();
+			decl = ((IMember) fModelElement).getNameRange();
 		}
 		if (decl != null) {
 			ReplaceEdit edit = new ReplaceEdit(decl.getOffset(), fCurrentName.length(), getNewElementName());
 			addTextEdit(fChangeManager.get(fCu), getProcessorName(), edit);
 		}
-		//fChange= new SourceModuleChange(RefactoringCoreMessages.RenameTempRefactoring_rename, fCu);
-		//MultiTextEdit rootEdit= new MultiTextEdit();
-		//fChange.setEdit(rootEdit);
-		//fChange.setKeepPreviewEdits(true);
-		//for (TextEdit edit : edits) {
-		//	rootEdit.addChild(edit);
-		//	fChange.addTextEditGroup(new TextEditGroup(RefactoringCoreMessages.RenameTempRefactoring_changeName, edit));
-		//}
+		// fChange= new
+		// SourceModuleChange(RefactoringCoreMessages.RenameTempRefactoring_rename,
+		// fCu);
+		// MultiTextEdit rootEdit= new MultiTextEdit();
+		// fChange.setEdit(rootEdit);
+		// fChange.setKeepPreviewEdits(true);
+		// for (TextEdit edit : edits) {
+		// rootEdit.addChild(edit);
+		// fChange.addTextEditGroup(new
+		// TextEditGroup(RefactoringCoreMessages.RenameTempRefactoring_changeName,
+		// edit));
+		// }
 	}
-	
-    /**
-     * Creates {@link ReplaceEdit} for the specified {@link SearchMatch}
-     * 
-     * @param match
-     * @return
-     * @since 5.0.0
-     */
+
+	/**
+	 * Creates {@link ReplaceEdit} for the specified {@link SearchMatch}
+	 * 
+	 * @param match
+	 * @return
+	 * @since 5.0.0
+	 */
 	protected ReplaceEdit createReplaceEdit(SearchMatch match) {
-        return new ReplaceEdit(match.getOffset(), fCurrentName.length(), getNewElementName());
-    }
-	
+		return new ReplaceEdit(match.getOffset(), fCurrentName.length(), getNewElementName());
+	}
+
 	private static void addTextEdit(TextChange change, String name, TextEdit edit) throws MalformedTreeException {
-		TextEdit root= change.getEdit();
+		TextEdit root = change.getEdit();
 		if (root == null) {
-			root= new MultiTextEdit();
+			root = new MultiTextEdit();
 			change.setEdit(root);
 		}
 		root.addChild(edit);
@@ -273,9 +302,10 @@
 
 	@Override
 	public Object[] getElements() {
-		return new Object[]{ fModelElement };
+		return new Object[] { fModelElement };
 	}
-	
+
+	@Override
 	public String getNewElement() {
 		return getNewElementName();
 	}
@@ -283,84 +313,89 @@
 	@Override
 	public RefactoringStatus checkInitialConditions(IProgressMonitor pm)
 			throws CoreException, OperationCanceledException {
-		//fCompilationUnitNode = RefactoringASTParser.parseWithASTProvider(fCu, true, null);
-		//ISourceRange sourceRange= fLocalVariable.
-		//fLocalVariable.get
-		//ASTNode name= NodeFinder.perform(fCompilationUnitNode, sourceRange);
-		//if (name == null)
-		//	return;
-		//if (name.getParent() instanceof VariableDeclaration)
-		//	fTempDeclarationNode= (VariableDeclaration) name.getParent();
-		//if (fTempDeclarationNode == null || fTempDeclarationNode.resolveBinding() == null)
-		//	return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.RenameTempRefactoring_must_select_local);
-		//if (! Checks.isDeclaredIn(fTempDeclarationNode, MethodDeclaration.class)
+		// fCompilationUnitNode = RefactoringASTParser.parseWithASTProvider(fCu, true,
+		// null);
+		// ISourceRange sourceRange= fLocalVariable.
+		// fLocalVariable.get
+		// ASTNode name= NodeFinder.perform(fCompilationUnitNode, sourceRange);
+		// if (name == null)
+		// return;
+		// if (name.getParent() instanceof VariableDeclaration)
+		// fTempDeclarationNode= (VariableDeclaration) name.getParent();
+		// if (fTempDeclarationNode == null || fTempDeclarationNode.resolveBinding() ==
+		// null)
+		// return
+		// RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.RenameTempRefactoring_must_select_local);
+		// if (! Checks.isDeclaredIn(fTempDeclarationNode, MethodDeclaration.class)
 		// && ! Checks.isDeclaredIn(fTempDeclarationNode, Initializer.class))
-		//	return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.RenameTempRefactoring_only_in_methods_and_initializers);
+		// return
+		// RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.RenameTempRefactoring_only_in_methods_and_initializers);
 
-		//fCurrentName= fTempDeclarationNode.getName().getIdentifier();
+		// fCurrentName= fTempDeclarationNode.getName().getIdentifier();
 		fCurrentName = fModelElement.getElementName();
 		return new RefactoringStatus();
 	}
 
-/*	private AccumulatingProblemReporter getAccumulatingProblemReporter() {
-		final PerWorkingCopyInfo perWorkingCopyInfo = getPerWorkingCopyInfo();
-		if (perWorkingCopyInfo != null && perWorkingCopyInfo.isActive()) {
-			final IScriptProject project = getScriptProject();
+	/*
+	 * private AccumulatingProblemReporter getAccumulatingProblemReporter() { final
+	 * PerWorkingCopyInfo perWorkingCopyInfo = getPerWorkingCopyInfo(); if
+	 * (perWorkingCopyInfo != null && perWorkingCopyInfo.isActive()) { final
+	 * IScriptProject project = getScriptProject();
+	 * 
+	 * // https://bugs.eclipse.org/bugs/show_bug.cgi?id=267008 // Script nature
+	 * check is not enough. It's possible that the // external project created //
+	 * has a name of ExternalScriptProject.EXTERNAL_PROJECT_NAME, but no // script
+	 * nature. // If script nature added during //
+	 * WorkingCopyOwner.newWorkingCopy(...), this fix is not relevant. // Does
+	 * script nature should be added in // WorkingCopyOwner.newWorkingCopy, or just
+	 * script name checked? if (project != null &&
+	 * (ExternalScriptProject.EXTERNAL_PROJECT_NAME
+	 * .equals(project.getProject().getName()) || ScriptProject
+	 * .hasScriptNature(project.getProject()))) { return new
+	 * AccumulatingProblemReporter(perWorkingCopyInfo); } } return null; }
+	 */
 
-			// https://bugs.eclipse.org/bugs/show_bug.cgi?id=267008
-			// Script nature check is not enough. It's possible that the
-			// external project created
-			// has a name of ExternalScriptProject.EXTERNAL_PROJECT_NAME, but no
-			// script nature.
-			// If script nature added during
-			// WorkingCopyOwner.newWorkingCopy(...), this fix is not relevant.
-			// Does script nature should be added in
-			// WorkingCopyOwner.newWorkingCopy, or just script name checked?
-			if (project != null
-					&& (ExternalScriptProject.EXTERNAL_PROJECT_NAME
-							.equals(project.getProject().getName()) || ScriptProject
-							.hasScriptNature(project.getProject()))) {
-				return new AccumulatingProblemReporter(perWorkingCopyInfo);
-			}
-		}
-		return null;
-	}*/
-
+	@Override
 	public Change createChange(IProgressMonitor monitor) throws CoreException {
 		try {
 			monitor.beginTask(RefactoringCoreMessages.RenameFieldRefactoring_checking, 1);
-			TextChange[] changes= fChangeManager.getAllChanges();
-			RenameModelElementDescriptor descriptor= createRefactoringDescriptor();
+			TextChange[] changes = fChangeManager.getAllChanges();
+			RenameModelElementDescriptor descriptor = createRefactoringDescriptor();
 			return new DynamicValidationRefactoringChange(descriptor, getProcessorName(), changes);
 		} finally {
 			monitor.done();
 		}
 	}
 
-	/*@Override
-	public Change createChange(IProgressMonitor pm) throws CoreException,
-			OperationCanceledException {
-		try {
-			pm.beginTask(RefactoringCoreMessages.RenameTypeProcessor_creating_changes, 1);
-			RenameModelElementDescriptor descriptor= createRefactoringDescriptor();
-			fChange.setDescriptor(new RefactoringChangeDescriptor(descriptor));
-			return fChange;
-		} finally {
-			pm.done();
-		}
-	}*/
+	/*
+	 * @Override public Change createChange(IProgressMonitor pm) throws
+	 * CoreException, OperationCanceledException { try {
+	 * pm.beginTask(RefactoringCoreMessages.RenameTypeProcessor_creating_changes,
+	 * 1); RenameModelElementDescriptor descriptor= createRefactoringDescriptor();
+	 * fChange.setDescriptor(new RefactoringChangeDescriptor(descriptor)); return
+	 * fChange; } finally { pm.done(); } }
+	 */
 	private RenameModelElementDescriptor createRefactoringDescriptor() {
-		String project= null;
-		IScriptProject scriptProject= fCu.getScriptProject();
+		String project = null;
+		IScriptProject scriptProject = fCu.getScriptProject();
 		if (scriptProject != null)
-			project= scriptProject.getElementName();
-		//final String header= Messages.format(RefactoringCoreMessages.RenameLocalVariableProcessor_descriptor_description, new String[] { BasicElementLabels.getJavaElementName(fCurrentName), JavaElementLabels.getElementLabel(fLocalVariable.getParent(), JavaElementLabels.ALL_FULLY_QUALIFIED), BasicElementLabels.getJavaElementName(fNewName)});
-		//final String description= Messages.format(RefactoringCoreMessages.RenameLocalVariableProcessor_descriptor_description_short, BasicElementLabels.getJavaElementName(fCurrentName));
-		//final String comment= new JDTRefactoringDescriptorComment(project, this, header).asString();
-		final RenameModelElementDescriptor descriptor= new RenameModelElementDescriptor(IScriptRefactorings.RENAME_LOCAL_VARIABLE);
+			project = scriptProject.getElementName();
+		// final String header=
+		// Messages.format(RefactoringCoreMessages.RenameLocalVariableProcessor_descriptor_description,
+		// new String[] { BasicElementLabels.getJavaElementName(fCurrentName),
+		// JavaElementLabels.getElementLabel(fLocalVariable.getParent(),
+		// JavaElementLabels.ALL_FULLY_QUALIFIED),
+		// BasicElementLabels.getJavaElementName(fNewName)});
+		// final String description=
+		// Messages.format(RefactoringCoreMessages.RenameLocalVariableProcessor_descriptor_description_short,
+		// BasicElementLabels.getJavaElementName(fCurrentName));
+		// final String comment= new JDTRefactoringDescriptorComment(project, this,
+		// header).asString();
+		final RenameModelElementDescriptor descriptor = new RenameModelElementDescriptor(
+				IScriptRefactorings.RENAME_LOCAL_VARIABLE);
 		descriptor.setProject(project);
-		//descriptor.setDescription(description);
-		//descriptor.setComment(comment);
+		// descriptor.setDescription(description);
+		// descriptor.setComment(comment);
 		descriptor.setFlags(RefactoringDescriptor.NONE);
 		descriptor.setModelElement(fModelElement);
 		descriptor.setNewName(getNewElementName());
diff --git a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/rename/RenameModifications.java b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/rename/RenameModifications.java
index 84cb914..7bba98b 100644
--- a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/rename/RenameModifications.java
+++ b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/rename/RenameModifications.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 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
@@ -46,31 +46,30 @@
 import org.eclipse.ltk.core.refactoring.participants.SharableParticipants;
 import org.eclipse.ltk.core.refactoring.participants.ValidateEditChecker;
 
-
 public class RenameModifications extends RefactoringModifications {
-	
-	private List fRename;
+
+	private List<Object> fRename;
 	private List fRenameArguments;
-	private List fParticipantDescriptorFilter;
-	
+	private List<IParticipantDescriptorFilter> fParticipantDescriptorFilter;
+
 	public RenameModifications() {
-		fRename= new ArrayList();
-		fRenameArguments= new ArrayList();
-		fParticipantDescriptorFilter= new ArrayList();
+		fRename = new ArrayList<>();
+		fRenameArguments = new ArrayList();
+		fParticipantDescriptorFilter = new ArrayList<>();
 	}
-	
+
 	public void rename(IResource resource, RenameArguments args) {
 		add(resource, args, null);
 	}
 
 	public void rename(IScriptProject project, RenameArguments args) {
 		add(project, args, null);
-		IProject rProject= project.getProject();
+		IProject rProject = project.getProject();
 		if (rProject != null) {
 			getResourceModifications().addRename(rProject, args);
-			IProject[] referencingProjects= rProject.getReferencingProjects();
-			for (int i= 0; i < referencingProjects.length; i++) {
-				IFile buildpath= getBuildpathFile(referencingProjects[i]);
+			IProject[] referencingProjects = rProject.getReferencingProjects();
+			for (int i = 0; i < referencingProjects.length; i++) {
+				IFile buildpath = getBuildpathFile(referencingProjects[i]);
 				if (buildpath != null) {
 					getResourceModifications().addChanged(buildpath);
 				}
@@ -84,29 +83,31 @@
 			getResourceModifications().addRename(sourceFolder.getResource(), arguments);
 		}
 	}
-	
-	public void rename(IScriptFolder rootPackage, RenameArguments args, boolean renameSubPackages) throws CoreException {
+
+	public void rename(IScriptFolder rootPackage, RenameArguments args, boolean renameSubPackages)
+			throws CoreException {
 		add(rootPackage, args, null);
-		IScriptFolder[] allSubPackages= null;
+		IScriptFolder[] allSubPackages = null;
 		if (renameSubPackages) {
-			allSubPackages= getSubpackages(rootPackage);
-			for (int i= 0; i < allSubPackages.length; i++) {
-				IScriptFolder pack= allSubPackages[i];
-				RenameArguments subArgs= new RenameArguments(
-					getNewPackageName(rootPackage, args.getNewName(), pack.getElementName()), 
-					args.getUpdateReferences());
+			allSubPackages = getSubpackages(rootPackage);
+			for (int i = 0; i < allSubPackages.length; i++) {
+				IScriptFolder pack = allSubPackages[i];
+				RenameArguments subArgs = new RenameArguments(
+						getNewPackageName(rootPackage, args.getNewName(), pack.getElementName()),
+						args.getUpdateReferences());
 				add(pack, subArgs, null);
 			}
 		}
-		IContainer container= (IContainer)rootPackage.getResource();
+		IContainer container = (IContainer) rootPackage.getResource();
 		if (container == null)
 			return;
-		IContainer target= (IContainer) ((IProjectFragment)rootPackage.getParent()).
-			getScriptFolder(args.getNewName()).getResource();
+		IContainer target = (IContainer) ((IProjectFragment) rootPackage.getParent()).getScriptFolder(args.getNewName())
+				.getResource();
 		if ((!rootPackage.hasSubfolders() || renameSubPackages) && canMove(container, target)) {
 			createIncludingParents(target.getParent());
 			if (container.getParent().equals(target.getParent())) {
-				getResourceModifications().addRename(container, new RenameArguments(target.getName(), args.getUpdateReferences()));
+				getResourceModifications().addRename(container,
+						new RenameArguments(target.getName(), args.getUpdateReferences()));
 			} else {
 				// This is a little tricky. The problem is that the refactoring participants
 				// don't support a generic move like the resource API does. So for the delta
@@ -118,7 +119,8 @@
 				} finally {
 					getResourceModifications().trackForDelta();
 				}
-				getResourceModifications().addDelta(new ResourceModifications.MoveDescription(container, target.getFullPath()));
+				getResourceModifications()
+						.addDelta(new ResourceModifications.MoveDescription(container, target.getFullPath()));
 			}
 		} else {
 			addAllResourceModifications(rootPackage, args, renameSubPackages, allSubPackages);
@@ -128,58 +130,61 @@
 	public void rename(ISourceModule unit, RenameArguments args) {
 		add(unit, args, null);
 		if (unit.getResource() != null) {
-			getResourceModifications().addRename(unit.getResource(), new RenameArguments(args.getNewName(), args.getUpdateReferences()));
+			getResourceModifications().addRename(unit.getResource(),
+					new RenameArguments(args.getNewName(), args.getUpdateReferences()));
 		}
-	}	
-	
+	}
+
 	public void rename(ILocalVariable variable, RenameArguments args) {
 		add(variable, args, null);
 	}
-	
+
 	public void rename(IField field, RenameArguments args) {
 		add(field, args, null);
 	}
-	
+
 	public void rename(IMethod method, RenameArguments args) {
 		add(method, args, null);
-	} 		
-	
+	}
+
+	@Override
 	public void buildDelta(IResourceChangeDescriptionFactory builder) {
-		for (int i= 0; i < fRename.size(); i++) {
-			Object element= fRename.get(i);
+		for (int i = 0; i < fRename.size(); i++) {
+			Object element = fRename.get(i);
 			if (element instanceof IResource) {
-				ResourceModifications.buildMoveDelta(builder, (IResource) element, (RenameArguments) fRenameArguments.get(i));
+				ResourceModifications.buildMoveDelta(builder, (IResource) element,
+						(RenameArguments) fRenameArguments.get(i));
 			}
 		}
 		getResourceModifications().buildDelta(builder);
 	}
-	
+
+	@Override
 	public void buildValidateEdits(ValidateEditChecker checker) {
-		for (Iterator iter= fRename.iterator(); iter.hasNext();) {
-			Object element= iter.next();
+		for (Iterator iter = fRename.iterator(); iter.hasNext();) {
+			Object element = iter.next();
 			if (element instanceof ISourceModule) {
-				ISourceModule unit= (ISourceModule)element;
-				IResource resource= unit.getResource();
+				ISourceModule unit = (ISourceModule) element;
+				IResource resource = unit.getResource();
 				if (resource != null && resource.getType() == IResource.FILE) {
-					checker.addFile((IFile)resource);
+					checker.addFile((IFile) resource);
 				}
 			}
 		}
 	}
 
-	public RefactoringParticipant[] loadParticipants(RefactoringStatus status, RefactoringProcessor owner, String[] natures, SharableParticipants shared) {
-		List<RefactoringParticipant> result= new ArrayList<RefactoringParticipant>();
-		for (int i= 0; i < fRename.size(); i++) {
-			result.addAll(Arrays.asList(ParticipantManager.loadRenameParticipants(status, 
-				owner, fRename.get(i), 
-				(RenameArguments) fRenameArguments.get(i), 
-				(IParticipantDescriptorFilter) fParticipantDescriptorFilter.get(i), 
-				natures, shared)));
+	@Override
+	public RefactoringParticipant[] loadParticipants(RefactoringStatus status, RefactoringProcessor owner,
+			String[] natures, SharableParticipants shared) {
+		List<RefactoringParticipant> result = new ArrayList<>();
+		for (int i = 0; i < fRename.size(); i++) {
+			result.addAll(Arrays.asList(ParticipantManager.loadRenameParticipants(status, owner, fRename.get(i),
+					(RenameArguments) fRenameArguments.get(i), fParticipantDescriptorFilter.get(i), natures, shared)));
 		}
 		result.addAll(Arrays.asList(getResourceModifications().getParticipants(status, owner, natures, shared)));
 		return result.toArray(new RefactoringParticipant[result.size()]);
 	}
-	
+
 	private void add(Object element, RefactoringArguments args, IParticipantDescriptorFilter filter) {
 		Assert.isNotNull(element);
 		Assert.isNotNull(args);
@@ -187,40 +192,41 @@
 		fRenameArguments.add(args);
 		fParticipantDescriptorFilter.add(filter);
 	}
-	
-	private void addAllResourceModifications(IScriptFolder rootPackage, RenameArguments args, boolean renameSubPackages, IScriptFolder[] allSubPackages) throws CoreException {
+
+	private void addAllResourceModifications(IScriptFolder rootPackage, RenameArguments args, boolean renameSubPackages,
+			IScriptFolder[] allSubPackages) throws CoreException {
 		addResourceModifications(rootPackage, args, rootPackage, renameSubPackages);
 		if (renameSubPackages) {
-			for (int i= 0; i < allSubPackages.length; i++) {
-				IScriptFolder pack= allSubPackages[i];
+			for (int i = 0; i < allSubPackages.length; i++) {
+				IScriptFolder pack = allSubPackages[i];
 				addResourceModifications(rootPackage, args, pack, renameSubPackages);
 			}
 		}
 	}
-	
-	private void addResourceModifications(IScriptFolder rootPackage, RenameArguments args, IScriptFolder pack, boolean renameSubPackages) throws CoreException {
-		IContainer container= (IContainer)pack.getResource();
+
+	private void addResourceModifications(IScriptFolder rootPackage, RenameArguments args, IScriptFolder pack,
+			boolean renameSubPackages) throws CoreException {
+		IContainer container = (IContainer) pack.getResource();
 		if (container == null)
 			return;
-		IFolder target= computeTargetFolder(rootPackage, args, pack);
+		IFolder target = computeTargetFolder(rootPackage, args, pack);
 		createIncludingParents(target);
-		MoveArguments arguments= new MoveArguments(target, args.getUpdateReferences());
-		IResource[] resourcesToMove= collectResourcesOfInterest(pack);
-		Set allMembers= new HashSet(Arrays.asList(container.members()));
-		for (int i= 0; i < resourcesToMove.length; i++) {
-			IResource toMove= resourcesToMove[i];
+		MoveArguments arguments = new MoveArguments(target, args.getUpdateReferences());
+		IResource[] resourcesToMove = collectResourcesOfInterest(pack);
+		Set<IResource> allMembers = new HashSet<>(Arrays.asList(container.members()));
+		for (int i = 0; i < resourcesToMove.length; i++) {
+			IResource toMove = resourcesToMove[i];
 			getResourceModifications().addMove(toMove, arguments);
 			allMembers.remove(toMove);
 		}
-		for (Iterator iter= allMembers.iterator(); iter.hasNext();) {
-			IResource element= (IResource) iter.next();
+		for (Iterator<IResource> iter = allMembers.iterator(); iter.hasNext();) {
+			IResource element = iter.next();
 			if (element instanceof IFile) {
 				getResourceModifications().addDelete(element);
 				iter.remove();
 			}
 		}
-		if (renameSubPackages && rootPackage.equals(pack)
-				|| ! renameSubPackages && allMembers.isEmpty()) {
+		if (renameSubPackages && rootPackage.equals(pack) || !renameSubPackages && allMembers.isEmpty()) {
 			getResourceModifications().addDelete(container);
 		}
 	}
@@ -230,29 +236,30 @@
 	}
 
 	private IScriptFolder[] getSubpackages(IScriptFolder pack) throws CoreException {
-		IProjectFragment root= (IProjectFragment) pack.getParent();
-		IModelElement[] allPackages= root.getChildren();
+		IProjectFragment root = (IProjectFragment) pack.getParent();
+		IModelElement[] allPackages = root.getChildren();
 		if (pack.isRootFolder())
 			return new IScriptFolder[0];
-		ArrayList<IScriptFolder> result= new ArrayList<IScriptFolder>();
-		String prefix= pack.getElementName() + IScriptFolder.PACKAGE_DELIMITER;
-		for (int i= 0; i < allPackages.length; i++) {
-			IScriptFolder currentPackage= (IScriptFolder) allPackages[i];
+		ArrayList<IScriptFolder> result = new ArrayList<>();
+		String prefix = pack.getElementName() + IScriptFolder.PACKAGE_DELIMITER;
+		for (int i = 0; i < allPackages.length; i++) {
+			IScriptFolder currentPackage = (IScriptFolder) allPackages[i];
 			if (currentPackage.getElementName().startsWith(prefix))
 				result.add(currentPackage);
 		}
 		return result.toArray(new IScriptFolder[result.size()]);
 	}
-	
+
 	private IFolder computeTargetFolder(IScriptFolder rootPackage, RenameArguments args, IScriptFolder pack) {
-		IPath path= pack.getParent().getPath();
-		path= path.append(getNewPackageName(rootPackage, args.getNewName(),  pack.getElementName()).replace('.', IPath.SEPARATOR));
-		IFolder target= ResourcesPlugin.getWorkspace().getRoot().getFolder(path);
+		IPath path = pack.getParent().getPath();
+		path = path.append(
+				getNewPackageName(rootPackage, args.getNewName(), pack.getElementName()).replace('.', IPath.SEPARATOR));
+		IFolder target = ResourcesPlugin.getWorkspace().getRoot().getFolder(path);
 		return target;
 	}
-	
+
 	private String getNewPackageName(IScriptFolder rootPackage, String newPackageName, String oldSubPackageName) {
-		String oldPackageName= rootPackage.getElementName();
+		String oldPackageName = rootPackage.getElementName();
 		return newPackageName + oldSubPackageName.substring(oldPackageName.length());
 	}
-} 
+}
diff --git a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/reorg/RefactoringModifications.java b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/reorg/RefactoringModifications.java
index 2c44cfa..dee61df 100644
--- a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/reorg/RefactoringModifications.java
+++ b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/reorg/RefactoringModifications.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 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
@@ -25,23 +25,23 @@
 import org.eclipse.ltk.core.refactoring.participants.SharableParticipants;
 import org.eclipse.ltk.core.refactoring.participants.ValidateEditChecker;
 
-
 public abstract class RefactoringModifications {
 
 	private ResourceModifications fResourceModifications;
 
 	public RefactoringModifications() {
-		fResourceModifications= new ResourceModifications();
+		fResourceModifications = new ResourceModifications();
 	}
-	
+
 	public ResourceModifications getResourceModifications() {
 		return fResourceModifications;
 	}
-	
-	public abstract RefactoringParticipant[] loadParticipants(RefactoringStatus status, RefactoringProcessor owner, String[] natures, SharableParticipants shared);
+
+	public abstract RefactoringParticipant[] loadParticipants(RefactoringStatus status, RefactoringProcessor owner,
+			String[] natures, SharableParticipants shared);
 
 	public abstract void buildDelta(IResourceChangeDescriptionFactory builder);
-	
+
 	public void buildValidateEdits(ValidateEditChecker checker) {
 		// Default implementation does nothing.
 	}
@@ -49,14 +49,14 @@
 	protected void createIncludingParents(IContainer container) {
 		while (container != null && !(container.exists() || getResourceModifications().willExist(container))) {
 			getResourceModifications().addCreate(container);
-			container= container.getParent();
+			container = container.getParent();
 		}
 	}
 
 	protected IResource[] collectResourcesOfInterest(IScriptFolder source) throws CoreException {
 		IModelElement[] children = source.getChildren();
-		int childOfInterest = IModelElement.SOURCE_MODULE;		
-		ArrayList<IResource> result = new ArrayList<IResource>(children.length);
+		int childOfInterest = IModelElement.SOURCE_MODULE;
+		ArrayList<IResource> result = new ArrayList<>(children.length);
 		for (int i = 0; i < children.length; i++) {
 			IModelElement child = children[i];
 			if (child.getElementType() == childOfInterest && child.getResource() != null) {
@@ -65,22 +65,22 @@
 		}
 		// Gather non-java resources
 		Object[] nonScriptResources = source.getForeignResources();
-		for (int i= 0; i < nonScriptResources.length; i++) {
-			Object element= nonScriptResources[i];
+		for (int i = 0; i < nonScriptResources.length; i++) {
+			Object element = nonScriptResources[i];
 			if (element instanceof IResource) {
 				result.add((IResource) element);
 			}
 		}
 		return result.toArray(new IResource[result.size()]);
 	}
-	
+
 	protected IFile getBuildpathFile(IResource resource) {
-		IProject project= resource.getProject();
+		IProject project = resource.getProject();
 		if (project == null)
 			return null;
-		IResource result= project.findMember(".classpath"); //$NON-NLS-1$
+		IResource result = project.findMember(".classpath"); //$NON-NLS-1$
 		if (result instanceof IFile)
-			return (IFile)result;
+			return (IFile) result;
 		return null;
 	}
 }
diff --git a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/util/ResourceUtil.java b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/util/ResourceUtil.java
index 4cd7f05..1da69be 100644
--- a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/util/ResourceUtil.java
+++ b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/util/ResourceUtil.java
@@ -1,11 +1,10 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 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
  * http://www.eclipse.org/legal/epl-v10.html
  *
- 
  *******************************************************************************/
 package org.eclipse.dltk.internal.corext.refactoring.util;
 
@@ -25,7 +24,7 @@
 	}
 
 	public static IFile[] getFiles(ISourceModule[] cus) {
-		List<IResource> files = new ArrayList<IResource>(cus.length);
+		List<IResource> files = new ArrayList<>(cus.length);
 		for (int i = 0; i < cus.length; i++) {
 			IResource resource = ResourceUtil.getResource(cus[i]);
 			if (resource != null && resource.getType() == IResource.FILE)
@@ -45,9 +44,9 @@
 	// ----- other ------------------------------
 
 	/**
-	 * Finds an <code>IResource</code> for a given <code>ISourceModule</code>.
-	 * If the parameter is a working copy then the <code>IResource</code> for
-	 * the original element is returned.
+	 * Finds an <code>IResource</code> for a given <code>ISourceModule</code>. If
+	 * the parameter is a working copy then the <code>IResource</code> for the
+	 * original element is returned.
 	 */
 	public static IResource getResource(ISourceModule cu) {
 		return cu.getResource();