Merge remote-tracking branch 'origin/master' into BETA_JAVA8

See this bug for problems in the "Generate 'for' loop" quick fixes:
Bug 430336: [1.8][compiler] Bad additional "cannot be resolved to a
type" error after syntax errors


Conflicts:
	org.eclipse.jdt.junit/META-INF/MANIFEST.MF
	org.eclipse.jdt.junit/pom.xml
	org.eclipse.jdt.text.tests/META-INF/MANIFEST.MF
	org.eclipse.jdt.text.tests/pom.xml
	org.eclipse.jdt.ui.tests.refactoring/test
cases/org/eclipse/jdt/ui/tests/refactoring/ExtractConstantTests.java
	org.eclipse.jdt.ui.tests.refactoring/test
cases/org/eclipse/jdt/ui/tests/refactoring/ExtractMethodTests.java
	org.eclipse.jdt.ui.tests/META-INF/MANIFEST.MF
	org.eclipse.jdt.ui.tests/pom.xml
	org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/AddImportTest.java
	org.eclipse.jdt.ui/META-INF/MANIFEST.MF
	org.eclipse.jdt.ui/core
extension/org/eclipse/jdt/internal/corext/codemanipulation/AddImportsOperation.java
	org.eclipse.jdt.ui/core
extension/org/eclipse/jdt/internal/corext/codemanipulation/StubUtility2.java
	org.eclipse.jdt.ui/core
refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractMethodRefactoring.java
	org.eclipse.jdt.ui/core
refactoring/org/eclipse/jdt/internal/corext/refactoring/code/PromoteTempToFieldRefactoring.java
	org.eclipse.jdt.ui/core
refactoring/org/eclipse/jdt/internal/corext/refactoring/surround/SurroundWithTryCatchRefactoring.java
	org.eclipse.jdt.ui/pom.xml
	org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ComplianceConfigurationBlock.java
	org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/JavaIndenter.java
	org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/QuickFixProcessor.java
diff --git a/.gitignore b/.gitignore
index 57dbb71..8b3dc23 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,3 +6,5 @@
 heapdump.*
 core.*
 Snap.*
+# maven
+/*/target/
diff --git a/org.eclipse.jdt.astview.feature/build.properties b/org.eclipse.jdt.astview.feature/build.properties
index 404641d..08c0f45 100644
--- a/org.eclipse.jdt.astview.feature/build.properties
+++ b/org.eclipse.jdt.astview.feature/build.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2001, 2006 IBM Corporation and others.
+# Copyright (c) 2001, 2014 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
@@ -12,11 +12,9 @@
                license.html,\
                feature.property,\
                cpl-v10.html,\
-               eclipse_update_120.jpg,\
                feature.properties
 src.includes = license.html,\
                feature.xml,\
                feature.properties,\
-               eclipse_update_120.jpg,\
                cpl-v10.html
 jre.compilation.profile = J2SE-1.4
diff --git a/org.eclipse.jdt.astview.feature/eclipse_update_120.jpg b/org.eclipse.jdt.astview.feature/eclipse_update_120.jpg
deleted file mode 100644
index 68e3e02..0000000
--- a/org.eclipse.jdt.astview.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.astview.feature/feature.xml b/org.eclipse.jdt.astview.feature/feature.xml
index 8b12ca7..99b1ca0 100644
--- a/org.eclipse.jdt.astview.feature/feature.xml
+++ b/org.eclipse.jdt.astview.feature/feature.xml
@@ -2,12 +2,12 @@
 <feature
       id="org.eclipse.jdt.astview.feature"
       label="AST View"
-      version="1.1.8.qualifier"
+      version="1.1.9.qualifier"
       provider-name="Eclipse.org">
    <install-handler/>
 
    <description>
-      AST View for JDT 3.7.1, 3.8, and later
+      AST View for JDT 4.4 and later
    </description>
 
    <license url="%licenseURL">
@@ -19,8 +19,8 @@
    </url>
 
    <requires>
-      <import plugin="org.eclipse.jdt.core" version="3.7.1" match="compatible"/>
-      <import plugin="org.eclipse.jdt.ui" version="3.7.1" match="compatible"/>
+      <import plugin="org.eclipse.jdt.core" version="3.9.0" match="compatible"/>
+      <import plugin="org.eclipse.jdt.ui" version="3.9.0" match="compatible"/>
       <import plugin="org.eclipse.core.runtime"/>
       <import plugin="org.eclipse.ui.ide"/>
       <import plugin="org.eclipse.ui.views"/>
diff --git a/org.eclipse.jdt.astview.feature/pom.xml b/org.eclipse.jdt.astview.feature/pom.xml
index 1d4bd39..cba6cd4 100644
--- a/org.eclipse.jdt.astview.feature/pom.xml
+++ b/org.eclipse.jdt.astview.feature/pom.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-  Copyright (c) 2012, 2013 Eclipse Foundation and others.
+  Copyright (c) 2012, 2014 Eclipse Foundation and others.
   All rights reserved. This program and the accompanying materials
   are made available under the terms of the Eclipse Distribution License v1.0
   which accompanies this distribution, and is available at
@@ -18,6 +18,6 @@
   </parent>
   <groupId>org.eclipse.jdt.feature</groupId>
   <artifactId>org.eclipse.jdt.astview.feature</artifactId>
-  <version>1.1.8-SNAPSHOT</version>
+  <version>1.1.9-SNAPSHOT</version>
   <packaging>eclipse-feature</packaging>
 </project>
diff --git a/org.eclipse.jdt.astview/META-INF/MANIFEST.MF b/org.eclipse.jdt.astview/META-INF/MANIFEST.MF
index a7b7cab..a858485 100644
--- a/org.eclipse.jdt.astview/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.astview/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.jdt.astview; singleton:=true
 Bundle-Version: 1.1.9.qualifier
-Eclipse-SourceReferences: scm:git:git://git.eclipse.org/gitroot/jdt/eclipse.jdt.ui.git;path="org.eclipse.jdt.astview";tag=R1_1_9
+Eclipse-SourceReferences: scm:git:git://git.eclipse.org/gitroot/jdt/eclipse.jdt.ui.git;path="org.eclipse.jdt.astview";tag=R4_4
 Bundle-Activator: org.eclipse.jdt.astview.ASTViewPlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
diff --git a/org.eclipse.jdt.jeview.feature/build.properties b/org.eclipse.jdt.jeview.feature/build.properties
index 903208a..dcdca5e 100644
--- a/org.eclipse.jdt.jeview.feature/build.properties
+++ b/org.eclipse.jdt.jeview.feature/build.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2001, 2007 IBM Corporation and others.
+# Copyright (c) 2001, 2014 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
@@ -11,10 +11,8 @@
 bin.includes = feature.xml,\
                epl-v10.html,\
                feature.properties,\
-               eclipse_update_120.jpg,\
                license.html
-src.includes = eclipse_update_120.jpg,\
-               epl-v10.html,\
+src.includes = epl-v10.html,\
                feature.properties,\
                feature.xml,\
                license.html
diff --git a/org.eclipse.jdt.jeview.feature/eclipse_update_120.jpg b/org.eclipse.jdt.jeview.feature/eclipse_update_120.jpg
deleted file mode 100644
index 68e3e02..0000000
--- a/org.eclipse.jdt.jeview.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.jeview.feature/feature.xml b/org.eclipse.jdt.jeview.feature/feature.xml
index cba9411..d417b1c 100644
--- a/org.eclipse.jdt.jeview.feature/feature.xml
+++ b/org.eclipse.jdt.jeview.feature/feature.xml
@@ -2,11 +2,11 @@
 <feature
       id="org.eclipse.jdt.jeview.feature"
       label="JavaElement View"
-      version="1.0.8.qualifier"
+      version="1.0.9.qualifier"
       provider-name="Eclipse.org">
 
    <description>
-      JavaElement View for JDT 3.7.0 and later
+      JavaElement View for JDT UI 4.4 and later
    </description>
 
    <license url="%licenseURL">
@@ -18,8 +18,8 @@
    </url>
 
    <requires>
-      <import plugin="org.eclipse.jdt.core" version="3.7.0" match="compatible"/>
-      <import plugin="org.eclipse.jdt.ui" version="3.7.0" match="compatible"/>
+      <import plugin="org.eclipse.jdt.core" version="3.9.0" match="compatible"/>
+      <import plugin="org.eclipse.jdt.ui" version="3.9.0" match="compatible"/>
       <import plugin="org.eclipse.ui"/>
       <import plugin="org.eclipse.core.runtime"/>
       <import plugin="org.eclipse.core.resources"/>
diff --git a/org.eclipse.jdt.jeview.feature/pom.xml b/org.eclipse.jdt.jeview.feature/pom.xml
index 61af502..26d169c 100644
--- a/org.eclipse.jdt.jeview.feature/pom.xml
+++ b/org.eclipse.jdt.jeview.feature/pom.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-  Copyright (c) 2012, 2013 Eclipse Foundation and others.
+  Copyright (c) 2012, 2014 Eclipse Foundation and others.
   All rights reserved. This program and the accompanying materials
   are made available under the terms of the Eclipse Distribution License v1.0
   which accompanies this distribution, and is available at
@@ -18,6 +18,6 @@
   </parent>
   <groupId>org.eclipse.jdt.feature</groupId>
   <artifactId>org.eclipse.jdt.jeview.feature</artifactId>
-  <version>1.0.8-SNAPSHOT</version>
+  <version>1.0.9-SNAPSHOT</version>
   <packaging>eclipse-feature</packaging>
 </project>
diff --git a/org.eclipse.jdt.jeview/META-INF/MANIFEST.MF b/org.eclipse.jdt.jeview/META-INF/MANIFEST.MF
index 6cb0faf..6212593 100644
--- a/org.eclipse.jdt.jeview/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.jeview/META-INF/MANIFEST.MF
@@ -2,15 +2,15 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.jdt.jeview; singleton:=true
-Bundle-Version: 1.0.8.qualifier
-Eclipse-SourceReferences: scm:git:git://git.eclipse.org/gitroot/jdt/eclipse.jdt.ui.git;path="org.eclipse.jdt.jeview";tag=R1_0_8
+Bundle-Version: 1.0.9.qualifier
+Eclipse-SourceReferences: scm:git:git://git.eclipse.org/gitroot/jdt/eclipse.jdt.ui.git;path="org.eclipse.jdt.jeview";tag=R4_4
 Bundle-Activator: org.eclipse.jdt.jeview.JEViewPlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
 Bundle-RequiredExecutionEnvironment: J2SE-1.5
 Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.jdt.core;bundle-version="[3.7.0,4.0.0)",
- org.eclipse.jdt.ui;bundle-version="[3.7.0,4.0.0)",
+ org.eclipse.jdt.core;bundle-version="[3.9.0,4.0.0)",
+ org.eclipse.jdt.ui;bundle-version="[3.9.0,4.0.0)",
  org.eclipse.ui,
  org.eclipse.core.resources,
  org.eclipse.jface.text,
diff --git a/org.eclipse.jdt.jeview/pom.xml b/org.eclipse.jdt.jeview/pom.xml
index 3557056..4a7ef6d 100644
--- a/org.eclipse.jdt.jeview/pom.xml
+++ b/org.eclipse.jdt.jeview/pom.xml
@@ -18,6 +18,6 @@
   </parent>
   <groupId>org.eclipse.jdt</groupId>
   <artifactId>org.eclipse.jdt.jeview</artifactId>
-  <version>1.0.8-SNAPSHOT</version>
+  <version>1.0.9-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
 </project>
diff --git a/org.eclipse.jdt.junit.core/src/org/eclipse/jdt/internal/junit/JUnitMessages.java b/org.eclipse.jdt.junit.core/src/org/eclipse/jdt/internal/junit/JUnitMessages.java
index 7bd387f..5574265 100644
--- a/org.eclipse.jdt.junit.core/src/org/eclipse/jdt/internal/junit/JUnitMessages.java
+++ b/org.eclipse.jdt.junit.core/src/org/eclipse/jdt/internal/junit/JUnitMessages.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -49,7 +49,6 @@
 
 	public static String JUnitLaunchConfigurationDelegate_verifying_attriburtes_description;
 
-	public static String TestRunnerViewPart_configName;
 	public static String TestRunSession_unrootedTests;
 
 	public static String TestSearchEngine_message_searching;
diff --git a/org.eclipse.jdt.junit.core/src/org/eclipse/jdt/internal/junit/JUnitMessages.properties b/org.eclipse.jdt.junit.core/src/org/eclipse/jdt/internal/junit/JUnitMessages.properties
index cf3fb9f..4824c19 100644
--- a/org.eclipse.jdt.junit.core/src/org/eclipse/jdt/internal/junit/JUnitMessages.properties
+++ b/org.eclipse.jdt.junit.core/src/org/eclipse/jdt/internal/junit/JUnitMessages.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2000, 2009 IBM Corporation and others.
+# Copyright (c) 2000, 2013 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,5 +25,4 @@
 JUnitLaunchConfigurationDelegate_error_wrong_input=Can only run types or single method
 JUnitLaunchConfigurationDelegate_error_input_element_deosn_not_exist=The input element of the launch configuration does not exist
 JUnitLaunchConfigurationDelegate_input_type_does_not_exist=The input type of the launch configuration does not exist
-TestRunnerViewPart_configName=Rerun {0}
 TestRunSession_unrootedTests=Unrooted Tests
diff --git a/org.eclipse.jdt.junit.core/src/org/eclipse/jdt/internal/junit/buildpath/BuildPathSupport.java b/org.eclipse.jdt.junit.core/src/org/eclipse/jdt/internal/junit/buildpath/BuildPathSupport.java
index 44bb9a8..9738453 100644
--- a/org.eclipse.jdt.junit.core/src/org/eclipse/jdt/internal/junit/buildpath/BuildPathSupport.java
+++ b/org.eclipse.jdt.junit.core/src/org/eclipse/jdt/internal/junit/buildpath/BuildPathSupport.java
@@ -13,13 +13,17 @@
 
 import java.io.File;
 import java.io.FilenameFilter;
+import java.io.IOException;
+import java.net.URL;
 
+import org.osgi.framework.Bundle;
 import org.osgi.framework.Version;
 
 import org.eclipse.equinox.frameworkadmin.BundleInfo;
 import org.eclipse.jdt.junit.JUnitCore;
 import org.eclipse.osgi.service.resolver.VersionRange;
 
+import org.eclipse.core.runtime.FileLocator;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Platform;
@@ -45,6 +49,8 @@
 		private final String sourceBundleId;
 		private final String repositorySource;
 		private final String javadocPreferenceKey;
+		
+		private String resolvedVersion = null;
 
 		public JUnitPluginDescription(String bundleId, VersionRange versionRange, String bundleRoot, String binaryImportedRoot, String sourceBundleId, String repositorySource, String javadocPreferenceKey) {
 			this.bundleId= bundleId;
@@ -57,21 +63,65 @@
 		}
 		
 		public IPath getBundleLocation() {
-			return P2Utils.getBundleLocationPath(P2Utils.findBundle(bundleId, versionRange, false));
+			return getBundleLocation(bundleId, versionRange);
 		}
 		
 		public IPath getSourceBundleLocation() {
-			return getSourceLocation(P2Utils.findBundle(bundleId, versionRange, false));
+			return getSourceLocation(getBundleLocation());
+		}
+
+		private IPath getBundleLocation(String aBundleId, VersionRange aVersionRange) {
+			return getBundleLocation(aBundleId, aVersionRange, false);
+		}
+		
+		private IPath getBundleLocation(String aBundleId, VersionRange aVersionRange, boolean isSourceBundle) {
+			BundleInfo bundleInfo = P2Utils.findBundle(aBundleId, aVersionRange, isSourceBundle);
+			if (bundleInfo != null) {
+				resolvedVersion = bundleInfo.getVersion();
+				return P2Utils.getBundleLocationPath(bundleInfo);
+			} else {
+				// p2's simple configurator is not available. Let's try with installed bundles from the running platform.
+				// Note: Source bundles are typically not available at run time!
+				Bundle[] bundles= Platform.getBundles(aBundleId, aVersionRange.toString());
+				Bundle bestMatch = null;
+				if (bundles != null) {
+					for (int i= 0; i < bundles.length; i++) {
+						Bundle bundle= bundles[i];
+						if (bestMatch == null || bundle.getState() > bestMatch.getState()) {
+							bestMatch= bundle;
+						}
+					}
+				}
+				if (bestMatch != null) {
+					try {
+						resolvedVersion = bestMatch.getVersion().toString();
+						URL rootUrl= bestMatch.getEntry("/"); //$NON-NLS-1$
+						URL fileRootUrl= FileLocator.toFileURL(rootUrl);
+						return new Path(fileRootUrl.getPath());
+					} catch (IOException ex) {
+						JUnitCorePlugin.log(ex);
+					}
+				}
+			}
+			return null;
 		}
 		
 		public IClasspathEntry getLibraryEntry() {
-			BundleInfo bundleInfo= P2Utils.findBundle(bundleId, versionRange, false);
-			IPath bundleLocation= P2Utils.getBundleLocationPath(bundleInfo);
+			IPath bundleLocation = getBundleLocation(bundleId, versionRange);
 			if (bundleLocation != null) {
-				
-				IPath bundleRootLocation= getLibraryLocation(bundleInfo, bundleLocation);
-				IPath srcLocation= getSourceLocation(bundleInfo);
-				
+				IPath bundleRootLocation= null;
+				if (bundleRoot != null) {
+					bundleRootLocation= getLocationIfExists(bundleLocation, bundleRoot);
+				}
+				if (bundleRootLocation == null && binaryImportedRoot != null) {
+					bundleRootLocation= getLocationIfExists(bundleLocation, binaryImportedRoot);
+				}
+				if (bundleRootLocation == null) {
+					bundleRootLocation= getBundleLocation(bundleId, versionRange);
+				}
+
+				IPath srcLocation= getSourceLocation(bundleLocation);
+
 				String javadocLocation= Platform.getPreferencesService().getString(JUnitCorePlugin.CORE_PLUGIN_ID, javadocPreferenceKey, "", null); //$NON-NLS-1$
 				IClasspathAttribute[] attributes;
 				if (javadocLocation.length() == 0) {
@@ -89,44 +139,30 @@
 			return new IAccessRule[0];
 		}
 
-		private IPath getLibraryLocation(BundleInfo bundleInfo, IPath bundleLocation) {
-			IPath bundleRootLocation= null;
-			if (bundleRoot != null)
-				bundleRootLocation= getLocationIfExists(bundleInfo, bundleRoot);
-			
-			if (bundleRootLocation == null && binaryImportedRoot != null)
-				bundleRootLocation= getLocationIfExists(bundleInfo, binaryImportedRoot);
-			
-			if (bundleRootLocation == null)
-				bundleRootLocation= bundleLocation;
-			return bundleRootLocation;
-		}
-
-		private IPath getSourceLocation(BundleInfo bundleInfo) {
+		private IPath getSourceLocation(IPath bundleLocation) {
 			IPath srcLocation= null;
 			if (repositorySource != null) {
 				// Try source in workspace (from repository)
-				srcLocation= getLocationIfExists(bundleInfo, repositorySource);
+				srcLocation= getLocationIfExists(bundleLocation, repositorySource);
 			}
 			
 			if (srcLocation == null) {
-				BundleInfo sourceBundleInfo= null;
-				if (bundleInfo != null) {
+				if (bundleLocation != null) {
 					// Try exact version
-					sourceBundleInfo= P2Utils.findBundle(sourceBundleId, new Version(bundleInfo.getVersion()), true);
+					Version version= new Version(resolvedVersion);
+					srcLocation= getBundleLocation(sourceBundleId, new VersionRange(version, true, version, true), true);
 				}
-				if (sourceBundleInfo == null) {
+				if (srcLocation == null) {
 					// Try version range
-					sourceBundleInfo= P2Utils.findBundle(sourceBundleId, versionRange, true);
+					srcLocation= getBundleLocation(sourceBundleId, versionRange, true);
 				}
-				srcLocation= P2Utils.getBundleLocationPath(sourceBundleInfo);
 			}
+
 			return srcLocation;
 		}
 
-		private IPath getLocationIfExists(BundleInfo bundleInfo, final String entryInBundle) {
+		private IPath getLocationIfExists(IPath bundleLocationPath, final String entryInBundle) {
 			IPath srcLocation= null;
-			IPath bundleLocationPath= P2Utils.getBundleLocationPath(bundleInfo);
 			if (bundleLocationPath != null) {
 				File bundleFile= bundleLocationPath.toFile();
 				if (bundleFile.isDirectory()) {
diff --git a/org.eclipse.jdt.junit.core/src/org/eclipse/jdt/internal/junit/model/TestRunSession.java b/org.eclipse.jdt.junit.core/src/org/eclipse/jdt/internal/junit/model/TestRunSession.java
index 3534d2d..b331768 100644
--- a/org.eclipse.jdt.junit.core/src/org/eclipse/jdt/internal/junit/model/TestRunSession.java
+++ b/org.eclipse.jdt.junit.core/src/org/eclipse/jdt/internal/junit/model/TestRunSession.java
@@ -8,6 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Achim Demelt <a.demelt@exxcellent.de> - [junit] Separate UI from non-UI code - https://bugs.eclipse.org/bugs/show_bug.cgi?id=278844
+ *     Thirumala Reddy Mutchukota <thirumala@google.com> - [JUnit] Avoid rerun test launch on UI thread - https://bugs.eclipse.org/bugs/show_bug.cgi?id=411841
  *******************************************************************************/
 package org.eclipse.jdt.internal.junit.model;
 
@@ -31,7 +32,6 @@
 import org.eclipse.debug.core.DebugPlugin;
 import org.eclipse.debug.core.ILaunch;
 import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
 import org.eclipse.debug.core.ILaunchManager;
 import org.eclipse.debug.core.ILaunchesListener2;
 
@@ -39,14 +39,11 @@
 
 import org.eclipse.jdt.internal.junit.JUnitCorePlugin;
 import org.eclipse.jdt.internal.junit.JUnitMessages;
-import org.eclipse.jdt.internal.junit.Messages;
 import org.eclipse.jdt.internal.junit.launcher.ITestKind;
 import org.eclipse.jdt.internal.junit.launcher.JUnitLaunchConfigurationConstants;
 import org.eclipse.jdt.internal.junit.model.TestElement.Status;
 import org.eclipse.jdt.internal.junit.runner.MessageIds;
 
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
-
 
 /**
  * A test run session holds all information about a test run, i.e.
@@ -451,17 +448,14 @@
 	}
 
 	/**
-	 * Reruns the given test method.
+	 * Reruns the given test method if the session is kept alive.
 	 *
 	 * @param testId test id
 	 * @param className test class name
 	 * @param testName test method name
-	 * @param launchMode launch mode, see {@link ILaunchManager}
-	 * @param buildBeforeLaunch whether a build should be done before launch 
 	 * @return <code>false</code> iff the rerun could not be started
-	 * @throws CoreException if the launch fails
 	 */
-	public boolean rerunTest(String testId, String className, String testName, String launchMode, boolean buildBeforeLaunch) throws CoreException {
+	public boolean rerunTest(String testId, String className, String testName) {
 		if (isKeptAlive()) {
 			Status status= ((TestCaseElement) getTestElement(testId)).getStatus();
 			if (status == Status.ERROR) {
@@ -471,31 +465,7 @@
 			}
 			fTestRunnerClient.rerunTest(testId, className, testName);
 			return true;
-
-		} else if (fLaunch != null) {
-			// run the selected test using the previous launch configuration
-			ILaunchConfiguration launchConfiguration= fLaunch.getLaunchConfiguration();
-			if (launchConfiguration != null) {
-
-				String name= className;
-				if (testName != null)
-					name+= "."+testName; //$NON-NLS-1$
-				String configName= Messages.format(JUnitMessages.TestRunnerViewPart_configName, name);
-				ILaunchConfigurationWorkingCopy tmp= launchConfiguration.copy(configName);
-				// fix for bug: 64838  junit view run single test does not use correct class [JUnit]
-				tmp.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, className);
-				// reset the container
-				tmp.setAttribute(JUnitLaunchConfigurationConstants.ATTR_TEST_CONTAINER, ""); //$NON-NLS-1$
-				if (testName != null) {
-					tmp.setAttribute(JUnitLaunchConfigurationConstants.ATTR_TEST_METHOD_NAME, testName);
-					//	String args= "-rerun "+testId;
-					//	tmp.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, args);
-				}
-				tmp.launch(launchMode, null, buildBeforeLaunch);
-				return true;
-			}
 		}
-
 		return false;
 	}
 
diff --git a/org.eclipse.jdt.junit.core/src/org/eclipse/jdt/junit/launcher/JUnitLaunchConfigurationDelegate.java b/org.eclipse.jdt.junit.core/src/org/eclipse/jdt/junit/launcher/JUnitLaunchConfigurationDelegate.java
index dee50ce..aa6e2ba 100644
--- a/org.eclipse.jdt.junit.core/src/org/eclipse/jdt/junit/launcher/JUnitLaunchConfigurationDelegate.java
+++ b/org.eclipse.jdt.junit.core/src/org/eclipse/jdt/junit/launcher/JUnitLaunchConfigurationDelegate.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -283,7 +283,16 @@
 		programArguments.addAll(Arrays.asList(execArgs.getProgramArgumentsArray()));
 
 		String testFailureNames= configuration.getAttribute(JUnitLaunchConfigurationConstants.ATTR_FAILURES_NAMES, ""); //$NON-NLS-1$
-
+		
+		/*
+		 * The "-version" "3" arguments don't make sense and should eventually be removed.
+		 * But we keep them for now, since users may want to run with older releases of
+		 * org.eclipse.jdt.junit[4].runtime, where this is still
+		 * read by org.eclipse.jdt.internal.junit.runner.RemoteTestRunner#defaultInit(String[])
+		 * and used in org.eclipse.jdt.internal.junit.runner.DefaultClassifier#isComparisonFailure(Throwable).
+		 * The JUnit4 equivalent of the latter method is already version-agnostic:
+		 * org.eclipse.jdt.internal.junit4.runner.JUnit4TestListener#testFailure(Failure, boolean)
+		 */
 		programArguments.add("-version"); //$NON-NLS-1$
 		programArguments.add("3"); //$NON-NLS-1$
 
diff --git a/org.eclipse.jdt.junit.runtime/pom.xml b/org.eclipse.jdt.junit.runtime/pom.xml
index c18a40c..88ec092 100644
--- a/org.eclipse.jdt.junit.runtime/pom.xml
+++ b/org.eclipse.jdt.junit.runtime/pom.xml
@@ -20,16 +20,4 @@
   <artifactId>org.eclipse.jdt.junit.runtime</artifactId>
   <version>3.4.400-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.eclipse.tycho</groupId>
-        <artifactId>target-platform-configuration</artifactId>
-        <configuration>
-          <!-- observed BREE as of Juno -->
-          <executionEnvironment>J2SE-1.4</executionEnvironment>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
 </project>
diff --git a/org.eclipse.jdt.junit.runtime/src/org/eclipse/jdt/internal/junit/runner/DefaultClassifier.java b/org.eclipse.jdt.junit.runtime/src/org/eclipse/jdt/internal/junit/runner/DefaultClassifier.java
index db89331..1657b49 100644
--- a/org.eclipse.jdt.junit.runtime/src/org/eclipse/jdt/internal/junit/runner/DefaultClassifier.java
+++ b/org.eclipse.jdt.junit.runtime/src/org/eclipse/jdt/internal/junit/runner/DefaultClassifier.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 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
@@ -19,12 +19,6 @@
 
 public class DefaultClassifier implements IClassifiesThrowables {
 
-	private String fVersion;
-
-	public DefaultClassifier(String version) {
-		fVersion= version;
-	}
-
 	/*
 	 * (non-Javadoc)
 	 *
@@ -44,9 +38,9 @@
 	 * @see org.eclipse.jdt.internal.junit.runner.ThrowableClassifier#isComparisonFailure(java.lang.Throwable)
 	 */
 	public boolean isComparisonFailure(Throwable throwable) {
-		if (! fVersion.equals("3")) //$NON-NLS-1$
-			return false;
-		// avoid reference to comparison failure to avoid a dependency on 3.8.1
-		return throwable.getClass().getName().equals("junit.framework.ComparisonFailure"); //$NON-NLS-1$
+		// avoid reference to comparison failure to avoid a dependency on 3.8.1 or 4.x
+		String classname= throwable.getClass().getName();
+		return classname.equals("junit.framework.ComparisonFailure") //$NON-NLS-1$
+				|| classname.equals("org.junit.ComparisonFailure"); //$NON-NLS-1$
 	}
 }
diff --git a/org.eclipse.jdt.junit.runtime/src/org/eclipse/jdt/internal/junit/runner/RemoteTestRunner.java b/org.eclipse.jdt.junit.runtime/src/org/eclipse/jdt/internal/junit/runner/RemoteTestRunner.java
index d42fa52..f33e7fe 100644
--- a/org.eclipse.jdt.junit.runtime/src/org/eclipse/jdt/internal/junit/runner/RemoteTestRunner.java
+++ b/org.eclipse.jdt.junit.runtime/src/org/eclipse/jdt/internal/junit/runner/RemoteTestRunner.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -67,11 +67,6 @@
 	private TestExecution fExecution;
 
 	/**
-	 * The version expected by the client
-	 */
-	private String fVersion= ""; //$NON-NLS-1$
-
-	/**
 	 * The client socket.
 	 */
 	private Socket fClientSocket;
@@ -280,10 +275,7 @@
 			}
 			else if(args[i].toLowerCase().equals("-debugging") || args[i].toLowerCase().equals("-debug")){ //$NON-NLS-1$ //$NON-NLS-2$
 			    fDebugMode= true;
-			}
-			else if(args[i].toLowerCase().equals("-version")){ //$NON-NLS-1$
-			    fVersion= args[i+1];
-			    i++;
+
 			} else if (args[i].toLowerCase().equals("-junitconsole")) { //$NON-NLS-1$
 			    fConsoleMode  = true;
 			} else if (args[i].toLowerCase().equals("-testloaderclass")) { //$NON-NLS-1$
@@ -511,7 +503,7 @@
 	}
 
 	protected IClassifiesThrowables getClassifier() {
-		return new DefaultClassifier(fVersion);
+		return new DefaultClassifier();
 	}
 
 	public void visitTreeEntry(ITestIdentifier id, boolean b, int i) {
diff --git a/org.eclipse.jdt.junit/plugin.properties b/org.eclipse.jdt.junit/plugin.properties
index de44686..92a92c1 100644
--- a/org.eclipse.jdt.junit/plugin.properties
+++ b/org.eclipse.jdt.junit/plugin.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2000, 2010 IBM Corporation and others.
+# Copyright (c) 2000, 2013 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
@@ -7,6 +7,7 @@
 #
 # Contributors:
 #     IBM Corporation - initial API and implementation
+#	  Andrew Eisenberg <andrew@eisenberg.as> - [JUnit] Add a monospace font option for the junit results view - https://bugs.eclipse.org/bugs/show_bug.cgi?id=411794
 ###############################################################################
 pluginName=Java Development Tools JUnit support
 providerName=Eclipse.org
@@ -30,6 +31,8 @@
 View.label= JUnit
 Launch.label= JUnit
 PreferencePage.label= JUnit
+FailureTraceFont.label= JUnit failure trace font
+FailureTraceFont.description= The JUnit failure trace font is used by the JUnit view to display the failure trace.
 
 TestWizard.description= Create a JUnit Test Case
 SuiteWizard.description= Create a JUnit Test Suite
diff --git a/org.eclipse.jdt.junit/plugin.xml b/org.eclipse.jdt.junit/plugin.xml
index 2bdf15a..d4399b8 100644
--- a/org.eclipse.jdt.junit/plugin.xml
+++ b/org.eclipse.jdt.junit/plugin.xml
@@ -448,4 +448,15 @@
             class="org.eclipse.jdt.internal.junit.ui.UITestRunListener">
       </testRunListener>
    </extension>
+   <extension
+         point="org.eclipse.ui.themes">
+      <fontDefinition
+            categoryId="org.eclipse.jdt.ui.presentation"
+            id="org.eclipse.jdt.junit.failurePaneFont"
+            label="%FailureTraceFont.label">
+         <description>
+            %FailureTraceFont.description
+         </description>
+      </fontDefinition>
+   </extension>
 </plugin>
diff --git a/org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/FailureTrace.java b/org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/FailureTrace.java
index 5e57509..cbef720 100644
--- a/org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/FailureTrace.java
+++ b/org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/FailureTrace.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -9,6 +9,7 @@
  *     IBM Corporation - initial API and implementation
  *     Sebastian Davids: sdavids@gmx.de bug 37333, 26653
  *     Johan Walles: walles@mailblocks.com bug 68737
+ *     Andrew Eisenberg: andrew@eisenberg.as bug 411794
  *******************************************************************************/
 package org.eclipse.jdt.internal.junit.ui;
 
@@ -29,8 +30,11 @@
 import org.eclipse.jface.action.IMenuManager;
 import org.eclipse.jface.action.MenuManager;
 import org.eclipse.jface.action.ToolBarManager;
+import org.eclipse.jface.resource.JFaceResources;
 import org.eclipse.jface.util.IOpenEventListener;
+import org.eclipse.jface.util.IPropertyChangeListener;
 import org.eclipse.jface.util.OpenStrategy;
+import org.eclipse.jface.util.PropertyChangeEvent;
 
 import org.eclipse.jdt.internal.junit.JUnitPreferencesConstants;
 import org.eclipse.jdt.internal.junit.model.TestElement;
@@ -39,7 +43,27 @@
  * A pane that shows a stack trace of a failed test.
  */
 public class FailureTrace implements IMenuListener {
+	
+	/**
+	 * Internal property change listener for handling workbench font changes.
+	 */
+	private class FontPropertyChangeListener implements IPropertyChangeListener {
+		/*
+		 * @see IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
+		 */
+		public void propertyChange(PropertyChangeEvent event) {
+			if (fTable == null)
+				return;
+
+			String property= event.getProperty();
+
+			if (FAILURE_FONT.equals(property))
+				fTable.setFont(JFaceResources.getFont(FAILURE_FONT));
+		}
+	}
+
     private static final int MAX_LABEL_LENGTH = 256;
+    private static final String FAILURE_FONT = "org.eclipse.jdt.junit.failurePaneFont"; //$NON-NLS-1$
 
     static final String FRAME_PREFIX= "at "; //$NON-NLS-1$
 	private Table fTable;
@@ -49,6 +73,7 @@
     private TestElement fFailure;
     private CompareResultsAction fCompareAction;
 	private final FailureTableDisplay fFailureTableDisplay;
+	private IPropertyChangeListener fFontPropertyChangeListener;
 
 	public FailureTrace(Composite parent, Clipboard clipboard, TestRunnerViewPart testRunner, ToolBar toolBar) {
 		Assert.isNotNull(clipboard);
@@ -62,6 +87,7 @@
 		failureToolBarmanager.update(true);
 
 		fTable= new Table(parent, SWT.SINGLE | SWT.V_SCROLL | SWT.H_SCROLL);
+		fTable.setFont(JFaceResources.getFont(FAILURE_FONT));
 		fTestRunner= testRunner;
 		fClipboard= clipboard;
 
@@ -78,6 +104,9 @@
 				}
 			}
 		});
+		
+		fFontPropertyChangeListener = new FontPropertyChangeListener();
+		JFaceResources.getFontRegistry().addListener(fFontPropertyChangeListener);
 
 		initMenu();
 
@@ -220,4 +249,8 @@
 	public FailureTableDisplay getFailureTableDisplay() {
 		return fFailureTableDisplay;
 	}
+
+	public void dispose() {
+		JFaceResources.getFontRegistry().removeListener(fFontPropertyChangeListener);
+	}
 }
diff --git a/org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TestRunnerViewPart.java b/org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TestRunnerViewPart.java
index 109345c..ccf104e 100644
--- a/org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TestRunnerViewPart.java
+++ b/org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TestRunnerViewPart.java
@@ -14,6 +14,8 @@
  *         - https://bugs.eclipse.org/bugs/show_bug.cgi?id=102236: [JUnit] display execution time next to each test
  *     Achim Demelt <a.demelt@exxcellent.de> - [junit] Separate UI from non-UI code - https://bugs.eclipse.org/bugs/show_bug.cgi?id=278844
  *     Andrew Eisenberg <andrew@eisenberg.as> - [JUnit] Rerun failed first does not work with JUnit4 - https://bugs.eclipse.org/bugs/show_bug.cgi?id=140392
+ *     Thirumala Reddy Mutchukota <thirumala@google.com> - [JUnit] Avoid rerun test launch on UI thread - https://bugs.eclipse.org/bugs/show_bug.cgi?id=411841
+ *     Andrew Eisenberg <andrew@eisenberg.as> - [JUnit] Add a monospace font option for the junit results view - https://bugs.eclipse.org/bugs/show_bug.cgi?id=411794
  *******************************************************************************/
 package org.eclipse.jdt.internal.junit.ui;
 
@@ -124,7 +126,6 @@
 import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
 
 import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
 
 import org.eclipse.jdt.core.ElementChangedEvent;
 import org.eclipse.jdt.core.IElementChangedListener;
@@ -146,6 +147,8 @@
 import org.eclipse.jdt.internal.junit.model.TestElement;
 import org.eclipse.jdt.internal.junit.model.TestRunSession;
 
+import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
+
 import org.eclipse.jdt.internal.ui.viewsupport.ViewHistory;
 
 /**
@@ -1573,6 +1576,9 @@
 			JavaCore.removeElementChangedListener(fDirtyListener);
 			fDirtyListener= null;
 		}
+		if (fFailureTrace != null) {
+			fFailureTrace.dispose();
+		}
 	}
 
 	private void disposeImages() {
@@ -2062,25 +2068,49 @@
 	}
 
 	public void rerunTest(String testId, String className, String testName, String launchMode) {
-		boolean buildBeforeLaunch= Platform.getPreferencesService().getBoolean(IDebugUIConstants.PLUGIN_ID, IDebugUIConstants.PREF_BUILD_BEFORE_LAUNCH, false, null);
-		try {
-			boolean couldLaunch= fTestRunSession.rerunTest(testId, className, testName, launchMode, buildBeforeLaunch);
-			if (! couldLaunch) {
-				MessageDialog.openInformation(getSite().getShell(),
-						JUnitMessages.TestRunnerViewPart_cannotrerun_title,
-						JUnitMessages.TestRunnerViewPart_cannotrerurn_message);
-			} else if (fTestRunSession.isKeptAlive()) {
-				TestCaseElement testCaseElement= (TestCaseElement) fTestRunSession.getTestElement(testId);
-				testCaseElement.setStatus(TestElement.Status.RUNNING, null, null, null);
-				fTestViewer.registerViewerUpdate(testCaseElement);
-				postSyncProcessChanges();
-			}
-
-		} catch (CoreException e) {
-			ErrorDialog.openError(getSite().getShell(),
-				JUnitMessages.TestRunnerViewPart_error_cannotrerun, e.getMessage(), e.getStatus()
-			);
+		if (lastLaunchIsKeptAlive()) {
+			fTestRunSession.rerunTest(testId, className, testName);
+			TestCaseElement testCaseElement= (TestCaseElement) fTestRunSession.getTestElement(testId);
+			testCaseElement.setStatus(TestElement.Status.RUNNING, null, null, null);
+			fTestViewer.registerViewerUpdate(testCaseElement);
+			postSyncProcessChanges();
+			return;
 		}
+
+		if (fTestRunSession != null) {
+			ILaunch launch= fTestRunSession.getLaunch();
+			if (launch != null) {
+				// run the selected test using the previous launch configuration
+				ILaunchConfiguration launchConfiguration= launch.getLaunchConfiguration();
+				if (launchConfiguration != null) {
+					try {
+						String name= className;
+						if (testName != null)
+							name+= "."+testName; //$NON-NLS-1$
+						String configName= Messages.format(JUnitMessages.TestRunnerViewPart_configName, name);
+						ILaunchConfigurationWorkingCopy tmp = launchConfiguration.copy(configName);
+						// fix for bug: 64838  junit view run single test does not use correct class [JUnit]
+						tmp.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, className);
+						// reset the container
+						tmp.setAttribute(JUnitLaunchConfigurationConstants.ATTR_TEST_CONTAINER, ""); //$NON-NLS-1$
+						if (testName != null) {
+							tmp.setAttribute(JUnitLaunchConfigurationConstants.ATTR_TEST_METHOD_NAME, testName);
+						}
+						relaunch(tmp, launchMode);
+						return;
+						} catch (CoreException e) {
+							ErrorDialog.openError(getSite().getShell(),
+									JUnitMessages.TestRunnerViewPart_error_cannotrerun, e.getMessage(), e.getStatus()
+								);
+							return;
+						}
+				}
+			}
+		}
+
+		MessageDialog.openInformation(getSite().getShell(),
+				JUnitMessages.TestRunnerViewPart_cannotrerun_title,
+				JUnitMessages.TestRunnerViewPart_cannotrerurn_message);
 	}
 
 	private void postSyncProcessChanges() {
diff --git a/org.eclipse.jdt.junit4.runtime/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jdt.junit4.runtime/.settings/org.eclipse.jdt.core.prefs
index 52a5c37..2694fcd 100644
--- a/org.eclipse.jdt.junit4.runtime/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jdt.junit4.runtime/.settings/org.eclipse.jdt.core.prefs
@@ -82,6 +82,7 @@
 org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
 org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
 org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
 org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
 org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
 org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
diff --git a/org.eclipse.jdt.junit4.runtime/src/org/eclipse/jdt/internal/junit4/runner/JUnit4TestLoader.java b/org.eclipse.jdt.junit4.runtime/src/org/eclipse/jdt/internal/junit4/runner/JUnit4TestLoader.java
index d25c5ea..0e3bc5e 100644
--- a/org.eclipse.jdt.junit4.runtime/src/org/eclipse/jdt/internal/junit4/runner/JUnit4TestLoader.java
+++ b/org.eclipse.jdt.junit4.runtime/src/org/eclipse/jdt/internal/junit4/runner/JUnit4TestLoader.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2006, 2010 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -27,7 +27,7 @@
 public class JUnit4TestLoader implements ITestLoader {
 
 	public ITestReference[] loadTests(
-			@SuppressWarnings("rawtypes") Class[] testClasses, // https://bugs.eclipse.org/bugs/show_bug.cgi?id=164472
+			Class[] testClasses,
 			String testName,
 			String[] failureNames,
 			RemoteTestRunner listener) {
diff --git a/org.eclipse.jdt.text.tests/META-INF/MANIFEST.MF b/org.eclipse.jdt.text.tests/META-INF/MANIFEST.MF
index 9dcae77..91c2c0a 100644
--- a/org.eclipse.jdt.text.tests/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.text.tests/META-INF/MANIFEST.MF
@@ -3,7 +3,6 @@
 Bundle-Name: %Plugin.name
 Bundle-SymbolicName: org.eclipse.jdt.text.tests
 Bundle-Version: 3.9.1.qualifier
-Bundle-ClassPath: jdttexttests.jar
 Bundle-Activator: org.eclipse.jdt.text.tests.JdtTextTestPlugin
 Bundle-ActivationPolicy: lazy
 Bundle-Vendor: %Plugin.providerName
diff --git a/org.eclipse.jdt.text.tests/build.properties b/org.eclipse.jdt.text.tests/build.properties
index 92462e0..5010c1a 100644
--- a/org.eclipse.jdt.text.tests/build.properties
+++ b/org.eclipse.jdt.text.tests/build.properties
@@ -12,9 +12,9 @@
                test.xml,\
                about.html,\
                testResources/,\
-               *.jar,\
+               .,\
                META-INF/
 
 src.includes = about.html
-source.jdttexttests.jar = src/
-javacWarnings.jdttexttests.jar=-deadCode,-raw,-unchecked
+source.. = src/
+javacWarnings..=-deadCode,-raw,-unchecked
diff --git a/org.eclipse.jdt.text.tests/pom.xml b/org.eclipse.jdt.text.tests/pom.xml
index 21dccc3..c6b07e2 100644
--- a/org.eclipse.jdt.text.tests/pom.xml
+++ b/org.eclipse.jdt.text.tests/pom.xml
@@ -8,16 +8,50 @@
  
   Contributors:
      Igor Fedorenko - initial implementation
+     Mickael Istria (Red Hat Inc.) - 416915: tycho-surefire-plugin configuration
 -->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <parent>
-    <artifactId>eclipse.jdt.ui</artifactId>
+    <artifactId>tests-pom</artifactId>
     <groupId>eclipse.jdt.ui</groupId>
     <version>4.3.0-SNAPSHOT</version>
+    <relativePath>../tests-pom/</relativePath>
   </parent>
   <groupId>org.eclipse.jdt</groupId>
   <artifactId>org.eclipse.jdt.text.tests</artifactId>
   <version>3.9.1-SNAPSHOT</version>
   <packaging>eclipse-test-plugin</packaging>
+
+  <properties>
+  	<testSuite>${project.artifactId}</testSuite>
+  	<testClass>org.eclipse.jdt.text.tests.JdtTextTestSuite</testClass>
+  </properties>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.eclipse.tycho</groupId>
+        <artifactId>tycho-surefire-plugin</artifactId>
+        <version>${tycho.version}</version>
+        <configuration>
+          <useUIHarness>true</useUIHarness>
+          <useUIThread>true</useUIThread>
+          <dependencies>
+            <dependency>
+              <type>eclipse-plugin</type>
+              <artifactId>org.eclipse.osgi.compatibility.state</artifactId>
+              <version>0.0.0</version>
+            </dependency>
+            <dependency>
+              <type>eclipse-plugin</type>
+              <artifactId>org.eclipse.equinox.event</artifactId>
+              <version>0.0.0</version>
+            </dependency>
+          </dependencies>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
 </project>
diff --git a/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/IndentActionTest.java b/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/IndentActionTest.java
index 71823c1..60f74cf 100644
--- a/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/IndentActionTest.java
+++ b/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/IndentActionTest.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2014 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
@@ -165,4 +165,14 @@
 			project.setOption(DefaultCodeFormatterConstants.FORMATTER_NEVER_INDENT_LINE_COMMENTS_ON_FIRST_COLUMN, DefaultCodeFormatterConstants.TRUE);
 		}
 	}
+
+	public void testBug424772() throws Exception {
+		selectAll();
+		assertIndentResult();
+	}
+
+	public void testBug428384() throws Exception {
+		selectAll();
+		assertIndentResult();
+	}
 }
diff --git a/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/PluginsNotLoadedTest.java b/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/PluginsNotLoadedTest.java
index 3dd1a85..30303e0 100644
--- a/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/PluginsNotLoadedTest.java
+++ b/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/PluginsNotLoadedTest.java
@@ -105,7 +105,6 @@
 			"org.eclipse.osgi.services",
 			"org.eclipse.pde",
 			"org.eclipse.pde.build",
-			"org.eclipse.pde.core",
 			"org.eclipse.pde.doc.user",
 			"org.eclipse.pde.runtime",
 			"org.eclipse.platform.doc.isv",
diff --git a/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/SmartSemicolonAutoEditStrategyTest.java b/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/SmartSemicolonAutoEditStrategyTest.java
index 8414c04..0ddbbaa 100644
--- a/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/SmartSemicolonAutoEditStrategyTest.java
+++ b/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/SmartSemicolonAutoEditStrategyTest.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -10,11 +10,12 @@
  *******************************************************************************/
 package org.eclipse.jdt.text.tests;
 
-import junit.framework.Assert;
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
+import org.junit.Assert;
+
 import org.eclipse.jface.text.BadLocationException;
 import org.eclipse.jface.text.Document;
 import org.eclipse.jface.text.IDocument;
diff --git a/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/contentassist/CodeCompletionTest.java b/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/contentassist/CodeCompletionTest.java
index 7accf33..72fd010 100644
--- a/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/contentassist/CodeCompletionTest.java
+++ b/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/contentassist/CodeCompletionTest.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 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
@@ -10,6 +10,11 @@
  *******************************************************************************/
 package org.eclipse.jdt.text.tests.contentassist;
 
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
 import java.util.Arrays;
 import java.util.Hashtable;
 import java.util.List;
@@ -38,6 +43,7 @@
 import org.eclipse.ui.PlatformUI;
 
 import org.eclipse.jdt.core.CompletionProposal;
+import org.eclipse.jdt.core.IBuffer;
 import org.eclipse.jdt.core.ICompilationUnit;
 import org.eclipse.jdt.core.IJavaProject;
 import org.eclipse.jdt.core.IPackageFragment;
@@ -88,6 +94,32 @@
 	}
 
 	private void codeComplete(ICompilationUnit cu, int offset, CompletionProposalCollector collector) throws JavaModelException {
+		// logging for https://bugs.eclipse.org/bugs/show_bug.cgi?id=423416
+		System.out.println();
+		System.out.println("---- " + getClass().getName() + "#" + getName() + " ----");
+		System.out.println("offset: " + offset);
+		System.out.println("cu: " + cu);
+		IBuffer buffer= cu.getBuffer();
+		System.out.println("buffer: " + buffer);
+		System.out.println("source: |" + buffer.getContents() + "|");
+
+		System.out.print("file contents: |");
+		File file= cu.getResource().getLocation().toFile();
+		try {
+			BufferedReader reader= new BufferedReader(new FileReader(file));
+			String line;
+			while ((line= reader.readLine()) != null) {
+				System.out.println(line);
+			}
+			System.out.println("|");
+			reader.close();
+		} catch (FileNotFoundException e1) {
+			e1.printStackTrace();
+		} catch (IOException e1) {
+			e1.printStackTrace();
+		}
+		System.out.println();
+
 		cu.codeComplete(offset, collector, new NullProgressMonitor());
 	}
 
diff --git a/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/performance/DifferenceMeter.java b/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/performance/DifferenceMeter.java
index f2e6a89..e1b21cd 100644
--- a/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/performance/DifferenceMeter.java
+++ b/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/performance/DifferenceMeter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * Copyright (c) 2007, 2013 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
@@ -15,7 +15,7 @@
 import java.util.Iterator;
 import java.util.Map;
 
-import junit.framework.Assert;
+import org.junit.Assert;
 
 import org.eclipse.test.internal.performance.InternalPerformanceMeter;
 import org.eclipse.test.internal.performance.OSPerformanceMeter;
diff --git a/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/performance/DisplayWaiter.java b/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/performance/DisplayWaiter.java
index 4b6c36f..ff94dbd 100644
--- a/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/performance/DisplayWaiter.java
+++ b/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/performance/DisplayWaiter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,7 +13,7 @@
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
-import junit.framework.Assert;
+import org.junit.Assert;
 
 import org.eclipse.swt.widgets.Display;
 
@@ -118,6 +118,8 @@
 					unhold();
 					setNextTimeout(delay);
 					break;
+				default:
+					break;
 			}
 
 			return fCurrentTimeoutState;
@@ -156,6 +158,8 @@
 				case IDLE:
 					unhold();
 					break;
+				default:
+					break;
 			}
 			setNextTimeout(delay);
 
diff --git a/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/performance/EditorTestHelper.java b/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/performance/EditorTestHelper.java
index bf08b14..fa09996 100644
--- a/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/performance/EditorTestHelper.java
+++ b/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/performance/EditorTestHelper.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -18,7 +18,7 @@
 import java.util.List;
 import java.util.logging.Logger;
 
-import junit.framework.Assert;
+import org.junit.Assert;
 
 import org.eclipse.jdt.testplugin.JavaProjectHelper;
 import org.eclipse.jdt.text.tests.JdtTextTestPlugin;
diff --git a/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/performance/InvocationCountPerformanceMeter.java b/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/performance/InvocationCountPerformanceMeter.java
index dd55cd5..4811da4 100644
--- a/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/performance/InvocationCountPerformanceMeter.java
+++ b/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/performance/InvocationCountPerformanceMeter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -20,8 +20,6 @@
 import java.util.List;
 import java.util.Map;
 
-import junit.framework.Assert;
-
 import com.sun.jdi.ClassType;
 import com.sun.jdi.Method;
 import com.sun.jdi.ObjectReference;
@@ -40,6 +38,8 @@
 import com.sun.jdi.request.BreakpointRequest;
 import com.sun.jdi.request.EventRequest;
 
+import org.junit.Assert;
+
 import org.eclipse.jdi.Bootstrap;
 import org.eclipse.test.internal.performance.InternalDimensions;
 import org.eclipse.test.internal.performance.InternalPerformanceMeter;
diff --git a/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/performance/ResourceTestHelper.java b/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/performance/ResourceTestHelper.java
index 0a330fc..89c2b84 100644
--- a/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/performance/ResourceTestHelper.java
+++ b/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/performance/ResourceTestHelper.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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 @@
 import java.util.zip.ZipException;
 import java.util.zip.ZipFile;
 
-import junit.framework.Assert;
+import org.junit.Assert;
 
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.Path;
diff --git a/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/performance/SWTEventHelper.java b/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/performance/SWTEventHelper.java
index 3340f30..fe55eb0 100644
--- a/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/performance/SWTEventHelper.java
+++ b/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/performance/SWTEventHelper.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -11,7 +11,8 @@
 
 package org.eclipse.jdt.text.tests.performance;
 
-import junit.framework.Assert;
+
+import org.junit.Assert;
 
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Display;
diff --git a/org.eclipse.jdt.text.tests/testResources/indentation/bug424772/Before.java b/org.eclipse.jdt.text.tests/testResources/indentation/bug424772/Before.java
new file mode 100644
index 0000000..8a94591
--- /dev/null
+++ b/org.eclipse.jdt.text.tests/testResources/indentation/bug424772/Before.java
@@ -0,0 +1,28 @@
+package indentbug;
+
+public class Bug {
+	void t1()
+			throws A1.A2, Exception
+	{
+
+	}
+
+	String t2()[] 
+			throws Exception
+	{
+		return new String[0];
+	}
+
+	String t3(int i,
+			int j)
+			[] []
+	{
+		return new String[0][0];
+	}
+}
+
+class A1  { 
+	class A2 extends Exception {
+
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.text.tests/testResources/indentation/bug424772/Modified.java b/org.eclipse.jdt.text.tests/testResources/indentation/bug424772/Modified.java
new file mode 100644
index 0000000..8a94591
--- /dev/null
+++ b/org.eclipse.jdt.text.tests/testResources/indentation/bug424772/Modified.java
@@ -0,0 +1,28 @@
+package indentbug;
+
+public class Bug {
+	void t1()
+			throws A1.A2, Exception
+	{
+
+	}
+
+	String t2()[] 
+			throws Exception
+	{
+		return new String[0];
+	}
+
+	String t3(int i,
+			int j)
+			[] []
+	{
+		return new String[0][0];
+	}
+}
+
+class A1  { 
+	class A2 extends Exception {
+
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.text.tests/testResources/indentation/bug428384/Before.java b/org.eclipse.jdt.text.tests/testResources/indentation/bug428384/Before.java
new file mode 100644
index 0000000..340c58f
--- /dev/null
+++ b/org.eclipse.jdt.text.tests/testResources/indentation/bug428384/Before.java
@@ -0,0 +1,12 @@
+package indentbug;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class Bug {
+	private void foo() {
+		List<String> test =
+				new ArrayList<>();
+		System.out.println(test);
+	}
+}
diff --git a/org.eclipse.jdt.text.tests/testResources/indentation/bug428384/Modified.java b/org.eclipse.jdt.text.tests/testResources/indentation/bug428384/Modified.java
new file mode 100644
index 0000000..340c58f
--- /dev/null
+++ b/org.eclipse.jdt.text.tests/testResources/indentation/bug428384/Modified.java
@@ -0,0 +1,12 @@
+package indentbug;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class Bug {
+	private void foo() {
+		List<String> test =
+				new ArrayList<>();
+		System.out.println(test);
+	}
+}
diff --git a/org.eclipse.jdt.ui.examples.javafamily/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jdt.ui.examples.javafamily/.settings/org.eclipse.jdt.core.prefs
index c697c39..c0eab31 100644
--- a/org.eclipse.jdt.ui.examples.javafamily/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jdt.ui.examples.javafamily/.settings/org.eclipse.jdt.core.prefs
@@ -14,6 +14,12 @@
 org.eclipse.jdt.core.codeComplete.localSuffixes=
 org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=fg
 org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
+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.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
@@ -31,9 +37,10 @@
 org.eclipse.jdt.core.compiler.problem.deprecation=warning
 org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
 org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=error
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
 org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
 org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
 org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
 org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
 org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
@@ -41,6 +48,7 @@
 org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
 org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
 org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
 org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=error
 org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=error
 org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
@@ -54,7 +62,6 @@
 org.eclipse.jdt.core.compiler.problem.missingDefaultCase=warning
 org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
 org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disable
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
 org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error
 org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
 org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
@@ -64,25 +71,39 @@
 org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
 org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
 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=error
 org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
 org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
 org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
 org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
 org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
 org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
 org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
 org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
 org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
 org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
 org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+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=error
+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=disabled
 org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
 org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
 org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
 org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
@@ -95,11 +116,13 @@
 org.eclipse.jdt.core.compiler.problem.unusedImport=error
 org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
 org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
 org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
 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.3
diff --git a/org.eclipse.jdt.ui.examples.javafamily/META-INF/MANIFEST.MF b/org.eclipse.jdt.ui.examples.javafamily/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..4137952
--- /dev/null
+++ b/org.eclipse.jdt.ui.examples.javafamily/META-INF/MANIFEST.MF
@@ -0,0 +1,35 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.jdt.ui.examples.javafamily; singleton:=true
+Bundle-Version: 3.1.200.qualifier
+Bundle-ClassPath: javafamily.jar
+Bundle-Activator: org.eclipse.core.internal.compatibility.PluginActivator
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.core.resources,
+ org.eclipse.core.variables,
+ org.eclipse.jface,
+ org.eclipse.ui,
+ org.eclipse.text,
+ org.eclipse.jface.text,
+ org.eclipse.ui.workbench.texteditor,
+ org.eclipse.ui.editors,
+ org.eclipse.ui.ide,
+ org.eclipse.jdt.core,
+ org.eclipse.jdt.ui,
+ org.eclipse.debug.core,
+ org.eclipse.debug.ui,
+ org.eclipse.jdt.debug,
+ org.eclipse.jdt.launching,
+ org.eclipse.jdt.debug.ui,
+ org.eclipse.core.runtime.compatibility,
+ org.eclipse.ltk.core.refactoring
+Plugin-Class: org.eclipse.jsp.JspUIPlugin
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.4
+Export-Package: org.eclipse.core.indexsearch;x-internal:=true,
+ org.eclipse.jdt.internal.ui.examples.jspeditor;x-internal:=true,
+ org.eclipse.jface.text.source.translation;x-internal:=true,
+ org.eclipse.jsp;x-internal:=true,
+ org.eclipse.jsp.launching;x-internal:=true
diff --git a/org.eclipse.jdt.ui.examples.javafamily/build.properties b/org.eclipse.jdt.ui.examples.javafamily/build.properties
index 88f5ade..15d66eb 100644
--- a/org.eclipse.jdt.ui.examples.javafamily/build.properties
+++ b/org.eclipse.jdt.ui.examples.javafamily/build.properties
@@ -15,5 +15,6 @@
                plugin.properties,\
                *.jar,\
                ReleaseNotes.html,\
-               stuff/
+               stuff/,\
+               META-INF/
 src.includes = about.html
diff --git a/org.eclipse.jdt.ui.examples.javafamily/plugin.xml b/org.eclipse.jdt.ui.examples.javafamily/plugin.xml
index 1bbb0bb..8da4ad3 100644
--- a/org.eclipse.jdt.ui.examples.javafamily/plugin.xml
+++ b/org.eclipse.jdt.ui.examples.javafamily/plugin.xml
@@ -1,38 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?eclipse version="3.0"?>
-<plugin
-	id="org.eclipse.jdt.ui.examples.javafamily"
-	name="%pluginName"
-	version="3.1.100.qualifier"
-	provider-name="%providerName"
-	class="org.eclipse.jsp.JspUIPlugin">
+<plugin>
 
-	<runtime>
-		<library name="javafamily.jar"/>
-	</runtime>
-      
-	<requires>
-		<import plugin="org.eclipse.core.resources"/>
-		<import plugin="org.eclipse.core.variables"/>
-		<import plugin="org.eclipse.jface"/>
-		<import plugin="org.eclipse.ui"/>
-		<import plugin="org.eclipse.text"/>
-		<import plugin="org.eclipse.jface.text"/>
-		<import plugin="org.eclipse.ui.workbench.texteditor"/>
-		<import plugin="org.eclipse.ui.editors"/>
-		<import plugin="org.eclipse.ui.ide"/>
-		<import plugin="org.eclipse.jdt.core"/>
-		<import plugin="org.eclipse.jdt.ui"/>
-		<import plugin="org.eclipse.debug.core"/>
-		<import plugin="org.eclipse.debug.ui"/>
-		<import plugin="org.eclipse.jdt.debug"/>
-		<import plugin="org.eclipse.jdt.launching"/>
-		<import plugin="org.eclipse.jdt.debug.ui"/>
-		<import plugin="org.eclipse.core.runtime.compatibility"/>
-	    <import plugin="org.eclipse.ltk.core.refactoring"/>
-	</requires>
-
-	<!-- =========================================================================== -->
+			<!-- =========================================================================== -->
 	<!-- Refactoring Participant                                                     -->
 	<!-- =========================================================================== -->
 	<extension point="org.eclipse.ltk.core.refactoring.renameParticipants">
diff --git a/org.eclipse.jdt.ui.tests.refactoring/META-INF/MANIFEST.MF b/org.eclipse.jdt.ui.tests.refactoring/META-INF/MANIFEST.MF
index ca2c414..9f82504 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.ui.tests.refactoring/META-INF/MANIFEST.MF
@@ -3,7 +3,6 @@
 Bundle-Name: %Plugin.name
 Bundle-SymbolicName: org.eclipse.jdt.ui.tests.refactoring; singleton:=true
 Bundle-Version: 3.9.0.qualifier
-Bundle-ClassPath: refactoringtests.jar
 Bundle-Activator: org.eclipse.jdt.ui.tests.refactoring.infra.RefactoringTestPlugin
 Bundle-ActivationPolicy: lazy
 Bundle-Vendor: %Plugin.providerName
diff --git a/org.eclipse.jdt.ui.tests.refactoring/build.properties b/org.eclipse.jdt.ui.tests.refactoring/build.properties
index 36513e9..d824734 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/build.properties
+++ b/org.eclipse.jdt.ui.tests.refactoring/build.properties
@@ -12,8 +12,8 @@
                test.xml,\
                about.html,\
                resources/,\
-               *.jar,\
+               .,\
                META-INF/,\
                plugin.properties
-source.refactoringtests.jar = test cases/
-javacWarnings.refactoringtests.jar=-deadCode,-raw,-unchecked
+source.. = test cases/
+javacWarnings..=-deadCode,-raw,-unchecked
diff --git a/org.eclipse.jdt.ui.tests.refactoring/pom.xml b/org.eclipse.jdt.ui.tests.refactoring/pom.xml
index e384ec8..7e6e371 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/pom.xml
+++ b/org.eclipse.jdt.ui.tests.refactoring/pom.xml
@@ -12,12 +12,13 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <parent>
-    <artifactId>eclipse.jdt.ui</artifactId>
+    <artifactId>tests-pom</artifactId>
     <groupId>eclipse.jdt.ui</groupId>
     <version>4.3.0-SNAPSHOT</version>
+    <relativePath>../tests-pom/</relativePath>
   </parent>
   <groupId>org.eclipse.jdt</groupId>
   <artifactId>org.eclipse.jdt.ui.tests.refactoring</artifactId>
   <version>3.9.0-SNAPSHOT</version>
-  <packaging>eclipse-plugin</packaging>
+  <packaging>eclipse-test-plugin</packaging>
 </project>
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ChangeTypeRefactoring/negative/A_InVisibleType.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ChangeTypeRefactoring/negative/A_InVisibleType.java
new file mode 100644
index 0000000..dafbfab
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ChangeTypeRefactoring/negative/A_InVisibleType.java
@@ -0,0 +1,5 @@
+package p;
+
+class A_InVisibleType{
+	
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ChangeTypeRefactoring/negative/A_VisibleType.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ChangeTypeRefactoring/negative/A_VisibleType.java
new file mode 100644
index 0000000..d6a8daa
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ChangeTypeRefactoring/negative/A_VisibleType.java
@@ -0,0 +1,3 @@
+package p;
+public class A_VisibleType extends A_InVisibleType{
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ChangeTypeRefactoring/negative/A_testInVisibleType_in.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ChangeTypeRefactoring/negative/A_testInVisibleType_in.java
new file mode 100644
index 0000000..7bcd961
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ChangeTypeRefactoring/negative/A_testInVisibleType_in.java
@@ -0,0 +1,8 @@
+
+import p.A_VisibleType;
+
+class A_testInvisibleType_in {
+    void f() {
+    	A_VisibleType b;
+    }
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ChangeTypeRefactoring/negative/A_testThrowableSubtype_in.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ChangeTypeRefactoring/negative/A_testThrowableSubtype_in.java
new file mode 100644
index 0000000..c8cd421
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ChangeTypeRefactoring/negative/A_testThrowableSubtype_in.java
@@ -0,0 +1,6 @@
+class A_testThrowableSubtype_in {
+    void foo() throws Exception {
+        Exception e = new Exception();
+		throw e;
+    }
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ConvertAnonymousToNested/canConvert/A_test33_in.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ConvertAnonymousToNested/canConvert/A_test33_in.java
new file mode 100644
index 0000000..edf8947
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ConvertAnonymousToNested/canConvert/A_test33_in.java
@@ -0,0 +1,14 @@
+package p;
+public interface A{
+   <T> void a();
+   <T> void b();
+}
+
+class Z{
+   void m(){
+      A a = new A(){ 
+         public <T> void b(){}
+         public <T> void a(){}
+      };
+   }
+}
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ConvertAnonymousToNested/canConvert/A_test33_out.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ConvertAnonymousToNested/canConvert/A_test33_out.java
new file mode 100644
index 0000000..c307f1e
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ConvertAnonymousToNested/canConvert/A_test33_out.java
@@ -0,0 +1,16 @@
+package p;
+public interface A{
+   <T> void a();
+   <T> void b();
+}
+
+class Z{
+   private static final class AImpl implements A {
+		public <T> void b(){}
+		public <T> void a(){}
+	}
+
+void m(){
+      A a = new AImpl();
+   }
+}
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ConvertAnonymousToNested/canConvert/A_test34_in.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ConvertAnonymousToNested/canConvert/A_test34_in.java
new file mode 100644
index 0000000..9f1fdd8
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ConvertAnonymousToNested/canConvert/A_test34_in.java
@@ -0,0 +1,24 @@
+package p;
+
+import java.util.Date;
+
+public class Sup {
+	interface ISup {
+		void m();
+	}
+
+	public Sup(ISup isup) {
+	}
+}
+
+class Sub extends Sup {
+	public Sub(final Date d) {
+		super(new ISup() {
+			private final long x= d.getTime();
+
+			public void m() {
+				System.out.println(x);
+			}
+		});
+	}
+}
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ConvertAnonymousToNested/canConvert/A_test34_out.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ConvertAnonymousToNested/canConvert/A_test34_out.java
new file mode 100644
index 0000000..20aaf11
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ConvertAnonymousToNested/canConvert/A_test34_out.java
@@ -0,0 +1,30 @@
+package p;
+
+import java.util.Date;
+
+public class Sup {
+	interface ISup {
+		void m();
+	}
+
+	public Sup(ISup isup) {
+	}
+}
+
+class Sub extends Sup {
+	private static class Nested implements ISup {
+		private final Date d;
+		private final long x;
+		private Nested(Date d) {
+			this.d= d;
+			x= d.getTime();
+		}
+		public void m() {
+			System.out.println(x);
+		}
+	}
+
+	public Sub(final Date d) {
+		super(new Nested(d));
+	}
+}
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ConvertAnonymousToNested/canConvert/A_test35_in.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ConvertAnonymousToNested/canConvert/A_test35_in.java
new file mode 100644
index 0000000..4dd7993
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ConvertAnonymousToNested/canConvert/A_test35_in.java
@@ -0,0 +1,28 @@
+package p;
+
+import java.util.Date;
+
+public class Sup {
+	interface ISup {
+		void m();
+	}
+
+	public Sup(ISup isup) {
+	}
+}
+
+class Sub extends Sup {
+	public Sub(final Date d) {
+		this(new ISup() {
+			private final long x= d.getTime();
+
+			public void m() {
+				System.out.println(x);
+			}
+		});
+	}
+
+	public Sub(ISup p) {
+		super(p);
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ConvertAnonymousToNested/canConvert/A_test35_out.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ConvertAnonymousToNested/canConvert/A_test35_out.java
new file mode 100644
index 0000000..7dd69ec
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ConvertAnonymousToNested/canConvert/A_test35_out.java
@@ -0,0 +1,34 @@
+package p;
+
+import java.util.Date;
+
+public class Sup {
+	interface ISup {
+		void m();
+	}
+
+	public Sup(ISup isup) {
+	}
+}
+
+class Sub extends Sup {
+	private static class Nested implements ISup {
+		private final Date d;
+		private final long x;
+		private Nested(Date d) {
+			this.d= d;
+			x= d.getTime();
+		}
+		public void m() {
+			System.out.println(x);
+		}
+	}
+
+	public Sub(final Date d) {
+		this(new Nested(d));
+	}
+
+	public Sub(ISup p) {
+		super(p);
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ConvertAnonymousToNested/canConvert/A_testGenerics7_in.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ConvertAnonymousToNested/canConvert/A_testGenerics7_in.java
new file mode 100644
index 0000000..89d695b
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ConvertAnonymousToNested/canConvert/A_testGenerics7_in.java
@@ -0,0 +1,11 @@
+package p;
+//private, static, final
+public interface A {}
+class Z<E> {
+	<T> void m(T t){
+		A a = new A(){
+			class C<AC> {}
+			public <AT> void foo(AT at, T t, E e){}
+		};
+	}
+}
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ConvertAnonymousToNested/canConvert/A_testGenerics7_out.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ConvertAnonymousToNested/canConvert/A_testGenerics7_out.java
new file mode 100644
index 0000000..a389118
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ConvertAnonymousToNested/canConvert/A_testGenerics7_out.java
@@ -0,0 +1,13 @@
+package p;
+//private, static, final
+public interface A {}
+class Z<E> {
+	private static final class Inner<T, E> implements A {
+		class C<AC> {}
+		public <AT> void foo(AT at, T t, E e){}
+	}
+
+	<T> void m(T t){
+		A a = new Inner<T, E>();
+	}
+}
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractClass/testNested1/in/Nested1.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractClass/testNested1/in/Nested1.java
new file mode 100644
index 0000000..c3f7559
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractClass/testNested1/in/Nested1.java
@@ -0,0 +1,7 @@
+package p;
+
+class Nested1 {
+    class Inner {
+        int m;
+    }
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractClass/testNested1/out/Nested1.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractClass/testNested1/out/Nested1.java
new file mode 100644
index 0000000..d72a12d
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractClass/testNested1/out/Nested1.java
@@ -0,0 +1,13 @@
+package p;
+
+class Nested1 {
+    class Inner {
+        public class Extracted {
+			public int m;
+			public Extracted() {
+			}
+		}
+
+		Extracted parameterObject = new Extracted();
+    }
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractClass/testNested2/in/Nested2.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractClass/testNested2/in/Nested2.java
new file mode 100644
index 0000000..08766ca
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractClass/testNested2/in/Nested2.java
@@ -0,0 +1,7 @@
+package p;
+
+interface Nested2 {
+    class Inner {
+        int m;
+    }
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractClass/testNested2/out/Nested2.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractClass/testNested2/out/Nested2.java
new file mode 100644
index 0000000..64a22d0
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractClass/testNested2/out/Nested2.java
@@ -0,0 +1,13 @@
+package p;
+
+interface Nested2 {
+    class Inner {
+        public static class Extracted {
+			public int m;
+			public Extracted() {
+			}
+		}
+
+		Extracted parameterObject = new Extracted();
+    }
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractClass/testTypeParameter/in/TypeParameter.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractClass/testTypeParameter/in/TypeParameter.java
new file mode 100644
index 0000000..37fc57f
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractClass/testTypeParameter/in/TypeParameter.java
@@ -0,0 +1,4 @@
+package p;
+class TypeParameter<T>{
+	T param;
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractClass/testTypeParameter/out/TypeParameter.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractClass/testTypeParameter/out/TypeParameter.java
new file mode 100644
index 0000000..bc82f29
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractClass/testTypeParameter/out/TypeParameter.java
@@ -0,0 +1,10 @@
+package p;
+class TypeParameter<T>{
+	public static class FooParameter<T> {
+		public T param;
+		public FooParameter() {
+		}
+	}
+
+	FooParameter data = new FooParameter();
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractConstant/canExtract/A_test11_out.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractConstant/canExtract/A_test11_out.java
index 2e4ef70..007e611 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractConstant/canExtract/A_test11_out.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractConstant/canExtract/A_test11_out.java
@@ -9,6 +9,6 @@
 		int c= 3 * (2 + 1) + CONSTANT + 28;
 
 
-		int e= (2 + 2) * (27 + 2 * (CONSTANT + 1*2));
+		int e= (2 + 2) * (27 + 2 * (CONSTANT+1*2));
 	}
 }
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractConstant/canExtract/A_test12_out.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractConstant/canExtract/A_test12_out.java
index 4a6e2cd..81a4530 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractConstant/canExtract/A_test12_out.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractConstant/canExtract/A_test12_out.java
@@ -8,6 +8,6 @@
 		
 		int e= (2 + 2) * CONSTANT;
 		
-		int f= 5 * CONSTANT * (1 + 1);
+		int f= 5 *CONSTANT*  (1 + 1);
 	}
 }
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractConstant/canExtract/A_test45_in.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractConstant/canExtract/A_test45_in.java
new file mode 100644
index 0000000..e9cc9c7
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractConstant/canExtract/A_test45_in.java
@@ -0,0 +1,9 @@
+package p; //7, 17, 7, 22
+
+public class A {
+	private static final int x = 9;
+	private static final int y = 10;
+    void m() {
+        int j = x + y + x + y;
+    }
+}
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractConstant/canExtract/A_test45_out.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractConstant/canExtract/A_test45_out.java
new file mode 100644
index 0000000..f3e8b1d
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractConstant/canExtract/A_test45_out.java
@@ -0,0 +1,10 @@
+package p; //7, 17, 7, 22
+
+public class A {
+	private static final int x = 9;
+	private static final int y = 10;
+	private static final int CONSTANT= x + y;
+    void m() {
+        int j = CONSTANT + x + y;
+    }
+}
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractConstant/canExtract/A_test46_in.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractConstant/canExtract/A_test46_in.java
new file mode 100644
index 0000000..01d10a9
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractConstant/canExtract/A_test46_in.java
@@ -0,0 +1,10 @@
+package p; //8, 17, 8, 22
+
+public class A {
+	private static final int x = 9;
+	private static final int y = 10;
+	private static final int k = 8;
+    void m() {
+        int j = x + y + 30 + k + x + y + k + k + 40 + x + y + k + y + x;
+    }
+}
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractConstant/canExtract/A_test46_out.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractConstant/canExtract/A_test46_out.java
new file mode 100644
index 0000000..4311680
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractConstant/canExtract/A_test46_out.java
@@ -0,0 +1,11 @@
+package p; //8, 17, 8, 22
+
+public class A {
+	private static final int x = 9;
+	private static final int y = 10;
+	private static final int CONSTANT= x + y;
+	private static final int k = 8;
+    void m() {
+        int j = CONSTANT + 30 + k + CONSTANT + k + k + 40 + CONSTANT + k + y + x;
+    }
+}
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/generics_in/A_test1121.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/generics_in/A_test1121.java
new file mode 100644
index 0000000..03a4bd9
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/generics_in/A_test1121.java
@@ -0,0 +1,11 @@
+package generics_in;
+import java.util.Map;
+
+public class A_test1121<V> {
+    public A_test1121(Map<?, ? extends V> c) {
+        this(/*[*/c.size()/*]*/);
+    }
+
+    public A_test1121(int size) {
+    }
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/generics_in/A_test1122.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/generics_in/A_test1122.java
new file mode 100644
index 0000000..3a25954
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/generics_in/A_test1122.java
@@ -0,0 +1,10 @@
+package generics_in;
+import java.util.ArrayList;
+import java.util.List;
+
+public class A_test1122{
+	public <E> void foo() {
+		List<? extends E> t = new ArrayList<E>();
+		/*[*/t.size();/*]*/
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/generics_out/A_test1121.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/generics_out/A_test1121.java
new file mode 100644
index 0000000..be2f261
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/generics_out/A_test1121.java
@@ -0,0 +1,15 @@
+package generics_out;
+import java.util.Map;
+
+public class A_test1121<V> {
+    public A_test1121(Map<?, ? extends V> c) {
+        this(extracted(c));
+    }
+
+	protected static <V> int extracted(Map<?, ? extends V> c) {
+		return /*[*/c.size()/*]*/;
+	}
+
+    public A_test1121(int size) {
+    }
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/generics_out/A_test1122.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/generics_out/A_test1122.java
new file mode 100644
index 0000000..a582ad3
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/generics_out/A_test1122.java
@@ -0,0 +1,14 @@
+package generics_out;
+import java.util.ArrayList;
+import java.util.List;
+
+public class A_test1122{
+	public <E> void foo() {
+		List<? extends E> t = new ArrayList<E>();
+		extracted(t);
+	}
+
+	protected <E> void extracted(List<? extends E> t) {
+		/*[*/t.size();/*]*/
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractTemp/canExtract/A_test113_in.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractTemp/canExtract/A_test113_in.java
new file mode 100644
index 0000000..b2a51ff
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractTemp/canExtract/A_test113_in.java
@@ -0,0 +1,9 @@
+package p; //7, 17, 7, 22
+
+public class A {
+    void m() {
+        int x = 9;
+        int y = 10;
+        int j = x + y + x + y;
+    }
+}
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractTemp/canExtract/A_test113_out.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractTemp/canExtract/A_test113_out.java
new file mode 100644
index 0000000..25210c9
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractTemp/canExtract/A_test113_out.java
@@ -0,0 +1,10 @@
+package p; //7, 17, 7, 22
+
+public class A {
+    void m() {
+        int x = 9;
+        int y = 10;
+        int temp= x + y;
+		int j = temp + temp;
+    }
+}
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractTemp/canExtract/A_test114_in.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractTemp/canExtract/A_test114_in.java
new file mode 100644
index 0000000..fc0f5c0
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractTemp/canExtract/A_test114_in.java
@@ -0,0 +1,10 @@
+package p; //8, 17, 8, 22
+
+public class A {
+    void m() {
+        int x = 9;
+        int y = 10;
+        int k = 8;
+        int j = x + y + 30 + k + x + y + k + k + 40 + x + y + k + y + x;
+    }
+}
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractTemp/canExtract/A_test114_out.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractTemp/canExtract/A_test114_out.java
new file mode 100644
index 0000000..672a51a
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractTemp/canExtract/A_test114_out.java
@@ -0,0 +1,11 @@
+package p; //8, 17, 8, 22
+
+public class A {
+    void m() {
+        int x = 9;
+        int y = 10;
+        int k = 8;
+        int temp= x + y;
+		int j = temp + 30 + k + temp + k + k + 40 + temp + k + y + x;
+    }
+}
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractTemp/canExtract/A_test115_in.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractTemp/canExtract/A_test115_in.java
new file mode 100644
index 0000000..a4bbfbe
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractTemp/canExtract/A_test115_in.java
@@ -0,0 +1,9 @@
+package p; //7, 17, 7, 22
+
+public class A {
+    void m() {
+        int x = 9;
+        int y = 10;
+        int j = x + y + (x + y);
+    }
+}
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractTemp/canExtract/A_test115_out.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractTemp/canExtract/A_test115_out.java
new file mode 100644
index 0000000..25210c9
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractTemp/canExtract/A_test115_out.java
@@ -0,0 +1,10 @@
+package p; //7, 17, 7, 22
+
+public class A {
+    void m() {
+        int x = 9;
+        int y = 10;
+        int temp= x + y;
+		int j = temp + temp;
+    }
+}
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractTemp/canExtract/A_test54_out.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractTemp/canExtract/A_test54_out.java
index 263cf5f..80f0b30 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractTemp/canExtract/A_test54_out.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractTemp/canExtract/A_test54_out.java
@@ -4,7 +4,7 @@
 class A {
 	void foob() {
 		int temp= 2+2* 4;
-		int e= (2 + 2) * (27 + 2 * (temp + 1*2));
+		int e= (2 + 2) * (27 + 2 * (temp+1*2));
 		
 		int c= 3 * (2 + 1) + temp + 28;
 	}
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractTemp/canExtract/A_test55_out.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractTemp/canExtract/A_test55_out.java
index f60ce2d..cdb6a48 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractTemp/canExtract/A_test55_out.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractTemp/canExtract/A_test55_out.java
@@ -4,7 +4,7 @@
 class A {
 	void foob() {
 		int temp= 3*  1;
-		int f= 5 * temp * (1 + 1);		
+		int f= 5 *temp*  (1 + 1);		
 		int e= (2 + 2) * temp;
 	}
 }
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractTemp/canExtract/A_test57_out.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractTemp/canExtract/A_test57_out.java
index 17e8887..d7b7aba 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractTemp/canExtract/A_test57_out.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractTemp/canExtract/A_test57_out.java
@@ -6,6 +6,6 @@
 	private void test() {
         String fdFontName= null;
         String newVariable= "/tmp"+fdFontName+".cff";
-		String tmpFileName = newVariable + ".txt";
+		String tmpFileName = newVariable+".txt";
     }	
 }
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractTemp/canExtract/A_test79_out.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractTemp/canExtract/A_test79_out.java
index 9deca39..d5e4c96 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractTemp/canExtract/A_test79_out.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractTemp/canExtract/A_test79_out.java
@@ -8,6 +8,6 @@
 	 */
 	protected void runTest() throws Throwable {
 		String strong= fName+"\" not found";
-		System.out.println("Method \"" + strong);
+		System.out.println("Method \""+strong);
 	}
 }
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test38/in/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test38/in/A.java
new file mode 100644
index 0000000..06251d8
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test38/in/A.java
@@ -0,0 +1,13 @@
+package p;
+
+public class A<T> {
+	static int m= 0;
+
+	static final int n= m;
+
+	static class C {
+		void f() {
+			int k= n;
+		}
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test38/out/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test38/out/A.java
new file mode 100644
index 0000000..d8ec128
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test38/out/A.java
@@ -0,0 +1,11 @@
+package p;
+
+public class A<T> {
+	static int m= 0;
+
+	static class C {
+		void f() {
+			int k= A.m;
+		}
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test39/in/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test39/in/A.java
new file mode 100644
index 0000000..7ebf1ee
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test39/in/A.java
@@ -0,0 +1,15 @@
+package p;
+
+public class A<T> {
+	static class B<U> {
+		static int m= 0;
+
+		static final int n= m;
+	}
+
+	static class C {
+		void f() {
+			int k= B.n;
+		}
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test39/out/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test39/out/A.java
new file mode 100644
index 0000000..09d06a5
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test39/out/A.java
@@ -0,0 +1,13 @@
+package p;
+
+public class A<T> {
+	static class B<U> {
+		static int m= 0;
+	}
+
+	static class C {
+		void f() {
+			int k= B.m;
+		}
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_in/TestFinalParameter1.java b/org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_in/TestFinalParameter1.java
new file mode 100644
index 0000000..ad63d3b
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_in/TestFinalParameter1.java
@@ -0,0 +1,14 @@
+package argument_in;
+
+class Bug {
+	{
+		int y=4;
+		/*]*/foo(y);/*[*/
+	}
+	void foo(final int x){
+		new Runnable(){
+			public void run(){
+				System.out.println(x);
+			}};
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_in/TestFinalParameter2.java b/org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_in/TestFinalParameter2.java
new file mode 100644
index 0000000..840d7ad
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_in/TestFinalParameter2.java
@@ -0,0 +1,14 @@
+package argument_in;
+
+class Bug {
+	void m(String y) {
+		/*]*/foo(y.substring(3, 10));/*[*/
+	}
+	void foo(final String x){
+		new Runnable(){
+			public void run(){
+				System.out.println(x.trim());
+			}};
+	    x.trim();
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_in/TestFinalParameter3.java b/org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_in/TestFinalParameter3.java
new file mode 100644
index 0000000..1581012
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_in/TestFinalParameter3.java
@@ -0,0 +1,14 @@
+package argument_in;
+
+class Bug {
+	{
+		final int y=4;
+		/*]*/foo(y);/*[*/
+	}
+	void foo(final int x){
+		new Runnable(){
+			public void run(){
+				System.out.println(x);
+			}};
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_out/TestFinalParameter1.java b/org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_out/TestFinalParameter1.java
new file mode 100644
index 0000000..aa90ee5
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_out/TestFinalParameter1.java
@@ -0,0 +1,18 @@
+package argument_out;
+
+class Bug {
+	{
+		int y=4;
+		final int x = y;
+		new Runnable(){
+		public void run(){
+			System.out.println(x);
+		}};
+	}
+	void foo(final int x){
+		new Runnable(){
+			public void run(){
+				System.out.println(x);
+			}};
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_out/TestFinalParameter2.java b/org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_out/TestFinalParameter2.java
new file mode 100644
index 0000000..e11c108
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_out/TestFinalParameter2.java
@@ -0,0 +1,19 @@
+package argument_out;
+
+class Bug {
+	void m(String y) {
+		final String x = y.substring(3, 10);
+		new Runnable(){
+			public void run(){
+				System.out.println(x.trim());
+			}};
+		x.trim();
+	}
+	void foo(final String x){
+		new Runnable(){
+			public void run(){
+				System.out.println(x.trim());
+			}};
+	    x.trim();
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_out/TestFinalParameter3.java b/org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_out/TestFinalParameter3.java
new file mode 100644
index 0000000..dad517a
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_out/TestFinalParameter3.java
@@ -0,0 +1,17 @@
+;
+
+class Bug {
+	{
+		final int y=4;
+		new Runnable(){
+		public void run(){
+			System.out.println(y);
+		}};
+	}
+	void foo(final int x){
+		new Runnable(){
+			public void run(){
+				System.out.println(x);
+			}};
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceFactory/Bugzilla/395016_1/AbstractClass.java b/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceFactory/Bugzilla/395016_1/AbstractClass.java
new file mode 100644
index 0000000..033b595
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceFactory/Bugzilla/395016_1/AbstractClass.java
@@ -0,0 +1,5 @@
+package p;
+abstract class AbstractClass {
+	public /*[*/AbstractClass/*]*/() {
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceFactory/Bugzilla/395016_1/AbstractClass_out.java b/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceFactory/Bugzilla/395016_1/AbstractClass_out.java
new file mode 100644
index 0000000..116bda0
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceFactory/Bugzilla/395016_1/AbstractClass_out.java
@@ -0,0 +1,10 @@
+package p;
+abstract class AbstractClass {
+	public static AbstractClass createAbstractClass() {
+		return new AbstractClass() {
+		};
+	}
+
+	private /*[*/AbstractClass/*]*/() {
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceFactory/Bugzilla/395016_2/AbstractMethod.java b/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceFactory/Bugzilla/395016_2/AbstractMethod.java
new file mode 100644
index 0000000..a0502af
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceFactory/Bugzilla/395016_2/AbstractMethod.java
@@ -0,0 +1,7 @@
+package p;
+abstract class AbstractMethod {
+	public /*[*/AbstractMethod/*]*/() {
+	}
+
+	abstract void foo();
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceFactory/Bugzilla/395016_2/AbstractMethod_out.java b/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceFactory/Bugzilla/395016_2/AbstractMethod_out.java
new file mode 100644
index 0000000..24219cf
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceFactory/Bugzilla/395016_2/AbstractMethod_out.java
@@ -0,0 +1,20 @@
+package p;
+abstract class AbstractMethod {
+	public static AbstractMethod createAbstractMethod() {
+		return new AbstractMethod() {
+			/* (non-Javadoc)
+			 * @see p.AbstractMethod#foo()
+			 */
+			@Override
+			void foo() {
+				// TODO Auto-generated method stub
+				
+			}
+		};
+	}
+
+	private /*[*/AbstractMethod/*]*/() {
+	}
+
+	abstract void foo();
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceIndirection/test32/in/Test.java b/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceIndirection/test32/in/Test.java
new file mode 100644
index 0000000..469658c
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceIndirection/test32/in/Test.java
@@ -0,0 +1,10 @@
+package p;
+
+public class Test<T extends Test<T>> {
+    void foo(T t) {
+    }
+
+    void f(T t) {
+        t.foo(null);
+    }
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceIndirection/test32/out/Test.java b/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceIndirection/test32/out/Test.java
new file mode 100644
index 0000000..c6ae063
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceIndirection/test32/out/Test.java
@@ -0,0 +1,18 @@
+package p;
+
+public class Test<T extends Test<T>> {
+    /**
+	 * @param test
+	 * @param t
+	 */
+	public static <T extends Test<T>> void foo(Test<T> test, T t) {
+		test.foo(t);
+	}
+
+	void foo(T t) {
+    }
+
+    void f(T t) {
+        Test.foo(t, null);
+    }
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceIndirection/test33/in/Test.java b/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceIndirection/test33/in/Test.java
new file mode 100644
index 0000000..469658c
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceIndirection/test33/in/Test.java
@@ -0,0 +1,10 @@
+package p;
+
+public class Test<T extends Test<T>> {
+    void foo(T t) {
+    }
+
+    void f(T t) {
+        t.foo(null);
+    }
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceIndirection/test33/out/Test.java b/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceIndirection/test33/out/Test.java
new file mode 100644
index 0000000..c6ae063
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceIndirection/test33/out/Test.java
@@ -0,0 +1,18 @@
+package p;
+
+public class Test<T extends Test<T>> {
+    /**
+	 * @param test
+	 * @param t
+	 */
+	public static <T extends Test<T>> void foo(Test<T> test, T t) {
+		test.foo(t);
+	}
+
+	void foo(T t) {
+    }
+
+    void f(T t) {
+        Test.foo(t, null);
+    }
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceIndirection/test34/in/Test.java b/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceIndirection/test34/in/Test.java
new file mode 100644
index 0000000..31cb28d
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceIndirection/test34/in/Test.java
@@ -0,0 +1,20 @@
+package p;
+
+class Test<T extends M> {
+	// Invoke "Introduce Indirection" on 'm2.m()'
+    void h(M2 m2) {
+    	m2.m();
+    }
+
+    void f(T t) {
+        t.m();
+    }
+}
+
+class M {
+	void m() { }
+}
+
+class M2 extends M {
+	void m() { }
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceIndirection/test34/out/Test.java b/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceIndirection/test34/out/Test.java
new file mode 100644
index 0000000..f3ab07d
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceIndirection/test34/out/Test.java
@@ -0,0 +1,27 @@
+package p;
+
+class Test<T extends M> {
+	/**
+	 * @param m
+	 */
+	public static void foo(M m) {
+		m.m();
+	}
+
+	// Invoke "Introduce Indirection" on 'm2.m()'
+    void h(M2 m2) {
+    	Test.foo(m2);
+    }
+
+    void f(T t) {
+        Test.foo(t);
+    }
+}
+
+class M {
+	void m() { }
+}
+
+class M2 extends M {
+	void m() { }
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceIndirection/test35/in/Test.java b/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceIndirection/test35/in/Test.java
new file mode 100644
index 0000000..745ffd5
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceIndirection/test35/in/Test.java
@@ -0,0 +1,20 @@
+package p;
+
+class Test<T extends Runnable & M> {
+	// Invoke "Introduce Indirection" on 'm2.m()'
+    void h(M2 m2) {
+    	m2.m();
+    }
+
+    void f(T t) {
+        t.m();
+    }
+}
+
+interface M {
+	void m();
+}
+
+interface M2 extends M {
+	void m();
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceIndirection/test35/out/Test.java b/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceIndirection/test35/out/Test.java
new file mode 100644
index 0000000..8a09715
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceIndirection/test35/out/Test.java
@@ -0,0 +1,27 @@
+package p;
+
+class Test<T extends Runnable & M> {
+	/**
+	 * @param m
+	 */
+	public static void foo(M m) {
+		m.m();
+	}
+
+	// Invoke "Introduce Indirection" on 'm2.m()'
+    void h(M2 m2) {
+    	Test.foo(m2);
+    }
+
+    void f(T t) {
+        Test.foo(t);
+    }
+}
+
+interface M {
+	void m();
+}
+
+interface M2 extends M {
+	void m();
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceIndirection/test36/in/Test.java b/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceIndirection/test36/in/Test.java
new file mode 100644
index 0000000..432130e
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceIndirection/test36/in/Test.java
@@ -0,0 +1,23 @@
+package p;
+
+class Test<T extends Runnable & M3> {
+	// Invoke "Introduce Indirection" on 'm2.m()'
+    void h(M2 m2) {
+    	m2.m();
+    }
+
+    void f(T t) {
+        t.m();
+    }
+}
+
+interface M {
+	void m();
+}
+
+interface M2 extends M {
+	void m();
+}
+
+interface M3 extends M2 {
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceIndirection/test36/out/Test.java b/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceIndirection/test36/out/Test.java
new file mode 100644
index 0000000..a787c12
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceIndirection/test36/out/Test.java
@@ -0,0 +1,30 @@
+package p;
+
+class Test<T extends Runnable & M3> {
+	/**
+	 * @param m2
+	 */
+	public static void foo(M2 m2) {
+		m2.m();
+	}
+
+	// Invoke "Introduce Indirection" on 'm2.m()'
+    void h(M2 m2) {
+    	Test.foo(m2);
+    }
+
+    void f(T t) {
+        Test.foo(t);
+    }
+}
+
+interface M {
+	void m();
+}
+
+interface M2 extends M {
+	void m();
+}
+
+interface M3 extends M2 {
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceParameterObject/testMethodTypeParamArgs/in/TestMethodTypeParamArgs.java b/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceParameterObject/testMethodTypeParamArgs/in/TestMethodTypeParamArgs.java
new file mode 100644
index 0000000..3a0120b
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceParameterObject/testMethodTypeParamArgs/in/TestMethodTypeParamArgs.java
@@ -0,0 +1,4 @@
+package p;
+interface TestMethodTypeParamArgs<T> {
+    void foo(T t);
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceParameterObject/testMethodTypeParamArgs/out/TestMethodTypeParamArgs.java b/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceParameterObject/testMethodTypeParamArgs/out/TestMethodTypeParamArgs.java
new file mode 100644
index 0000000..b6a0b6b
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceParameterObject/testMethodTypeParamArgs/out/TestMethodTypeParamArgs.java
@@ -0,0 +1,11 @@
+package p;
+interface TestMethodTypeParamArgs<T> {
+    public static class FooParameter<T> {
+		public T t;
+		public FooParameter(T t) {
+			this.t = t;
+		}
+	}
+
+	void foo(FooParameter parameterObject);
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceParameterObject/testMethodTypeParamArgsTopLevel/in/TestMethodTypeParamArgsTopLevel.java b/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceParameterObject/testMethodTypeParamArgsTopLevel/in/TestMethodTypeParamArgsTopLevel.java
new file mode 100644
index 0000000..c208c11
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceParameterObject/testMethodTypeParamArgsTopLevel/in/TestMethodTypeParamArgsTopLevel.java
@@ -0,0 +1,4 @@
+package p;
+interface TestMethodTypeParamArgsTopLevel<T> {
+	void foo(T t);
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceParameterObject/testMethodTypeParamArgsTopLevel/out/FooParameter.java b/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceParameterObject/testMethodTypeParamArgsTopLevel/out/FooParameter.java
new file mode 100644
index 0000000..e796e1d
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceParameterObject/testMethodTypeParamArgsTopLevel/out/FooParameter.java
@@ -0,0 +1,8 @@
+package p;
+
+public class FooParameter<T> {
+	public T t;
+	public FooParameter(T t) {
+		this.t = t;
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceParameterObject/testMethodTypeParamArgsTopLevel/out/TestMethodTypeParamArgsTopLevel.java b/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceParameterObject/testMethodTypeParamArgsTopLevel/out/TestMethodTypeParamArgsTopLevel.java
new file mode 100644
index 0000000..34f5b58
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceParameterObject/testMethodTypeParamArgsTopLevel/out/TestMethodTypeParamArgsTopLevel.java
@@ -0,0 +1,4 @@
+package p;
+interface TestMethodTypeParamArgsTopLevel<T> {
+	void foo(FooParameter parameterObject);
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInnerToTopLevel/test_static_context_0/in/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInnerToTopLevel/test_static_context_0/in/A.java
new file mode 100644
index 0000000..a916ad8
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInnerToTopLevel/test_static_context_0/in/A.java
@@ -0,0 +1,5 @@
+package p;
+class A<T> {
+	interface Inner{
+	}
+}
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInnerToTopLevel/test_static_context_0/out/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInnerToTopLevel/test_static_context_0/out/A.java
new file mode 100644
index 0000000..fa67c89
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInnerToTopLevel/test_static_context_0/out/A.java
@@ -0,0 +1,3 @@
+package p;
+class A<T> {
+}
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInnerToTopLevel/test_static_context_0/out/Inner.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInnerToTopLevel/test_static_context_0/out/Inner.java
new file mode 100644
index 0000000..89f411a
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInnerToTopLevel/test_static_context_0/out/Inner.java
@@ -0,0 +1,3 @@
+package p;
+interface Inner{
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test48/in/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test48/in/A.java
new file mode 100644
index 0000000..24af3ab
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test48/in/A.java
@@ -0,0 +1,6 @@
+package p;
+public class A {
+	protected void m(){}
+}
+
+
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test48/in/B.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test48/in/B.java
new file mode 100644
index 0000000..0cef974
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test48/in/B.java
@@ -0,0 +1,7 @@
+package p;
+public class B {
+	public void n(q.C c, A a) {
+		a.m();
+	}
+}
+
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test48/in/C.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test48/in/C.java
new file mode 100644
index 0000000..c5aafd8
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test48/in/C.java
@@ -0,0 +1,4 @@
+package q;
+public class C {
+
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test48/out/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test48/out/A.java
new file mode 100644
index 0000000..043d169
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test48/out/A.java
@@ -0,0 +1,6 @@
+package p;
+public class A {
+	public void m(){}
+}
+
+
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test48/out/B.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test48/out/B.java
new file mode 100644
index 0000000..bf3403d
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test48/out/B.java
@@ -0,0 +1,4 @@
+package p;
+public class B {
+}
+
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test48/out/C.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test48/out/C.java
new file mode 100644
index 0000000..5ee0bf7
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test48/out/C.java
@@ -0,0 +1,11 @@
+package q;
+
+import p.A;
+
+public class C {
+
+	public void n(A a) {
+		a.m();
+	}
+
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test49/in/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test49/in/A.java
new file mode 100644
index 0000000..d51f77d
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test49/in/A.java
@@ -0,0 +1,13 @@
+package p;
+
+class A {
+	B b;
+	void m(int i) {
+	}
+}
+
+class B extends A {
+	void test() {
+		super.m(2);
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test49/out/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test49/out/A.java
new file mode 100644
index 0000000..f801bce
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test49/out/A.java
@@ -0,0 +1,14 @@
+package p;
+
+class A {
+	B b;
+}
+
+class B extends A {
+	void test() {
+		b.m(2);
+	}
+
+	protected void m(int i) {
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test50/in/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test50/in/A.java
new file mode 100644
index 0000000..717b911
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test50/in/A.java
@@ -0,0 +1,12 @@
+package p;
+
+class A {
+	void m(B b) {
+	}
+}
+
+class B extends A {
+	void test() {
+		super.m(this);
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test50/out/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test50/out/A.java
new file mode 100644
index 0000000..d4ef636
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test50/out/A.java
@@ -0,0 +1,13 @@
+package p;
+
+class A {
+}
+
+class B extends A {
+	void test() {
+		m();
+	}
+
+	protected void m() {
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test51/in/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test51/in/A.java
new file mode 100644
index 0000000..10180f5
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test51/in/A.java
@@ -0,0 +1,15 @@
+package p;
+
+class A {
+	void m(B b) {
+	}
+}
+
+class B extends A {
+}
+
+class C extends B {
+	void test() {
+		super.m(this);
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test51/out/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test51/out/A.java
new file mode 100644
index 0000000..db68480
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test51/out/A.java
@@ -0,0 +1,16 @@
+package p;
+
+class A {
+}
+
+class B extends A {
+
+	protected void m() {
+	}
+}
+
+class C extends B {
+	void test() {
+		m();
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test52/in/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test52/in/A.java
new file mode 100644
index 0000000..434a087
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test52/in/A.java
@@ -0,0 +1,16 @@
+package p;
+
+class A {
+	B b;
+	void m(int i) {
+	}
+}
+
+class B extends A {
+}
+
+class C extends B {
+	void test() {
+		super.m(2);
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test52/out/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test52/out/A.java
new file mode 100644
index 0000000..04179ce
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test52/out/A.java
@@ -0,0 +1,17 @@
+package p;
+
+class A {
+	B b;
+}
+
+class B extends A {
+
+	protected void m(int i) {
+	}
+}
+
+class C extends B {
+	void test() {
+		b.m(2);
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test53/in/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test53/in/A.java
new file mode 100644
index 0000000..dae754f
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test53/in/A.java
@@ -0,0 +1,15 @@
+package p;
+
+class A {
+	void m(B b) {
+	}
+}
+
+class B extends A {
+}
+
+class C extends B {
+	void test(B b) {
+		super.m(b);
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test53/out/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test53/out/A.java
new file mode 100644
index 0000000..a41d57e
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test53/out/A.java
@@ -0,0 +1,16 @@
+package p;
+
+class A {
+}
+
+class B extends A {
+
+	protected void m() {
+	}
+}
+
+class C extends B {
+	void test(B b) {
+		b.m();
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test54/in/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test54/in/A.java
new file mode 100644
index 0000000..380c050
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test54/in/A.java
@@ -0,0 +1,12 @@
+package p;
+
+public class A {
+  public long m(B b, int i) {
+  	return 1;
+  }
+}
+public class B extends A {
+  public long test() {
+    return super.m(null, 2);
+  }
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test54/out/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test54/out/A.java
new file mode 100644
index 0000000..3bb3c3c
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test54/out/A.java
@@ -0,0 +1,16 @@
+package p;
+
+public class A {
+  public long m(B b, int i) {
+	return b.m(i);
+}
+}
+public class B extends A {
+  public long test() {
+    return super.m(null, 2);
+  }
+
+public long m(int i) {
+  	return 1;
+  }
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test55/in/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test55/in/A.java
new file mode 100644
index 0000000..5d04130
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test55/in/A.java
@@ -0,0 +1,15 @@
+package p;
+class A {
+	B b;
+	public void m() {
+		m2();
+	}
+	
+	public void m2() {
+	}
+}
+class B extends A {
+	public void test() {
+		super.m();
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test55/out/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test55/out/A.java
new file mode 100644
index 0000000..78dcb67
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test55/out/A.java
@@ -0,0 +1,15 @@
+package p;
+class A {
+	B b;
+	public void m2() {
+	}
+}
+class B extends A {
+	public void test() {
+		b.m(this);
+	}
+
+	public void m(A a) {
+		a.m2();
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test56/in/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test56/in/A.java
new file mode 100644
index 0000000..c48687f
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test56/in/A.java
@@ -0,0 +1,14 @@
+package p;
+class A {
+	public void m(B b) {
+		m2();
+	}
+	
+	public void m2() {
+	}
+}
+class B extends A {
+	public void test() {
+		super.m(this);
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test56/out/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test56/out/A.java
new file mode 100644
index 0000000..927ff45
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test56/out/A.java
@@ -0,0 +1,14 @@
+package p;
+class A {
+	public void m2() {
+	}
+}
+class B extends A {
+	public void test() {
+		m(this);
+	}
+
+	public void m(A a) {
+		a.m2();
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test57/in/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test57/in/A.java
new file mode 100644
index 0000000..46f1404
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test57/in/A.java
@@ -0,0 +1,13 @@
+package p;
+class A {
+	public int i = 0;
+
+	public long m(int i, B b) {
+		return this.i + i;
+	}
+}
+class B extends A {
+	public long test() {
+		return super.m(2, new B());
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test57/out/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test57/out/A.java
new file mode 100644
index 0000000..f2b0e41
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test57/out/A.java
@@ -0,0 +1,13 @@
+package p;
+class A {
+	public int i = 0;
+}
+class B extends A {
+	public long test() {
+		return new B().m(2, this);
+	}
+
+	public long m(int i, A a) {
+		return a.i + i;
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test58/in/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test58/in/A.java
new file mode 100644
index 0000000..543ff33
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test58/in/A.java
@@ -0,0 +1,11 @@
+package p;
+
+import static java.util.Arrays.asList;
+
+import java.util.List;
+
+public class A {
+	public List<String> abc(B b) {
+		return asList("a", b.toString());
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test58/in/B.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test58/in/B.java
new file mode 100644
index 0000000..ec3e38a
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test58/in/B.java
@@ -0,0 +1,5 @@
+package p;
+
+public class B {
+	
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test58/out/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test58/out/A.java
new file mode 100644
index 0000000..d0fba05
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test58/out/A.java
Binary files differ
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test58/out/B.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test58/out/B.java
new file mode 100644
index 0000000..7976393
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test58/out/B.java
@@ -0,0 +1,13 @@
+package p;
+
+import static java.util.Arrays.asList;
+
+import java.util.List;
+
+public class B {
+
+	public List<String> abc() {
+		return asList("a", toString());
+	}
+	
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test59/in/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test59/in/A.java
new file mode 100644
index 0000000..ddeb48f
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test59/in/A.java
@@ -0,0 +1,13 @@
+package p;
+import static java.util.Arrays.asList;
+public class A {	
+	class X {
+		void m(B b) {
+			asList(b.toString());
+			n();
+		}
+	}
+	
+	public static void n() {
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test59/in/B.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test59/in/B.java
new file mode 100644
index 0000000..ae61754
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test59/in/B.java
@@ -0,0 +1,4 @@
+package p;
+
+public class B {	
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test59/out/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test59/out/A.java
new file mode 100644
index 0000000..a083789
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test59/out/A.java
@@ -0,0 +1,8 @@
+package p;
+public class A {	
+	class X {
+	}
+	
+	public static void n() {
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test59/out/B.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test59/out/B.java
new file mode 100644
index 0000000..d1abcff
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test59/out/B.java
@@ -0,0 +1,11 @@
+package p;
+
+import static java.util.Arrays.asList;
+
+public class B {
+
+	void m() {
+		asList(toString());
+		A.n();
+	}	
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test60/in/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test60/in/A.java
new file mode 100644
index 0000000..a1c7a08
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test60/in/A.java
@@ -0,0 +1,17 @@
+package p;
+import static java.util.Arrays.asList;
+public class A {	
+	class X {
+		void m(B b) {
+			asList(b.toString());
+			n();
+		}
+	}
+	
+	public static void n() {
+	}
+}
+
+class B {
+	
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test60/out/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test60/out/A.java
new file mode 100644
index 0000000..c37260d
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test60/out/A.java
@@ -0,0 +1,18 @@
+package p;
+import static java.util.Arrays.asList;
+public class A {	
+	class X {
+	}
+	
+	public static void n() {
+	}
+}
+
+class B {
+
+	void m() {
+		asList(toString());
+		A.n();
+	}
+	
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test61/in/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test61/in/A.java
new file mode 100644
index 0000000..c23f0ee
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test61/in/A.java
@@ -0,0 +1,15 @@
+package p;
+
+public class A {
+	public static class X {
+		void m(B b) {
+			n();
+		}
+		public static void n() {
+		}
+	}
+}
+
+class B {
+	
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test61/out/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test61/out/A.java
new file mode 100644
index 0000000..14ba522
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test61/out/A.java
@@ -0,0 +1,16 @@
+package p;
+
+public class A {
+	public static class X {
+		public static void n() {
+		}
+	}
+}
+
+class B {
+
+	void m() {
+		A.X.n();
+	}
+	
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test62/in/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test62/in/A.java
new file mode 100644
index 0000000..9d44bb9
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test62/in/A.java
@@ -0,0 +1,16 @@
+package p;
+
+import static java.util.Arrays.asList;
+import q.B;
+
+public class A {
+	public static class X {
+		void m(B.C c) {
+			n();
+			A.m();
+			asList("a","b");
+		}
+		public static void n() {}
+	}
+	public static void m() {}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test62/in/B.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test62/in/B.java
new file mode 100644
index 0000000..ad80049
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test62/in/B.java
@@ -0,0 +1,6 @@
+package q;
+
+public class B {
+	public class C {
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test62/out/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test62/out/A.java
new file mode 100644
index 0000000..2bfaa6d
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test62/out/A.java
@@ -0,0 +1,9 @@
+package p;
+
+
+public class A {
+	public static class X {
+		public static void n() {}
+	}
+	public static void m() {}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test62/out/B.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test62/out/B.java
new file mode 100644
index 0000000..d04a1df
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test62/out/B.java
@@ -0,0 +1,15 @@
+package q;
+
+import static java.util.Arrays.asList;
+import p.A;
+
+public class B {
+	public class C {
+
+		public void m() {
+			A.X.n();
+			A.m();
+			asList("a","b");
+		}
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test63/in/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test63/in/A.java
new file mode 100644
index 0000000..ba858f2
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test63/in/A.java
@@ -0,0 +1,10 @@
+public class A {
+	void m(B b) {
+		n();
+	}
+	public static void n() {};
+}
+
+class B {
+	
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test63/out/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test63/out/A.java
new file mode 100644
index 0000000..2337a2d
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test63/out/A.java
@@ -0,0 +1,11 @@
+public class A {
+	public static void n() {};
+}
+
+class B {
+
+	void m() {
+		A.n();
+	}
+	
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test64/in/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test64/in/A.java
new file mode 100644
index 0000000..2375090
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test64/in/A.java
@@ -0,0 +1,10 @@
+public class A {
+	public int a;
+	public void m(B b) {
+		a++;
+	}
+}
+class B {
+	public void m() {		
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test64/out/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test64/out/A.java
new file mode 100644
index 0000000..e75d5f1
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test64/out/A.java
@@ -0,0 +1,11 @@
+public class A {
+	public int a;
+}
+class B {
+	public void m() {		
+	}
+
+	public void m(A a) {
+		a.a++;
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test65/in/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test65/in/A.java
new file mode 100644
index 0000000..c33a73e
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test65/in/A.java
@@ -0,0 +1,14 @@
+public class A extends B {
+	@Override
+	public void m(C c) {
+	}
+}
+
+class B {
+	public void m(C c) {
+	}
+}
+
+class C {
+
+}
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test65/out/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test65/out/A.java
new file mode 100644
index 0000000..08d7f69
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test65/out/A.java
@@ -0,0 +1,18 @@
+public class A extends B {
+	@Override
+	public void m(C c) {
+		c.m();
+	}
+}
+
+class B {
+	public void m(C c) {
+	}
+}
+
+class C {
+
+	public void m() {
+	}
+
+}
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/cannotMove/testFail14/in/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/cannotMove/testFail14/in/A.java
new file mode 100644
index 0000000..0899fab
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/cannotMove/testFail14/in/A.java
@@ -0,0 +1,9 @@
+public class A {
+	public void m(B b) {
+	}	
+}
+
+class B {
+	public void m() {		
+	}
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/cannotMove/testFail15/in/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/cannotMove/testFail15/in/A.java
new file mode 100644
index 0000000..90574d0
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/cannotMove/testFail15/in/A.java
@@ -0,0 +1,7 @@
+public class A {
+	private B fB;
+	public void m() { }
+}
+class B {
+	public void m() { }
+}
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/SefWorkSpace/SefTests/object_in/TestCompoundParenthesizedWrite.java b/org.eclipse.jdt.ui.tests.refactoring/resources/SefWorkSpace/SefTests/object_in/TestCompoundParenthesizedWrite.java
new file mode 100644
index 0000000..e39665b
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/SefWorkSpace/SefTests/object_in/TestCompoundParenthesizedWrite.java
@@ -0,0 +1,10 @@
+package object_in;
+
+public class TestCompoundParenthesizedWrite {
+	public String field;
+	
+	public void foo(TestCompoundParenthesizedWrite other) {
+		(other.field)= "field";
+	}
+}
+
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/SefWorkSpace/SefTests/object_in/TestSimpleParenthesizedWrite.java b/org.eclipse.jdt.ui.tests.refactoring/resources/SefWorkSpace/SefTests/object_in/TestSimpleParenthesizedWrite.java
new file mode 100644
index 0000000..62076a0
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/SefWorkSpace/SefTests/object_in/TestSimpleParenthesizedWrite.java
@@ -0,0 +1,10 @@
+package object_in;
+
+public class TestSimpleWrite {
+	public String field;
+	
+	public void foo() {
+		(field)= "field";
+	}
+}
+
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/SefWorkSpace/SefTests/object_out/TestCompoundParenthesizedWrite.java b/org.eclipse.jdt.ui.tests.refactoring/resources/SefWorkSpace/SefTests/object_out/TestCompoundParenthesizedWrite.java
new file mode 100644
index 0000000..01421ab
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/SefWorkSpace/SefTests/object_out/TestCompoundParenthesizedWrite.java
@@ -0,0 +1,18 @@
+package object_out;
+
+public class TestCompoundParenthesizedWrite {
+	private String field;
+	
+	public void foo(TestCompoundParenthesizedWrite other) {
+		other.setField("field");
+	}
+
+	public String getField() {
+		return field;
+	}
+
+	public void setField(String field) {
+		this.field = field;
+	}
+}
+
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/SefWorkSpace/SefTests/object_out/TestSimpleParenthesizedWrite.java b/org.eclipse.jdt.ui.tests.refactoring/resources/SefWorkSpace/SefTests/object_out/TestSimpleParenthesizedWrite.java
new file mode 100644
index 0000000..75cc585
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/SefWorkSpace/SefTests/object_out/TestSimpleParenthesizedWrite.java
@@ -0,0 +1,18 @@
+package object_out;
+
+public class TestSimpleWrite {
+	private String field;
+	
+	public void foo() {
+		setField("field");
+	}
+
+	public String getField() {
+		return field;
+	}
+
+	public void setField(String field) {
+		this.field = field;
+	}
+}
+
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/SurroundWithWorkSpace/SurroundWithTests/trycatch17_in/TestMultiTryCatch.java b/org.eclipse.jdt.ui.tests.refactoring/resources/SurroundWithWorkSpace/SurroundWithTests/trycatch17_in/TestMultiTryCatch.java
new file mode 100644
index 0000000..86c41a3
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/SurroundWithWorkSpace/SurroundWithTests/trycatch17_in/TestMultiTryCatch.java
@@ -0,0 +1,14 @@
+package trycatch17_in;
+import java.io.IOException;
+import java.net.MalformedURLException;
+
+public class TestMultiTryCatch {
+	private static void call() throws Exception, IOException, MalformedURLException {
+		
+	}
+	
+	public static void main(String[] args) {
+		/*[*/call();/*]*/
+	}
+
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/SurroundWithWorkSpace/SurroundWithTests/trycatch17_out/TestMultiTryCatch.java b/org.eclipse.jdt.ui.tests.refactoring/resources/SurroundWithWorkSpace/SurroundWithTests/trycatch17_out/TestMultiTryCatch.java
new file mode 100644
index 0000000..54f4e0e
--- /dev/null
+++ b/org.eclipse.jdt.ui.tests.refactoring/resources/SurroundWithWorkSpace/SurroundWithTests/trycatch17_out/TestMultiTryCatch.java
@@ -0,0 +1,17 @@
+package trycatch17_out;
+import java.io.IOException;
+import java.net.MalformedURLException;
+
+public class TestMultiTryCatch {
+	private static void call() throws Exception, IOException, MalformedURLException {
+		
+	}
+	
+	public static void main(String[] args) {
+		try {
+			/*[*/call();/*]*/
+		} catch (Exception e) {
+		}
+	}
+
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ChangeTypeRefactoringTests.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ChangeTypeRefactoringTests.java
index 7d7bbeb..316fd97 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ChangeTypeRefactoringTests.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ChangeTypeRefactoringTests.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -7,15 +7,18 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Samrat Dhillon samrat.dhillon@gmail.com  - [generalize type] Generalize Declared Type offers types that are not visible - https://bugs.eclipse.org/bugs/show_bug.cgi?id=395992
+ *     Samrat Dhillon samrat.dhillon@gmail.com [generalize type] Generalize Declared Type does not consider use of variable in throw statement, which yields compilation error - https://bugs.eclipse.org/bugs/show_bug.cgi?id=395989
  *******************************************************************************/
 package org.eclipse.jdt.ui.tests.refactoring;
 
 import java.util.Collection;
 
-import junit.framework.Assert;
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
+import org.junit.Assert;
+
 import org.eclipse.jdt.testplugin.StringAsserts;
 
 import org.eclipse.core.runtime.NullProgressMonitor;
@@ -87,6 +90,11 @@
 		String fullName= TEST_PATH_PREFIX + getRefactoringPath() + "positive/" + fileName + ".java";
 		return createCU(pack, fileName + ".java", getFileContents(fullName));
 	}
+	
+	private ICompilationUnit createAdditionalCUForNegative(String fileName, IPackageFragment pack) throws Exception {
+		String fullName= TEST_PATH_PREFIX + getRefactoringPath() + "negative/" + fileName + ".java";
+		return createCU(pack, fileName + ".java", getFileContents(fullName));
+	}
 
 	protected ChangeTypeRefactoring helper1(int startLine, int startColumn, int endLine, int endColumn, String selectedTypeName)
 		throws Exception {
@@ -132,6 +140,16 @@
 
 		assertEqualLines(getFileContents(canonAfterSrcName), cu.getSource());
 	}
+	
+	protected ChangeTypeRefactoring failHelper2(int startLine, int startColumn, int endLine, int endColumn, 
+			String selectedTypeName, IPackageFragment pack) throws Exception {
+		ICompilationUnit	cu= createCUfromTestFile(pack, false, true);
+		ISourceRange		selection= TextRangeUtil.getSelection(cu, startLine, startColumn, endLine, endColumn);
+		ChangeTypeRefactoring	ref= new ChangeTypeRefactoring(cu, selection.getOffset(), selection.getLength(), selectedTypeName);
+		performRefactoring(ref);
+		return ref;
+	}
+	
 
 	//--- TESTS
 	public void testLocalVarName() throws Exception {
@@ -625,4 +643,16 @@
 	public void testQualifiedFieldRef() throws Exception {
 		failHelper1(4, 9, 4, 15, 4, "java.lang.Object");
 	}
+	public void testInVisibleType() throws Exception {
+		createAdditionalCUForNegative("A_InVisibleType", getPackageP());
+		createAdditionalCUForNegative("A_VisibleType", getPackageP());
+		Collection types= failHelper2(6, 9, 6, 21, "p.A_VisibleType", getRoot().getPackageFragment("")).getValidTypeNames();
+		Assert.assertFalse(types.contains("p.A_InVisibleType"));
+	}
+
+	public void testThrowableSubtype() throws Exception {
+		Collection types= failHelper2(3, 9, 3, 17, "java.lang.Exception", getPackageP()).getValidTypeNames();
+		Assert.assertTrue(types.contains("java.lang.Throwable"));
+		Assert.assertFalse(types.contains("java.lang.Object"));
+	}
 }
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ConvertAnonymousToNestedTests.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ConvertAnonymousToNestedTests.java
index f165b78..58a464e 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ConvertAnonymousToNestedTests.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ConvertAnonymousToNestedTests.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -7,9 +7,13 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
- *     N.Metchev@teamphone.com - contributed fixes for
+ *     NikolayMetchev@gmail.com - contributed fixes for
  *     - convert anonymous to nested should sometimes declare class as static [refactoring]
  *       (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=43360)
+ *     - [refactoring][convert anonymous] gets confused with generic methods
+ *       (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=124978)
+ *     - [convert anonymous] Convert Anonymous to nested generates wrong code
+ *       (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=159917)
  *******************************************************************************/
 package org.eclipse.jdt.ui.tests.refactoring;
 
@@ -372,6 +376,10 @@
 		helper1(7, 20, 7, 20, true, true, "Inner", Modifier.PRIVATE);
 	}
 
+	public void testGenerics7() throws Exception{ // test for bug 124978
+		helper1(6, 18, 6, 18, true, true, "Inner", Modifier.PRIVATE);
+	}
+	
     public void test31() throws Exception{ // for bug 181054
     	helper1(10, 24, 10, 30, true, false, "Inner1Extension", Modifier.PRIVATE);
     }
@@ -379,4 +387,16 @@
     public void test32() throws Exception{ // for bug 158028
     	helper1(10, 30, 10, 36, true, false, "Inner1Extension", Modifier.PRIVATE);
     }
+    
+	public void test33() throws Exception { // for bug 124978
+		helper1(9, 21, 12, 7, true, true, "AImpl", Modifier.PRIVATE);
+	}
+    
+	public void test34() throws Exception { // for bug 159917
+		helper1(16, 27, 22, 9, false, false, "Nested", Modifier.PRIVATE);
+    }
+
+	public void test35() throws Exception { // for bug 159917
+		helper1(16, 26, 22, 9, false, false, "Nested", Modifier.PRIVATE);
+    }
 }
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ExtractClassTests.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ExtractClassTests.java
index 85d2093..d2b0ff6 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ExtractClassTests.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ExtractClassTests.java
@@ -7,6 +7,8 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Nikolay Metchev <nikolaymetchev@gmail.com> - [extract class] Extract class refactoring on a field in an inner non-static class yields compilation error - https://bugs.eclipse.org/394547
+ *     Samrat Dhillon samrat.dhillon@gmail.com - [extract class] Extract class on a field with generic type yields compilation error  - https://bugs.eclipse.org/bugs/show_bug.cgi?id=394548
  *******************************************************************************/
 package org.eclipse.jdt.ui.tests.refactoring;
 
@@ -410,4 +412,33 @@
 		runRefactoring(false);
 	}
 	
+	// see bug 394547
+	public void testNested1() throws Exception {
+		IType outer= setupType();
+		IType inner= outer.getType("Inner");
+		assertTrue(inner.exists());
+		fDescriptor.setType(inner);
+		fDescriptor.setClassName("Extracted");
+		fDescriptor.setCreateTopLevel(false);
+		runRefactoring(false);
+	}
+
+	// see bug 394547
+	public void testNested2() throws Exception {
+		IType outer= setupType();
+		IType inner= outer.getType("Inner");
+		assertTrue(inner.exists());
+		fDescriptor.setType(inner);
+		fDescriptor.setClassName("Extracted");
+		fDescriptor.setCreateTopLevel(false);
+		runRefactoring(false);
+	}
+	// see bug 394548
+	public void testTypeParameter() throws Exception {
+		fDescriptor.setType(setupType());
+		fDescriptor.setCreateTopLevel(false);
+		fDescriptor.setFieldName("data");
+		fDescriptor.setClassName("FooParameter");
+		runRefactoring(false);
+	}
 }
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ExtractConstantTests.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ExtractConstantTests.java
index c4cffa8..355cb43 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ExtractConstantTests.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ExtractConstantTests.java
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Nikolay Metchev <nikolaymetchev@gmail.com> - [extract local] Extract to local variable not replacing multiple occurrences in same statement - https://bugs.eclipse.org/406347
  *******************************************************************************/
 package org.eclipse.jdt.ui.tests.refactoring;
 
@@ -352,6 +353,14 @@
 		helper1(7, 18, 7, 19, false, false, "CONSTANT", "_1");
 	}
 
+	public void test45() throws Exception { // bug 406347
+		helper1(7, 17, 7, 22, false, false, "CONSTANT", "INT");
+	}
+
+	public void test46() throws Exception { // bug 406347
+		helper1(8, 17, 8, 22, true, false, "CONSTANT", "INT");
+	}
+
 	public void testZeroLengthSelection0() throws Exception {
 		helper1(5, 18, 5, 18, false, false, "CONSTANT", "_100");
 	}
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ExtractMethodTests.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ExtractMethodTests.java
index 6c523ee..b4c9606 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ExtractMethodTests.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ExtractMethodTests.java
@@ -18,6 +18,7 @@
  *     Benjamin Muskalla <bmuskalla@eclipsesource.com> - [extract method] should declare method static if extracted from anonymous in static method - https://bugs.eclipse.org/bugs/show_bug.cgi?id=152004
  *     Benjamin Muskalla <bmuskalla@eclipsesource.com> - [extract method] extracting return value results in compile error - https://bugs.eclipse.org/bugs/show_bug.cgi?id=264606
  *     Samrat Dhillon <samrat.dhillon@gmail.com> -  [extract method] Extracted method should be declared static if extracted expression is also used in another static method https://bugs.eclipse.org/bugs/show_bug.cgi?id=393098
+ *     Samrat Dhillon <samrat.dhillon@gmail.com> -  [extract method] Extracting expression of parameterized type that is passed as argument to this constructor yields compilation error https://bugs.eclipse.org/bugs/show_bug.cgi?id=394030
  *******************************************************************************/
 package org.eclipse.jdt.ui.tests.refactoring;
 
@@ -2101,6 +2102,14 @@
 	public void test1120() throws Exception {
 		genericTest(); //https://bugs.eclipse.org/bugs/show_bug.cgi?id=369295
 	}
+	
+	public void test1121() throws Exception {
+		genericTest();
+	}
+	
+	public void test1122() throws Exception {
+		genericTest();
+	}
 
 	//---- Test enums ---------------------------------
 
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ExtractTempTests.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ExtractTempTests.java
index d4a7649..d370241 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ExtractTempTests.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ExtractTempTests.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Nikolay Metchev <nikolaymetchev@gmail.com> - [extract local] Extract to local variable not replacing multiple occurrences in same statement - https://bugs.eclipse.org/406347
  *******************************************************************************/
 package org.eclipse.jdt.ui.tests.refactoring;
 
@@ -681,6 +682,21 @@
 		helper1(5, 20, 5, 29, true, false, "temp", "i");
 	}
 
+	public void test113() throws Exception {
+		//test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=406347
+		helper1(7, 17, 7, 22, true, false, "temp", "i");
+	}
+
+	public void test114() throws Exception {
+		//test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=406347
+		helper1(8, 17, 8, 22, true, false, "temp", "i");
+	}
+
+	public void test115() throws Exception {
+		//test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=406347
+		helper1(7, 17, 7, 22, true, false, "temp", "i");
+	}
+	
 	public void testZeroLengthSelection0() throws Exception {
 //		printTestDisabledMessage("test for bug 30146");
 		helper1(4, 18, 4, 18, true, false, "temp", "j");
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/InferTypeArgumentsTests.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/InferTypeArgumentsTests.java
index c6a3341..76a6a27 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/InferTypeArgumentsTests.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/InferTypeArgumentsTests.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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,10 +16,11 @@
 import java.util.Arrays;
 import java.util.zip.ZipInputStream;
 
-import junit.framework.Assert;
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
+import org.junit.Assert;
+
 import org.eclipse.jdt.testplugin.JavaProjectHelper;
 import org.eclipse.jdt.testplugin.JavaTestPlugin;
 
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/InlineConstantTests.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/InlineConstantTests.java
index ec59186..25c7670 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/InlineConstantTests.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/InlineConstantTests.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Nikolay Metchev <nikolaymetchev@gmail.com> - [inline] problem with fields from generic types - https://bugs.eclipse.org/218431
  *******************************************************************************/
 package org.eclipse.jdt.ui.tests.refactoring;
 
@@ -313,6 +314,14 @@
 		helper1("p.A", 4, 23, 4, 28, true, true);
 	}
 
+	public void test38() throws Exception { // test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=218431
+		helper1("p.A", 6, 22, 6, 23, true, true);
+	}
+
+	public void test39() throws Exception { // test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=218431
+		helper1("p.A", 7, 26, 7, 27, true, true);
+	}
+
 	// -- testing failing preconditions
 
 	public void testFail0() throws Exception {
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/InlineMethodTests.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/InlineMethodTests.java
index 15f096b..536f0ed 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/InlineMethodTests.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/InlineMethodTests.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -20,6 +20,7 @@
  *         (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=44417)
  *       o Allow 'this' constructor to be inlined
  *         (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=38093)
+ *     Nikolay Metchev <nikolaymetchev@gmail.com> - Anonymous class using final parameter breaks method inlining - https://bugs.eclipse.org/269401
  *******************************************************************************/
 package org.eclipse.jdt.ui.tests.refactoring;
 
@@ -503,7 +504,22 @@
 	public void test91470() throws Exception {
 		performArgumentTest();
 	}
+	
+	//see bug 269401
+	public void testFinalParameter1() throws Exception {
+		performArgumentTest();
+	}
 
+	//see bug 269401
+	public void testFinalParameter2() throws Exception {
+		performArgumentTest();
+	}
+
+	//see bug 269401
+	public void testFinalParameter3() throws Exception {
+		performArgumentTest();
+	}
+	
 	/* *********************** Name Conflict Tests ******************************* */
 
 	private void performNameConflictTest() throws Exception {
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/IntroduceFactoryTests.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/IntroduceFactoryTests.java
index de4e2d1..bb881b0 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/IntroduceFactoryTests.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/IntroduceFactoryTests.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Samrat Dhillon <samrat.dhillon@gmail.com> - [introduce factory] Introduce Factory on an abstract class adds a statement to create an instance of that class - https://bugs.eclipse.org/bugs/show_bug.cgi?id=395016
  *******************************************************************************/
 package org.eclipse.jdt.ui.tests.refactoring;
 
@@ -214,6 +215,26 @@
 
 		assertEqualLines(getName() + ": ", getFileContents(outputFileName), newSource);
 	}
+	
+	private void doSingleUnitTestWithWarning(boolean protectConstructor, ICompilationUnit cu, String outputFileName) throws Exception, JavaModelException, IOException {
+		ISourceRange selection= findSelectionInSource(cu.getSource());
+		IntroduceFactoryRefactoring ref= new IntroduceFactoryRefactoring(cu, selection.getOffset(), selection.getLength());
+
+		ref.setProtectConstructor(protectConstructor);
+
+		RefactoringStatus activationResult= ref.checkInitialConditions(new NullProgressMonitor());
+
+		assertTrue("activation was supposed to be successful", activationResult.isOK());
+
+		RefactoringStatus checkInputResult= ref.checkFinalConditions(new NullProgressMonitor());
+
+		assertEquals(RefactoringStatus.WARNING, checkInputResult.getSeverity());
+		performChange(ref, false);
+
+		String newSource= cu.getSource();
+
+		assertEqualLines(getName() + ": ", getFileContents(outputFileName), newSource);
+	}
 
 	/**
 	 * Tests the IntroduceFactoryRefactoring refactoring on a single input source file
@@ -249,6 +270,14 @@
 
 		doSingleUnitTest(protectConstructor, cu, getBugTestFileName(null, getPackageP(), baseFileName, false));
 	}
+	
+	protected void singleUnitBugHelperWithWarning(String baseFileName, boolean protectConstructor)
+			throws Exception
+	{
+		ICompilationUnit cu= createCUForBugTestCase(null, getPackageP(), baseFileName, true);
+
+		doSingleUnitTestWithWarning(protectConstructor, cu, getBugTestFileName(null, getPackageP(), baseFileName, false));
+	}
 
 	/**
 	 * Like singleUnitHelper(), but allows for the specification of the names of
@@ -738,6 +767,14 @@
 		singleUnitBugHelper("Thing", true);
 	}
 	
+	public void test395016_1() throws Exception {
+		singleUnitBugHelperWithWarning("AbstractClass", true);
+	}
+	
+	public void test395016_2() throws Exception {
+		singleUnitBugHelperWithWarning("AbstractMethod", true);
+	}
+	
 	public void testFactoryClash() throws Exception {
 		failHelper(RefactoringStatus.ERROR);
 	}
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/IntroduceIndirectionTests.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/IntroduceIndirectionTests.java
index 3e8c633..f17d33f 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/IntroduceIndirectionTests.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/IntroduceIndirectionTests.java
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Nikolay Metchev <nikolaymetchev@gmail.com> - [introduce indirection] ClassCastException when introducing indirection on method in generic class - https://bugs.eclipse.org/395231
  *******************************************************************************/
 package org.eclipse.jdt.ui.tests.refactoring;
 
@@ -305,5 +306,30 @@
 	public void test31() throws Exception {
 		// test for bug 127665
 		helperPass(new String[] { "p.Test" }, "foo", "p.Test0", 13, 20, 13, 23);
-	}	
+	}
+
+	public void test32() throws Exception {
+		// test for bug 395231
+		helperPass(new String[] { "p.Test" }, "foo", "p.Test0", 4, 10, 4, 13);
+	}
+
+	public void test33() throws Exception {
+		// test for bug 395231
+		helper(new String[] { "p.Test" }, "foo", "p.Test0", 8, 9, 8, 20, false, false, false, false);
+	}
+
+	public void test34() throws Exception {
+		// test for bug 395231
+		helperPass(new String[] { "p.Test" }, "foo", "p.Test0", 6, 9, 6, 13);
+	}
+
+	public void test35() throws Exception {
+		// test for bug 395231
+		helperPass(new String[] { "p.Test" }, "foo", "p.Test0", 6, 9, 6, 13);
+	}
+
+	public void test36() throws Exception {
+		// test for bug 395231
+		helperPass(new String[] { "p.Test" }, "foo", "p.Test0", 6, 9, 6, 13);
+	}
 }
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/IntroduceParameterObjectTests.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/IntroduceParameterObjectTests.java
index 6a2e66a..c1a3fb2 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/IntroduceParameterObjectTests.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/IntroduceParameterObjectTests.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 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
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Samrat Dhillon samrat.dhillon@gmail.com https://bugs.eclipse.org/bugs/show_bug.cgi?id=395558 and https://bugs.eclipse.org/bugs/show_bug.cgi?id=395561
  *******************************************************************************/
 package org.eclipse.jdt.ui.tests.refactoring;
 
@@ -407,4 +408,18 @@
 		fDescriptor.setParameters(parameters);
 		runRefactoring(false, true);
 	}
+	
+	public void testMethodTypeParamArgs() throws Exception {
+		fDescriptor.setMethod(setupMethod());
+		fDescriptor.setTopLevel(false);
+		fDescriptor.setClassName("FooParameter");
+		runRefactoring(false, true);
+	}
+	
+	public void testMethodTypeParamArgsTopLevel() throws Exception {
+		fDescriptor.setMethod(setupMethod());
+		fDescriptor.setTopLevel(true);
+		fDescriptor.setClassName("FooParameter");
+		runRefactoring(false, true);
+	}
 }
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/MoveInnerToTopLevelTests.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/MoveInnerToTopLevelTests.java
index 61ec8e3..36f7cef 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/MoveInnerToTopLevelTests.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/MoveInnerToTopLevelTests.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Samrat Dhillon samrat.dhillon@gmail.com - [move member type] Moving a member interface to its own file adds the host's type parameters to it - https://bugs.eclipse.org/bugs/show_bug.cgi?id=385237
  *******************************************************************************/
 package org.eclipse.jdt.ui.tests.refactoring;
 
@@ -385,6 +386,11 @@
 		validatePassingTest("A", "B", "p", new String[] { "A"}, new String[] { "p"}, "a", true, true, true, true);
 	}
 	
+	// static context: https://bugs.eclipse.org/bugs/show_bug.cgi?id=385237
+	public void test_static_context_0() throws Exception{
+		validatePassingTest("A", "Inner", new String[]{"A"}, new String[]{"p"}, null, false, false);
+	}
+	
 	// --- Non static
 
 	public void test_nonstatic_0() throws Exception{
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/MoveInstanceMethodTests.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/MoveInstanceMethodTests.java
index 5ee1cf0..8bd6974 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/MoveInstanceMethodTests.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/MoveInstanceMethodTests.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -7,6 +7,10 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Nikolay Metchev <nikolaymetchev@gmail.com> - [move method] super method invocation does not compile after refactoring - https://bugs.eclipse.org/356687
+ *     Nikolay Metchev <nikolaymetchev@gmail.com> - [move method] Move method with static imported method calls introduces compiler error - https://bugs.eclipse.org/217753
+ *     Nikolay Metchev <nikolaymetchev@gmail.com> - [move method] Wrong detection of duplicate methods (can result in compile errors) - https://bugs.eclipse.org/404477
+ *     Nikolay Metchev <nikolaymetchev@gmail.com> - [move method] Annotation error in applying move-refactoring to inherited methods - https://bugs.eclipse.org/404471
  *******************************************************************************/
 package org.eclipse.jdt.ui.tests.refactoring;
 
@@ -469,7 +473,97 @@
 	public void test47() throws Exception {
 		helper1(new String[] { "p.A" }, "p.A", 8, 17, 8, 17, PARAMETER, "target", true, true);
 	}
+
+	// bug 411529
+	public void test48() throws Exception {
+		helper1(new String[] { "p.A", "p.B", "q.C" }, "p.B", 3, 17, 3, 17, PARAMETER, "c", true, true);
+	}
 	
+	//bug 356687
+	public void test49() throws Exception {
+		helper1(new String[] {"p.A"}, "p.A", 5, 10, 5, 11, FIELD, "b", true, true);
+	}
+	
+	//bug 356687
+	public void test50() throws Exception {
+		helper1(new String[] {"p.A"}, "p.A", 4, 10, 4, 11, PARAMETER, "b", true, true);
+	}
+
+	//bug 356687
+	public void test51() throws Exception {
+		helper1(new String[] {"p.A"}, "p.A", 4, 10, 4, 11, PARAMETER, "b", true, true);
+	}
+
+	//bug 356687
+	public void test52() throws Exception {
+		helper1(new String[] {"p.A"}, "p.A", 5, 10, 5, 11, FIELD, "b", true, true);
+	}
+	
+	//bug 356687
+	public void test53() throws Exception {
+		helper1(new String[] {"p.A"}, "p.A", 4, 10, 4, 11, PARAMETER, "b", true, true);
+	}
+	
+	//bug 356687
+	public void test54() throws Exception {
+		helper1(new String[] {"p.A"}, "p.A", 4, 15, 4, 16, PARAMETER, "b", false, false);
+	}
+	
+	//bug 356687
+	public void test55() throws Exception {
+		helper1(new String[] {"p.A"}, "p.A", 4, 17, 4, 18, FIELD, "b", true, true);
+	}
+	
+	//bug 356687
+	public void test56() throws Exception {
+		helper1(new String[] {"p.A"}, "p.A", 3, 17, 3, 18, PARAMETER, "b", true, true);
+	}
+	
+	//bug 356687
+	public void test57() throws Exception {
+		helper1(new String[] { "p.A" }, "p.A", 5, 17, 5, 18, PARAMETER, "b", true, true);
+	}
+
+	//bug 217753
+	public void test58() throws Exception {
+		helper1(new String[] { "p.A", "p.B" }, "p.A", 8, 25, 8, 28, PARAMETER, "b", true, true);
+	}
+
+	// bug 217753
+	public void test59() throws Exception {
+		helper1(new String[] { "p.A", "p.B" }, "p.A", 5, 14, 5, 15, PARAMETER, "b", true, true);
+	}
+
+	// bug 217753
+	public void test60() throws Exception {
+		helper1(new String[] { "p.A" }, "p.A", 5, 14, 5, 15, PARAMETER, "b", true, true);
+	}
+
+	// bug 217753
+	public void test61() throws Exception {
+		helper1(new String[] { "p.A" }, "p.A", 5, 14, 5, 15, PARAMETER, "b", true, true);
+	}
+
+	// bug 217753
+	public void test62() throws Exception {
+		helper1(new String[] { "p.A", "q.B" }, "p.A", 8, 14, 8, 15, PARAMETER, "c", true, true);
+	}
+
+	// bug 217753
+	public void test63() throws Exception {
+		helper1(new String[] { "A" }, "A", 2, 10, 2, 11, PARAMETER, "b", true, true);
+	}
+
+	// bug 404477
+	public void test64() throws Exception {
+		helper1(new String[] { "A" }, "A", 3, 17, 3, 18, PARAMETER, "b", true, true);
+	}
+
+	// bug 404471
+	public void test65() throws Exception {
+		helper1(new String[] { "A" }, "A", 3, 17, 3, 18, PARAMETER, "c", false, false);
+	}
+
 	// Move mA1 to field fB, do not inline delegator
 	public void test3() throws Exception {
 		helper1(new String[] { "p1.A", "p2.B", "p3.C"}, "p1.A", 9, 17, 9, 20, FIELD, "fB", false, false);
@@ -538,6 +632,16 @@
 //		failHelper2(new String[] { "p1.A", "p2.B"}, "p1.A", 5, 12, 5, 13, PARAMETER, "b", "a", true, true);
 	}
 
+	// bug 404477 - target method already exists
+	public void testFail14() throws Exception {
+		failHelper1(new String[] { "A" }, "A", 2, 17, 2, 18, PARAMETER, "b", true, true);
+	}
+
+	// bug 404477 / bug 286221 - target method already exists
+	public void testFail15() throws Exception {
+		failHelper1(new String[] { "A" }, "A", 3, 17, 3, 18, FIELD, "fB", true, true);
+	}
+	
 	// Cannot move static method
 	public void testFail2() throws Exception {
 		failHelper1(new String[] { "p1.A", "p2.B"}, "p1.A", 6, 23, 6, 24, PARAMETER, "b", true, true);
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ParticipantTesting.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ParticipantTesting.java
index e299044..4ee2963 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ParticipantTesting.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ParticipantTesting.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,7 +13,7 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import junit.framework.Assert;
+import org.junit.Assert;
 
 import org.eclipse.core.resources.IResource;
 
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/RenamePackageTests.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/RenamePackageTests.java
index e080ff8..f26417c 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/RenamePackageTests.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/RenamePackageTests.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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,10 +25,11 @@
 import java.util.Map;
 import java.util.zip.ZipInputStream;
 
-import junit.framework.Assert;
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
+import org.junit.Assert;
+
 import org.eclipse.jdt.testplugin.JavaProjectHelper;
 import org.eclipse.jdt.testplugin.JavaTestPlugin;
 
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/SefTests.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/SefTests.java
index ffaeb59..0de7f3c 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/SefTests.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/SefTests.java
@@ -10,6 +10,7 @@
  *     Dmitry Stalnov (dstalnov@fusionone.com) - contributed fix for
  *       bug Encapuslate field can fail when two variables in one variable declaration (see
  *       https://bugs.eclipse.org/bugs/show_bug.cgi?id=51540).
+ *     Nikolay Metchev <nikolaymetchev@gmail.com> - [encapsulate field] Encapsulating parenthesized field assignment yields compilation error - https://bugs.eclipse.org/177095
  *******************************************************************************/
 package org.eclipse.jdt.ui.tests.refactoring;
 
@@ -185,6 +186,10 @@
 		objectTest("field");
 	}
 
+	public void testSimpleParenthesizedWrite() throws Exception {
+		objectTest("field");
+	}
+
 	public void testSimpleReadWrite() throws Exception {
 		objectTest("field");
 	}
@@ -226,6 +231,10 @@
 		objectTest("field");
 	}
 
+	public void testCompoundParenthesizedWrite() throws Exception {
+		objectTest("field");
+	}
+
 	public void testCompoundWrite() throws Exception {
 		objectTest("field");
 	}
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/SurroundWithTests17.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/SurroundWithTests17.java
index 5ec9ec0..78b7d98 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/SurroundWithTests17.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/SurroundWithTests17.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
+ * Copyright (c) 2011, 2013 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
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Samrat Dhillon <samrat.dhillon@gmail.com> - Bug 388724 -  [surround with try/catch][quick fix] Multi-Catch QuickFix creates compiler error
  *******************************************************************************/
 package org.eclipse.jdt.ui.tests.refactoring;
 
@@ -59,5 +60,9 @@
 	public void testSimple2() throws Exception {
 		tryCatchTest();
 	}
+	
+	public void testMultiTryCatch() throws Exception {
+		tryCatchTest();
+	}
 
 }
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestChangeMethodSignaturParticipant.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestChangeMethodSignaturParticipant.java
index 5e74f89..2287437 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestChangeMethodSignaturParticipant.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestChangeMethodSignaturParticipant.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007, 2009 IBM Corporation and others.
+ * Copyright (c) 2007, 2013 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
@@ -10,7 +10,8 @@
  *******************************************************************************/
 package org.eclipse.jdt.ui.tests.refactoring;
 
-import junit.framework.Assert;
+
+import org.junit.Assert;
 
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
@@ -25,9 +26,9 @@
 import org.eclipse.jdt.core.JavaModelException;
 import org.eclipse.jdt.core.Signature;
 import org.eclipse.jdt.core.refactoring.participants.ChangeMethodSignatureArguments;
-import org.eclipse.jdt.core.refactoring.participants.ChangeMethodSignatureParticipant;
 import org.eclipse.jdt.core.refactoring.participants.ChangeMethodSignatureArguments.Parameter;
 import org.eclipse.jdt.core.refactoring.participants.ChangeMethodSignatureArguments.ThrownException;
+import org.eclipse.jdt.core.refactoring.participants.ChangeMethodSignatureParticipant;
 
 import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
 import org.eclipse.jdt.internal.corext.util.JdtFlags;
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestCopyParticipantShared.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestCopyParticipantShared.java
index ac739f9..c223a13 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestCopyParticipantShared.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestCopyParticipantShared.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,7 +13,7 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import junit.framework.Assert;
+import org.junit.Assert;
 
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestCopyParticipantSingle.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestCopyParticipantSingle.java
index af09c2c..0429d42 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestCopyParticipantSingle.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestCopyParticipantSingle.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -14,7 +14,7 @@
 import java.util.Arrays;
 import java.util.List;
 
-import junit.framework.Assert;
+import org.junit.Assert;
 
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestCreateParticipantShared.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestCreateParticipantShared.java
index 5bfdb4c..f742c8c 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestCreateParticipantShared.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestCreateParticipantShared.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,7 +13,7 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import junit.framework.Assert;
+import org.junit.Assert;
 
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestCreateParticipantSingle.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestCreateParticipantSingle.java
index be37b2b..90dddf7 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestCreateParticipantSingle.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestCreateParticipantSingle.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -14,7 +14,7 @@
 import java.util.Arrays;
 import java.util.List;
 
-import junit.framework.Assert;
+import org.junit.Assert;
 
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestDeleteParticipantShared.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestDeleteParticipantShared.java
index d2dc137..c15b773 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestDeleteParticipantShared.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestDeleteParticipantShared.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,7 +13,7 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import junit.framework.Assert;
+import org.junit.Assert;
 
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestDeleteParticipantSingle.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestDeleteParticipantSingle.java
index 5232a7d..ca810a5 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestDeleteParticipantSingle.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestDeleteParticipantSingle.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -14,7 +14,7 @@
 import java.util.Arrays;
 import java.util.List;
 
-import junit.framework.Assert;
+import org.junit.Assert;
 
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestModelProvider.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestModelProvider.java
index f456fd1..66833b2 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestModelProvider.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestModelProvider.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -15,7 +15,7 @@
 import java.util.Comparator;
 import java.util.List;
 
-import junit.framework.Assert;
+import org.junit.Assert;
 
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestMoveParticipantShared.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestMoveParticipantShared.java
index c642487..f83856b 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestMoveParticipantShared.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestMoveParticipantShared.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,7 +13,7 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import junit.framework.Assert;
+import org.junit.Assert;
 
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestMoveParticipantSingle.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestMoveParticipantSingle.java
index c627f47..907b761 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestMoveParticipantSingle.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestMoveParticipantSingle.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -14,7 +14,7 @@
 import java.util.Arrays;
 import java.util.List;
 
-import junit.framework.Assert;
+import org.junit.Assert;
 
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestRenameParticipantShared.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestRenameParticipantShared.java
index d66d95e..6ae1319 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestRenameParticipantShared.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestRenameParticipantShared.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -15,7 +15,7 @@
 import java.util.List;
 import java.util.Map;
 
-import junit.framework.Assert;
+import org.junit.Assert;
 
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestRenameParticipantSingle.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestRenameParticipantSingle.java
index 5f17795..7ed7be1 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestRenameParticipantSingle.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/TestRenameParticipantSingle.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -14,7 +14,7 @@
 import java.util.Arrays;
 import java.util.List;
 
-import junit.framework.Assert;
+import org.junit.Assert;
 
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/infra/ZipTools.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/infra/ZipTools.java
index c8d7d38..db9c280 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/infra/ZipTools.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/infra/ZipTools.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -17,7 +17,7 @@
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipInputStream;
 
-import junit.framework.Assert;
+import org.junit.Assert;
 
 import org.eclipse.jdt.core.ICompilationUnit;
 import org.eclipse.jdt.core.IJavaElement;
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/reorg/IntroduceIndirectionPerfAcceptanceTests.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/reorg/IntroduceIndirectionPerfAcceptanceTests.java
index 74a1e58..ed7b851 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/reorg/IntroduceIndirectionPerfAcceptanceTests.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/reorg/IntroduceIndirectionPerfAcceptanceTests.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -10,9 +10,10 @@
  *******************************************************************************/
 package org.eclipse.jdt.ui.tests.refactoring.reorg;
 
-import junit.framework.Assert;
 import junit.framework.Test;
 
+import org.junit.Assert;
+
 import org.eclipse.test.OrderedTestSuite;
 
 import org.eclipse.core.resources.ResourcesPlugin;
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/reorg/TestProject.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/reorg/TestProject.java
index da3aab1..6923e44 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/reorg/TestProject.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/reorg/TestProject.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -10,7 +10,8 @@
  *******************************************************************************/
 package org.eclipse.jdt.ui.tests.refactoring.reorg;
 
-import junit.framework.Assert;
+
+import org.junit.Assert;
 
 import org.eclipse.jdt.testplugin.JavaProjectHelper;
 
diff --git a/org.eclipse.jdt.ui.tests/META-INF/MANIFEST.MF b/org.eclipse.jdt.ui.tests/META-INF/MANIFEST.MF
index 221450a..9c5b2c7 100644
--- a/org.eclipse.jdt.ui.tests/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.ui.tests/META-INF/MANIFEST.MF
@@ -3,7 +3,6 @@
 Bundle-Name: %Plugin.name
 Bundle-SymbolicName: org.eclipse.jdt.ui.tests; singleton:=true
 Bundle-Version: 3.9.1.qualifier
-Bundle-ClassPath: javauitests.jar
 Bundle-Activator: org.eclipse.jdt.testplugin.JavaTestPlugin
 Bundle-ActivationPolicy: lazy
 Bundle-Vendor: %Plugin.providerName
@@ -59,7 +58,6 @@
  org.eclipse.ui,
  org.eclipse.ui.editors,
  org.eclipse.ui.ide,
- org.eclipse.ui.ide,
  org.eclipse.ui.navigator,
  org.eclipse.ui.views,
  org.eclipse.ui.workbench.texteditor,
diff --git a/org.eclipse.jdt.ui.tests/build.properties b/org.eclipse.jdt.ui.tests/build.properties
index e0ab7ec..d917a29 100644
--- a/org.eclipse.jdt.ui.tests/build.properties
+++ b/org.eclipse.jdt.ui.tests/build.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2000, 2010 IBM Corporation and others.
+# Copyright (c) 2000, 2013 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
@@ -12,13 +12,13 @@
                test.xml,\
                about.html,\
                testresources/,\
-               *.jar,\
+               .,\
                META-INF/,\
                plugin.properties
-source.javauitests.jar = examples/,\
-                         chkpii/,\
-                         test plugin/,\
-                         ui/,\
-                         leaks/,\
-                         performance/
-javacWarnings.javauitests.jar=-deadCode,-raw,-unchecked
+source.. =  examples/,\
+            chkpii/,\
+            test plugin/,\
+            ui/,\
+            leaks/,\
+            performance/
+javacWarnings..=-raw,-unchecked
diff --git a/org.eclipse.jdt.ui.tests/performance/org/eclipse/jdt/ui/tests/performance/SWTTestProject.java b/org.eclipse.jdt.ui.tests/performance/org/eclipse/jdt/ui/tests/performance/SWTTestProject.java
index 1cad568..bcd0562 100644
--- a/org.eclipse.jdt.ui.tests/performance/org/eclipse/jdt/ui/tests/performance/SWTTestProject.java
+++ b/org.eclipse.jdt.ui.tests/performance/org/eclipse/jdt/ui/tests/performance/SWTTestProject.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,7 +16,7 @@
 import java.util.zip.ZipException;
 import java.util.zip.ZipFile;
 
-import junit.framework.Assert;
+import org.junit.Assert;
 
 import org.eclipse.jdt.testplugin.JavaProjectHelper;
 import org.eclipse.jdt.testplugin.JavaTestPlugin;
diff --git a/org.eclipse.jdt.ui.tests/pom.xml b/org.eclipse.jdt.ui.tests/pom.xml
index 2b740082..0b94358 100644
--- a/org.eclipse.jdt.ui.tests/pom.xml
+++ b/org.eclipse.jdt.ui.tests/pom.xml
@@ -8,28 +8,58 @@
  
   Contributors:
      Igor Fedorenko - initial implementation
+     Mickael Istria (Red Hat Inc.) - 416915: tycho-surefire-plugin configuration
 -->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <parent>
-    <artifactId>eclipse.jdt.ui</artifactId>
+    <artifactId>tests-pom</artifactId>
     <groupId>eclipse.jdt.ui</groupId>
     <version>4.3.0-SNAPSHOT</version>
+    <relativePath>../tests-pom/</relativePath>
   </parent>
   <groupId>org.eclipse.jdt</groupId>
   <artifactId>org.eclipse.jdt.ui.tests</artifactId>
   <version>3.9.1-SNAPSHOT</version>
   <packaging>eclipse-test-plugin</packaging>
+  <properties>
+    <defaultSigning-excludeInnerJars>true</defaultSigning-excludeInnerJars>
+    <testSuite>${project.artifactId}</testSuite>
+    <testClass>org.eclipse.jdt.ui.tests.AutomatedSuite</testClass>
+  </properties>
+
   <build>
     <plugins>
       <plugin>
         <groupId>org.eclipse.tycho</groupId>
-        <artifactId>tycho-compiler-plugin</artifactId>
+        <artifactId>tycho-surefire-plugin</artifactId>
         <version>${tycho.version}</version>
         <configuration>
-          <compilerArgument>-warn:-deprecation,raw,unchecked,discouraged,forbidden,warningToken</compilerArgument>
+          <useUIHarness>true</useUIHarness>
+          <useUIThread>true</useUIThread>
+          <explodedBundles>
+            <bundle>org.junit</bundle>
+          </explodedBundles>
+          <dependencies>
+            <dependency>
+              <type>eclipse-plugin</type>
+              <artifactId>org.eclipse.jdt.annotation</artifactId>
+              <version>0.0.0</version>
+            </dependency>
+            <dependency>
+              <type>eclipse-plugin</type>
+              <artifactId>org.eclipse.jdt.junit4.runtime</artifactId>
+              <version>0.0.0</version>
+            </dependency>
+            <dependency>
+              <type>eclipse-plugin</type>
+              <artifactId>org.eclipse.equinox.event</artifactId>
+              <version>0.0.0</version>
+            </dependency>
+          </dependencies>
         </configuration>
       </plugin>
     </plugins>
- </build>
+  </build>
+
 </project>
diff --git a/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/MixedLineDelimiterDetector.java b/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/MixedLineDelimiterDetector.java
index 1016f58..b3a1a46 100644
--- a/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/MixedLineDelimiterDetector.java
+++ b/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/MixedLineDelimiterDetector.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 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
@@ -10,7 +10,7 @@
  *******************************************************************************/
 package org.eclipse.jdt.testplugin;
 
-import junit.framework.Assert;
+import org.junit.Assert;
 
 import org.eclipse.core.resources.IResource;
 
diff --git a/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/StringAsserts.java b/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/StringAsserts.java
index c0e2b7d..3e3106d 100644
--- a/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/StringAsserts.java
+++ b/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/StringAsserts.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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,11 +16,9 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 
-import junit.framework.Assert;
+import org.junit.Assert;
 
-/**
- *
- */
+
 public class StringAsserts {
 	/**
 	 *
diff --git a/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/util/DialogCheck.java b/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/util/DialogCheck.java
index 9ddd130..039a18b 100644
--- a/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/util/DialogCheck.java
+++ b/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/util/DialogCheck.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -10,10 +10,7 @@
  *******************************************************************************/
 package org.eclipse.jdt.testplugin.util;
 
-
-
-
-import junit.framework.Assert;
+import org.junit.Assert;
 
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.graphics.Point;
diff --git a/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/util/DisplayHelper.java b/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/util/DisplayHelper.java
index 2714cbe..8952c14 100644
--- a/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/util/DisplayHelper.java
+++ b/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/util/DisplayHelper.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,10 +13,11 @@
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
-import junit.framework.Assert;
+import org.junit.Assert;
 
 import org.eclipse.swt.widgets.Display;
 
+
 /**
  * Runs the event loop of the given display until {@link #condition()} becomes
  * <code>true</code> or no events have occurred for the supplied timeout.
diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/callhierarchy/CallHierarchyTestHelper.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/callhierarchy/CallHierarchyTestHelper.java
index 662048c..29fb7b9 100644
--- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/callhierarchy/CallHierarchyTestHelper.java
+++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/callhierarchy/CallHierarchyTestHelper.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,7 +16,7 @@
 import java.util.Collection;
 import java.util.Iterator;
 
-import junit.framework.Assert;
+import org.junit.Assert;
 
 import org.eclipse.jdt.testplugin.JavaProjectHelper;
 
diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/AddImportTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/AddImportTest.java
index 6160310..996bf1b 100644
--- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/AddImportTest.java
+++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/AddImportTest.java
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Nikolay Metchev <nikolaymetchev@gmail.com> - Import static (Ctrl+Shift+M) creates imports for private methods - https://bugs.eclipse.org/409594
  *******************************************************************************/
 package org.eclipse.jdt.ui.tests.core;
 
@@ -981,7 +982,227 @@
 		buf.append("}\n");
 		assertEqualString(cu.getSource(), buf.toString());
 	}
+	
+	public void testAddImportActionBug_409594_test1() throws Exception {
+		IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src");
+		
+		IPackageFragment pack1= sourceFolder.createPackageFragment("p", false, null);
+		String input =
+				"package p;\n" + 
+				"\n" + 
+				"class A {\n" + 
+				"	static void foo() {\n" + 
+				"		A.bar();\n" + 
+				"	}\n" + 
+				"\n" + 
+				"	private static void bar() {\n" + 
+				"	}\n" + 
+				"}";
+		ICompilationUnit cu= pack1.createCompilationUnit("A.java", input, false, null);
+		
+		int selOffset= input.indexOf("bar");
+		
+		AddImportsOperation op= new AddImportsOperation(cu, selOffset, 3, null, true);
+		op.run(null);
+		
+		String expected = 
+				"package p;\n" + 
+				"\n" + 
+				"class A {\n" + 
+				"	static void foo() {\n" + 
+				"		bar();\n" + 
+				"	}\n" + 
+				"\n" + 
+				"	private static void bar() {\n" + 
+				"	}\n" + 
+				"}";
+		assertEqualString(cu.getSource(), expected);
+	}
+	
+	public void testAddImportActionBug_409594_test2() throws Exception {
+		IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src");
+		
+		IPackageFragment pack1= sourceFolder.createPackageFragment("p", false, null);
+		String input =
+				"package p;\n" + 
+				"\n" + 
+				"class A {\n" + 
+				"	static void foo() {\n" + 
+				"		A.bar();\n" + 
+				"	}\n" + 
+				"\n" + 
+				"	public static void bar() {\n" + 
+				"	}\n" + 
+				"}";
+		ICompilationUnit cu= pack1.createCompilationUnit("A.java", input, false, null);
+		
+		int selOffset= input.indexOf("bar");
+		
+		AddImportsOperation op= new AddImportsOperation(cu, selOffset, 3, null, true);
+		op.run(null);
+		
+		String expected = 
+				"package p;\n" + 
+				"\n" + 
+				"class A {\n" + 
+				"	static void foo() {\n" + 
+				"		bar();\n" + 
+				"	}\n" + 
+				"\n" + 
+				"	public static void bar() {\n" + 
+				"	}\n" + 
+				"}";
+		assertEqualString(cu.getSource(), expected);
+	}
+	
+	public void testAddImportActionBug_409594_test3() throws Exception {
+		IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src");
+		
+		IPackageFragment pack1= sourceFolder.createPackageFragment("p", false, null);
+		String input =
+				"package p;\n" + 
+				"class SnippetX {\n" + 
+				"    private static class Test {\n" + 
+				"        class X {\n" + 
+				"            void foo() {\n" + 
+				"                Test.bar();\n" + 
+				"            }\n" + 
+				"        }\n" + 
+				"        public static void bar() {}\n" + 
+				"    }\n" + 
+				"}";
+		ICompilationUnit cu= pack1.createCompilationUnit("A.java", input, false, null);
+		
+		int selOffset= input.indexOf("bar");
+		
+		AddImportsOperation op= new AddImportsOperation(cu, selOffset, 3, null, true);
+		op.run(null);
+		
+		String expected = 
+				"package p;\n" + 
+				"class SnippetX {\n" + 
+				"    private static class Test {\n" + 
+				"        class X {\n" + 
+				"            void foo() {\n" + 
+				"                bar();\n" + 
+				"            }\n" + 
+				"        }\n" + 
+				"        public static void bar() {}\n" + 
+				"    }\n" + 
+				"}";
+		assertEqualString(cu.getSource(), expected);
+	}
 
+	public void testAddImportActionBug_409594_test4() throws Exception {
+		IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src");
+
+		IPackageFragment pack1= sourceFolder.createPackageFragment("p", false, null);
+		StringBuffer buf= new StringBuffer();
+		buf.append("package p;\n");
+		buf.append("\n");
+		buf.append("class SnippetY {\n");
+		buf.append("    static class Test {\n");
+		buf.append("        static void bar() {}\n");
+		buf.append("    }\n");
+		buf.append("\n");
+		buf.append("    void foo() {\n");
+		buf.append("        Test.bar();\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+		ICompilationUnit cu= pack1.createCompilationUnit("A.java", buf.toString(), false, null);
+
+		int selOffset= buf.indexOf("bar();");
+
+		AddImportsOperation op= new AddImportsOperation(cu, selOffset, 3, null, true);
+		op.run(null);
+
+		buf= new StringBuffer();
+		buf.append("package p;\n");
+		buf.append("\n");
+		buf.append("import static p.SnippetY.Test.bar;\n");
+		buf.append("\n");
+		buf.append("class SnippetY {\n");
+		buf.append("    static class Test {\n");
+		buf.append("        static void bar() {}\n");
+		buf.append("    }\n");
+		buf.append("\n");
+		buf.append("    void foo() {\n");
+		buf.append("        bar();\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+		assertEqualString(cu.getSource(), buf.toString());
+	}
+	
+	public void testAddImportActionBug_409594_test5() throws Exception {
+		IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src");
+
+		IPackageFragment pack1= sourceFolder.createPackageFragment("p", false, null);
+		StringBuffer buf= new StringBuffer();
+		buf.append("package organize.imports.pvtStaticMembers.bug409594;\n");
+		buf.append("\n");
+		buf.append("class SnippetY {    \n");
+		buf.append("    private static class Test {\n");
+		buf.append("        static void bar() {}        \n");
+		buf.append("    }\n");
+		buf.append("    \n");
+		buf.append("    void foo() {\n");
+		buf.append("         Test.bar();\n");
+		buf.append("     }\n");
+		buf.append("}\n");
+		ICompilationUnit cu= pack1.createCompilationUnit("A.java", buf.toString(), false, null);
+
+		int selOffset= buf.indexOf("bar();");
+
+		AddImportsOperation op= new AddImportsOperation(cu, selOffset, 3, null, true);
+		op.run(null);
+
+		assertEqualString(cu.getSource(), cu.getSource());
+	}
+	
+	public void testAddImportActionBug_409594_test6() throws Exception {
+		IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src");
+
+		IPackageFragment pack1= sourceFolder.createPackageFragment("p", false, null);
+		String inputA=
+				"package q;\n" +
+						"\n" +
+						"public class A {\n" +
+						"	protected static void bar() {\n" +
+						"	}\n" +
+						"}";
+		String inputB=
+				"package p;\n" +
+						"\n" +
+						"import q.A;\n" +
+						"\n" +
+						"class B extends A {\n" +
+						"	void foo() {\n" +
+						"		A.bar();\n" +
+						"	}\n" +
+						"}\n" +
+						"";
+		pack1.createCompilationUnit("A.java", inputA, false, null);
+		ICompilationUnit cuB= pack1.createCompilationUnit("B.java", inputB, false, null);
+
+		int selOffset= inputB.indexOf("bar");
+
+		AddImportsOperation op= new AddImportsOperation(cuB, selOffset, 3, null, true);
+		op.run(null);
+
+		String expected=
+				"package p;\n" +
+						"\n" +
+						"import q.A;\n" +
+						"\n" +
+						"class B extends A {\n" +
+						"	void foo() {\n" +
+						"		bar();\n" +
+						"	}\n" +
+						"}\n" +
+						"";
+		assertEqualString(cuB.getSource(), expected);
+	}
+	
 	public void testAddImportAction_bug107206() throws Exception {
 		IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src");
 
diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateConstructorUsingFieldsTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateConstructorUsingFieldsTest.java
index e972358..4f789c3 100644
--- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateConstructorUsingFieldsTest.java
+++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateConstructorUsingFieldsTest.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -12,10 +12,11 @@
 
 import java.lang.reflect.Modifier;
 
-import junit.framework.Assert;
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
+import org.junit.Assert;
+
 import org.eclipse.jdt.testplugin.JavaProjectHelper;
 
 import org.eclipse.core.runtime.CoreException;
diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateDelegateMethodsTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateDelegateMethodsTest.java
index 8bb0f11..976f562 100644
--- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateDelegateMethodsTest.java
+++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateDelegateMethodsTest.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -10,10 +10,11 @@
  *******************************************************************************/
 package org.eclipse.jdt.ui.tests.core.source;
 
-import junit.framework.Assert;
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
+import org.junit.Assert;
+
 import org.eclipse.jdt.testplugin.JavaProjectHelper;
 
 import org.eclipse.core.runtime.CoreException;
diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateHashCodeEqualsTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateHashCodeEqualsTest.java
index c5af64a..e14ba2d 100644
--- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateHashCodeEqualsTest.java
+++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateHashCodeEqualsTest.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,10 +13,11 @@
 import java.util.HashMap;
 import java.util.Map;
 
-import junit.framework.Assert;
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
+import org.junit.Assert;
+
 import org.eclipse.jdt.testplugin.JavaProjectHelper;
 
 import org.eclipse.core.runtime.CoreException;
diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateToStringTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateToStringTest.java
index 64c6a42..5f80eb7 100644
--- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateToStringTest.java
+++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateToStringTest.java
@@ -16,10 +16,11 @@
 
 import java.util.ArrayList;
 
-import junit.framework.Assert;
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
+import org.junit.Assert;
+
 import org.eclipse.jdt.testplugin.JavaProjectHelper;
 
 import org.eclipse.core.runtime.CoreException;
diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/packageHover/PackageJavadocTests.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/packageHover/PackageJavadocTests.java
index 5ff4a7d..82b0fbf 100644
--- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/packageHover/PackageJavadocTests.java
+++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/packageHover/PackageJavadocTests.java
@@ -13,10 +13,11 @@
 import java.io.File;
 import java.net.URL;
 
-import junit.framework.Assert;
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
+import org.junit.Assert;
+
 import org.eclipse.jdt.testplugin.JavaProjectHelper;
 import org.eclipse.jdt.testplugin.JavaTestPlugin;
 
diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AssistQuickFixTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AssistQuickFixTest.java
index 104149c..536579c 100644
--- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AssistQuickFixTest.java
+++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AssistQuickFixTest.java
@@ -8,6 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Sebastian Davids <sdavids@gmx.de> - testInvertEquals1-23
+ *     Lukas Hanke <hanke@yatta.de> - Bug 241696 [quick fix] quickfix to iterate over a collection - https://bugs.eclipse.org/bugs/show_bug.cgi?id=241696
  *******************************************************************************/
 package org.eclipse.jdt.ui.tests.quickfix;
 
@@ -44,6 +45,7 @@
 
 import org.eclipse.jdt.internal.ui.JavaPlugin;
 import org.eclipse.jdt.internal.ui.text.correction.AssistContext;
+import org.eclipse.jdt.internal.ui.text.correction.CorrectionMessages;
 import org.eclipse.jdt.internal.ui.text.correction.QuickAssistProcessor;
 import org.eclipse.jdt.internal.ui.text.correction.proposals.AssignToVariableAssistProposal;
 import org.eclipse.jdt.internal.ui.text.correction.proposals.LinkedNamesAssistProposal;
@@ -1268,7 +1270,7 @@
 		AssistContext context= getCorrectionContext(cu, buf.toString().indexOf(str) + str.length(), 0);
 		List proposals= collectAssists(context, false);
 
-		assertNumberOfProposals(proposals, 2);
+		assertNumberOfProposals(proposals, 4);
 		assertCorrectLabels(proposals);
 
 		CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0);
@@ -8410,4 +8412,1055 @@
 	
 		assertExpectedExistInProposals(proposals, expected);
 	}
+	
+	public void testGenerateForSimple() throws Exception {
+		IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
+		StringBuffer buf= new StringBuffer();
+		buf.append("package test1;\n");
+		buf.append("import java.util.Collection;\n");
+		buf.append("public class E {\n");
+		buf.append("    void foo(Collection<String> collection) {\n");
+		buf.append("        collection\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+		ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
+
+		Map saveOptions= fJProject1.getOptions(false);
+		Map newOptions= new HashMap(saveOptions);
+		newOptions.put(DefaultCodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE, "true");
+		try {
+			fJProject1.setOptions(newOptions);
+			String selection= "collection";
+			AssistContext context= getCorrectionContext(cu, buf.toString().lastIndexOf(selection) + selection.length(), 0);
+			List proposals= collectAssists(context, false);
+
+			assertNumberOfProposals(proposals, 2);
+			assertCorrectLabels(proposals);
+
+			String[] expected= new String[2];
+			buf= new StringBuffer();
+			buf.append("package test1;\n");
+			buf.append("import java.util.Collection;\n");
+			buf.append("public class E {\n");
+			buf.append("    void foo(Collection<String> collection) {\n");
+			buf.append("        for (String string : collection) {\n");
+			buf.append("            \n");
+			buf.append("        }\n");
+			buf.append("    }\n");
+			buf.append("}\n");
+			expected[0]= buf.toString();
+
+			buf= new StringBuffer();
+			buf.append("package test1;\n");
+			buf.append("import java.util.Collection;\n");
+			buf.append("import java.util.Iterator;\n");
+			buf.append("public class E {\n");
+			buf.append("    void foo(Collection<String> collection) {\n");
+			buf.append("        for (Iterator<String> iterator = collection.iterator(); iterator\n");
+			buf.append("                .hasNext();) {\n");
+			buf.append("            String string = iterator.next();\n");
+			buf.append("            \n");
+			buf.append("        }\n");
+			buf.append("    }\n");
+			buf.append("}\n");
+			expected[1]= buf.toString();
+
+			assertExpectedExistInProposals(proposals, expected);
+		} finally {
+			fJProject1.setOptions(saveOptions);
+		}
+	}
+
+	public void testGenerateForWithSemicolon() throws Exception {
+		IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
+		StringBuffer buf= new StringBuffer();
+		buf.append("package test1;\n");
+		buf.append("import java.util.Collection;\n");
+		buf.append("public class E {\n");
+		buf.append("    void foo(Collection<String> collection) {\n");
+		buf.append("        collection;\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+		ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
+
+		Map saveOptions= fJProject1.getOptions(false);
+		Map newOptions= new HashMap(saveOptions);
+		newOptions.put(DefaultCodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE, "true");
+		try {
+			fJProject1.setOptions(newOptions);
+			String selection= "collection;";
+			AssistContext context= getCorrectionContext(cu, buf.toString().lastIndexOf(selection) + selection.length(), 0);
+			List proposals= collectAssists(context, false);
+
+			assertNumberOfProposals(proposals, 4);
+			assertCorrectLabels(proposals);
+
+			String[] expected= new String[2];
+			buf= new StringBuffer();
+			buf.append("package test1;\n");
+			buf.append("import java.util.Collection;\n");
+			buf.append("public class E {\n");
+			buf.append("    void foo(Collection<String> collection) {\n");
+			buf.append("        for (String string : collection) {\n");
+			buf.append("            \n");
+			buf.append("        }\n");
+			buf.append("    }\n");
+			buf.append("}\n");
+			expected[0]= buf.toString();
+
+			buf= new StringBuffer();
+			buf.append("package test1;\n");
+			buf.append("import java.util.Collection;\n");
+			buf.append("import java.util.Iterator;\n");
+			buf.append("public class E {\n");
+			buf.append("    void foo(Collection<String> collection) {\n");
+			buf.append("        for (Iterator<String> iterator = collection.iterator(); iterator.hasNext();) {\n");
+			buf.append("            String string = iterator.next();\n");
+			buf.append("            \n");
+			buf.append("        }\n");
+			buf.append("    }\n");
+			buf.append("}\n");
+			expected[1]= buf.toString();
+
+			assertExpectedExistInProposals(proposals, expected);
+		} finally {
+			fJProject1.setOptions(saveOptions);
+		}
+	}
+
+	public void testGenerateForMethodInvocation() throws Exception {
+		IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
+		StringBuffer buf= new StringBuffer();
+		buf.append("package test1;\n");
+		buf.append("import java.util.Map;\n");
+		buf.append("public class E {\n");
+		buf.append("    void foo(Map<String, String> map) {\n");
+		buf.append("        map.keySet()\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+		ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
+
+		Map saveOptions= fJProject1.getOptions(false);
+		Map newOptions= new HashMap(saveOptions);
+		newOptions.put(DefaultCodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE, "true");
+		try {
+			fJProject1.setOptions(newOptions);
+			String selection= "keySet()";
+			AssistContext context= getCorrectionContext(cu, buf.toString().indexOf(selection) + selection.length(), 0);
+			List proposals= collectAssists(context, false);
+
+			assertNumberOfProposals(proposals, 6);
+			assertCorrectLabels(proposals);
+
+			String[] expected= new String[2];
+			buf= new StringBuffer();
+			buf.append("package test1;\n");
+			buf.append("import java.util.Map;\n");
+			buf.append("public class E {\n");
+			buf.append("    void foo(Map<String, String> map) {\n");
+			buf.append("        for (String string : map.keySet()) {\n");
+			buf.append("            \n");
+			buf.append("        }\n");
+			buf.append("    }\n");
+			buf.append("}\n");
+			expected[0]= buf.toString();
+
+			buf= new StringBuffer();
+			buf.append("package test1;\n");
+			buf.append("import java.util.Iterator;\n");
+			buf.append("import java.util.Map;\n");
+			buf.append("public class E {\n");
+			buf.append("    void foo(Map<String, String> map) {\n");
+			buf.append("        for (Iterator<String> iterator = map.keySet().iterator(); iterator\n");
+			buf.append("                .hasNext();) {\n");
+			buf.append("            String string = iterator.next();\n");
+			buf.append("            \n");
+			buf.append("        }\n");
+			buf.append("    }\n");
+			buf.append("}\n");
+			expected[1]= buf.toString();
+
+			assertExpectedExistInProposals(proposals, expected);
+		} finally {
+			fJProject1.setOptions(saveOptions);
+		}
+	}
+
+	public void testGenerateForComplexParametrization() throws Exception {
+		IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
+		StringBuffer buf= new StringBuffer();
+		buf.append("package test1;\n");
+		buf.append("import java.util.LinkedList;\n");
+		buf.append("public class E {\n");
+		buf.append("    void foo(MySecondOwnIterable collection) {\n");
+		buf.append("        collection\n");
+		buf.append("    }\n");
+		buf.append("private class MyFirstOwnIterable<T, K> extends LinkedList<K>{}");
+		buf.append("private class MySecondOwnIterable extends MyFirstOwnIterable<Integer, String>{}");
+		buf.append("}\n");
+
+		ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
+
+		Map saveOptions= fJProject1.getOptions(false);
+		Map newOptions= new HashMap(saveOptions);
+		newOptions.put(DefaultCodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE, "true");
+		try {
+			fJProject1.setOptions(newOptions);
+			String selection= "collection";
+			AssistContext context= getCorrectionContext(cu, buf.toString().lastIndexOf(selection) + selection.length(), 0);
+			List proposals= collectAssists(context, false);
+
+			assertNumberOfProposals(proposals, 3);
+			assertCorrectLabels(proposals);
+
+			String[] expected= new String[3];
+			buf= new StringBuffer();
+			buf.append("package test1;\n");
+			buf.append("import java.util.LinkedList;\n");
+			buf.append("public class E {\n");
+			buf.append("    void foo(MySecondOwnIterable collection) {\n");
+			buf.append("        for (String string : collection) {\n");
+			buf.append("            \n");
+			buf.append("        }\n");
+			buf.append("    }\n");
+			buf.append("private class MyFirstOwnIterable<T, K> extends LinkedList<K>{}");
+			buf.append("private class MySecondOwnIterable extends MyFirstOwnIterable<Integer, String>{}");
+			buf.append("}\n");
+			expected[0]= buf.toString();
+
+			buf= new StringBuffer();
+			buf.append("package test1;\n");
+			buf.append("import java.util.Iterator;\n");
+			buf.append("import java.util.LinkedList;\n");
+			buf.append("public class E {\n");
+			buf.append("    void foo(MySecondOwnIterable collection) {\n");
+			buf.append("        for (Iterator<String> iterator = collection.iterator(); iterator\n");
+			buf.append("                .hasNext();) {\n");
+			buf.append("            String string = iterator.next();\n");
+			buf.append("            \n");
+			buf.append("        }\n");
+			buf.append("    }\n");
+			buf.append("private class MyFirstOwnIterable<T, K> extends LinkedList<K>{}");
+			buf.append("private class MySecondOwnIterable extends MyFirstOwnIterable<Integer, String>{}");
+			buf.append("}\n");
+			expected[1]= buf.toString();
+			
+			buf= new StringBuffer();
+			buf.append("package test1;\n");
+			buf.append("import java.util.LinkedList;\n");
+			buf.append("public class E {\n");
+			buf.append("    void foo(MySecondOwnIterable collection) {\n");
+			buf.append("        for (int i = 0; i < collection.size(); i++) {\n");
+			buf.append("            String string = collection.get(i);\n");
+			buf.append("            \n");
+			buf.append("        }\n");
+			buf.append("    }\n");
+			buf.append("private class MyFirstOwnIterable<T, K> extends LinkedList<K>{}");
+			buf.append("private class MySecondOwnIterable extends MyFirstOwnIterable<Integer, String>{}");
+			buf.append("}\n");
+			expected[2]= buf.toString();
+
+			assertExpectedExistInProposals(proposals, expected);
+		} finally {
+			fJProject1.setOptions(saveOptions);
+		}
+	}
+	
+	public void testGenerateForGenerics() throws Exception {
+		IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
+		StringBuffer buf= new StringBuffer();
+		buf.append("package test1;\n");
+		buf.append("import java.util.Collection;\n");
+		buf.append("import java.util.Date;\n");
+		buf.append("public class E {\n");
+		buf.append("    void <T extends Date> foo(Collection<T> collection) {\n");
+		buf.append("        collection\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+		ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
+
+		Map saveOptions= fJProject1.getOptions(false);
+		Map newOptions= new HashMap(saveOptions);
+		newOptions.put(DefaultCodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE, "true");
+		try {
+			fJProject1.setOptions(newOptions);
+			String selection= "collection";
+			AssistContext context= getCorrectionContext(cu, buf.toString().lastIndexOf(selection) + selection.length(), 0);
+			List proposals= collectAssists(context, false);
+
+			assertNumberOfProposals(proposals, 2);
+			assertCorrectLabels(proposals);
+
+			String[] expected= new String[2];
+			buf= new StringBuffer();
+			buf.append("package test1;\n");
+			buf.append("import java.util.Collection;\n");
+			buf.append("import java.util.Date;\n");
+			buf.append("public class E {\n");
+			buf.append("    void <T extends Date> foo(Collection<T> collection) {\n");
+			buf.append("        for (T t : collection) {\n");
+			buf.append("            \n");
+			buf.append("        }\n");
+			buf.append("    }\n");
+			buf.append("}\n");
+			expected[0]= buf.toString();
+
+			buf= new StringBuffer();
+			buf.append("package test1;\n");
+			buf.append("import java.util.Collection;\n");
+			buf.append("import java.util.Date;\n");
+			buf.append("import java.util.Iterator;\n");
+			buf.append("public class E {\n");
+			buf.append("    void <T extends Date> foo(Collection<T> collection) {\n");
+			buf.append("        for (Iterator<T> iterator = collection.iterator(); iterator\n");
+			buf.append("                .hasNext();) {\n");
+			buf.append("            T t = iterator.next();\n");
+			buf.append("            \n");
+			buf.append("        }\n");
+			buf.append("    }\n");
+			buf.append("}\n");
+			expected[1]= buf.toString();
+
+			assertExpectedExistInProposals(proposals, expected);
+		} finally {
+			fJProject1.setOptions(saveOptions);
+		}
+	}
+	
+	public void testGenerateForComplexGenerics() throws Exception {
+		IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
+		StringBuffer buf= new StringBuffer();
+		buf.append("package test1;\n");
+		buf.append("import java.util.List;\n");
+		buf.append("public class E {\n");
+		buf.append("    void foo() {\n");
+		buf.append("        getIterable()\n");
+		buf.append("    }\n");
+		buf.append("    <T extends Iterable<? super Number> & Comparable<Number>> Iterable<T> getIterable() {\n");
+		buf.append("        return null;\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+		ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
+
+		Map saveOptions= fJProject1.getOptions(false);
+		Map newOptions= new HashMap(saveOptions);
+		newOptions.put(DefaultCodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE, "true");
+		try {
+			fJProject1.setOptions(newOptions);
+			String selection= "getIterable()";
+			AssistContext context= getCorrectionContext(cu, buf.toString().indexOf(selection) + selection.length(), 0);
+			List proposals= collectAssists(context, false);
+
+			assertNumberOfProposals(proposals, 6);
+			assertCorrectLabels(proposals);
+
+			String[] expected= new String[2];
+			buf= new StringBuffer();
+			buf.append("package test1;\n");
+			buf.append("import java.util.List;\n");
+			buf.append("public class E {\n");
+			buf.append("    void foo() {\n");
+			buf.append("        for (Iterable<? super Number> iterable : getIterable()) {\n");
+			buf.append("            \n");
+			buf.append("        }\n");
+			buf.append("    }\n");
+			buf.append("    <T extends Iterable<? super Number> & Comparable<Number>> Iterable<T> getIterable() {\n");
+			buf.append("        return null;\n");
+			buf.append("    }\n");
+			buf.append("}\n");
+			expected[0]= buf.toString();
+
+			buf= new StringBuffer();
+			buf.append("package test1;\n");
+			buf.append("import java.util.Iterator;\n");
+			buf.append("import java.util.List;\n");
+			buf.append("public class E {\n");
+			buf.append("    void foo() {\n");
+			buf.append("        for (Iterator<? extends Iterable<? super Number>> iterator = getIterable()\n");
+			buf.append("                .iterator(); iterator.hasNext();) {\n");
+			buf.append("            Iterable<? super Number> iterable = iterator.next();\n");
+			buf.append("            \n");
+			buf.append("        }\n");
+			buf.append("    }\n");
+			buf.append("    <T extends Iterable<? super Number> & Comparable<Number>> Iterable<T> getIterable() {\n");
+			buf.append("        return null;\n");
+			buf.append("    }\n");
+			buf.append("}\n");
+			expected[1]= buf.toString();
+
+			assertExpectedExistInProposals(proposals, expected);
+		} finally {
+			fJProject1.setOptions(saveOptions);
+		}
+	}
+	
+	public void testGenerateForUpperboundWildcard() throws Exception {
+		IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
+		StringBuffer buf= new StringBuffer();
+		buf.append("package test1;\n");
+		buf.append("import java.util.List;\n");
+		buf.append("import java.util.Date;\n");
+		buf.append("public class E {\n");
+		buf.append("    void foo(List<? extends Date> list) {\n");
+		buf.append("        list\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+		ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
+
+		Map saveOptions= fJProject1.getOptions(false);
+		Map newOptions= new HashMap(saveOptions);
+		newOptions.put(DefaultCodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE, "true");
+		try {
+			fJProject1.setOptions(newOptions);
+			String selection= "list";
+			AssistContext context= getCorrectionContext(cu, buf.toString().lastIndexOf(selection) + selection.length(), 0);
+			List proposals= collectAssists(context, false);
+
+			assertNumberOfProposals(proposals, 3);
+			assertCorrectLabels(proposals);
+
+			String[] expected= new String[3];
+			buf= new StringBuffer();
+			buf.append("package test1;\n");
+			buf.append("import java.util.List;\n");
+			buf.append("import java.util.Date;\n");
+			buf.append("public class E {\n");
+			buf.append("    void foo(List<? extends Date> list) {\n");
+			buf.append("        for (Date date : list) {\n");
+			buf.append("            \n");
+			buf.append("        }\n");
+			buf.append("    }\n");
+			buf.append("}\n");
+			expected[0]= buf.toString();
+
+			buf= new StringBuffer();
+			buf.append("package test1;\n");
+			buf.append("import java.util.Iterator;\n");
+			buf.append("import java.util.List;\n");
+			buf.append("import java.util.Date;\n");
+			buf.append("public class E {\n");
+			buf.append("    void foo(List<? extends Date> list) {\n");
+			buf.append("        for (Iterator<? extends Date> iterator = list.iterator(); iterator\n");
+			buf.append("                .hasNext();) {\n");
+			buf.append("            Date date = iterator.next();\n");
+			buf.append("            \n");
+			buf.append("        }\n");
+			buf.append("    }\n");
+			buf.append("}\n");
+			expected[1]= buf.toString();
+
+			buf= new StringBuffer();
+			buf.append("package test1;\n");
+			buf.append("import java.util.List;\n");
+			buf.append("import java.util.Date;\n");
+			buf.append("public class E {\n");
+			buf.append("    void foo(List<? extends Date> list) {\n");
+			buf.append("        for (int i = 0; i < list.size(); i++) {\n");
+			buf.append("            Date date = list.get(i);\n");
+			buf.append("            \n");
+			buf.append("        }\n");
+			buf.append("    }\n");
+			buf.append("}\n");
+			expected[2]= buf.toString();
+
+			assertExpectedExistInProposals(proposals, expected);
+		} finally {
+			fJProject1.setOptions(saveOptions);
+		}
+	}
+
+	public void testGenerateForLowerboundWildcard() throws Exception {
+		IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
+		StringBuffer buf= new StringBuffer();
+		buf.append("package test1;\n");
+		buf.append("import java.util.List;\n");
+		buf.append("import java.util.Date;\n");
+		buf.append("public class E {\n");
+		buf.append("    void foo(List<? super Date> list) {\n");
+		buf.append("        list\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+		ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
+
+		Map saveOptions= fJProject1.getOptions(false);
+		Map newOptions= new HashMap(saveOptions);
+		newOptions.put(DefaultCodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE, "true");
+		try {
+			fJProject1.setOptions(newOptions);
+			String selection= "list";
+			AssistContext context= getCorrectionContext(cu, buf.toString().lastIndexOf(selection) + selection.length(), 0);
+			List proposals= collectAssists(context, false);
+
+			assertNumberOfProposals(proposals, 3);
+			assertCorrectLabels(proposals);
+
+			String[] expected= new String[3];
+			buf= new StringBuffer();
+			buf.append("package test1;\n");
+			buf.append("import java.util.List;\n");
+			buf.append("import java.util.Date;\n");
+			buf.append("public class E {\n");
+			buf.append("    void foo(List<? super Date> list) {\n");
+			buf.append("        for (Object object : list) {\n");
+			buf.append("            \n");
+			buf.append("        }\n");
+			buf.append("    }\n");
+			buf.append("}\n");
+			expected[0]= buf.toString();
+
+			buf= new StringBuffer();
+			buf.append("package test1;\n");
+			buf.append("import java.util.Iterator;\n");
+			buf.append("import java.util.List;\n");
+			buf.append("import java.util.Date;\n");
+			buf.append("public class E {\n");
+			buf.append("    void foo(List<? super Date> list) {\n");
+			buf.append("        for (Iterator<? super Date> iterator = list.iterator(); iterator\n");
+			buf.append("                .hasNext();) {\n");
+			buf.append("            Object object = iterator.next();\n");
+			buf.append("            \n");
+			buf.append("        }\n");
+			buf.append("    }\n");
+			buf.append("}\n");
+			expected[1]= buf.toString();
+
+			buf= new StringBuffer();
+			buf.append("package test1;\n");
+			buf.append("import java.util.List;\n");
+			buf.append("import java.util.Date;\n");
+			buf.append("public class E {\n");
+			buf.append("    void foo(List<? super Date> list) {\n");
+			buf.append("        for (int i = 0; i < list.size(); i++) {\n");
+			buf.append("            Object object = list.get(i);\n");
+			buf.append("            \n");
+			buf.append("        }\n");
+			buf.append("    }\n");
+			buf.append("}\n");
+			expected[2]= buf.toString();
+
+			assertExpectedExistInProposals(proposals, expected);
+		} finally {
+			fJProject1.setOptions(saveOptions);
+		}
+	}
+
+	public void testGenerateForComplexInnerLowerboundWildcard() throws Exception {
+		IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
+		StringBuffer buf= new StringBuffer();
+		buf.append("package test1;\n");
+		buf.append("import java.util.List;\n");
+		buf.append("public class E {\n");
+		buf.append("    private abstract class Inner<T, K> implements Iterable<K>{}\n");
+		buf.append("    void foo() {\n");
+		buf.append("        getList()\n");
+		buf.append("    }\n");
+		buf.append("    Inner<? super List<Number>, ? super List<List<Number>>> getList() {\n");
+		buf.append("        return null;\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+		ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
+
+		Map saveOptions= fJProject1.getOptions(false);
+		Map newOptions= new HashMap(saveOptions);
+		newOptions.put(DefaultCodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE, "true");
+		try {
+			fJProject1.setOptions(newOptions);
+			String selection= "getList()";
+			AssistContext context= getCorrectionContext(cu, buf.toString().indexOf(selection) + selection.length(), 0);
+			List proposals= collectAssists(context, false);
+
+			assertNumberOfProposals(proposals, 6);
+			assertCorrectLabels(proposals);
+
+			String[] expected= new String[2];
+			buf= new StringBuffer();
+			buf.append("package test1;\n");
+			buf.append("import java.util.List;\n");
+			buf.append("public class E {\n");
+			buf.append("    private abstract class Inner<T, K> implements Iterable<K>{}\n");
+			buf.append("    void foo() {\n");
+			buf.append("        for (Object object : getList()) {\n");
+			buf.append("            \n");
+			buf.append("        }\n");
+			buf.append("    }\n");
+			buf.append("    Inner<? super List<Number>, ? super List<List<Number>>> getList() {\n");
+			buf.append("        return null;\n");
+			buf.append("    }\n");
+			buf.append("}\n");
+			expected[0]= buf.toString();
+
+			buf= new StringBuffer();
+			buf.append("package test1;\n");
+			buf.append("import java.util.Iterator;\n");
+			buf.append("import java.util.List;\n");
+			buf.append("public class E {\n");
+			buf.append("    private abstract class Inner<T, K> implements Iterable<K>{}\n");
+			buf.append("    void foo() {\n");
+			buf.append("        for (Iterator<? super List<List<Number>>> iterator = getList()\n");
+			buf.append("                .iterator(); iterator.hasNext();) {\n");
+			buf.append("            Object object = iterator.next();\n");
+			buf.append("            \n");
+			buf.append("        }\n");
+			buf.append("    }\n");
+			buf.append("    Inner<? super List<Number>, ? super List<List<Number>>> getList() {\n");
+			buf.append("        return null;\n");
+			buf.append("    }\n");
+			buf.append("}\n");
+			expected[1]= buf.toString();
+
+			assertExpectedExistInProposals(proposals, expected);
+		} finally {
+			fJProject1.setOptions(saveOptions);
+		}
+	}
+
+	public void testGenerateForMissingParametrization() throws Exception {
+		IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
+		StringBuffer buf= new StringBuffer();
+		buf.append("package test1;\n");
+		buf.append("import java.util.Collection;\n");
+		buf.append("public class E {\n");
+		buf.append("    void foo(Collection collection) {\n");
+		buf.append("        collection\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+		ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
+
+		Map saveOptions= fJProject1.getOptions(false);
+		Map newOptions= new HashMap(saveOptions);
+		newOptions.put(DefaultCodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE, "true");
+		try {
+			fJProject1.setOptions(newOptions);
+			String selection= "collection";
+			AssistContext context= getCorrectionContext(cu, buf.toString().lastIndexOf(selection) + selection.length(), 0);
+			List proposals= collectAssists(context, false);
+
+			assertNumberOfProposals(proposals, 2);
+			assertCorrectLabels(proposals);
+
+			String[] expected= new String[2];
+			buf= new StringBuffer();
+			buf.append("package test1;\n");
+			buf.append("import java.util.Collection;\n");
+			buf.append("public class E {\n");
+			buf.append("    void foo(Collection collection) {\n");
+			buf.append("        for (Object object : collection) {\n");
+			buf.append("            \n");
+			buf.append("        }\n");
+			buf.append("    }\n");
+			buf.append("}\n");
+			expected[0]= buf.toString();
+
+			buf= new StringBuffer();
+			buf.append("package test1;\n");
+			buf.append("import java.util.Collection;\n");
+			buf.append("import java.util.Iterator;\n");
+			buf.append("public class E {\n");
+			buf.append("    void foo(Collection collection) {\n");
+			buf.append("        for (Iterator iterator = collection.iterator(); iterator\n");
+			buf.append("                .hasNext();) {\n");
+			buf.append("            Object object = iterator.next();\n");
+			buf.append("            \n");
+			buf.append("        }\n");
+			buf.append("    }\n");
+			buf.append("}\n");
+			expected[1]= buf.toString();
+
+			assertExpectedExistInProposals(proposals, expected);
+		} finally {
+			fJProject1.setOptions(saveOptions);
+		}
+	}
+
+	public void testGenerateForLowVersion() throws Exception {
+		IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
+		StringBuffer buf= new StringBuffer();
+		buf.append("package test1;\n");
+		buf.append("import java.util.Collection;\n");
+		buf.append("public class E {\n");
+		buf.append("    void foo(Collection collection) {\n");
+		buf.append("        collection\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+		ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
+
+		Map saveOptions= fJProject1.getOptions(false);
+		Map newOptions= new HashMap();
+		JavaCore.setComplianceOptions(JavaCore.VERSION_1_4, newOptions);
+		newOptions.put(DefaultCodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE, "true");
+		try {
+			fJProject1.setOptions(newOptions);
+
+			String selection= "collection";
+			AssistContext context= getCorrectionContext(cu, buf.toString().lastIndexOf(selection) + selection.length(), 0);
+			List proposals= collectAssists(context, false);
+
+			assertNumberOfProposals(proposals, 1);
+			assertProposalDoesNotExist(proposals, CorrectionMessages.QuickAssistProcessor_generate_enhanced_for_loop);
+			assertCorrectLabels(proposals);
+
+			String[] expected= new String[1];
+
+			// no generics should be added to iterator since the version is too low
+			buf= new StringBuffer();
+			buf.append("package test1;\n");
+			buf.append("import java.util.Collection;\n");
+			buf.append("import java.util.Iterator;\n");
+			buf.append("public class E {\n");
+			buf.append("    void foo(Collection collection) {\n");
+			buf.append("        for (Iterator iterator = collection.iterator(); iterator\n");
+			buf.append("                .hasNext();) {\n");
+			buf.append("            Object object = iterator.next();\n");
+			buf.append("            \n");
+			buf.append("        }\n");
+			buf.append("    }\n");
+			buf.append("}\n");
+			expected[0]= buf.toString();
+
+			assertExpectedExistInProposals(proposals, expected);
+		} finally {
+			fJProject1.setOptions(saveOptions);
+		}
+	}
+
+	public void testGenerateForArray() throws Exception {
+		IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
+		StringBuffer buf= new StringBuffer();
+		buf.append("package test1;\n");
+		buf.append("public class E {\n");
+		buf.append("    void foo(String[] array) {\n");
+		buf.append("        array\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+		ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
+
+		Map saveOptions= fJProject1.getOptions(false);
+		Map newOptions= new HashMap(saveOptions);
+		newOptions.put(DefaultCodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE, "true");
+		try {
+			fJProject1.setOptions(newOptions);
+			String selection= "array";
+			AssistContext context= getCorrectionContext(cu, buf.toString().lastIndexOf(selection) + selection.length(), 0);
+			List proposals= collectAssists(context, false);
+	
+			assertNumberOfProposals(proposals, 2);
+			assertCorrectLabels(proposals);
+	
+			String[] expected= new String[2];
+			buf= new StringBuffer();
+			buf.append("package test1;\n");
+			buf.append("public class E {\n");
+			buf.append("    void foo(String[] array) {\n");
+			buf.append("        for (int i = 0; i < array.length; i++) {\n");
+			buf.append("            String string = array[i];\n");
+			buf.append("            \n");
+			buf.append("        }\n");
+			buf.append("    }\n");
+			buf.append("}\n");
+			expected[0]= buf.toString();
+	
+			buf= new StringBuffer();
+			buf.append("package test1;\n");
+			buf.append("public class E {\n");
+			buf.append("    void foo(String[] array) {\n");
+			buf.append("        for (String string : array) {\n");
+			buf.append("            \n");
+			buf.append("        }\n");
+			buf.append("    }\n");
+			buf.append("}\n");
+			expected[1]= buf.toString();
+	
+			assertExpectedExistInProposals(proposals, expected);
+		} finally {
+			fJProject1.setOptions(saveOptions);
+		}
+	}
+	
+	public void testGenerateForNameClash() throws Exception {
+		IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
+		StringBuffer buf= new StringBuffer();
+		buf.append("package test1;\n");
+		buf.append("public class E {\n");
+		buf.append("    private int[] nums;\n");
+		buf.append("    void foo() {\n");
+		buf.append("        nums\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+		ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
+	
+		Map saveOptions= fJProject1.getOptions(false);
+		Map newOptions= new HashMap(saveOptions);
+		newOptions.put(DefaultCodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE, "true");
+		try {
+			fJProject1.setOptions(newOptions);
+			String selection= "nums";
+			AssistContext context= getCorrectionContext(cu, buf.toString().lastIndexOf(selection) + selection.length(), 0);
+			List proposals= collectAssists(context, false);
+	
+			assertNumberOfProposals(proposals, 2);
+			assertCorrectLabels(proposals);
+	
+			String[] expected= new String[2];
+			buf= new StringBuffer();
+			buf.append("package test1;\n");
+			buf.append("public class E {\n");
+			buf.append("    private int[] nums;\n");
+			buf.append("    void foo() {\n");
+			buf.append("        for (int i = 0; i < nums.length; i++) {\n");
+			buf.append("            int j = nums[i];\n");
+			buf.append("            \n");
+			buf.append("        }\n");
+			buf.append("    }\n");
+			buf.append("}\n");
+			expected[0]= buf.toString();
+	
+			buf= new StringBuffer();
+			buf.append("package test1;\n");
+			buf.append("public class E {\n");
+			buf.append("    private int[] nums;\n");
+			buf.append("    void foo() {\n");
+			buf.append("        for (int i : nums) {\n");
+			buf.append("            \n");
+			buf.append("        }\n");
+			buf.append("    }\n");
+			buf.append("}\n");
+			expected[1]= buf.toString();
+	
+			assertExpectedExistInProposals(proposals, expected);
+		} finally {
+			fJProject1.setOptions(saveOptions);
+		}
+	}
+
+	public void testGenerateForImportsAndFormat1() throws Exception {
+		IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
+		StringBuffer buf= new StringBuffer();
+		buf.append("package test1;\n");
+		buf.append("public class A {\n");
+		buf.append("    class Iterator {}\n");	
+		buf.append("    void foo() {\n");
+		buf.append("        B.get( /*important: empty*/ );\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+
+		StringBuffer buf2= new StringBuffer();
+		buf2.append("package test1;\n");
+		buf2.append("import java.util.ArrayList;\n");
+		buf2.append("import java.util.Date;\n");
+		buf2.append("import java.util.Set;\n");
+		buf2.append("public class B {\n");
+		buf2.append("    static ArrayList<Date> get() {\n");
+		buf2.append("        return new ArrayList<Date>();\n");
+		buf2.append("    }\n");
+		buf2.append("    static Set raw(int i) {\n");
+		buf2.append("        return java.util.Collections.emptySet();\n");
+		buf2.append("    }\n");
+		buf2.append("}");
+		
+		ICompilationUnit cu= pack1.createCompilationUnit("A.java", buf.toString(), false, null);
+		pack1.createCompilationUnit("B.java", buf2.toString(), false, null);
+
+		Map saveOptions= fJProject1.getOptions(false);
+		Map newOptions= new HashMap();
+		JavaCore.setComplianceOptions(JavaCore.VERSION_1_5, newOptions);
+		newOptions.put(DefaultCodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE, "true");
+		try {
+			fJProject1.setOptions(newOptions);
+		
+			String selection= "B.get( /*important: empty*/ );";
+			AssistContext context= getCorrectionContext(cu, buf.toString().lastIndexOf(selection) + selection.length(), 0);
+			List proposals= collectAssists(context, false);
+	
+			assertNumberOfProposals(proposals, 5);
+			assertCorrectLabels(proposals);
+	
+			String[] expected= new String[3];
+			buf= new StringBuffer();
+			buf.append("package test1;\n");
+			buf.append("\n");
+			buf.append("import java.util.Date;\n");
+			buf.append("\n");
+			buf.append("public class A {\n");
+			buf.append("    class Iterator {}\n");	
+			buf.append("    void foo() {\n");
+			buf.append("        for (Date date : B.get( /*important: empty*/ )) {\n");
+			buf.append("            \n");
+			buf.append("        }\n");
+			buf.append("    }\n");
+			buf.append("}\n");
+			expected[0]= buf.toString();
+	
+			buf= new StringBuffer();
+			buf.append("package test1;\n");
+			buf.append("\n");
+			buf.append("import java.util.Date;\n");
+			buf.append("\n");
+			buf.append("public class A {\n");
+			buf.append("    class Iterator {}\n");	
+			buf.append("    void foo() {\n");
+			buf.append("        for (java.util.Iterator<Date> iterator = B.get( /*important: empty*/ ).iterator(); iterator\n");
+			buf.append("                .hasNext();) {\n");
+			buf.append("            Date date = iterator.next();\n");
+			buf.append("            \n");
+			buf.append("        }\n");
+			buf.append("    }\n");
+			buf.append("}\n");
+			expected[1]= buf.toString();
+			
+			buf= new StringBuffer();
+			buf.append("package test1;\n");
+			buf.append("\n");
+			buf.append("import java.util.Date;\n");
+			buf.append("\n");
+			buf.append("public class A {\n");
+			buf.append("    class Iterator {}\n");	
+			buf.append("    void foo() {\n");
+			buf.append("        for (int i = 0; i < B.get( /*important: empty*/ ).size(); i++) {\n");
+			buf.append("            Date date = B.get( /*important: empty*/ ).get(i);\n");
+			buf.append("            \n");
+			buf.append("        }\n");
+			buf.append("    }\n");
+			buf.append("}\n");
+			expected[2]= buf.toString();
+	
+			assertExpectedExistInProposals(proposals, expected);
+		} finally {
+			fJProject1.setOptions(saveOptions);
+		}
+	}
+	
+	public void testGenerateForImportsAndFormat2() throws Exception {
+		IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
+		StringBuffer buf= new StringBuffer();
+		buf.append("package test1;\n");
+		buf.append("public class A {\n");
+		buf.append("    class Object {}\n");
+		buf.append("    class Iterator {}\n");	
+		buf.append("    void foo() {\n");
+		buf.append("        B.raw(1+ 2);\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+
+		StringBuffer buf2= new StringBuffer();
+		buf2.append("package test1;\n");
+		buf2.append("import java.util.ArrayList;\n");
+		buf2.append("import java.util.Date;\n");
+		buf2.append("import java.util.Set;\n");
+		buf2.append("public class B {\n");
+		buf2.append("    static ArrayList<Date> get() {\n");
+		buf2.append("        return new ArrayList<Date>();\n");
+		buf2.append("    }\n");
+		buf2.append("    static Set raw(int i) {\n");
+		buf2.append("        return java.util.Collections.emptySet();\n");
+		buf2.append("    }\n");
+		buf2.append("}");
+		
+		ICompilationUnit cu= pack1.createCompilationUnit("A.java", buf.toString(), false, null);
+		pack1.createCompilationUnit("B.java", buf2.toString(), false, null);
+
+		Map saveOptions= fJProject1.getOptions(false);
+		Map newOptions= new HashMap();
+		JavaCore.setComplianceOptions(JavaCore.VERSION_1_5, newOptions);
+		newOptions.put(DefaultCodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE, "true");
+		try {
+			fJProject1.setOptions(newOptions);
+		
+			String selection= "B.raw(1+ 2);";
+			AssistContext context= getCorrectionContext(cu, buf.toString().lastIndexOf(selection) + selection.length(), 0);
+			List proposals= collectAssists(context, false);
+	
+			assertNumberOfProposals(proposals, 4);
+			assertCorrectLabels(proposals);
+	
+			String[] expected= new String[2];
+			buf= new StringBuffer();
+			buf.append("package test1;\n");
+			buf.append("public class A {\n");
+			buf.append("    class Object {}\n");	
+			buf.append("    class Iterator {}\n");	
+			buf.append("    void foo() {\n");
+			buf.append("        for (java.lang.Object object : B.raw(1+ 2)) {\n");
+			buf.append("            \n");
+			buf.append("        }\n");
+			buf.append("    }\n");
+			buf.append("}\n");
+			expected[0]= buf.toString();
+	
+			buf= new StringBuffer();
+			buf.append("package test1;\n");
+			buf.append("public class A {\n");
+			buf.append("    class Object {}\n");
+			buf.append("    class Iterator {}\n");	
+			buf.append("    void foo() {\n");
+			buf.append("        for (java.util.Iterator iterator = B.raw(1+ 2).iterator(); iterator\n");
+			buf.append("                .hasNext();) {\n");
+			buf.append("            java.lang.Object object = iterator.next();\n");
+			buf.append("            \n");
+			buf.append("        }\n");
+			buf.append("    }\n");
+			buf.append("}\n");
+			expected[1]= buf.toString();
+	
+			assertExpectedExistInProposals(proposals, expected);
+		} finally {
+			fJProject1.setOptions(saveOptions);
+		}
+	}
+	
+	public void testGenerateForImportsArray() throws Exception {
+		IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
+		StringBuffer buf= new StringBuffer();
+		buf.append("package test1;\n");
+		buf.append("public class A {\n");
+		buf.append("    class Date {}\n");	
+		buf.append("    void foo() {\n");
+		buf.append("        B.get();\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+
+		StringBuffer buf2= new StringBuffer();
+		buf2.append("package test1;\n");
+		buf2.append("import java.util.Date;\n");
+		buf2.append("public class B {\n");
+		buf2.append("    static Date[] get() {\n");
+		buf2.append("        return new Date[1];\n");
+		buf2.append("    }\n");
+		buf2.append("}");
+		
+		ICompilationUnit cu= pack1.createCompilationUnit("A.java", buf.toString(), false, null);
+		pack1.createCompilationUnit("B.java", buf2.toString(), false, null);
+
+		Map saveOptions= fJProject1.getOptions(false);
+		Map newOptions= new HashMap();
+		JavaCore.setComplianceOptions(JavaCore.VERSION_1_5, newOptions);
+		newOptions.put(DefaultCodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE, "true");
+		try {
+			fJProject1.setOptions(newOptions);
+		
+			String selection= "B.get();";
+			AssistContext context= getCorrectionContext(cu, buf.toString().lastIndexOf(selection) + selection.length(), 0);
+			List proposals= collectAssists(context, false);
+	
+			assertNumberOfProposals(proposals, 4);
+			assertCorrectLabels(proposals);
+	
+			String[] expected= new String[1];
+			buf= new StringBuffer();
+			buf.append("package test1;\n");
+			buf.append("public class A {\n");
+			buf.append("    class Date {}\n");
+			buf.append("    void foo() {\n");
+			buf.append("        for (java.util.Date date : B.get()) {\n");
+			buf.append("            \n");
+			buf.append("        }\n");
+			buf.append("    }\n");
+			buf.append("}\n");
+			expected[0]= buf.toString();
+	
+			assertExpectedExistInProposals(proposals, expected);
+		} finally {
+			fJProject1.setOptions(saveOptions);
+		}
+	}
+	
 }
diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/ConvertIterableLoopQuickFixTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/ConvertIterableLoopQuickFixTest.java
index 9ce7ef8..a067584 100644
--- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/ConvertIterableLoopQuickFixTest.java
+++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/ConvertIterableLoopQuickFixTest.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2011 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 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
@@ -915,6 +915,72 @@
 		assertEqualString(preview, expected);
 	}
 
+	public void testWrongIteratorMethod_bug411588() throws Exception {
+		IPackageFragment pack= fSourceFolder.createPackageFragment("test1", false, null);
+		StringBuffer buf= new StringBuffer();
+		buf.append("package p;\n");
+		buf.append("import java.util.Iterator;\n");
+		buf.append("\n");
+		buf.append("public class TestSaveActionConvertToEnhancedForLoop {\n");
+		buf.append("    static class Something implements Iterable<Object>{\n");
+		buf.append("        @Override\n");
+		buf.append("        public Iterator<Object> iterator() {\n");
+		buf.append("            return null;\n");
+		buf.append("        }\n");
+		buf.append("        \n");
+		buf.append("        public Iterator<Object> iterator(int filter) {\n");
+		buf.append("            return null;\n");
+		buf.append("        }\n");
+		buf.append("    }\n");
+		buf.append("    \n");
+		buf.append("    public static void main(String[] args) {          \n");
+		buf.append("        Something s = new Something();\n");
+		buf.append("        for (Iterator<Object> it = s.iterator(42) ; it.hasNext(); ) {\n");
+		buf.append("             Object obj = it.next();\n");
+		buf.append("        }\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+
+		ICompilationUnit unit= pack.createCompilationUnit("TestSaveActionConvertToEnhancedForLoop.java", buf.toString(), false, null);
+
+		List proposals= fetchConvertingProposal(buf, unit);
+
+		assertTrue(fConvertLoopProposal.getFixStatus() != null && fConvertLoopProposal.getFixStatus().getCode() == IStatus.WARNING);
+
+		assertCorrectLabels(proposals);
+
+		assertNotNull(fConvertLoopProposal.getStatusMessage());
+
+		String preview= getPreviewContent(fConvertLoopProposal);
+
+		buf= new StringBuffer();
+		buf.append("package p;\n");
+		buf.append("import java.util.Iterator;\n");
+		buf.append("\n");
+		buf.append("public class TestSaveActionConvertToEnhancedForLoop {\n");
+		buf.append("    static class Something implements Iterable<Object>{\n");
+		buf.append("        @Override\n");
+		buf.append("        public Iterator<Object> iterator() {\n");
+		buf.append("            return null;\n");
+		buf.append("        }\n");
+		buf.append("        \n");
+		buf.append("        public Iterator<Object> iterator(int filter) {\n");
+		buf.append("            return null;\n");
+		buf.append("        }\n");
+		buf.append("    }\n");
+		buf.append("    \n");
+		buf.append("    public static void main(String[] args) {          \n");
+		buf.append("        Something s = new Something();\n");
+		buf.append("        for (Object obj : s) {\n");
+		buf.append("        }\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+
+		String expected= buf.toString();
+		assertEqualString(preview, expected);
+
+	}
+
 	public void testCorrectIteratorMethod() throws Exception {
 		IPackageFragment pack= fSourceFolder.createPackageFragment("test1", false, null);
 		StringBuffer buf= new StringBuffer();
diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/LocalCorrectionsQuickFixTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/LocalCorrectionsQuickFixTest.java
index 1297e88..aa3176a 100644
--- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/LocalCorrectionsQuickFixTest.java
+++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/LocalCorrectionsQuickFixTest.java
@@ -8,11 +8,15 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Benjamin Muskalla <bmuskalla@innoopract.com> - [quick fix] Shouldn't offer "Add throws declaration" quickfix for overriding signature if result would conflict with overridden signature
+ *     Lukas Hanke <hanke@yatta.de> - Bug 241696 [quick fix] quickfix to iterate over a collection - https://bugs.eclipse.org/bugs/show_bug.cgi?id=241696
  *******************************************************************************/
 package org.eclipse.jdt.ui.tests.quickfix;
 
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
 
 import junit.framework.Test;
 import junit.framework.TestSuite;
@@ -39,6 +43,7 @@
 
 import org.eclipse.jdt.internal.ui.JavaPlugin;
 import org.eclipse.jdt.internal.ui.text.correction.AssistContext;
+import org.eclipse.jdt.internal.ui.text.correction.CorrectionMessages;
 import org.eclipse.jdt.internal.ui.text.correction.proposals.LinkedNamesAssistProposal;
 
 public class LocalCorrectionsQuickFixTest extends QuickFixTest {
@@ -4556,8 +4561,6 @@
 		assertExpectedExistInProposals(proposals, expected);
 	}
 
-
-
 	public void testUnusedVariableBug120579() throws Exception {
 		Hashtable hashtable= JavaCore.getOptions();
 		hashtable.put(JavaCore.COMPILER_PB_UNUSED_LOCAL, JavaCore.ERROR);
@@ -4581,6 +4584,216 @@
 		assertCorrectLabels(proposals);
 	}
 
+
+	public void testUnusedVariableWithSideEffectAssignments() throws Exception {
+		// https://bugs.eclipse.org/421717
+		Hashtable hashtable= JavaCore.getOptions();
+		hashtable.put(JavaCore.COMPILER_PB_UNUSED_LOCAL, JavaCore.ERROR);
+		JavaCore.setOptions(hashtable);
+		
+		IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null);
+		StringBuffer buf= new StringBuffer();
+		buf.append("package pack;\n");
+		buf.append("\n");
+		buf.append("public class E {\n");
+		buf.append("    void foo() {\n");
+		buf.append("        int h= super.hashCode();\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+		ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
+		
+		CompilationUnit astRoot= getASTRoot(cu);
+		ArrayList proposals= collectCorrections(cu, astRoot);
+		
+		assertCorrectLabels(proposals);
+		assertNumberOfProposals(proposals, 2);
+		
+		String[] expected= new String[2];
+		buf= new StringBuffer();
+		buf.append("package pack;\n");
+		buf.append("\n");
+		buf.append("public class E {\n");
+		buf.append("    void foo() {\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+		expected[0]= buf.toString();
+		
+		buf= new StringBuffer();
+		buf.append("package pack;\n");
+		buf.append("\n");
+		buf.append("public class E {\n");
+		buf.append("    void foo() {\n");
+		buf.append("        super.hashCode();\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+		expected[1]= buf.toString();
+		
+		assertExpectedExistInProposals(proposals, expected);
+	}
+	
+	public void testUnusedVariableWithSideEffectAssignments2() throws Exception {
+		// https://bugs.eclipse.org/421717
+		Hashtable hashtable= JavaCore.getOptions();
+		hashtable.put(JavaCore.COMPILER_PB_UNUSED_LOCAL, JavaCore.ERROR);
+		JavaCore.setOptions(hashtable);
+	
+		IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null);
+		StringBuffer buf= new StringBuffer();
+		buf.append("package pack;\n");
+		buf.append("\n");
+		buf.append("public class E {\n");
+		buf.append("    void foo(int a) {\n");
+		buf.append("        int f= 1 + a-- + (int) Math.ceil(a);\n");
+		buf.append("        f= -a;\n");
+		buf.append("        f= ~a;\n");
+		buf.append("        f= a++;\n");
+		buf.append("        f= Math.abs(a);\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+		ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
+	
+		CompilationUnit astRoot= getASTRoot(cu);
+		ArrayList proposals= collectCorrections(cu, astRoot);
+	
+		assertCorrectLabels(proposals);
+		assertNumberOfProposals(proposals, 2);
+	
+		String[] expected= new String[2];
+		buf= new StringBuffer();
+		buf.append("package pack;\n");
+		buf.append("\n");
+		buf.append("public class E {\n");
+		buf.append("    void foo(int a) {\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+		expected[0]= buf.toString();
+	
+		buf= new StringBuffer();
+		buf.append("package pack;\n");
+		buf.append("\n");
+		buf.append("public class E {\n");
+		buf.append("    void foo(int a) {\n");
+		buf.append("        a--;\n");
+		buf.append("        Math.ceil(a);\n");
+		buf.append("        a++;\n");
+		buf.append("        Math.abs(a);\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+		expected[1]= buf.toString();
+	
+		assertExpectedExistInProposals(proposals, expected);
+	}
+
+	public void testUnusedVariableWithSideEffectAssignments3() throws Exception {
+		// https://bugs.eclipse.org/421717
+		Hashtable hashtable= JavaCore.getOptions();
+		hashtable.put(JavaCore.COMPILER_PB_UNUSED_LOCAL, JavaCore.ERROR);
+		JavaCore.setOptions(hashtable);
+	
+		IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null);
+		StringBuffer buf= new StringBuffer();
+		buf.append("package pack;\n");
+		buf.append("\n");
+		buf.append("public class E {\n");
+		buf.append("    int f;\n");
+		buf.append("    void foo() {\n");
+		buf.append("        int a = 1, b= f++ - --f, c= a;\n");
+		buf.append("        System.out.println(a);\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+		ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
+	
+		CompilationUnit astRoot= getASTRoot(cu);
+		ArrayList proposals= collectCorrections(cu, astRoot, 2);
+	
+		assertCorrectLabels(proposals);
+		assertNumberOfProposals(proposals, 2);
+	
+		String[] expected= new String[2];
+		buf= new StringBuffer();
+		buf.append("package pack;\n");
+		buf.append("\n");
+		buf.append("public class E {\n");
+		buf.append("    int f;\n");
+		buf.append("    void foo() {\n");
+		buf.append("        int a = 1, c= a;\n");
+		buf.append("        System.out.println(a);\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+		expected[0]= buf.toString();
+	
+		buf= new StringBuffer();
+		buf.append("package pack;\n");
+		buf.append("\n");
+		buf.append("public class E {\n");
+		buf.append("    int f;\n");
+		buf.append("    void foo() {\n");
+		buf.append("        int a = 1;\n");
+		buf.append("        f++;\n");
+		buf.append("        --f;\n");
+		buf.append("        int c= a;\n");
+		buf.append("        System.out.println(a);\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+		expected[1]= buf.toString();
+	
+		assertExpectedExistInProposals(proposals, expected);
+	}
+
+	public void testUnusedVariableWithSideEffectAssignments4() throws Exception {
+		// https://bugs.eclipse.org/421717
+		Hashtable hashtable= JavaCore.getOptions();
+		hashtable.put(JavaCore.COMPILER_PB_UNUSED_LOCAL, JavaCore.ERROR);
+		JavaCore.setOptions(hashtable);
+	
+		IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null);
+		StringBuffer buf= new StringBuffer();
+		buf.append("package pack;\n");
+		buf.append("\n");
+		buf.append("public class E {\n");
+		buf.append("    int f;\n");
+		buf.append("    void foo() {\n");
+		buf.append("        int a = 1, b = \"\".hashCode() + 1;\n");
+		buf.append("        System.out.println(a);\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+		ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
+	
+		CompilationUnit astRoot= getASTRoot(cu);
+		ArrayList proposals= collectCorrections(cu, astRoot);
+	
+		assertCorrectLabels(proposals);
+		assertNumberOfProposals(proposals, 2);
+	
+		String[] expected= new String[2];
+		buf= new StringBuffer();
+		buf.append("package pack;\n");
+		buf.append("\n");
+		buf.append("public class E {\n");
+		buf.append("    int f;\n");
+		buf.append("    void foo() {\n");
+		buf.append("        int a = 1;\n");
+		buf.append("        System.out.println(a);\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+		expected[0]= buf.toString();
+	
+		buf= new StringBuffer();
+		buf.append("package pack;\n");
+		buf.append("\n");
+		buf.append("public class E {\n");
+		buf.append("    int f;\n");
+		buf.append("    void foo() {\n");
+		buf.append("        int a = 1;\n");
+		buf.append("        \"\".hashCode();\n");
+		buf.append("        System.out.println(a);\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+		expected[1]= buf.toString();
+	
+		assertExpectedExistInProposals(proposals, expected);
+	}
+
 	public void testUnusedParam() throws Exception {
 		Hashtable hashtable= JavaCore.getOptions();
 		hashtable.put(JavaCore.COMPILER_PB_UNUSED_LOCAL, JavaCore.ERROR);
@@ -9532,5 +9745,182 @@
 
 		assertExpectedExistInProposals(proposals, expected);
 	}
+	
+	/**
+	 * Tests if the quick fix to loop over a variable name is added correctly. The complete
+	 * functionality of the for loop generation is tested in {@link AssistQuickFixTest}
+	 * 
+	 * @throws Exception
+	 */
+	public void testLoopOverAddedToFixesForVariable() throws Exception {
+		IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
+		StringBuffer buf= new StringBuffer();
+		buf.append("package test1;\n");
+		buf.append("import java.util.Collection;\n");
+		buf.append("public class E {\n");
+		buf.append("    void foo(Collection<String> collection) {\n");
+		buf.append("        collection\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+		ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
 
+		Map saveOptions= fJProject1.getOptions(false);
+		Map newOptions= new HashMap(saveOptions);
+		newOptions.put(DefaultCodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE, "true");
+		try {
+			fJProject1.setOptions(newOptions);
+			List proposals= collectCorrections(cu, getASTRoot(cu), 2, null);
+
+			assertNumberOfProposals(proposals, 2);
+			assertCorrectLabels(proposals);
+
+			String[] expected= new String[2];
+			buf= new StringBuffer();
+			buf.append("package test1;\n");
+			buf.append("import java.util.Collection;\n");
+			buf.append("public class E {\n");
+			buf.append("    void foo(Collection<String> collection) {\n");
+			buf.append("        for (String string : collection) {\n");
+			buf.append("            \n");
+			buf.append("        }\n");
+			buf.append("    }\n");
+			buf.append("}\n");
+			expected[0]= buf.toString();
+
+			buf= new StringBuffer();
+			buf.append("package test1;\n");
+			buf.append("import java.util.Collection;\n");
+			buf.append("import java.util.Iterator;\n");
+			buf.append("public class E {\n");
+			buf.append("    void foo(Collection<String> collection) {\n");
+			buf.append("        for (Iterator<String> iterator = collection.iterator(); iterator\n");
+			buf.append("                .hasNext();) {\n");
+			buf.append("            String string = iterator.next();\n");
+			buf.append("            \n");
+			buf.append("        }\n");
+			buf.append("    }\n");
+			buf.append("}\n");
+			expected[1]= buf.toString();
+
+			assertExpectedExistInProposals(proposals, expected);
+		} finally {
+			fJProject1.setOptions(saveOptions);
+		}
+	}
+
+	/**
+	 * Tests if the quick fix to loop over a method invocation is added correctly. The complete
+	 * functionality of the for loop generation is tested in {@link AssistQuickFixTest}
+	 * 
+	 * @throws Exception
+	 */
+	public void testLoopOverAddedToFixesForMethodInvocation() throws Exception {
+		IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
+		StringBuffer buf= new StringBuffer();
+		buf.append("package test1;\n");
+		buf.append("import java.util.Map;\n");
+		buf.append("public class E {\n");
+		buf.append("    void foo(Map<String, String> map) {\n");
+		buf.append("        map.keySet()\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+		ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
+
+		Map saveOptions= fJProject1.getOptions(false);
+		Map newOptions= new HashMap(saveOptions);
+		newOptions.put(DefaultCodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE, "true");
+		try {
+			fJProject1.setOptions(newOptions);
+			List proposals= collectCorrections(cu, getASTRoot(cu));
+
+			assertNumberOfProposals(proposals, 2);
+			assertCorrectLabels(proposals);
+
+			String[] expected= new String[2];
+			buf= new StringBuffer();
+			buf.append("package test1;\n");
+			buf.append("import java.util.Map;\n");
+			buf.append("public class E {\n");
+			buf.append("    void foo(Map<String, String> map) {\n");
+			buf.append("        for (String string : map.keySet()) {\n");
+			buf.append("            \n");
+			buf.append("        }\n");
+			buf.append("    }\n");
+			buf.append("}\n");
+			expected[0]= buf.toString();
+
+			buf= new StringBuffer();
+			buf.append("package test1;\n");
+			buf.append("import java.util.Iterator;\n");
+			buf.append("import java.util.Map;\n");
+			buf.append("public class E {\n");
+			buf.append("    void foo(Map<String, String> map) {\n");
+			buf.append("        for (Iterator<String> iterator = map.keySet().iterator(); iterator\n");
+			buf.append("                .hasNext();) {\n");
+			buf.append("            String string = iterator.next();\n");
+			buf.append("            \n");
+			buf.append("        }\n");
+			buf.append("    }\n");
+			buf.append("}\n");
+			expected[1]= buf.toString();
+
+			assertExpectedExistInProposals(proposals, expected);
+		} finally {
+			fJProject1.setOptions(saveOptions);
+		}
+	}
+
+	/**
+	 * Tests if the quick fix to loop over a method invocation is added correctly. The complete
+	 * functionality of the for loop generation is tested in {@link AssistQuickFixTest}
+	 * 
+	 * @throws Exception
+	 */
+	public void testGenerateForeachNotAddedForLowVersion() throws Exception {
+		IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
+		StringBuffer buf= new StringBuffer();
+		buf.append("package test1;\n");
+		buf.append("import java.util.Collection;\n");
+		buf.append("public class E {\n");
+		buf.append("    void foo(Collection collection) {\n");
+		buf.append("        collection\n");
+		buf.append("    }\n");
+		buf.append("}\n");
+		ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
+
+		Map saveOptions= fJProject1.getOptions(false);
+		Map newOptions= new HashMap();
+		JavaCore.setComplianceOptions(JavaCore.VERSION_1_4, newOptions);
+		newOptions.put(DefaultCodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE, "true");
+		try {
+			fJProject1.setOptions(newOptions);
+			List proposals= collectCorrections(cu, getASTRoot(cu), 2, null);
+
+			assertNumberOfProposals(proposals, 1);
+			assertCorrectLabels(proposals);
+			assertProposalDoesNotExist(proposals, CorrectionMessages.QuickAssistProcessor_generate_enhanced_for_loop);
+
+			String[] expected= new String[1];
+
+			// no generics should be added to iterator since the version is too low
+			buf= new StringBuffer();
+			buf.append("package test1;\n");
+			buf.append("import java.util.Collection;\n");
+			buf.append("import java.util.Iterator;\n");
+			buf.append("public class E {\n");
+			buf.append("    void foo(Collection collection) {\n");
+			buf.append("        for (Iterator iterator = collection.iterator(); iterator\n");
+			buf.append("                .hasNext();) {\n");
+			buf.append("            Object object = iterator.next();\n");
+			buf.append("            \n");
+			buf.append("        }\n");
+			buf.append("    }\n");
+			buf.append("}\n");
+			expected[0]= buf.toString();
+
+			assertExpectedExistInProposals(proposals, expected);
+		} finally {
+			fJProject1.setOptions(saveOptions);
+		}
+	}
 }
diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/search/NLSSearchTestHelper.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/search/NLSSearchTestHelper.java
index 8bd40de..47b0dbe 100644
--- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/search/NLSSearchTestHelper.java
+++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/search/NLSSearchTestHelper.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2006, 2010 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,7 +13,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 
-import junit.framework.Assert;
+import org.junit.Assert;
 
 import org.eclipse.core.runtime.CoreException;
 
diff --git a/org.eclipse.jdt.ui/.classpath b/org.eclipse.jdt.ui/.classpath
index 6bf65f0..4bc88dd 100644
--- a/org.eclipse.jdt.ui/.classpath
+++ b/org.eclipse.jdt.ui/.classpath
@@ -5,11 +5,7 @@
 	<classpathentry kind="src" path="core refactoring"/>
 	<classpathentry kind="src" path="core extension"/>
 	<classpathentry kind="src" output="bin-jar-in-jar-loader" path="jar in jar loader"/>
-	<classpathentry kind="src" path="internal compatibility">
-		<attributes>
-			<attribute name="ignore_optional_problems" value="true"/>
-		</attributes>
-	</classpathentry>
+	<classpathentry kind="src" path="internal compatibility"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
 	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
 	<classpathentry kind="output" path="bin"/>
diff --git a/org.eclipse.jdt.ui/build.properties b/org.eclipse.jdt.ui/build.properties
index 5cb0fd6..3fc2d9a 100644
--- a/org.eclipse.jdt.ui/build.properties
+++ b/org.eclipse.jdt.ui/build.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2000, 2011 IBM Corporation and others.
+# Copyright (c) 2000, 2013 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -33,4 +33,4 @@
 src.excludes = jar in jar loader/
 jars.compile.order = .
 customBuildCallbacks = customBuildCallbacks.xml
-javacWarnings..=-raw,-unchecked
+javacWarnings..=-unavoidableGenericProblems
diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddImportsOperation.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddImportsOperation.java
index 18b90e5..a58ceee 100644
--- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddImportsOperation.java
+++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddImportsOperation.java
@@ -11,6 +11,7 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Nikolay Metchev <nikolaymetchev@gmail.com> - Import static (Ctrl+Shift+M) creates imports for private methods - https://bugs.eclipse.org/409594
  *******************************************************************************/
 package org.eclipse.jdt.internal.corext.codemanipulation;
 
@@ -41,7 +42,9 @@
 import org.eclipse.jdt.core.JavaModelException;
 import org.eclipse.jdt.core.Signature;
 import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.AbstractTypeDeclaration;
 import org.eclipse.jdt.core.dom.Annotation;
+import org.eclipse.jdt.core.dom.AnonymousClassDeclaration;
 import org.eclipse.jdt.core.dom.CompilationUnit;
 import org.eclipse.jdt.core.dom.IBinding;
 import org.eclipse.jdt.core.dom.IMethodBinding;
@@ -281,17 +284,29 @@
 						return null; // variableBinding.getDeclaringClass() is null for array.length
 					}
 					if (Modifier.isStatic(binding.getModifiers())) {
-						if (Modifier.isPrivate(declaringClass.getModifiers())) {
-							fStatus= JavaUIStatus.createError(IStatus.ERROR, Messages.format(CodeGenerationMessages.AddImportsOperation_error_not_visible_class, BasicElementLabels.getJavaElementName(declaringClass.getName())), null);
-							return null;
-						}
-
 						if (containerName.length() > 0) {
 							if (containerName.equals(declaringClass.getName()) || containerName.equals(declaringClass.getQualifiedName()) ) {
-								String res= importRewrite.addStaticImport(declaringClass.getQualifiedName(), binding.getName(), isField);
-								if (!res.equals(simpleName)) {
-									// adding import failed
-									return null;
+								ASTNode node= nameNode.getParent();
+								boolean isDirectlyAccessible= false;
+								while (node != null) {
+									if (isTypeDeclarationSubTypeCompatible(node, declaringClass)) {
+										isDirectlyAccessible= true;
+										break;
+									}
+									node= node.getParent();
+								}
+								if (!isDirectlyAccessible) {
+									if (Modifier.isPrivate(declaringClass.getModifiers())) {
+										fStatus= JavaUIStatus.createError(IStatus.ERROR,
+												Messages.format(CodeGenerationMessages.AddImportsOperation_error_not_visible_class, BasicElementLabels.getJavaElementName(declaringClass.getName())),
+												null);
+										return null;
+									}
+									String res= importRewrite.addStaticImport(declaringClass.getQualifiedName(), binding.getName(), isField);
+									if (!res.equals(simpleName)) {
+										// adding import failed
+										return null;
+									}
 								}
 								return new ReplaceEdit(qualifierStart, simpleNameStart - qualifierStart, ""); //$NON-NLS-1$
 							}
@@ -364,6 +379,18 @@
 	}
 
 
+	private boolean isTypeDeclarationSubTypeCompatible(ASTNode typeDeclaration, ITypeBinding supertype) {
+		if (typeDeclaration instanceof AbstractTypeDeclaration) {
+			ITypeBinding binding= ((AbstractTypeDeclaration) typeDeclaration).resolveBinding();
+			return binding != null && binding.isSubTypeCompatible(supertype);
+		} else if (typeDeclaration instanceof AnonymousClassDeclaration) {
+			ITypeBinding binding= ((AnonymousClassDeclaration) typeDeclaration).resolveBinding();
+			return binding != null && binding.isSubTypeCompatible(supertype);
+		} else {
+			return false;
+		}
+	}
+
 	private int getNameStart(IBuffer buffer, int pos) {
 		while (pos > 0) {
 			char ch= buffer.getChar(pos - 1);
diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/ContextSensitiveImportRewriteContext.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/ContextSensitiveImportRewriteContext.java
index e72151e..cb343d6 100644
--- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/ContextSensitiveImportRewriteContext.java
+++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/ContextSensitiveImportRewriteContext.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -65,7 +65,7 @@
 	/**
 	 * Creates an import rewrite context at the given start position.
 	 * 
-	 * @param compilationUnit the root
+	 * @param compilationUnit the root (must have resolved bindings)
 	 * @param position the context position
 	 * @param importRewrite the import rewrite
 	 */
diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/GenerateHashCodeEqualsOperation.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/GenerateHashCodeEqualsOperation.java
index bc7f17e..6c8c1ce 100644
--- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/GenerateHashCodeEqualsOperation.java
+++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/GenerateHashCodeEqualsOperation.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -292,7 +292,7 @@
 			// get the declaration and the rewrite
 			AbstractTypeDeclaration declaration= (AbstractTypeDeclaration) ASTNodes.findDeclaration(fType, fRewrite.getRoot());
 			ListRewrite rewriter= fRewrite.getASTRewrite().getListRewrite(declaration, declaration.getBodyDeclarationsProperty());
-			final List<BodyDeclaration> list= (List<BodyDeclaration>) declaration.getStructuralProperty(declaration.getBodyDeclarationsProperty());
+			List<BodyDeclaration> list= declaration.bodyDeclarations();
 			if (fType != null && rewriter != null) {
 
 				ICompilationUnit cu= (ICompilationUnit) fUnit.getJavaElement();
diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/StubUtility.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/StubUtility.java
index 08b7ff4..39e5392 100644
--- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/StubUtility.java
+++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/StubUtility.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 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
@@ -844,10 +844,8 @@
 	}
 
 	/**
-	 * Examines a string and returns the first line delimiter found.
-	 * 
-	 * @param elem the element
-	 * @return the line delimiter used for the element
+	 * @param elem a Java element (doesn't have to exist)
+	 * @return the existing or default line delimiter for the element
 	 */
 	public static String getLineDelimiterUsed(IJavaElement elem) {
 		IOpenable openable= elem.getOpenable();
diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/tostringgeneration/GenerateToStringOperation.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/tostringgeneration/GenerateToStringOperation.java
index 7812150..11ba0c8 100644
--- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/tostringgeneration/GenerateToStringOperation.java
+++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/tostringgeneration/GenerateToStringOperation.java
@@ -86,7 +86,7 @@
 
 				MethodDeclaration toStringMethod= fGenerator.generateToStringMethod();
 
-				final List<BodyDeclaration> list= (List<BodyDeclaration>) declaration.getStructuralProperty(declaration.getBodyDeclarationsProperty());
+				List<BodyDeclaration> list= declaration.bodyDeclarations();
 				BodyDeclaration replace= findMethodToReplace(list, toStringMethod);
 				if (replace == null || ((Boolean)toStringMethod.getProperty(AbstractToStringGenerator.OVERWRITE_METHOD_PROPERTY)).booleanValue())
 					insertMethod(toStringMethod, rewriter, replace);
diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/ASTBatchParser.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/ASTBatchParser.java
index 52b7d66..24182e8 100644
--- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/ASTBatchParser.java
+++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/ASTBatchParser.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007, 2011 IBM Corporation and others.
+ * Copyright (c) 2007, 2013 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
@@ -40,28 +40,13 @@
 
 	private static final int MAX_AT_ONCE;
 	static {
-		long maxMemory= Runtime.getRuntime().maxMemory();
-		int ratio= (int) Math.round((double) maxMemory / (64 * 0x100000));
-		switch (ratio) {
-			case 0:
-				MAX_AT_ONCE= 25;
-				break;
-			case 1:
-				MAX_AT_ONCE= 100;
-				break;
-			case 2:
-				MAX_AT_ONCE= 200;
-				break;
-			case 3:
-				MAX_AT_ONCE= 300;
-				break;
-			case 4:
-				MAX_AT_ONCE= 400;
-				break;
-			default:
-				MAX_AT_ONCE= 500;
-				break;
-		}
+		long maxMemory= Runtime.getRuntime().maxMemory() / (1 << 20); // in MiB
+		
+		if      (maxMemory >= 2000) MAX_AT_ONCE= 400;
+		else if (maxMemory >= 1500) MAX_AT_ONCE= 300;
+		else if (maxMemory >= 1000) MAX_AT_ONCE= 200;
+		else if (maxMemory >=  500) MAX_AT_ONCE= 100;
+		else                        MAX_AT_ONCE=  25;
 	}
 
 	/**
diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/ASTNodes.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/ASTNodes.java
index 6fda149..33fba3b 100644
--- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/ASTNodes.java
+++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/ASTNodes.java
@@ -95,6 +95,7 @@
 import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
 import org.eclipse.jdt.core.dom.VariableDeclarationStatement;
 import org.eclipse.jdt.core.dom.WhileStatement;
+import org.eclipse.jdt.core.dom.rewrite.ASTRewrite;
 
 import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility;
 import org.eclipse.jdt.internal.corext.util.CodeFormatterUtil;
@@ -200,12 +201,30 @@
     public static List<? extends ASTNode> getContainingList(ASTNode node) {
     	StructuralPropertyDescriptor locationInParent= node.getLocationInParent();
     	if (locationInParent != null && locationInParent.isChildListProperty()) {
-    		return (List<? extends ASTNode>) node.getParent().getStructuralProperty(locationInParent);
+    		return getChildListProperty(node.getParent(), (ChildListPropertyDescriptor) locationInParent);
     	}
     	return null;
     }
 
 	/**
+	 * Variant of {@link ASTNode#getStructuralProperty(StructuralPropertyDescriptor)} that avoids
+	 * unchecked casts in the caller.
+	 * <p>
+	 * To improve type-safety, callers can add the expected element type as explicit type argument, e.g.:
+	 * <p>
+	 * {@code ASTNodes.<BodyDeclaration>getChildListProperty(typeDecl, bodyDeclarationsProperty)}
+	 * 
+	 * @param node the node
+	 * @param propertyDescriptor the child list property to get
+	 * @return the child list
+	 * @exception RuntimeException if this node does not have the given property
+	 */
+	@SuppressWarnings("unchecked")
+	public static <T extends ASTNode> List<T> getChildListProperty(ASTNode node, ChildListPropertyDescriptor propertyDescriptor) {
+		return (List<T>) node.getStructuralProperty(propertyDescriptor);
+	}
+
+	/**
 	 * Returns a list of the direct children of a node. The siblings are ordered by start offset.
 	 * @param node the node to get the children for
 	 * @return the children
@@ -1098,4 +1117,31 @@
 		return characterLiteral.getEscapedValue();
 	}
 
+	/**
+	 * Type-safe variant of {@link ASTRewrite#createMoveTarget(ASTNode)}.
+	 * 
+	 * @param rewrite ASTRewrite for the given node
+	 * @param node the node to create a move placeholder for
+	 * @return the new placeholder node
+	 * @throws IllegalArgumentException if the node is null, or if the node
+	 * is not part of the rewrite's AST
+	 */
+	@SuppressWarnings("unchecked")
+	public static <T extends ASTNode> T createMoveTarget(ASTRewrite rewrite, T node) {
+		return (T) rewrite.createMoveTarget(node);
+	}
+
+	/**
+	 * Type-safe variant of {@link ASTNode#copySubtree(AST, ASTNode)}.
+	 * 
+	 * @param target the AST that is to own the nodes in the result
+	 * @param node the node to copy, or <code>null</code> if none
+	 * @return the copied node, or <code>null</code> if <code>node</code>
+	 *    is <code>null</code>
+	 */
+	@SuppressWarnings("unchecked")
+	public static <T extends ASTNode> T copySubtree(AST target, T node) {
+		return (T) ASTNode.copySubtree(target, node);
+	}
+
 }
diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/Bindings.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/Bindings.java
index d8d959a..a44d153 100644
--- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/Bindings.java
+++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/Bindings.java
@@ -755,8 +755,6 @@
 			return containsTypeVariables(type.getWildcard());
 		if (type.isParameterizedType())
 			return containsTypeVariables(type.getTypeArguments());
-		if (type.isTypeVariable())
-			return containsTypeVariables(type.getTypeBounds());
 		if (type.isWildcardType() && type.getBound() != null)
 			return containsTypeVariables(type.getBound());
 		return false;
diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/VariableDeclarationRewrite.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/VariableDeclarationRewrite.java
index 1ce4ae1..6639b6c 100644
--- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/VariableDeclarationRewrite.java
+++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/VariableDeclarationRewrite.java
@@ -94,6 +94,7 @@
 		while (iter.hasNext()) {
 			VariableDeclarationFragment currentFragment= iter.next();
 			
+			@SuppressWarnings("unchecked")
 			Map<VariableDeclarationFragment, MovedFragment> lookup= (Map<VariableDeclarationFragment, MovedFragment>) rewrite.getProperty(MovedFragment.class.getName());
 			if (lookup == null) {
 				lookup= new HashMap<VariableDeclarationFragment, MovedFragment>();
diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/fragments/AssociativeInfixExpressionFragment.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/fragments/AssociativeInfixExpressionFragment.java
index aabb804..d7a7a44 100644
--- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/fragments/AssociativeInfixExpressionFragment.java
+++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/fragments/AssociativeInfixExpressionFragment.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -32,7 +32,6 @@
 import org.eclipse.jdt.core.dom.rewrite.ASTRewrite;
 
 import org.eclipse.jdt.internal.corext.SourceRangeFactory;
-import org.eclipse.jdt.internal.corext.dom.ASTNodeFactory;
 import org.eclipse.jdt.internal.corext.dom.GenericVisitor;
 import org.eclipse.jdt.internal.corext.dom.JdtASTMatcher;
 
@@ -402,21 +401,12 @@
 			return;
 		}
 
-		// Could maybe be done with less edits.
-		// Problem is that the nodes to replace may not be all in the same InfixExpression.
+		rewrite.replace(fOperands.get(0), replacement, textEditGroup);
 		int first= allOperands.indexOf(fOperands.get(0));
 		int after= first + fOperands.size();
-		ArrayList<Expression> newOperands= new ArrayList<Expression>();
-		for (int i= 0; i < allOperands.size(); i++) {
-			if (i < first || after <= i) {
-				newOperands.add((Expression) rewrite.createCopyTarget(allOperands.get(i)));
-			} else /* i == first */ {
-				newOperands.add((Expression) replacement);
-				i= after - 1;
-			}
+		for (int i= first + 1; i < after; i++) {
+			rewrite.remove(allOperands.get(i), textEditGroup);
 		}
-		Expression newExpression= ASTNodeFactory.newInfixExpression(rewrite.getAST(), getOperator(), newOperands);
-		rewrite.replace(groupNode, newExpression, textEditGroup);
 	}
 
 	private static ArrayList<Expression> findGroupMembersInOrderFor(InfixExpression groupRoot) {
diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/CleanUpConstants.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/CleanUpConstants.java
index 92da649..7abb8d4 100644
--- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/CleanUpConstants.java
+++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/CleanUpConstants.java
@@ -1256,8 +1256,8 @@
 		options.setOption(EXPRESSIONS_USE_PARENTHESES_ALWAYS, CleanUpOptions.FALSE);
 
 		//Variable Declarations
-		options.setOption(VARIABLE_DECLARATIONS_USE_FINAL, CleanUpOptions.TRUE);
-		options.setOption(VARIABLE_DECLARATIONS_USE_FINAL_LOCAL_VARIABLES, CleanUpOptions.FALSE);
+		options.setOption(VARIABLE_DECLARATIONS_USE_FINAL, CleanUpOptions.FALSE);
+		options.setOption(VARIABLE_DECLARATIONS_USE_FINAL_LOCAL_VARIABLES, CleanUpOptions.TRUE);
 		options.setOption(VARIABLE_DECLARATIONS_USE_FINAL_PARAMETERS, CleanUpOptions.FALSE);
 		options.setOption(VARIABLE_DECLARATIONS_USE_FINAL_PRIVATE_FIELDS, CleanUpOptions.TRUE);
 
diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/CleanUpRefactoring.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/CleanUpRefactoring.java
index 288e08d..4deb073 100644
--- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/CleanUpRefactoring.java
+++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/CleanUpRefactoring.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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,8 +22,10 @@
 
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.SubProgressMonitor;
 import org.eclipse.core.runtime.jobs.ISchedulingRule;
 
@@ -80,6 +82,7 @@
 import org.eclipse.jdt.ui.cleanup.ICleanUpFix;
 import org.eclipse.jdt.ui.text.java.IProblemLocation;
 
+import org.eclipse.jdt.internal.ui.IJavaStatusConstants;
 import org.eclipse.jdt.internal.ui.JavaPlugin;
 import org.eclipse.jdt.internal.ui.fix.IMultiFix.MultiFixContext;
 import org.eclipse.jdt.internal.ui.fix.MapCleanUpOptions;
@@ -155,8 +158,11 @@
 					}
 				});
 
-				if (exs[0] != null)
-					throw exs[0];
+				if (exs[0] != null) {
+					IStatus status= new Status(IStatus.ERROR, JavaPlugin.getPluginId(), IJavaStatusConstants.INTERNAL_ERROR, Messages.format(FixMessages.CleanUpRefactoring_exception,
+							getCompilationUnit().getResource().getFullPath().toString()), exs[0]);
+					throw new CoreException(status);
+				}
 
 				return result[0];
 			} else {
diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/CodeFormatFix.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/CodeFormatFix.java
index 7417142..5e1b31a 100644
--- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/CodeFormatFix.java
+++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/CodeFormatFix.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -88,13 +88,8 @@
 		}
 
 		MultiTextEdit otherEdit= new MultiTextEdit();
-		if ((removeTrailingWhitespacesAll || removeTrailingWhitespacesIgnorEmpty || correctIndentation) && (!format || regions != null)) {
+		if ((removeTrailingWhitespacesAll || removeTrailingWhitespacesIgnorEmpty || correctIndentation)) {
 			try {
-				if (correctIndentation && removeTrailingWhitespacesAll) {
-					removeTrailingWhitespacesAll= false;
-					removeTrailingWhitespacesIgnorEmpty= true;
-				}
-
 				Document document= new Document(cu.getBuffer().getContents());
 				if (removeTrailingWhitespacesAll || removeTrailingWhitespacesIgnorEmpty) {
 					String label= MultiFixMessages.CodeFormatFix_RemoveTrailingWhitespace_changeDescription;
@@ -155,13 +150,13 @@
 							for (int i= 0; i < children.length; i++) {
 								TextEdit child= children[i];
 								edit.removeChild(child);
-								if (!TextEditUtil.overlaps(formatEdit, child)) {
+								if (!TextEditUtil.overlaps(formatEdit, child) && !TextEditUtil.overlaps(otherEdit, child)) {
 									otherEdit.addChild(child);
 									group.addTextEdit(child);
 								}
 							}
 						} else {
-							if (!TextEditUtil.overlaps(formatEdit, edit)) {
+							if (!TextEditUtil.overlaps(formatEdit, edit) && !TextEditUtil.overlaps(otherEdit, edit)) {
 								otherEdit.addChild(edit);
 								group.addTextEdit(edit);
 							}
diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/ConvertIterableLoopOperation.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/ConvertIterableLoopOperation.java
index 96a64aa..3d65660 100644
--- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/ConvertIterableLoopOperation.java
+++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/ConvertIterableLoopOperation.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2012 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 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
@@ -357,7 +357,7 @@
 			if (resultStatus.getSeverity() == IStatus.ERROR)
 				return resultStatus;
 
-			List<Expression> updateExpressions= (List<Expression>) getForStatement().getStructuralProperty(ForStatement.UPDATERS_PROPERTY);
+			List<Expression> updateExpressions= getForStatement().updaters();
 			if (updateExpressions.size() == 1) {
 				resultStatus= new StatusInfo(IStatus.WARNING, Messages.format(FixMessages.ConvertIterableLoopOperation_RemoveUpdateExpression_Warning, BasicElementLabels.getJavaCodeString(updateExpressions.get(0).toString())));
 			} else if (updateExpressions.size() > 1) {
@@ -451,14 +451,14 @@
 								String name= invocation.getName().getIdentifier();
 								if (name.equals("next") || name.equals("nextElement")) { //$NON-NLS-1$ //$NON-NLS-2$
 									nextInvocationCount[0]++;
-									
+
 									Expression left= null;
 									if (invocation.getLocationInParent() == Assignment.RIGHT_HAND_SIDE_PROPERTY) {
 										left= ((Assignment) invocation.getParent()).getLeftHandSide();
 									} else if (invocation.getLocationInParent() == VariableDeclarationFragment.INITIALIZER_PROPERTY) {
 										left= ((VariableDeclarationFragment) invocation.getParent()).getName();
-									} 
-									
+									}
+
 									return visitElementVariable(left);
 								}
 							}
@@ -466,7 +466,7 @@
 						}
 						return true;
 					}
-					
+
 					private boolean visitElementVariable(final Expression node) {
 						if (node != null) {
 							final ITypeBinding binding= node.resolveTypeBinding();
@@ -594,9 +594,9 @@
 
 		MethodInvocation methodInvocation= (MethodInvocation)initializer;
 		String methodName= methodInvocation.getName().getIdentifier();
-		if (!"iterator".equals(methodName)) //$NON-NLS-1$
+		if (!"iterator".equals(methodName) || methodInvocation.arguments().size() != 0) //$NON-NLS-1$
 			return SEMANTIC_CHANGE_WARNING_STATUS;
-		
+
 		return StatusInfo.OK_STATUS;
 	}
 
diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/FixMessages.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/FixMessages.java
index e6964c9..21a8d4a 100644
--- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/FixMessages.java
+++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/FixMessages.java
@@ -39,6 +39,7 @@
 	public static String CleanUpRefactoring_Refactoring_name;
 	public static String CleanUpRefactoring_ProcessingCompilationUnit_message;
 	public static String CleanUpRefactoring_Initialize_message;
+	public static String CleanUpRefactoring_exception;
 
 	public static String CleanUpRegistry_ErrorTabPage_description;
 	public static String CleanUpRegistry_ErrorTabPage_preview;
diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/FixMessages.properties b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/FixMessages.properties
index 2fe2bf8..bc97fc3 100644
--- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/FixMessages.properties
+++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/FixMessages.properties
@@ -23,6 +23,7 @@
 CleanUpRefactoring_could_not_retrive_profile=Could not retrieve profile for project ''{0}''
 CleanUpRefactoring_ProcessingCompilationUnit_message=Processing compilation unit {0} of {1} ({2})
 CleanUpRefactoring_checkingPostConditions_message=Checking post conditions
+CleanUpRefactoring_exception=Exception occurred while changing ''{0}''.
 
 CleanUpRegistry_ErrorTabPage_description=An error occurred while creating this page:\n{0}\n\nSee the error log for details.
 CleanUpRegistry_ErrorTabPage_preview=No preview available
diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/Java50Fix.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/Java50Fix.java
index fb1ea4a..c51d173 100644
--- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/Java50Fix.java
+++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/Java50Fix.java
@@ -132,7 +132,7 @@
 			ASTRewrite astRewrite= cuRewrite.getASTRewrite();
 			for (int i= 0; i < nodes.length; i++) {
 				ParameterizedType type= nodes[i];
-				List<Type> args= (List<Type>) type.getStructuralProperty(ParameterizedType.TYPE_ARGUMENTS_PROPERTY);
+				List<Type> args= type.typeArguments();
 				int j= 0;
 				for (Iterator<Type> iter= args.iterator(); iter.hasNext();) {
 					LinkedProposalPositionGroup group= new LinkedProposalPositionGroup("G" + i + "_" + j); //$NON-NLS-1$ //$NON-NLS-2$
diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/UnusedCodeFix.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/UnusedCodeFix.java
index 7f76eb5..b7e01c6 100644
--- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/UnusedCodeFix.java
+++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/UnusedCodeFix.java
@@ -18,7 +18,6 @@
 import java.util.ListIterator;
 import java.util.Map;
 
-import org.eclipse.core.runtime.Assert;
 import org.eclipse.core.runtime.CoreException;
 
 import org.eclipse.text.edits.TextEditGroup;
@@ -27,8 +26,8 @@
 import org.eclipse.jdt.core.dom.ASTNode;
 import org.eclipse.jdt.core.dom.ASTVisitor;
 import org.eclipse.jdt.core.dom.Assignment;
-import org.eclipse.jdt.core.dom.Block;
 import org.eclipse.jdt.core.dom.CastExpression;
+import org.eclipse.jdt.core.dom.ChildListPropertyDescriptor;
 import org.eclipse.jdt.core.dom.ClassInstanceCreation;
 import org.eclipse.jdt.core.dom.CompilationUnit;
 import org.eclipse.jdt.core.dom.EnhancedForStatement;
@@ -51,8 +50,8 @@
 import org.eclipse.jdt.core.dom.QualifiedName;
 import org.eclipse.jdt.core.dom.SimpleName;
 import org.eclipse.jdt.core.dom.SingleVariableDeclaration;
+import org.eclipse.jdt.core.dom.Statement;
 import org.eclipse.jdt.core.dom.SuperMethodInvocation;
-import org.eclipse.jdt.core.dom.SwitchStatement;
 import org.eclipse.jdt.core.dom.TagElement;
 import org.eclipse.jdt.core.dom.Type;
 import org.eclipse.jdt.core.dom.TypeDeclarationStatement;
@@ -65,6 +64,7 @@
 import org.eclipse.jdt.internal.corext.dom.ASTNodes;
 import org.eclipse.jdt.internal.corext.dom.LinkedNodeFinder;
 import org.eclipse.jdt.internal.corext.dom.NecessaryParenthesesChecker;
+import org.eclipse.jdt.internal.corext.dom.StatementRewrite;
 import org.eclipse.jdt.internal.corext.refactoring.structure.CompilationUnitRewrite;
 import org.eclipse.jdt.internal.corext.util.Messages;
 
@@ -107,8 +107,9 @@
 			Object operator= node.getOperator();
 			if (operator == PrefixExpression.Operator.INCREMENT || operator == PrefixExpression.Operator.DECREMENT) {
 				fSideEffectNodes.add(node);
+				return false;
 			}
-			return false;
+			return true;
 		}
 
 		@Override
@@ -311,10 +312,11 @@
 					fragments= ((VariableDeclarationStatement) varDecl).fragments();
 				}
 				Expression initializer = frag.getInitializer();
-				if (initializer instanceof CastExpression) {
-					initializer= ((CastExpression) initializer).getExpression();
+				ArrayList<Expression> sideEffects= new ArrayList<Expression>();
+				if (initializer != null) {
+					initializer.accept(new SideEffectFinder(sideEffects));
 				}
-				boolean sideEffectInitializer = initializer instanceof MethodInvocation || initializer instanceof ClassInstanceCreation;
+				boolean sideEffectInitializer= sideEffects.size() > 0;
 				if (fragments.size() == fUnusedNames.length) {
 					if (fForceRemove) {
 						rewrite.remove(varDecl, group);
@@ -324,10 +326,15 @@
 						rewrite.remove(varDecl, group);
 						return;
 					}
-					if (sideEffectInitializer){
-						Expression movedInit = (Expression) rewrite.createMoveTarget(initializer);
-						ExpressionStatement wrapped = rewrite.getAST().newExpressionStatement(movedInit);
-						rewrite.replace(varDecl, wrapped, group);
+					if (sideEffectInitializer) {
+						Statement[] wrapped= new Statement[sideEffects.size()];
+						for (int i= 0; i < wrapped.length; i++) {
+							Expression sideEffect= sideEffects.get(i);
+							Expression movedInit= (Expression) rewrite.createMoveTarget(sideEffect);
+							wrapped[i]= rewrite.getAST().newExpressionStatement(movedInit);
+						}
+						StatementRewrite statementRewrite= new StatementRewrite(rewrite, new ASTNode[] { varDecl });
+						statementRewrite.replace(wrapped, group);
 					} else {
 						rewrite.remove(varDecl, group);
 					}
@@ -343,16 +350,7 @@
 						return;
 					}
 					if (declaration instanceof VariableDeclarationStatement) {
-						ASTNode lst = declaration.getParent();
-						ListRewrite listRewrite= null;
-						if (lst instanceof Block) {
-							listRewrite= rewrite.getListRewrite(lst, Block.STATEMENTS_PROPERTY);
-						} else if (lst instanceof SwitchStatement) {
-							listRewrite= rewrite.getListRewrite(lst, SwitchStatement.STATEMENTS_PROPERTY);
-						} else {
-							Assert.isTrue(false);
-						}
-						splitUpDeclarations(rewrite, group, frag, listRewrite, (VariableDeclarationStatement) declaration);
+						splitUpDeclarations(rewrite, group, frag, (VariableDeclarationStatement) declaration, sideEffects);
 						rewrite.remove(frag, group);
 						return;
 					}
@@ -374,14 +372,18 @@
 			}
 		}
 
-		private void splitUpDeclarations(ASTRewrite rewrite, TextEditGroup group, VariableDeclarationFragment frag, ListRewrite statementRewrite, VariableDeclarationStatement originalStatement) {
-			Expression initializer = frag.getInitializer();
-			//keep constructors and method invocations
-			if (initializer instanceof MethodInvocation || initializer instanceof ClassInstanceCreation){
-				Expression movedInitializer= (Expression) rewrite.createMoveTarget(initializer);
-
-				ExpressionStatement newInitializer= rewrite.getAST().newExpressionStatement( movedInitializer);
-				statementRewrite.insertAfter(newInitializer, originalStatement, group);
+		private void splitUpDeclarations(ASTRewrite rewrite, TextEditGroup group, VariableDeclarationFragment frag, VariableDeclarationStatement originalStatement, List<Expression> sideEffects) {
+			if (sideEffects.size() > 0) {
+				ListRewrite statementRewrite= rewrite.getListRewrite(originalStatement.getParent(), (ChildListPropertyDescriptor) originalStatement.getLocationInParent());
+				
+				Statement previousStatement= originalStatement;
+				for (int i= 0; i < sideEffects.size(); i++) {
+					Expression sideEffect= sideEffects.get(i);
+					Expression movedInit= (Expression) rewrite.createMoveTarget(sideEffect);
+					ExpressionStatement wrapped= rewrite.getAST().newExpressionStatement(movedInit);
+					statementRewrite.insertAfter(wrapped, previousStatement, group);
+					previousStatement= wrapped;
+				}
 
 				VariableDeclarationStatement newDeclaration= null;
 				List<VariableDeclarationFragment> fragments= originalStatement.fragments();
@@ -394,14 +396,15 @@
 						newDeclaration= rewrite.getAST().newVariableDeclarationStatement(movedFragment);
 						Type copiedType= (Type) rewrite.createCopyTarget(originalStatement.getType());
 						newDeclaration.setType(copiedType);
-					} else
+					} else {
 						newDeclaration.fragments().add(movedFragment);
+					}
 				}
 				if (newDeclaration != null){
-					statementRewrite.insertAfter(newDeclaration, newInitializer, group);
-				}
-				if (originalStatement.fragments().size() == newDeclaration.fragments().size() + 1){
-					rewrite.remove(originalStatement, group);
+					statementRewrite.insertAfter(newDeclaration, previousStatement, group);
+					if (originalStatement.fragments().size() == newDeclaration.fragments().size() + 1){
+						rewrite.remove(originalStatement, group);
+					}
 				}
 			}
 		}
diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/RefactoringCoreMessages.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/RefactoringCoreMessages.java
index e4c5944..f8d6905 100644
--- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/RefactoringCoreMessages.java
+++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/RefactoringCoreMessages.java
@@ -12,6 +12,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Benjamin Muskalla <bmuskalla@eclipsesource.com> - [extract method] Extract method and continue https://bugs.eclipse.org/bugs/show_bug.cgi?id=48056
+ *     Samrat Dhillon <samrat.dhillon@gmail.com> - [introduce factory] Introduce Factory on an abstract class adds a statement to create an instance of that class - https://bugs.eclipse.org/bugs/show_bug.cgi?id=395016
  *******************************************************************************/
 package org.eclipse.jdt.internal.corext.refactoring;
 
@@ -937,6 +938,8 @@
 
 	public static String IntroduceFactory_unsupportedNestedTypes;
 
+	public static String IntroduceFactory_abstractClass;
+
 	public static String IntroduceFactoryRefactoring_declare_private;
 
 	public static String IntroduceFactoryRefactoring_descriptor_description_short;
diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/CallInliner.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/CallInliner.java
index 9d5b0b1..063360f 100644
--- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/CallInliner.java
+++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/CallInliner.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -18,6 +18,7 @@
  *         (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=44417)
  *       o Allow 'this' constructor to be inlined
  *         (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=38093)
+ *	   Nikolay Metchev <nikolaymetchev@gmail.com> - Anonymous class using final parameter breaks method inlining - https://bugs.eclipse.org/269401
  *******************************************************************************/
 package org.eclipse.jdt.internal.corext.refactoring.code;
 
@@ -65,6 +66,7 @@
 import org.eclipse.jdt.core.dom.MethodDeclaration;
 import org.eclipse.jdt.core.dom.MethodInvocation;
 import org.eclipse.jdt.core.dom.Modifier;
+import org.eclipse.jdt.core.dom.Modifier.ModifierKeyword;
 import org.eclipse.jdt.core.dom.Name;
 import org.eclipse.jdt.core.dom.ParenthesizedExpression;
 import org.eclipse.jdt.core.dom.ReturnStatement;
@@ -163,6 +165,9 @@
 			IBinding binding= node.resolveBinding();
 			if (binding instanceof IVariableBinding) {
 				int accessMode = fFormalArgument.getSimplifiedAccessMode();
+				if (fFormalArgument.isFinal() && !Modifier.isFinal(binding.getModifiers())) {
+					return setResult(false);
+				}
 				if (accessMode == FlowInfo.READ || accessMode == FlowInfo.UNUSED)
 					return setResult(true);
 				// from now on we only have write accesses.
@@ -515,9 +520,11 @@
 			} else {
 				String name= fInvocationScope.createName(parameter.getName(), true);
 				realArguments[i]= ast.newSimpleName(name);
-				fLocals.add(createLocalDeclaration(
-					parameter.getTypeBinding(), name,
-					(Expression)fRewrite.createCopyTarget(expression)));
+				VariableDeclarationStatement local= createLocalDeclaration(parameter.getTypeBinding(), name, (Expression) fRewrite.createCopyTarget(expression));
+				if (parameter.isFinal()) {
+					local.modifiers().add(fInvocation.getAST().newModifier(ModifierKeyword.FINAL_KEYWORD));
+				}
+				fLocals.add(local);
 			}
 		}
 		if (needsVarargBoxing) {
diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ConvertAnonymousToNestedRefactoring.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ConvertAnonymousToNestedRefactoring.java
index 74fcfe0..089127c 100644
--- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ConvertAnonymousToNestedRefactoring.java
+++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ConvertAnonymousToNestedRefactoring.java
@@ -11,11 +11,15 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
- *     N.Metchev@teamphone.com - contributed fixes for
+ *     NikolayMetchev@gmail.com - contributed fixes for
  *     - convert anonymous to nested should sometimes declare class as static [refactoring]
  *       (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=43360)
  *     - Convert anonymous to nested: should show error if field form outer anonymous type is references [refactoring]
  *       (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=48282)
+ *     - [refactoring][convert anonymous] gets confused with generic methods
+ *       (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=124978)
+ *     - [convert anonymous] Convert Anonymous to nested generates wrong code
+ *       (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=159917)
  *******************************************************************************/
 package org.eclipse.jdt.internal.corext.refactoring.code;
 
@@ -140,7 +144,17 @@
 			}
 			return true;
 		}
-
+		
+		@Override
+		public final boolean visit(TypeParameter parameter) {
+			ITypeBinding binding= parameter.resolveBinding();
+			if (binding != null) {
+				// don't collect type parameters declared inside the anonymous
+				fBindings.put(binding.getKey(), binding);
+			}
+			return false;
+		}
+		
 		public final ITypeBinding[] getResult() {
 			final ITypeBinding[] result= new ITypeBinding[fFound.size()];
 			fFound.toArray(result);
@@ -1087,7 +1101,10 @@
         boolean ans = false;
         while(current != null) {
             switch(current.getNodeType()) {
-                case ASTNode.ANONYMOUS_CLASS_DECLARATION:
+				case ASTNode.SUPER_CONSTRUCTOR_INVOCATION:
+				case ASTNode.CONSTRUCTOR_INVOCATION:
+					return true;
+				case ASTNode.ANONYMOUS_CLASS_DECLARATION:
                 {
                     AnonymousClassDeclaration enclosingAnonymousClassDeclaration= (AnonymousClassDeclaration)current;
                     ITypeBinding binding= enclosingAnonymousClassDeclaration.resolveBinding();
diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractConstantRefactoring.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractConstantRefactoring.java
index ab6f720..f9b2c2f 100644
--- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractConstantRefactoring.java
+++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractConstantRefactoring.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractMethodRefactoring.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractMethodRefactoring.java
index 90fc023..1dca999 100644
--- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractMethodRefactoring.java
+++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractMethodRefactoring.java
@@ -15,6 +15,7 @@
  *     Benjamin Muskalla <bmuskalla@eclipsesource.com> - [extract method] Extract method and continue https://bugs.eclipse.org/bugs/show_bug.cgi?id=48056
  *     Benjamin Muskalla <bmuskalla@eclipsesource.com> - [extract method] should declare method static if extracted from anonymous in static method - https://bugs.eclipse.org/bugs/show_bug.cgi?id=152004
  *     Samrat Dhillon <samrat.dhillon@gmail.com> -  [extract method] Extracted method should be declared static if extracted expression is also used in another static method https://bugs.eclipse.org/bugs/show_bug.cgi?id=393098
+ *     Samrat Dhillon <samrat.dhillon@gmail.com> -  [extract method] Extracting expression of parameterized type that is passed as argument to this constructor yields compilation error https://bugs.eclipse.org/bugs/show_bug.cgi?id=394030
  *******************************************************************************/
 package org.eclipse.jdt.internal.corext.refactoring.code;
 
@@ -1015,7 +1016,7 @@
 			modifiers|= Modifier.DEFAULT;
 		}
 
-		ITypeBinding[] typeVariables= computeLocalTypeVariables();
+		ITypeBinding[] typeVariables= computeLocalTypeVariables(modifiers);
 		List<TypeParameter> typeParameters= result.typeParameters();
 		for (int i= 0; i < typeVariables.length; i++) {
 			TypeParameter parameter= fAST.newTypeParameter();
@@ -1054,20 +1055,20 @@
 		return result;
 	}
 
-	private ITypeBinding[] computeLocalTypeVariables() {
+	private ITypeBinding[] computeLocalTypeVariables(int modifier) {
 		List<ITypeBinding> result= new ArrayList<ITypeBinding>(Arrays.asList(fAnalyzer.getTypeVariables()));
 		for (int i= 0; i < fParameterInfos.size(); i++) {
 			ParameterInfo info= fParameterInfos.get(i);
-			processVariable(result, info.getOldBinding());
+			processVariable(result, info.getOldBinding(), modifier);
 		}
 		IVariableBinding[] methodLocals= fAnalyzer.getMethodLocals();
 		for (int i= 0; i < methodLocals.length; i++) {
-			processVariable(result, methodLocals[i]);
+			processVariable(result, methodLocals[i], modifier);
 		}
 		return result.toArray(new ITypeBinding[result.size()]);
 	}
 
-	private void processVariable(List<ITypeBinding> result, IVariableBinding variable) {
+	private void processVariable(List<ITypeBinding> result, IVariableBinding variable, int modifier) {
 		if (variable == null)
 			return;
 		ITypeBinding binding= variable.getType();
@@ -1077,8 +1078,22 @@
 				ITypeBinding arg= typeArgs[args];
 				if (arg.isTypeVariable() && !result.contains(arg)) {
 					ASTNode decl= fRoot.findDeclaringNode(arg);
-					if (decl != null && decl.getParent() instanceof MethodDeclaration) {
-						result.add(arg);
+					if (decl != null) {
+						ASTNode parent= decl.getParent();
+						if (parent instanceof MethodDeclaration || (parent instanceof TypeDeclaration && Modifier.isStatic(modifier))) {
+							result.add(arg);
+						}
+					}
+				} else {
+					ITypeBinding bound= arg.getBound();
+					if (arg.isWildcardType() && bound != null && !result.contains(bound)) {
+						ASTNode decl= fRoot.findDeclaringNode(bound);
+						if (decl != null) {
+							ASTNode parent= decl.getParent();
+							if (parent instanceof MethodDeclaration || (parent instanceof TypeDeclaration && Modifier.isStatic(modifier))) {
+								result.add(bound);
+							}
+						}
 					}
 				}
 			}
diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractTempRefactoring.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractTempRefactoring.java
index 3d84176..101e074 100644
--- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractTempRefactoring.java
+++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractTempRefactoring.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Nikolay Metchev <nikolaymetchev@gmail.com> - [extract local] Extract to local variable not replacing multiple occurrences in same statement - https://bugs.eclipse.org/406347
  *******************************************************************************/
 package org.eclipse.jdt.internal.corext.refactoring.code;
 
diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/InlineConstantRefactoring.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/InlineConstantRefactoring.java
index 39a8e97..0b274c5 100644
--- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/InlineConstantRefactoring.java
+++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/InlineConstantRefactoring.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Nikolay Metchev <nikolaymetchev@gmail.com> - [inline] problem with fields from generic types - https://bugs.eclipse.org/218431
  *******************************************************************************/
 package org.eclipse.jdt.internal.corext.refactoring.code;
 
@@ -395,7 +396,7 @@
 				if (declaringClass == null)
 					return;
 
-				Type newQualification= fNewLocationCuRewrite.getImportRewrite().addImport(declaringClass, fInitializerRewrite.getAST(), fNewLocationContext);
+				Type newQualification= fNewLocationCuRewrite.getImportRewrite().addImport(declaringClass.getErasure(), fInitializerRewrite.getAST(), fNewLocationContext);
 				fNewLocationCuRewrite.getImportRemover().registerAddedImports(newQualification);
 
 				SimpleName newToQualify= (SimpleName) fInitializerRewrite.createMoveTarget(toQualify);
@@ -809,6 +810,8 @@
 		pm.beginTask("", 3); //$NON-NLS-1$
 
 		try {
+			fSelectionCuRewrite.clearASTAndImportRewrites();
+			fDeclarationCuRewrite.clearASTAndImportRewrites();
 			List<CompilationUnitChange>changes= new ArrayList<CompilationUnitChange>();
 			HashSet<SimpleName> staticImportsInInitializer= new HashSet<SimpleName>();
 			ImportReferencesCollector.collect(getInitializer(), fField.getJavaProject(), null, new ArrayList<SimpleName>(), staticImportsInInitializer);
@@ -873,10 +876,6 @@
 			return result;
 
 		} finally {
-			fSelectionCuRewrite= null;
-			fSelectedConstantName= null;
-			fDeclarationCuRewrite= null;
-			fDeclaration= null;
 			pm.done();
 		}
 	}
diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/IntroduceFactoryRefactoring.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/IntroduceFactoryRefactoring.java
index 551a289..5d4fbe4 100644
--- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/IntroduceFactoryRefactoring.java
+++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/IntroduceFactoryRefactoring.java
@@ -11,6 +11,7 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Samrat Dhillon <samrat.dhillon@gmail.com> - [introduce factory] Introduce Factory on an abstract class adds a statement to create an instance of that class - https://bugs.eclipse.org/bugs/show_bug.cgi?id=395016
  *******************************************************************************/
 package org.eclipse.jdt.internal.corext.refactoring.code;
 
@@ -49,6 +50,7 @@
 import org.eclipse.jdt.core.dom.AST;
 import org.eclipse.jdt.core.dom.ASTNode;
 import org.eclipse.jdt.core.dom.AbstractTypeDeclaration;
+import org.eclipse.jdt.core.dom.AnonymousClassDeclaration;
 import org.eclipse.jdt.core.dom.Block;
 import org.eclipse.jdt.core.dom.ChildListPropertyDescriptor;
 import org.eclipse.jdt.core.dom.ClassInstanceCreation;
@@ -76,6 +78,7 @@
 import org.eclipse.jdt.core.dom.VariableDeclaration;
 import org.eclipse.jdt.core.dom.rewrite.ASTRewrite;
 import org.eclipse.jdt.core.dom.rewrite.ImportRewrite;
+import org.eclipse.jdt.core.dom.rewrite.ImportRewrite.ImportRewriteContext;
 import org.eclipse.jdt.core.dom.rewrite.ListRewrite;
 import org.eclipse.jdt.core.refactoring.CompilationUnitChange;
 import org.eclipse.jdt.core.refactoring.IJavaRefactorings;
@@ -87,7 +90,10 @@
 import org.eclipse.jdt.core.search.SearchPattern;
 
 import org.eclipse.jdt.internal.core.refactoring.descriptors.RefactoringSignatureDescriptorFactory;
+import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationSettings;
+import org.eclipse.jdt.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext;
 import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility;
+import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility2;
 import org.eclipse.jdt.internal.corext.dom.ASTNodeFactory;
 import org.eclipse.jdt.internal.corext.dom.ASTNodes;
 import org.eclipse.jdt.internal.corext.dom.Bindings;
@@ -106,11 +112,13 @@
 import org.eclipse.jdt.internal.corext.refactoring.util.ResourceUtil;
 import org.eclipse.jdt.internal.corext.util.JdtFlags;
 import org.eclipse.jdt.internal.corext.util.Messages;
+import org.eclipse.jdt.internal.corext.util.MethodsSourcePositionComparator;
 import org.eclipse.jdt.internal.corext.util.SearchUtils;
 
 import org.eclipse.jdt.ui.JavaElementLabels;
 
 import org.eclipse.jdt.internal.ui.JavaUIStatus;
+import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings;
 import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels;
 import org.eclipse.jdt.internal.ui.viewsupport.BindingLabelProvider;
 
@@ -550,6 +558,10 @@
 			if (fCallSitesInBinaryUnits)
 				result.merge(RefactoringStatus.createWarningStatus(RefactoringCoreMessages.IntroduceFactory_callSitesInBinaryClass));
 
+			if(Modifier.isAbstract(fCtorBinding.getDeclaringClass().getModifiers())){
+				result.merge(RefactoringStatus.createWarningStatus(RefactoringCoreMessages.IntroduceFactory_abstractClass));
+			}
+
 			return result;
 		} finally {
 			pm.done();
@@ -588,14 +600,16 @@
 	}
 
 	/**
-	 * Creates and returns a new MethodDeclaration that represents the factory
-	 * method to be used in place of direct calls to the constructor in question.
+	 * Creates and returns a new MethodDeclaration that represents the factory method to be used in
+	 * place of direct calls to the constructor in question.
+	 * 
 	 * @param ast An AST used as a factory for various AST nodes
 	 * @param ctorBinding binding for the constructor being wrapped
 	 * @param unitRewriter the ASTRewrite to be used
 	 * @return the new method declaration
+	 * @throws CoreException if an exception occurs while accessing its corresponding resource
 	 */
-	private MethodDeclaration createFactoryMethod(AST ast, IMethodBinding ctorBinding, ASTRewrite unitRewriter) {
+	private MethodDeclaration createFactoryMethod(AST ast, IMethodBinding ctorBinding, ASTRewrite unitRewriter) throws CoreException{
 		MethodDeclaration		newMethod= ast.newMethodDeclaration();
 		SimpleName				newMethodName= ast.newSimpleName(fNewMethodName);
 		ClassInstanceCreation	newCtorCall= ast.newClassInstanceCreation();
@@ -609,21 +623,42 @@
 		newMethod.setName(newMethodName);
 		newMethod.setBody(body);
 
-        ITypeBinding[] ctorOwnerTypeParameters= fCtorBinding.getDeclaringClass().getTypeParameters();
+		ITypeBinding declaringClass= fCtorBinding.getDeclaringClass();
+		ITypeBinding[] ctorOwnerTypeParameters= declaringClass.getTypeParameters();
 
-        setMethodReturnType(newMethod, retTypeName, ctorOwnerTypeParameters, ast);
+		setMethodReturnType(newMethod, retTypeName, ctorOwnerTypeParameters, ast);
 
 		newMethod.modifiers().addAll(ASTNodeFactory.newModifiers(ast, Modifier.STATIC | Modifier.PUBLIC));
 
-        setCtorTypeArguments(newCtorCall, retTypeName, ctorOwnerTypeParameters, ast);
+		setCtorTypeArguments(newCtorCall, retTypeName, ctorOwnerTypeParameters, ast);
 
-        createFactoryMethodConstructorArgs(ast, newCtorCall);
+		createFactoryMethodConstructorArgs(ast, newCtorCall);
+
+		if (Modifier.isAbstract(declaringClass.getModifiers())) {
+			AnonymousClassDeclaration decl= ast.newAnonymousClassDeclaration();
+			IMethodBinding[] unimplementedMethods= getUnimplementedMethods(declaringClass);
+			CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings(fCUHandle.getJavaProject());
+			ImportRewriteContext context= new ContextSensitiveImportRewriteContext(fFactoryCU, decl.getStartPosition(), fImportRewriter);
+			for (int i= 0; i < unimplementedMethods.length; i++) {
+				IMethodBinding unImplementedMethod= unimplementedMethods[i];
+				MethodDeclaration newMethodDecl= StubUtility2.createImplementationStub(fCUHandle, unitRewriter, fImportRewriter, context, unImplementedMethod, unImplementedMethod.getDeclaringClass()
+						.getName(), settings, false);
+				decl.bodyDeclarations().add(newMethodDecl);
+			}
+			newCtorCall.setAnonymousClassDeclaration(decl);
+		}
 
 		ret.setExpression(newCtorCall);
 		stmts.add(ret);
 
 		return newMethod;
 	}
+	
+	private IMethodBinding[] getUnimplementedMethods(ITypeBinding binding) {
+		IMethodBinding[] unimplementedMethods= StubUtility2.getUnimplementedMethods(binding, true);
+		Arrays.sort(unimplementedMethods, new MethodsSourcePositionComparator(binding));
+		return unimplementedMethods;
+	}
 
 	/**
 	 * Sets the type being instantiated in the given constructor call, including
@@ -1095,14 +1130,16 @@
 	}
 
 	/**
-	 * Perform the AST rewriting necessary on the given <code>CompilationUnit</code>
-	 * to create the factory method. The method will reside on the type identified by
+	 * Perform the AST rewriting necessary on the given <code>CompilationUnit</code> to create the
+	 * factory method. The method will reside on the type identified by
 	 * <code>fFactoryOwningClass</code>.
-	 * @param unitRewriter
-	 * @param unit
+	 * 
+	 * @param unitRewriter the ASTRewrite to be used
+	 * @param unit the <code>CompilationUnit</code> where factory method will be created
 	 * @param gd the <code>GroupDescription</code> to associate with the changes made
+	 * @throws CoreException if an exception occurs while accessing its corresponding resource
 	 */
-	private void createFactoryChange(ASTRewrite unitRewriter, CompilationUnit unit, TextEditGroup gd) {
+	private void createFactoryChange(ASTRewrite unitRewriter, CompilationUnit unit, TextEditGroup gd) throws CoreException {
 		// ================================================================================
 		// First add the factory itself (method, class, and interface as needed/directed by user)
 		AST				ast= unit.getAST();
diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/IntroduceIndirectionRefactoring.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/IntroduceIndirectionRefactoring.java
index 884c255..1b9fa52 100644
--- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/IntroduceIndirectionRefactoring.java
+++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/IntroduceIndirectionRefactoring.java
@@ -11,6 +11,7 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Nikolay Metchev <nikolaymetchev@gmail.com> - [introduce indirection] ClassCastException when introducing indirection on method in generic class - https://bugs.eclipse.org/395231
  *******************************************************************************/
 package org.eclipse.jdt.internal.corext.refactoring.code;
 
@@ -120,6 +121,7 @@
 
 import org.eclipse.jdt.internal.ui.JavaPlugin;
 import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider;
+import org.eclipse.jdt.internal.ui.text.correction.ASTResolving;
 import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels;
 
 /**
@@ -1130,6 +1132,13 @@
 
 	private CompilationUnitRewrite getCachedCURewrite(ICompilationUnit unit) {
 		CompilationUnitRewrite rewrite= fRewrites.get(unit);
+		if (rewrite == null && fSelectionMethodInvocation != null) {
+			CompilationUnit cuNode= ASTResolving.findParentCompilationUnit(fSelectionMethodInvocation);
+			if (cuNode != null && cuNode.getJavaElement().equals(unit)) {
+				rewrite= new CompilationUnitRewrite(unit, cuNode);
+				fRewrites.put(unit, rewrite);
+			}
+		}
 		if (rewrite == null) {
 			rewrite= new CompilationUnitRewrite(unit);
 			fRewrites.put(unit, rewrite);
@@ -1210,11 +1219,44 @@
 		} else {
 			typeBinding= expression.resolveTypeBinding();
 		}
-
+		if (typeBinding != null && typeBinding.isTypeVariable()) {
+			ITypeBinding[] typeBounds= typeBinding.getTypeBounds();
+			if (typeBounds.length > 0) {
+				for (ITypeBinding typeBound : typeBounds) {
+					ITypeBinding expressionType= getExpressionType(invocation, typeBound);
+					if (expressionType != null) {
+						return expressionType;
+					}
+				}
+				typeBinding= typeBounds[0].getTypeDeclaration();
+			} else {
+				typeBinding= invocation.getAST().resolveWellKnownType("java.lang.Object"); //$NON-NLS-1$
+			}
+		}
 		Assert.isNotNull(typeBinding, "Type binding of target expression may not be null"); //$NON-NLS-1$
 		return typeBinding;
 	}
 
+	private ITypeBinding getExpressionType(final MethodInvocation invocation, ITypeBinding typeBinding) {
+		if (typeBinding == null)
+			return null;
+		for (IMethodBinding iMethodBinding : typeBinding.getDeclaredMethods()) {
+			if (invocation.resolveMethodBinding() == iMethodBinding)
+				return typeBinding.getTypeDeclaration();
+		}
+		ITypeBinding expressionType= getExpressionType(invocation, typeBinding.getSuperclass());
+		if (expressionType != null) {
+			return expressionType;
+		}
+		for (ITypeBinding interfaceBinding : typeBinding.getInterfaces()) {
+			expressionType= getExpressionType(invocation, interfaceBinding);
+			if (expressionType != null) {
+				return expressionType;
+			}
+		}
+		return null;
+	}
+
 	private IFile[] getAllFilesToModify() {
 		List<ICompilationUnit> cus= new ArrayList<ICompilationUnit>();
 		cus.addAll(Arrays.asList(fTextChangeManager.getAllCompilationUnits()));
diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ParameterData.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ParameterData.java
index b4a3994..4db6bad 100644
--- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ParameterData.java
+++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ParameterData.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Nikolay Metchev <nikolaymetchev@gmail.com> - Anonymous class using final parameter breaks method inlining - https://bugs.eclipse.org/269401
  *******************************************************************************/
 package org.eclipse.jdt.internal.corext.refactoring.code;
 
@@ -14,6 +15,7 @@
 import java.util.List;
 
 import org.eclipse.jdt.core.dom.ITypeBinding;
+import org.eclipse.jdt.core.dom.Modifier;
 import org.eclipse.jdt.core.dom.SimpleName;
 import org.eclipse.jdt.core.dom.SingleVariableDeclaration;
 
@@ -59,6 +61,10 @@
 	public boolean isUnused() {
 		return fAccessMode == FlowInfo.UNUSED;
 	}
+	
+	public boolean isFinal() {
+		return Modifier.isFinal(fDeclaration.getModifiers());
+	}
 
 	public boolean isReadOnly() {
 		return (fAccessMode & (FlowInfo.READ | FlowInfo.READ_POTENTIAL)) != 0;
diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/PromoteTempToFieldRefactoring.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/PromoteTempToFieldRefactoring.java
index 0c4da89..aa4de86 100644
--- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/PromoteTempToFieldRefactoring.java
+++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/PromoteTempToFieldRefactoring.java
@@ -500,7 +500,7 @@
 	}
 
     private RefactoringStatus checkClashesWithExistingFields(){
-        FieldDeclaration[] existingFields= getFieldDeclarations(getBodyDeclarationListOfDeclaringType());
+        FieldDeclaration[] existingFields= getFieldDeclarations();
         for (int i= 0; i < existingFields.length; i++) {
             FieldDeclaration declaration= existingFields[i];
 			VariableDeclarationFragment[] fragments= (VariableDeclarationFragment[]) declaration.fragments().toArray(new VariableDeclarationFragment[declaration.fragments().size()]);
@@ -516,18 +516,8 @@
         return null;
     }
 
-    private ChildListPropertyDescriptor getBodyDeclarationListOfDeclaringType(){
-    	ASTNode methodParent= getMethodDeclaration().getParent();
-    	if (methodParent instanceof AbstractTypeDeclaration)
-    		return ((AbstractTypeDeclaration) methodParent).getBodyDeclarationsProperty();
-    	if (methodParent instanceof AnonymousClassDeclaration)
-    		return AnonymousClassDeclaration.BODY_DECLARATIONS_PROPERTY;
-    	Assert.isTrue(false);
-    	return null;
-    }
-
-    private FieldDeclaration[] getFieldDeclarations(ChildListPropertyDescriptor descriptor) {
-    	final List<BodyDeclaration> bodyDeclarations= (List<BodyDeclaration>) getMethodDeclaration().getParent().getStructuralProperty(descriptor);
+    private FieldDeclaration[] getFieldDeclarations() {
+    	List<BodyDeclaration> bodyDeclarations= ASTNodes.getBodyDeclarations(getMethodDeclaration().getParent());
     	List<FieldDeclaration> fields= new ArrayList<FieldDeclaration>(1);
     	for (Iterator<BodyDeclaration> iter= bodyDeclarations.iterator(); iter.hasNext();) {
 	        Object each= iter.next();
@@ -834,14 +824,14 @@
     }
 
     private void addFieldDeclaration(ASTRewrite rewrite) {
-    	final ChildListPropertyDescriptor descriptor= getBodyDeclarationListOfDeclaringType();
-    	FieldDeclaration[] fields= getFieldDeclarations(getBodyDeclarationListOfDeclaringType());
-    	final ASTNode parent= getMethodDeclaration().getParent();
+    	FieldDeclaration[] fields= getFieldDeclarations();
+    	ASTNode parent= getMethodDeclaration().getParent();
+    	ChildListPropertyDescriptor descriptor= ASTNodes.getBodyDeclarationsProperty(parent);
     	int insertIndex;
     	if (fields.length == 0)
     		insertIndex= 0;
     	else
-    		insertIndex= ((List<? extends ASTNode>) parent.getStructuralProperty(descriptor)).indexOf(fields[fields.length - 1]) + 1;
+    		insertIndex= ASTNodes.getBodyDeclarations(parent).indexOf(fields[fields.length - 1]) + 1;
 
     	final FieldDeclaration declaration= createNewFieldDeclaration(rewrite);
 		rewrite.getListRewrite(parent, descriptor).insertAt(declaration, insertIndex, null);
diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/TargetProvider.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/TargetProvider.java
index a001cea..ac0e068 100644
--- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/TargetProvider.java
+++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/TargetProvider.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -63,10 +63,9 @@
 import org.eclipse.jdt.internal.corext.refactoring.RefactoringScopeFactory;
 import org.eclipse.jdt.internal.corext.refactoring.base.JavaStatusContext;
 import org.eclipse.jdt.internal.corext.refactoring.base.ReferencesInBinaryContext;
-import org.eclipse.jdt.internal.corext.refactoring.util.RefactoringASTParser;
 import org.eclipse.jdt.internal.corext.util.SearchUtils;
 
-import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider;
+import org.eclipse.jdt.ui.SharedASTProvider;
 
 /**
  * A TargetProvider provides all targets that have to be adapted, i.e. all method invocations that should be inlined.
@@ -469,7 +468,7 @@
 
 		@Override
 		public BodyDeclaration[] getAffectedBodyDeclarations(ICompilationUnit unit, IProgressMonitor pm) {
-			ASTNode root= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(unit, true);
+			ASTNode root= SharedASTProvider.getAST(unit, SharedASTProvider.WAIT_YES, pm);
 			InvocationFinder finder= new InvocationFinder(fMethodBinding);
 			root.accept(finder);
 			fCurrentBodies= finder.result;
diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/generics/InferTypeArgumentsTCModel.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/generics/InferTypeArgumentsTCModel.java
index c915bef..4f61fa9 100644
--- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/generics/InferTypeArgumentsTCModel.java
+++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/generics/InferTypeArgumentsTCModel.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -534,14 +534,14 @@
 
 	public CollectionElementVariable2 getElementVariable(ConstraintVariable2 constraintVariable, ITypeBinding typeVariable) {
 		Assert.isTrue(typeVariable.isTypeVariable()); // includes null check
-		HashMap<String, CollectionElementVariable2> typeVarToElementVars= (HashMap<String, CollectionElementVariable2>) constraintVariable.getData(INDEXED_COLLECTION_ELEMENTS);
+		HashMap<String, CollectionElementVariable2> typeVarToElementVars= getIndexedCollectionElements(constraintVariable);
 		if (typeVarToElementVars == null)
 			return null;
 		return typeVarToElementVars.get(typeVariable.getKey());
 	}
 
 	public Map<String, CollectionElementVariable2> getElementVariables(ConstraintVariable2 constraintVariable) {
-		Map<String, CollectionElementVariable2> elementVariables= (Map<String, CollectionElementVariable2>) constraintVariable.getData(INDEXED_COLLECTION_ELEMENTS);
+		Map<String, CollectionElementVariable2> elementVariables= getIndexedCollectionElements(constraintVariable);
 		if (elementVariables == null)
 			return EMPTY_COLLECTION_ELEMENT_VARIABLES_MAP;
 		else
@@ -790,8 +790,13 @@
 		return cv;
 	}
 
-	private void setElementVariable(ConstraintVariable2 typeConstraintVariable, CollectionElementVariable2 elementVariable, TypeVariable typeVariable) {
-		HashMap<String, CollectionElementVariable2> keyToElementVar= (HashMap<String, CollectionElementVariable2>) typeConstraintVariable.getData(INDEXED_COLLECTION_ELEMENTS);
+	@SuppressWarnings("unchecked")
+	private static HashMap<String, CollectionElementVariable2> getIndexedCollectionElements(ConstraintVariable2 constraintVariable) {
+		return (HashMap<String, CollectionElementVariable2>) constraintVariable.getData(INDEXED_COLLECTION_ELEMENTS);
+	}
+
+	private static void setElementVariable(ConstraintVariable2 typeConstraintVariable, CollectionElementVariable2 elementVariable, TypeVariable typeVariable) {
+		HashMap<String, CollectionElementVariable2> keyToElementVar= getIndexedCollectionElements(typeConstraintVariable);
 		String key= typeVariable.getBindingKey();
 		if (keyToElementVar == null) {
 			keyToElementVar= new HashMap<String, CollectionElementVariable2>();
@@ -807,7 +812,7 @@
 
 	public CollectionElementVariable2 getElementVariable(ConstraintVariable2 constraintVariable, TypeVariable typeVariable) {
 		Assert.isTrue(typeVariable.isTypeVariable()); // includes null check
-		HashMap<String, CollectionElementVariable2> typeVarToElementVars= (HashMap<String, CollectionElementVariable2>) constraintVariable.getData(INDEXED_COLLECTION_ELEMENTS);
+		HashMap<String, CollectionElementVariable2> typeVarToElementVars= getIndexedCollectionElements(constraintVariable);
 		if (typeVarToElementVars == null)
 			return null;
 		return typeVarToElementVars.get(typeVariable.getBindingKey());
diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/refactoring.properties b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/refactoring.properties
index 2688ca4..5b05a4f 100644
--- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/refactoring.properties
+++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/refactoring.properties
@@ -13,6 +13,7 @@
 #     IBM Corporation - initial API and implementation
 #     Benjamin Muskalla <bmuskalla@eclipsesource.com> - [extract method] Extract method and continue https://bugs.eclipse.org/bugs/show_bug.cgi?id=48056
 #     Benjamin Muskalla <bmuskalla@eclipsesource.com> - [extract method] Name ambiguous return value in error message - https://bugs.eclipse.org/bugs/show_bug.cgi?id=50607
+#	  Samrat Dhillon <samrat.dhillon@gmail.com> - [introduce factory] Introduce Factory on an abstract class adds a statement to create an instance of that class - https://bugs.eclipse.org/bugs/show_bug.cgi?id=395016
 ###############################################################################
 # NLS properties for the Refactoring Core
 
@@ -1274,6 +1275,7 @@
 IntroduceFactoryRefactoring_factory_pattern=Factory name: ''{0}''
 IntroduceFactoryRefactoring_declare_private=Declare original constructor 'private'
 IntroduceFactory_constructorInEnum=Introduce Factory is not supported for constructors of enumerated types.
+IntroduceFactory_abstractClass=Anonymous class will be created within the factory method.
 
 #--- Generalize Declared Type
 ChangeTypeRefactoring_checking_preconditions=Checking preconditions...
diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameTypeProcessor.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameTypeProcessor.java
index b015f3a..736dc6b 100644
--- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameTypeProcessor.java
+++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameTypeProcessor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -700,7 +700,7 @@
 				IJavaElement element= iter.next();
 				fPreloadedElementToSelection.put(element, Boolean.TRUE);
 			}
-			fPreloadedElementToNameDefault= (LinkedHashMap<IJavaElement, String>) fPreloadedElementToName.clone();
+			fPreloadedElementToNameDefault= new LinkedHashMap<IJavaElement, String>(fPreloadedElementToName);
 
 		} catch (OperationCanceledException e) {
 			fReferences= null;
diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/JavaDeleteProcessor.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/JavaDeleteProcessor.java
index 6ef8423..91856d5 100644
--- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/JavaDeleteProcessor.java
+++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/JavaDeleteProcessor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -397,6 +397,7 @@
 	 */
 	private void addDeletableParentPackagesOnPackageDeletion() throws CoreException {
 
+		@SuppressWarnings("unchecked")
 		final List<IPackageFragment> initialPackagesToDelete= (List<IPackageFragment>) ReorgUtils.getElementsOfType(fJavaElements, IJavaElement.PACKAGE_FRAGMENT);
 
 		if (initialPackagesToDelete.size() == 0)
diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/ReorgPolicyFactory.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/ReorgPolicyFactory.java
index e743a7d..618686b 100644
--- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/ReorgPolicyFactory.java
+++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/ReorgPolicyFactory.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -4254,7 +4254,7 @@
 			if (copy) {
 				return new CopySubCuElementsPolicy(javaElements);
 			} else {
-				List<IImportDeclaration> declarations= (List<IImportDeclaration>) ReorgUtils.getElementsOfType(javaElements, IJavaElement.IMPORT_DECLARATION);
+				List<?> declarations= ReorgUtils.getElementsOfType(javaElements, IJavaElement.IMPORT_DECLARATION);
 				return new MoveImportDeclarationsPolicy(declarations.toArray(new IImportDeclaration[declarations.size()]));
 			}
 		}
diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/sef/AccessAnalyzer.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/sef/AccessAnalyzer.java
index 27889dc..935504e 100644
--- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/sef/AccessAnalyzer.java
+++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/sef/AccessAnalyzer.java
@@ -9,6 +9,7 @@
  *     IBM Corporation - initial API and implementation
  *     jens.lukowski@gmx.de - contributed code to convert prefix and postfix
  *       expressions into a combination of setter and getter calls.
+ *     Nikolay Metchev <nikolaymetchev@gmail.com> - [encapsulate field] Encapsulating parenthesized field assignment yields compilation error - https://bugs.eclipse.org/177095
  *******************************************************************************/
 package org.eclipse.jdt.internal.corext.refactoring.sef;
 
@@ -280,6 +281,8 @@
 			return ((QualifiedName)expression).resolveBinding();
 		else if (expression instanceof FieldAccess)
 			return ((FieldAccess)expression).getName().resolveBinding();
+		else if (expression instanceof ParenthesizedExpression)
+			return resolveBinding(((ParenthesizedExpression) expression).getExpression());
 		return null;
 	}
 
@@ -292,6 +295,8 @@
 				return ((QualifiedName)expression).getQualifier();
 			case ASTNode.FIELD_ACCESS:
 				return ((FieldAccess)expression).getExpression();
+			case ASTNode.PARENTHESIZED_EXPRESSION:
+				return getReceiver(((ParenthesizedExpression)expression).getExpression());
 		}
 		return null;
 	}
diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ChangeSignatureProcessor.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ChangeSignatureProcessor.java
index 578bebb..0503d2d 100644
--- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ChangeSignatureProcessor.java
+++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ChangeSignatureProcessor.java
@@ -2791,9 +2791,9 @@
 	protected <T extends ASTNode> T moveNode(T oldNode, ASTRewrite rewrite) {
 		T movedNode;
 		if (ASTNodes.isExistingNode(oldNode))
-			movedNode= (T) rewrite.createMoveTarget(oldNode); //node must be one of ast
+			movedNode= ASTNodes.createMoveTarget(rewrite, oldNode); //node must be one of ast
 		else
-			movedNode= (T) ASTNode.copySubtree(rewrite.getAST(), oldNode);
+			movedNode= ASTNodes.copySubtree(rewrite.getAST(), oldNode);
 		return movedNode;
 	}
 
diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ChangeTypeRefactoring.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ChangeTypeRefactoring.java
index 306d795..88989a1 100644
--- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ChangeTypeRefactoring.java
+++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ChangeTypeRefactoring.java
@@ -44,7 +44,9 @@
 import org.eclipse.jdt.core.IField;
 import org.eclipse.jdt.core.IJavaElement;
 import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IMember;
 import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IPackageFragment;
 import org.eclipse.jdt.core.JavaModelException;
 import org.eclipse.jdt.core.dom.AST;
 import org.eclipse.jdt.core.dom.ASTNode;
@@ -78,6 +80,7 @@
 import org.eclipse.jdt.core.search.SearchPattern;
 
 import org.eclipse.jdt.internal.core.refactoring.descriptors.RefactoringSignatureDescriptorFactory;
+import org.eclipse.jdt.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext;
 import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility;
 import org.eclipse.jdt.internal.corext.dom.ASTNodeFactory;
 import org.eclipse.jdt.internal.corext.dom.Bindings;
@@ -109,6 +112,7 @@
 import org.eclipse.jdt.internal.corext.refactoring.typeconstraints.TypeVariable;
 import org.eclipse.jdt.internal.corext.refactoring.util.RefactoringASTParser;
 import org.eclipse.jdt.internal.corext.refactoring.util.ResourceUtil;
+import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
 import org.eclipse.jdt.internal.corext.util.Messages;
 import org.eclipse.jdt.internal.corext.util.SearchUtils;
 
@@ -537,7 +541,7 @@
 	 * @throws CoreException
 	 */
 	private void addAllChangesFor(ICompilationUnit icu, Set<ConstraintVariable> vars, CompilationUnitChange unitChange) throws CoreException {
-		CompilationUnit	unit= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(icu, false);
+		CompilationUnit	unit= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(icu, true);
 		ASTRewrite unitRewriter= ASTRewrite.create(unit.getAST());
 		MultiTextEdit root= new MultiTextEdit();
 		unitChange.setEdit(root); // Adam sez don't need this, but then unitChange.addGroupDescription() fails an assertion!
@@ -1211,6 +1215,13 @@
 						    Collection<ITypeConstraint> constraints,
 							IProgressMonitor pm) throws JavaModelException {
 		pm.beginTask(RefactoringCoreMessages.ChangeTypeRefactoring_analyzingMessage, constraints.size());
+
+		for(ICompilationUnit cu: fAffectedUnits){
+			if (!JavaModelUtil.isVisibleInHierarchy((IMember) (type.getJavaElement()), (IPackageFragment) cu.getParent())) {
+				return false;
+			}
+		}
+
 		for (Iterator<ITypeConstraint> it= constraints.iterator(); it.hasNext(); ) {
 			ITypeConstraint tc= it.next();
 			if (tc instanceof SimpleTypeConstraint) {
@@ -1320,7 +1331,8 @@
 	 */
 	private String updateImports(CompilationUnit astRoot, MultiTextEdit rootEdit) throws CoreException{
 		ImportRewrite rewrite= StubUtility.createImportRewrite(astRoot, true);
-		String typeName= rewrite.addImport(fSelectedType.getQualifiedName());
+		ContextSensitiveImportRewriteContext context= new ContextSensitiveImportRewriteContext(astRoot, fSelectionStart, rewrite);
+		String typeName= rewrite.addImport(fSelectedType.getQualifiedName(), context);
 		rootEdit.addChild(rewrite.rewriteImports(null));
 		return typeName;
 	}
diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/CompilationUnitRewrite.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/CompilationUnitRewrite.java
index 4c4ee9e..2557820 100644
--- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/CompilationUnitRewrite.java
+++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/CompilationUnitRewrite.java
@@ -158,11 +158,12 @@
 
 	public void clearImportRewrites() {
 		fImportRewrite= null;
+		fImportRemover= null;
 	}
 
 	public void clearASTAndImportRewrites() {
 		clearASTRewrite();
-		fImportRewrite= null;
+		clearImportRewrites();
 	}
 
 	public CategorizedTextEditGroup createCategorizedGroupDescription(String name, GroupCategorySet set) {
@@ -268,6 +269,8 @@
 			}
 
 			if (needsAstRewrite) {
+				// clean up garbage from earlier calls to ASTRewrite#rewriteAST(..), see https://bugs.eclipse.org/bugs/show_bug.cgi?id=408334#c2
+				clearGroupDescriptionEdits();
 				TextEdit rewriteEdit;
 				if (fRememberContent != null) {
 					rewriteEdit= fRewrite.rewriteAST(fRememberContent, fCu.getJavaProject().getOptions(true));
@@ -366,7 +369,7 @@
 		return fImportRemover;
 	}
 
-	public void clearGroupDescriptions() {
+	private void clearGroupDescriptionEdits() {
 		for (Iterator<TextEditGroup> iter= fTextEditGroups.iterator(); iter.hasNext();) {
 			TextEditGroup group= iter.next();
 			group.clearTextEdits();
diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ExtractClassRefactoring.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ExtractClassRefactoring.java
index 5c5c75b..30e5b2f 100644
--- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ExtractClassRefactoring.java
+++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ExtractClassRefactoring.java
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Nikolay Metchev <nikolaymetchev@gmail.com> - [extract class] Extract class refactoring on a field in an inner non-static class yields compilation error - https://bugs.eclipse.org/394547
  *******************************************************************************/
 package org.eclipse.jdt.internal.corext.refactoring.structure;
 
@@ -482,18 +483,29 @@
 			ListRewrite listRewrite= rewrite.getListRewrite(typeDecl, TypeDeclaration.BODY_DECLARATIONS_PROPERTY);
 			TypeDeclaration paramClass= pof.createClassDeclaration(typeDecl.getName().getFullyQualifiedName(), fBaseCURewrite, fieldUpdate);
 			paramClass.modifiers().add(rewrite.getAST().newModifier(ModifierKeyword.PUBLIC_KEYWORD));
-			paramClass.modifiers().add(rewrite.getAST().newModifier(ModifierKeyword.STATIC_KEYWORD));
+			if (shouldParamClassBeStatic(typeDecl)) {
+				paramClass.modifiers().add(rewrite.getAST().newModifier(ModifierKeyword.STATIC_KEYWORD));
+			}
 			listRewrite.insertFirst(paramClass, fBaseCURewrite.createGroupDescription(RefactoringCoreMessages.ExtractClassRefactoring_group_insert_parameter));
 			return new ArrayList<ResourceChange>(); //Change will be generated later for fBaseCURewrite
 		}
 
 	}
 
+	private boolean shouldParamClassBeStatic(TypeDeclaration enclosingTypeDecl) {
+		if (enclosingTypeDecl.isPackageMemberTypeDeclaration()) {
+			return true;
+		}
+		ITypeBinding binding= enclosingTypeDecl.resolveBinding();
+		int modifiers= binding != null ? binding.getModifiers() : enclosingTypeDecl.getModifiers();
+		return Modifier.isStatic(modifiers);
+	}
+
 	private ParameterObjectFactory initializeFactory() {
 		ParameterObjectFactory pof= new ParameterObjectFactory();
 		pof.setClassName(fDescriptor.getClassName());
 		pof.setPackage(fDescriptor.getPackage());
-		pof.setEnclosingType(fDescriptor.getType().getFullyQualifiedName());
+		pof.setEnclosingType(fDescriptor.getType().getFullyQualifiedName('.'));
 		pof.setCreateGetter(fDescriptor.isCreateGetterSetter());
 		pof.setCreateSetter(fDescriptor.isCreateGetterSetter());
 		List<ParameterInfo> variables= new ArrayList<ParameterInfo>();
@@ -742,9 +754,9 @@
 						status.addFatalError(Messages.format(RefactoringCoreMessages.ExtractClassRefactoring_fatal_error_cannot_resolve_binding, BasicElementLabels.getJavaElementName(pi.name)), JavaStatusContext.create(typeRoot, vdf));
 					} else {
 						ITypeBinding typeBinding= binding.getType();
-						if (Modifier.isPrivate(typeBinding.getDeclaredModifiers())){
+						if (Modifier.isPrivate(typeBinding.getModifiers())){
 							status.addError(Messages.format(RefactoringCoreMessages.ExtractClassRefactoring_error_referencing_private_class, BasicElementLabels.getJavaElementName(typeBinding.getName())), JavaStatusContext.create(typeRoot, vdf));
-						} else if (Modifier.isProtected(typeBinding.getDeclaredModifiers())){
+						} else if (Modifier.isProtected(typeBinding.getModifiers())){
 							ITypeBinding declaringClass= typeBinding.getDeclaringClass();
 							if (declaringClass != null) {
 								IPackageBinding package1= declaringClass.getPackage();
diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/HierarchyProcessor.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/HierarchyProcessor.java
index afbe912..06f156e 100644
--- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/HierarchyProcessor.java
+++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/HierarchyProcessor.java
@@ -247,7 +247,7 @@
 		}
 	}
 
-	protected static void copyJavadocNode(final ASTRewrite rewrite, final BodyDeclaration oldDeclaration, final BodyDeclaration newDeclaration) throws JavaModelException {
+	protected static void copyJavadocNode(final ASTRewrite rewrite, final BodyDeclaration oldDeclaration, final BodyDeclaration newDeclaration) {
 		final Javadoc predecessor= oldDeclaration.getJavadoc();
 		if (predecessor != null) {
 			String newString= ASTNodes.getNodeSource(predecessor, false, true);
@@ -731,4 +731,4 @@
 			return true;
 		return hasNonMovedReferences(member, monitor, status);
 	}
-}
\ No newline at end of file
+}
diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MemberVisibilityAdjustor.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MemberVisibilityAdjustor.java
index 800311f..1464477 100644
--- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MemberVisibilityAdjustor.java
+++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MemberVisibilityAdjustor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -997,6 +997,7 @@
 				rewrite= new CompilationUnitRewrite(unit);
 			else
 				rewrite= new CompilationUnitRewrite(fOwner, unit);
+			fRewrites.put(unit, rewrite);
 		}
 		return rewrite;
 	}
diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MoveInnerToTopRefactoring.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MoveInnerToTopRefactoring.java
index d602cc1..4e76be8 100644
--- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MoveInnerToTopRefactoring.java
+++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MoveInnerToTopRefactoring.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Samrat Dhillon samrat.dhillon@gmail.com - [move member type] Moving a member interface to its own file adds the host's type parameters to it - https://bugs.eclipse.org/bugs/show_bug.cgi?id=385237
  *******************************************************************************/
 package org.eclipse.jdt.internal.corext.refactoring.structure;
 
@@ -38,7 +39,6 @@
 import org.eclipse.ltk.core.refactoring.RefactoringStatusEntry;
 import org.eclipse.ltk.core.refactoring.TextChange;
 
-import org.eclipse.jdt.core.Flags;
 import org.eclipse.jdt.core.ICompilationUnit;
 import org.eclipse.jdt.core.IField;
 import org.eclipse.jdt.core.IJavaElement;
@@ -346,7 +346,7 @@
 					map.put(binding.getKey(), binding);
 			}
 			final IType declaring= type.getDeclaringType();
-			if (declaring != null && !Flags.isStatic(type.getFlags()))
+			if (declaring != null && !JdtFlags.isStatic(type))
 				addTypeParameters(unit, declaring, map);
 		}
 	}
diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MoveInstanceMethodProcessor.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MoveInstanceMethodProcessor.java
index 48d6687..2cf23c2 100644
--- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MoveInstanceMethodProcessor.java
+++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MoveInstanceMethodProcessor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -7,6 +7,9 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Nikolay Metchev <nikolaymetchev@gmail.com> - [move method] super method invocation does not compile after refactoring - https://bugs.eclipse.org/356687
+ *     Nikolay Metchev <nikolaymetchev@gmail.com> - [move method] Move method with static imported method calls introduces compiler error - https://bugs.eclipse.org/217753
+ *     Nikolay Metchev <nikolaymetchev@gmail.com> - [move method] Annotation error in applying move-refactoring to inherited methods - https://bugs.eclipse.org/404471
  *******************************************************************************/
 package org.eclipse.jdt.internal.corext.refactoring.structure;
 
@@ -69,6 +72,7 @@
 import org.eclipse.jdt.core.dom.ASTNode;
 import org.eclipse.jdt.core.dom.ASTVisitor;
 import org.eclipse.jdt.core.dom.AbstractTypeDeclaration;
+import org.eclipse.jdt.core.dom.Annotation;
 import org.eclipse.jdt.core.dom.AnnotationTypeDeclaration;
 import org.eclipse.jdt.core.dom.AnonymousClassDeclaration;
 import org.eclipse.jdt.core.dom.Assignment;
@@ -79,6 +83,7 @@
 import org.eclipse.jdt.core.dom.Expression;
 import org.eclipse.jdt.core.dom.FieldAccess;
 import org.eclipse.jdt.core.dom.IBinding;
+import org.eclipse.jdt.core.dom.IExtendedModifier;
 import org.eclipse.jdt.core.dom.IMethodBinding;
 import org.eclipse.jdt.core.dom.ITypeBinding;
 import org.eclipse.jdt.core.dom.IVariableBinding;
@@ -263,8 +268,6 @@
 
 		private Map<IMember, IncomingMemberVisibilityAdjustment> fAdjustments;
 
-		private boolean fNeededInsertion;
-
 		private Map<ICompilationUnit, CompilationUnitRewrite> fRewrites;
 
 		public DelegateInstanceMethodCreator(Map<IMember, IncomingMemberVisibilityAdjustment> adjustments, Map<ICompilationUnit, CompilationUnitRewrite> rewrites) {
@@ -279,7 +282,7 @@
 			final MethodInvocation invocation= getAst().newMethodInvocation();
 			invocation.setName(getAst().newSimpleName(getNewElementName()));
 			invocation.setExpression(createSimpleTargetAccessExpression(methodDeclaration));
-			fNeededInsertion= createArgumentList(methodDeclaration, invocation.arguments(), new VisibilityAdjustingArgumentFactory(getAst(), fRewrites, fAdjustments));
+			createArgumentList(methodDeclaration, invocation.arguments(), new VisibilityAdjustingArgumentFactory(getAst(), fRewrites, fAdjustments));
 			final Block block= getAst().newBlock();
 			block.statements().add(createMethodInvocation(methodDeclaration, invocation));
 			if (!fSourceRewrite.getCu().equals(fTargetType.getCompilationUnit()))
@@ -291,10 +294,6 @@
 		protected ASTNode createDocReference(final BodyDeclaration declaration) throws JavaModelException {
 			return MoveInstanceMethodProcessor.this.createMethodReference((MethodDeclaration) declaration, getAst());
 		}
-
-		protected boolean getNeededInsertion() {
-			return fNeededInsertion;
-		}
 	}
 
 	/**
@@ -584,8 +583,15 @@
 					final AST ast= node.getAST();
 					if (!JdtFlags.isStatic(method))
 						rewrite.set(node, MethodInvocation.EXPRESSION_PROPERTY, ast.newSimpleName(fTargetName), null);
-					else
-						rewrite.set(node, MethodInvocation.EXPRESSION_PROPERTY, ast.newSimpleType(ast.newSimpleName(fMethod.getDeclaringType().getElementName())), null);
+					else if (!fStaticImports.contains(method)) {
+						ITypeBinding declaring= method.getDeclaringClass();
+						if (declaring != null) {
+							IType type= (IType) declaring.getJavaElement();
+							if (type != null) {
+								rewrite.set(node, MethodInvocation.EXPRESSION_PROPERTY, ast.newName(type.getTypeQualifiedName('.')), null);
+							}
+						}
+					}
 					return true;
 				} else {
 					if (expression instanceof FieldAccess) {
@@ -1212,15 +1218,17 @@
 		Assert.isNotNull(monitor);
 		Assert.isNotNull(status);
 		final IMethod[] methods= fTargetType.getMethods();
+		int newParamCount= fMethod.getParameterTypes().length;
+		if (!fTarget.isField())
+			newParamCount--; // moving to a parameter
+		if (needsTargetNode())
+			newParamCount++; // will add a parameter for the old 'this'
 		try {
 			monitor.beginTask("", methods.length); //$NON-NLS-1$
 			monitor.setTaskName(RefactoringCoreMessages.MoveInstanceMethodProcessor_checking);
 			IMethod method= null;
 			for (int index= 0; index < methods.length; index++) {
 				method= methods[index];
-				int newParamCount= fMethod.getParameterTypes().length;
-				if (needsTargetNode())
-					newParamCount--;
 				if (method.getElementName().equals(fMethodName) && method.getParameterTypes().length == newParamCount)
 					status.merge(RefactoringStatus.createErrorStatus(Messages.format(RefactoringCoreMessages.MoveInstanceMethodProcessor_method_already_exists, new String[] { BasicElementLabels.getJavaElementName(fMethodName), BasicElementLabels.getJavaElementName(fTargetType.getElementName()) }), JavaStatusContext.create(method)));
 				monitor.worked(1);
@@ -1685,39 +1693,32 @@
 	 *            the argument list to create
 	 * @param factory
 	 *            the argument factory to use
-	 * @return <code>true</code> if a target node had to be inserted as first
-	 *         argument, <code>false</code> otherwise
 	 * @throws JavaModelException
 	 *             if an error occurs
 	 */
-	protected boolean createArgumentList(final MethodDeclaration declaration, final List<ASTNode> arguments, final IArgumentFactory factory) throws JavaModelException {
+	protected void createArgumentList(MethodDeclaration declaration, List<ASTNode> arguments, IArgumentFactory factory) throws JavaModelException {
 		Assert.isNotNull(declaration);
 		Assert.isNotNull(arguments);
 		Assert.isNotNull(factory);
-		final AstNodeFinder finder= new ThisReferenceFinder();
-		declaration.accept(finder);
-		IVariableBinding binding= null;
-		VariableDeclaration variable= null;
-		boolean added= false;
-		final int size= declaration.parameters().size();
-		for (int index= 0; index < size; index++) {
-			variable= (VariableDeclaration) declaration.parameters().get(index);
-			binding= variable.resolveBinding();
-			if (binding != null) {
-				if (!Bindings.equals(binding, fTarget))
-					arguments.add(factory.getArgumentNode(binding, index == size - 1));
-				else if (!finder.getStatus().isOK()) {
+		List<SingleVariableDeclaration> parameters= declaration.parameters();
+		int size= parameters.size();
+		for (int i= 0; i < size; i++) {
+			IVariableBinding binding= parameters.get(i).resolveBinding();
+			if (binding != null && Bindings.equals(binding, fTarget)) {
+				if (needsTargetNode()) {
+					// replace move target parameter with new target
 					arguments.add(factory.getTargetNode());
-					added= true;
+				} else {
+					// drop unused move target parameter 
 				}
-			} else
-				arguments.add(factory.getArgumentNode(binding, index == size - 1));
+			} else {
+				arguments.add(factory.getArgumentNode(binding, i == size - 1));
+			}
 		}
-		if (!finder.getStatus().isOK() && !added) {
+		if (needsTargetNode() && fTarget.isField()) {
+			// prepend new target when moving to a field
 			arguments.add(0, factory.getTargetNode());
-			added= true;
 		}
-		return added;
 	}
 
 	/*
@@ -1808,15 +1809,15 @@
 			adjustor.setRewrite(sourceRewrite, fSourceRewrite.getRoot());
 			adjustor.adjustVisibility(new SubProgressMonitor(monitor, 1));
 			final IDocument document= new Document(fMethod.getCompilationUnit().getBuffer().getContents());
-			final boolean target= createMethodCopy(document, declaration, sourceRewrite, rewrites, adjustor.getAdjustments(), status, new SubProgressMonitor(monitor, 1));
-			createMethodJavadocReferences(rewrites, declaration, references, target, status, new SubProgressMonitor(monitor, 1));
+			createMethodCopy(document, declaration, sourceRewrite, rewrites, adjustor.getAdjustments(), status, new SubProgressMonitor(monitor, 1));
+			createMethodJavadocReferences(rewrites, declaration, references, status, new SubProgressMonitor(monitor, 1));
 			if (!fSourceRewrite.getCu().equals(targetRewrite.getCu()))
 				createMethodImports(targetRewrite, declaration, new SubProgressMonitor(monitor, 1), status);
 			boolean removable= false;
 			if (fInline) {
 				String binaryRefsDescription= Messages.format(RefactoringCoreMessages.ReferencesInBinaryContext_ref_in_binaries_description , BasicElementLabels.getJavaElementName(getMethod().getElementName()));
 				ReferencesInBinaryContext binaryRefs= new ReferencesInBinaryContext(binaryRefsDescription);
-				removable= createMethodDelegator(rewrites, declaration, references, adjustor.getAdjustments(), target, binaryRefs, status, new SubProgressMonitor(monitor, 1));
+				removable= createMethodDelegator(rewrites, declaration, references, adjustor.getAdjustments(), binaryRefs, status, new SubProgressMonitor(monitor, 1));
 				binaryRefs.addErrorIfNecessary(status);
 				if (fRemove && removable) {
 					fSourceRewrite.getASTRewrite().remove(declaration, fSourceRewrite.createGroupDescription(RefactoringCoreMessages.MoveInstanceMethodProcessor_remove_original_method));
@@ -1864,9 +1865,6 @@
 	 *            the search match representing the method invocation
 	 * @param adjustments
 	 *            the map of elements to visibility adjustments
-	 * @param target
-	 *            <code>true</code> if a target node had to be inserted as
-	 *            first argument, <code>false</code> otherwise
 	 * @param status
 	 *            the refactoring status
 	 * @return <code>true</code> if the inline change could be performed,
@@ -1875,7 +1873,8 @@
 	 *             if a problem occurred while creating the inlined target
 	 *             expression for field targets
 	 */
-	protected boolean createInlinedMethodInvocation(final CompilationUnitRewrite rewriter, final MethodDeclaration declaration, final SearchMatch match, final Map<IMember, IncomingMemberVisibilityAdjustment> adjustments, final boolean target, final RefactoringStatus status) throws JavaModelException {
+	protected boolean createInlinedMethodInvocation(CompilationUnitRewrite rewriter, MethodDeclaration declaration, SearchMatch match,
+			Map<IMember, IncomingMemberVisibilityAdjustment> adjustments, RefactoringStatus status) throws JavaModelException {
 		Assert.isNotNull(rewriter);
 		Assert.isNotNull(declaration);
 		Assert.isNotNull(match);
@@ -1885,7 +1884,47 @@
 		final ASTRewrite rewrite= rewriter.getASTRewrite();
 		final ASTNode node= ASTNodeSearchUtil.findNode(match, rewriter.getRoot());
 		final TextEditGroup group= rewriter.createGroupDescription(RefactoringCoreMessages.MoveInstanceMethodProcessor_inline_method_invocation);
-		if (node instanceof MethodInvocation) {
+		if (node instanceof SuperMethodInvocation) {
+			SuperMethodInvocation invocation= (SuperMethodInvocation) node;
+			MethodInvocation newMethodInvocation= rewrite.getAST().newMethodInvocation();
+			newMethodInvocation.setName(rewrite.getAST().newSimpleName(fMethodName));
+			if (fTarget.isField()) {
+				newMethodInvocation.setStructuralProperty(MethodInvocation.EXPRESSION_PROPERTY, rewrite.getAST().newSimpleName(fTarget.getName()));
+				if (needsTargetNode()) {
+					newMethodInvocation.arguments().add(rewrite.getAST().newThisExpression());
+				}
+				for (ASTNode astNode : (List<ASTNode>) invocation.arguments()) {
+					newMethodInvocation.arguments().add(rewrite.createCopyTarget(astNode));
+				}
+			} else {
+				final IVariableBinding[] bindings= getArgumentBindings(declaration);
+				List<ASTNode> arguments= invocation.arguments();
+				for (int i= 0; i < arguments.size(); i++) {
+					ASTNode arg= arguments.get(i);
+					if (bindings.length > i && Bindings.equals(bindings[i], fTarget)) {
+						if (arg.getNodeType() == ASTNode.NULL_LITERAL) {
+							status.merge(RefactoringStatus.createErrorStatus(
+									Messages.format(RefactoringCoreMessages.MoveInstanceMethodProcessor_no_null_argument,
+											BindingLabelProvider.getBindingLabel(declaration.resolveBinding(), JavaElementLabels.ALL_FULLY_QUALIFIED)),
+											JavaStatusContext.create(rewriter.getCu(), invocation)));
+							result= false;
+						} else {
+							if (arg.getNodeType() != ASTNode.THIS_EXPRESSION) {
+								newMethodInvocation.setStructuralProperty(MethodInvocation.EXPRESSION_PROPERTY, rewrite.createCopyTarget(arg));
+							}
+							if (needsTargetNode()) {
+								newMethodInvocation.arguments().add(rewrite.getAST().newThisExpression());
+							}
+						}
+					} else {
+						newMethodInvocation.arguments().add(rewrite.createCopyTarget(arg));
+					}
+				}
+			}
+			if (result) {
+				rewrite.replace(node, newMethodInvocation, group);
+			}
+		} else if (node instanceof MethodInvocation) {
 			final MethodInvocation invocation= (MethodInvocation) node;
 			final ListRewrite list= rewrite.getListRewrite(invocation, MethodInvocation.ARGUMENTS_PROPERTY);
 			if (fTarget.isField()) {
@@ -1895,7 +1934,7 @@
 					rewrite.set(invocation, MethodInvocation.EXPRESSION_PROPERTY, access, group);
 				} else
 					rewrite.set(invocation, MethodInvocation.EXPRESSION_PROPERTY, rewrite.getAST().newSimpleName(fTarget.getName()), group);
-				if (target) {
+				if (needsTargetNode()) {
 					if (access == null || !(access instanceof FieldAccess))
 						list.insertFirst(rewrite.getAST().newThisExpression(), null);
 					else
@@ -1918,7 +1957,7 @@
 								rewrite.remove(invocation.getExpression(), null);
 							else
 								rewrite.set(invocation, MethodInvocation.EXPRESSION_PROPERTY, rewrite.createCopyTarget(argument), group);
-							if (target) {
+							if (needsTargetNode()) {
 								if (invocation.getExpression() != null)
 									list.replace(argument, rewrite.createCopyTarget(invocation.getExpression()), group);
 								else {
@@ -1999,12 +2038,10 @@
 	 *            the map of elements to visibility adjustments
 	 * @param status
 	 *            the refactoring status
-	 * @return <code>true</code> if a target node had to be inserted as method
-	 *         argument, <code>false</code> otherwise
 	 * @throws JavaModelException
 	 *             if an error occurs while accessing the types of the arguments
 	 */
-	protected boolean createMethodArguments(final Map<ICompilationUnit, CompilationUnitRewrite> rewrites, final ASTRewrite rewrite, final MethodDeclaration declaration, final Map<IMember, IncomingMemberVisibilityAdjustment> adjustments, final RefactoringStatus status) throws JavaModelException {
+	protected void createMethodArguments(Map<ICompilationUnit, CompilationUnitRewrite> rewrites, ASTRewrite rewrite, final MethodDeclaration declaration, Map<IMember, IncomingMemberVisibilityAdjustment> adjustments, RefactoringStatus status) throws JavaModelException {
 		Assert.isNotNull(rewrites);
 		Assert.isNotNull(declaration);
 		Assert.isNotNull(rewrite);
@@ -2015,7 +2052,7 @@
 		final AstNodeFinder finder= new AnonymousClassReferenceFinder(declaration);
 		declaration.accept(finder);
 		final List<ASTNode> arguments= new ArrayList<ASTNode>(declaration.parameters().size() + 1);
-		final boolean result= createArgumentList(declaration, arguments, new VisibilityAdjustingArgumentFactory(ast, rewrites, adjustments) {
+		createArgumentList(declaration, arguments, new VisibilityAdjustingArgumentFactory(ast, rewrites, adjustments) {
 
 			@Override
 			public final ASTNode getArgumentNode(final IVariableBinding binding, final boolean last) throws JavaModelException {
@@ -2074,7 +2111,6 @@
 			node= iterator.next();
 			list.insertLast(node, null);
 		}
-		return result;
 	}
 
 	/**
@@ -2226,10 +2262,8 @@
 	 *            the progress monitor to display progress
 	 * @throws CoreException
 	 *             if an error occurs
-	 * @return <code>true</code> if a target node had to be inserted as first
-	 *         argument, <code>false</code> otherwise
 	 */
-	protected boolean createMethodCopy(final IDocument document, final MethodDeclaration declaration, final ASTRewrite rewrite, final Map<ICompilationUnit, CompilationUnitRewrite> rewrites, final Map<IMember, IncomingMemberVisibilityAdjustment> adjustments, final RefactoringStatus status, final IProgressMonitor monitor) throws CoreException {
+	protected void createMethodCopy(IDocument document, MethodDeclaration declaration, ASTRewrite rewrite, Map<ICompilationUnit, CompilationUnitRewrite> rewrites, Map<IMember, IncomingMemberVisibilityAdjustment> adjustments, RefactoringStatus status, IProgressMonitor monitor) throws CoreException {
 		Assert.isNotNull(document);
 		Assert.isNotNull(declaration);
 		Assert.isNotNull(rewrite);
@@ -2237,7 +2271,6 @@
 		Assert.isNotNull(adjustments);
 		Assert.isNotNull(status);
 		Assert.isNotNull(monitor);
-		boolean target= false;
 		final CompilationUnitRewrite rewriter= getCompilationUnitRewrite(rewrites, getTargetType().getCompilationUnit());
 		try {
 			rewrite.set(declaration, MethodDeclaration.NAME_PROPERTY, rewrite.getAST().newSimpleName(fMethodName), null);
@@ -2255,7 +2288,16 @@
 					adjustments.put(fMethod, adjustment);
 				}
 			}
-			target= createMethodArguments(rewrites, rewrite, declaration, adjustments, status);
+			for (IExtendedModifier modifier : (List<IExtendedModifier>) declaration.modifiers()) {
+				if (modifier.isAnnotation()) {
+					Annotation annotation= (Annotation) modifier;
+					ITypeBinding typeBinding= annotation.resolveTypeBinding();
+					if (typeBinding != null && typeBinding.getQualifiedName().equals("java.lang.Override")) { //$NON-NLS-1$
+						rewrite.remove(annotation, null);
+					}
+				}
+			}
+			createMethodArguments(rewrites, rewrite, declaration, adjustments, status);
 			createMethodTypeParameters(rewrite, declaration, status);
 			createMethodComment(rewrite, declaration);
 			createMethodBody(rewriter, rewrite, declaration);
@@ -2263,7 +2305,6 @@
 			if (fMethod.getCompilationUnit().equals(getTargetType().getCompilationUnit()))
 				rewriter.clearImportRewrites();
 		}
-		return target;
 	}
 
 	/**
@@ -2282,10 +2323,8 @@
 	 *            the progress monitor to display progress
 	 * @throws CoreException
 	 *             if the change could not be generated
-	 * @return <code>true</code> if a target node had to be inserted as first
-	 *         argument, <code>false</code> otherwise
 	 */
-	protected boolean createMethodDelegation(final MethodDeclaration declaration, final Map<ICompilationUnit, CompilationUnitRewrite> rewrites, final Map<IMember, IncomingMemberVisibilityAdjustment> adjustments, final RefactoringStatus status, final IProgressMonitor monitor) throws CoreException {
+	protected void createMethodDelegation(final MethodDeclaration declaration, final Map<ICompilationUnit, CompilationUnitRewrite> rewrites, final Map<IMember, IncomingMemberVisibilityAdjustment> adjustments, final RefactoringStatus status, final IProgressMonitor monitor) throws CoreException {
 		Assert.isNotNull(declaration);
 		Assert.isNotNull(monitor);
 
@@ -2297,8 +2336,6 @@
 		creator.setNewElementName(fMethodName);
 		creator.prepareDelegate();
 		creator.createEdit();
-
-		return creator.getNeededInsertion();
 	}
 
 	/**
@@ -2314,9 +2351,6 @@
 	 *            moved method, including references in comments
 	 * @param adjustments
 	 *            the map of elements to visibility adjustments
-	 * @param target
-	 *            <code>true</code> if a target node must be inserted as first
-	 *            argument, <code>false</code> otherwise
 	 * @param binaryRefs
 	 *            the binary references context
 	 * @param status
@@ -2327,7 +2361,7 @@
 	 *         method declaration could be inlined, <code>false</code>
 	 *         otherwise
 	 */
-	protected boolean createMethodDelegator(final Map<ICompilationUnit, CompilationUnitRewrite> rewrites, final MethodDeclaration declaration, final SearchResultGroup[] groups, final Map<IMember, IncomingMemberVisibilityAdjustment> adjustments, final boolean target, ReferencesInBinaryContext binaryRefs, final RefactoringStatus status, final IProgressMonitor monitor) {
+	protected boolean createMethodDelegator(Map<ICompilationUnit, CompilationUnitRewrite> rewrites, MethodDeclaration declaration, SearchResultGroup[] groups, Map<IMember, IncomingMemberVisibilityAdjustment> adjustments, ReferencesInBinaryContext binaryRefs, RefactoringStatus status, IProgressMonitor monitor) {
 		Assert.isNotNull(rewrites);
 		Assert.isNotNull(declaration);
 		Assert.isNotNull(groups);
@@ -2380,7 +2414,7 @@
 								if (match.getAccuracy() == SearchMatch.A_INACCURATE) {
 									status.merge(RefactoringStatus.createWarningStatus(Messages.format(RefactoringCoreMessages.MoveInstanceMethodProcessor_inline_inaccurate, BasicElementLabels.getFileName(unit)), JavaStatusContext.create(unit, new SourceRange(match.getOffset(), match.getLength()))));
 									result= false;
-								} else if (!createInlinedMethodInvocation(rewrite, declaration, match, adjustments, target, status))
+								} else if (!createInlinedMethodInvocation(rewrite, declaration, match, adjustments, status))
 									result= false;
 							}
 						} else {
@@ -2438,13 +2472,10 @@
 	 *            the source method declaration
 	 * @param match
 	 *            the search match representing the method reference
-	 * @param targetNode
-	 *            <code>true</code> if a target node had to be inserted as
-	 *            first argument, <code>false</code> otherwise
 	 * @param status
 	 *            the refactoring status
 	 */
-	protected void createMethodJavadocReference(final CompilationUnitRewrite rewrite, final MethodDeclaration declaration, final SearchMatch match, final boolean targetNode, final RefactoringStatus status) {
+	protected void createMethodJavadocReference(CompilationUnitRewrite rewrite, MethodDeclaration declaration, SearchMatch match, RefactoringStatus status) {
 		Assert.isNotNull(rewrite);
 		Assert.isNotNull(declaration);
 		Assert.isNotNull(match);
@@ -2469,15 +2500,12 @@
 	 * @param groups
 	 *            the search result groups representing all references to the
 	 *            moved method, including references in comments
-	 * @param target
-	 *            <code>true</code> if a target node must be inserted as first
-	 *            argument, <code>false</code> otherwise
 	 * @param status
 	 *            the refactoring status
 	 * @param monitor
 	 *            the progress monitor to use
 	 */
-	protected void createMethodJavadocReferences(final Map<ICompilationUnit, CompilationUnitRewrite> rewrites, final MethodDeclaration declaration, final SearchResultGroup[] groups, final boolean target, final RefactoringStatus status, final IProgressMonitor monitor) {
+	protected void createMethodJavadocReferences(Map<ICompilationUnit, CompilationUnitRewrite> rewrites, MethodDeclaration declaration, SearchResultGroup[] groups, RefactoringStatus status, IProgressMonitor monitor) {
 		Assert.isNotNull(rewrites);
 		Assert.isNotNull(declaration);
 		Assert.isNotNull(status);
@@ -2504,7 +2532,7 @@
 						if (match.getAccuracy() == SearchMatch.A_INACCURATE) {
 							status.merge(RefactoringStatus.createWarningStatus(Messages.format(RefactoringCoreMessages.MoveInstanceMethodProcessor_inline_inaccurate, BasicElementLabels.getFileName(unit)), JavaStatusContext.create(unit, new SourceRange(match.getOffset(), match.getLength()))));
 						} else
-							createMethodJavadocReference(rewrite, declaration, match, target, status);
+							createMethodJavadocReference(rewrite, declaration, match, status);
 					}
 				}
 				monitor.worked(1);
diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ParameterObjectFactory.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ParameterObjectFactory.java
index 6b8dd5a..ea9af25 100644
--- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ParameterObjectFactory.java
+++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ParameterObjectFactory.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007, 2011 IBM Corporation and others.
+ * Copyright (c) 2007, 2013 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
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Samrat Dhillon samrat.dhillon@gmail.com https://bugs.eclipse.org/bugs/show_bug.cgi?id=395558 , https://bugs.eclipse.org/bugs/show_bug.cgi?id=395561 and https://bugs.eclipse.org/bugs/show_bug.cgi?id=394548
  *******************************************************************************/
 package org.eclipse.jdt.internal.corext.refactoring.structure;
 
@@ -61,6 +62,7 @@
 import org.eclipse.jdt.core.dom.SuperFieldAccess;
 import org.eclipse.jdt.core.dom.Type;
 import org.eclipse.jdt.core.dom.TypeDeclaration;
+import org.eclipse.jdt.core.dom.TypeParameter;
 import org.eclipse.jdt.core.dom.VariableDeclarationExpression;
 import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
 import org.eclipse.jdt.core.dom.rewrite.ASTRewrite;
@@ -192,6 +194,12 @@
 				FieldDeclaration declaration= createField(pi, cuRewrite);
 				listener.fieldCreated(cuRewrite, declaration, pi);
 				body.add(declaration);
+				ITypeBinding oldTypeBinding= pi.getOldTypeBinding();
+				if(oldTypeBinding != null && oldTypeBinding.isTypeVariable()){
+					TypeParameter param= ast.newTypeParameter();
+					param.setName(ast.newSimpleName(pi.getNewTypeName()));
+					typeDeclaration.typeParameters().add(param);
+				}
 			}
 		}
 		MethodDeclaration constructor= createConstructor(declaringType, cuRewrite, listener);
@@ -291,7 +299,7 @@
 
 
 	public static Type importBinding(ITypeBinding typeBinding, CompilationUnitRewrite cuRewrite) {
-		int declaredModifiers= typeBinding.getDeclaredModifiers();
+		int declaredModifiers= typeBinding.getModifiers();
 		AST ast= cuRewrite.getAST();
 		if (Modifier.isPrivate(declaredModifiers) || Modifier.isProtected(declaredModifiers)) {
 			return ast.newSimpleType(ast.newSimpleName(typeBinding.getName()));
diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/PullUpRefactoringProcessor.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/PullUpRefactoringProcessor.java
index 5c82112..8f176b9 100644
--- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/PullUpRefactoringProcessor.java
+++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/PullUpRefactoringProcessor.java
@@ -253,7 +253,7 @@
 				final SimpleName simple= ast.newSimpleName(node.getName().getIdentifier());
 				invocation.setName(simple);
 				invocation.setExpression(expression);
-				final List<Expression> arguments= (List<Expression>) node.getStructuralProperty(SuperMethodInvocation.ARGUMENTS_PROPERTY);
+				final List<Expression> arguments= node.arguments();
 				if (arguments != null && arguments.size() > 0) {
 					final ListRewrite rewriter= fRewrite.getListRewrite(invocation, MethodInvocation.ARGUMENTS_PROPERTY);
 					ListRewrite superRewriter= fRewrite.getListRewrite(node, SuperMethodInvocation.ARGUMENTS_PROPERTY);
@@ -1259,10 +1259,6 @@
 						CompilationUnitChange current= (CompilationUnitChange) manager.get(unit);
 						if (change != null && current.getEdit() == null)
 							manager.remove(unit);
-						CompilationUnitRewrite rewrite= fCompilationUnitRewrites.get(unit);
-						if (rewrite != null) {
-							rewrite.clearGroupDescriptions();
-						}
 					}
 				}
 			}
diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/constraints/SuperTypeRefactoringProcessor.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/constraints/SuperTypeRefactoringProcessor.java
index b2de6bd..57c443e 100644
--- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/constraints/SuperTypeRefactoringProcessor.java
+++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/constraints/SuperTypeRefactoringProcessor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -623,7 +623,9 @@
 			engine.setScope(RefactoringScopeFactory.create(type));
 			engine.setPattern(SearchPattern.createPattern(type, IJavaSearchConstants.REFERENCES, SearchUtils.GENERICS_AGNOSTIC_MATCH_RULE));
 			engine.searchPattern(new SubProgressMonitor(monitor, 100));
-			return (Map<IJavaProject, Set<SearchResultGroup>>) engine.getAffectedProjects();
+			@SuppressWarnings("unchecked")
+			Map<IJavaProject, Set<SearchResultGroup>> result= (Map<IJavaProject, Set<SearchResultGroup>>) engine.getAffectedProjects();
+			return result;
 		} finally {
 			monitor.done();
 		}
diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/surround/SurroundWithTryCatchRefactoring.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/surround/SurroundWithTryCatchRefactoring.java
index f40d7e0..17049d8 100644
--- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/surround/SurroundWithTryCatchRefactoring.java
+++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/surround/SurroundWithTryCatchRefactoring.java
@@ -11,6 +11,7 @@
 package org.eclipse.jdt.internal.corext.refactoring.surround;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Iterator;
 import java.util.List;
 
@@ -257,6 +258,7 @@
 				fLinkedProposalModel.getPositionGroup(GROUP_EXC_NAME + i, true).addPosition(fRewriter.track(decl.getName()), false);
 			}
 		} else {
+			List<ITypeBinding> filteredExceptions= filterSubtypeExceptions(exceptions);
 			CatchClause catchClause= getAST().newCatchClause();
 			SingleVariableDeclaration decl= getAST().newSingleVariableDeclaration();
 			String varName= StubUtility.getExceptionVariableName(fCUnit.getJavaProject());
@@ -265,11 +267,12 @@
 
 			UnionType unionType= getAST().newUnionType();
 			List<Type> types= unionType.types();
-			for (int i= 0; i < exceptions.length; i++) {
-				ITypeBinding exception= exceptions[i];
+			int i=0;
+			for (ITypeBinding exception : filteredExceptions) {
 				Type type= fImportRewrite.addImport(exception, getAST(), context);
 				types.add(type);
 				fLinkedProposalModel.getPositionGroup(GROUP_EXC_TYPE + i, true).addPosition(fRewriter.track(type), i == 0);
+				i++;
 			}
 
 			decl.setType(unionType);
@@ -374,6 +377,23 @@
 		}
 	}
 
+	private List<ITypeBinding> filterSubtypeExceptions(ITypeBinding[] exceptions) {
+		List<ITypeBinding> filteredExceptions= new ArrayList<ITypeBinding>();
+		filteredExceptions.addAll(Arrays.asList(exceptions));
+
+		for (Iterator<ITypeBinding> subtypeIterator= filteredExceptions.iterator(); subtypeIterator.hasNext();) {
+			ITypeBinding iTypeBinding= subtypeIterator.next();
+			for (Iterator<ITypeBinding> supertypeIterator= filteredExceptions.iterator(); supertypeIterator.hasNext();) {
+				ITypeBinding superTypeBinding= supertypeIterator.next();
+				if (!iTypeBinding.equals(superTypeBinding) && iTypeBinding.isSubTypeCompatible(superTypeBinding)) {
+					subtypeIterator.remove();
+					break;
+				}
+			}
+		}
+		return filteredExceptions;
+	}
+
 	private List<ASTNode> getSpecialVariableDeclarationStatements() {
 		List<ASTNode> result= new ArrayList<ASTNode>(3);
 		VariableDeclaration[] locals= fAnalyzer.getAffectedLocals();
diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/FullConstraintCreator.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/FullConstraintCreator.java
index bef5a84..18eabcc 100644
--- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/FullConstraintCreator.java
+++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/FullConstraintCreator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Samrat Dhillon samrat.dhillon@gmail.com [generalize type] Generalize Declared Type does not consider use of variable in throw statement, which yields compilation error https://bugs.eclipse.org/bugs/show_bug.cgi?id=395989
  *******************************************************************************/
 package org.eclipse.jdt.internal.corext.refactoring.typeconstraints;
 
@@ -49,6 +50,7 @@
 import org.eclipse.jdt.core.dom.SuperFieldAccess;
 import org.eclipse.jdt.core.dom.SuperMethodInvocation;
 import org.eclipse.jdt.core.dom.ThisExpression;
+import org.eclipse.jdt.core.dom.ThrowStatement;
 import org.eclipse.jdt.core.dom.Type;
 import org.eclipse.jdt.core.dom.VariableDeclaration;
 import org.eclipse.jdt.core.dom.VariableDeclarationExpression;
@@ -486,6 +488,18 @@
 	public ITypeConstraint[] create(VariableDeclarationStatement vds){
 		return getConstraintsFromFragmentList(vds.fragments(), vds.getType());
 	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ThrowStatement)
+	 */
+	@Override
+	public ITypeConstraint[] create(ThrowStatement node) {
+		ConstraintVariable nameVariable= fConstraintVariableFactory.makeExpressionOrTypeVariable(node.getExpression(), getContext());
+		ITypeBinding throwable= node.getAST().resolveWellKnownType("java.lang.Throwable"); //$NON-NLS-1$
+		return fTypeConstraintFactory.createSubtypeConstraint(
+				nameVariable,
+				fConstraintVariableFactory.makeRawBindingVariable(throwable));
+	}
 
 
 	//--------- private helpers ----------------//
diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/util/TightSourceRangeComputer.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/util/TightSourceRangeComputer.java
index 04ed571..ecee089 100644
--- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/util/TightSourceRangeComputer.java
+++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/util/TightSourceRangeComputer.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2011 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 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,9 +16,12 @@
 import java.util.List;
 
 import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.ChildListPropertyDescriptor;
 import org.eclipse.jdt.core.dom.StructuralPropertyDescriptor;
 import org.eclipse.jdt.core.dom.rewrite.TargetSourceRangeComputer;
 
+import org.eclipse.jdt.internal.corext.dom.ASTNodes;
+
 /**
  * A source range computer that uses the shortest possible source range for a given set of nodes.
  * <p>
@@ -51,7 +54,7 @@
 	        		addTightSourceNode(child);
 	        	}
 	        } else if (descriptor.isChildListProperty()) {
-	        	List<? extends ASTNode> children= (List<? extends ASTNode>) reference.getStructuralProperty(descriptor);
+	        	List<? extends ASTNode> children= ASTNodes.getChildListProperty(reference, (ChildListPropertyDescriptor) descriptor);
 	        	for (Iterator<? extends ASTNode> iterator2= children.iterator(); iterator2.hasNext();) {
 	                ASTNode child= iterator2.next();
 	                if (isExtending(child, reference)) {
diff --git a/org.eclipse.jdt.ui/dictionaries/en_GB.dictionary b/org.eclipse.jdt.ui/dictionaries/en_GB.dictionary
index 934f15b..e65e4af 100644
--- a/org.eclipse.jdt.ui/dictionaries/en_GB.dictionary
+++ b/org.eclipse.jdt.ui/dictionaries/en_GB.dictionary
@@ -80,6 +80,7 @@
 Antarctica's
 Aphrodite
 Aphrodite's
+Apache
 Apollo
 Apollo's
 Apollonian
@@ -1320,6 +1321,7 @@
 acknowledge
 acknowledged
 acknowledgedly
+acknowledgement
 acknowledger
 acknowledgers
 acknowledges
@@ -7473,6 +7475,7 @@
 bugling
 bugs
 build
+buildable
 builded
 builder
 builders
@@ -8799,6 +8802,7 @@
 checkering
 checkers
 checking
+checklist
 checkout
 checkouts
 checkpoint
@@ -9439,6 +9443,7 @@
 cloners
 clones
 cloning
+closable
 close
 closed
 closely
@@ -9956,6 +9961,7 @@
 committee
 committee's
 committees
+committer
 committing
 commodities
 commodity
@@ -10156,8 +10162,9 @@
 complexly
 complexness
 compliance
-compliant
 compliances
+compliancy
+compliant
 complicate
 complicated
 complicatedly
@@ -16403,6 +16410,7 @@
 euphemism's
 euphemisms
 euphoria
+euro
 evacuate
 evacuated
 evacuates
@@ -16425,6 +16433,7 @@
 evaluator
 evaluator's
 evaluators
+evangelist
 evaporate
 evaporated
 evaporates
@@ -17777,6 +17786,7 @@
 fingerer
 fingering
 fingerings
+fingerprint
 fingers
 fining
 finish
@@ -20460,6 +20470,7 @@
 handles
 handling
 hands
+handset
 handshake
 handshake's
 handshaker
@@ -20725,6 +20736,7 @@
 headland
 headland's
 headlands
+headless
 headline
 headlined
 headliner
@@ -21701,6 +21713,7 @@
 idealistic
 ideally
 ideals
+idempotent
 ideas
 identical
 identically
@@ -21724,6 +21737,8 @@
 ideology
 idiocies
 idiocy
+idiom
+idioms
 idiosyncrasies
 idiosyncrasy
 idiosyncrasy's
@@ -21746,6 +21761,7 @@
 idolatry
 idols
 if
+iff
 ignition
 ignoble
 ignobleness
@@ -26005,6 +26021,7 @@
 malefactors
 maleness
 males
+malformed
 malfunction
 malfunctioned
 malfunctioning
@@ -26940,6 +26957,7 @@
 millstone
 millstone's
 millstones
+mime
 mimic
 mimicked
 mimicking
@@ -28868,6 +28886,7 @@
 officiously
 officiousness
 offing
+offline
 offs
 offset
 offset's
@@ -29144,6 +29163,7 @@
 orgy
 orgy's
 orient
+orientated
 orientation
 orientation's
 orientations
@@ -32331,6 +32351,7 @@
 programmability
 programmable
 programmatic
+programmatically
 programmed
 programmer
 programmer's
@@ -32910,6 +32931,7 @@
 pursers
 purses
 pursing
+pursuance
 pursue
 pursued
 pursuer
@@ -32958,6 +32980,7 @@
 quacked
 quacking
 quacks
+quad
 quadrant
 quadrant's
 quadrants
@@ -34052,6 +34075,7 @@
 rectangles
 rectangular
 rectangularly
+rectify
 rector
 rector's
 rectors
@@ -41740,6 +41764,7 @@
 teamed
 teaming
 teams
+teapot
 tear
 tear's
 teared
@@ -41833,6 +41858,7 @@
 telephonic
 telephoning
 telephony
+teleport
 telescope
 telescoped
 telescopes
@@ -42344,6 +42370,7 @@
 throughout
 throughput
 throw
+throwable
 thrower
 throwing
 thrown
@@ -45614,6 +45641,7 @@
 viewpoint
 viewpoint's
 viewpoints
+viewport
 views
 vigilance
 vigilant
@@ -49305,6 +49333,7 @@
 externalisation
 externalisation's
 externalisations
+externalise
 favouritism
 favouritism's
 favouritisms
@@ -49510,6 +49539,7 @@
 operationalised
 orthogonalisation
 orthogonalised
+orthographic
 orthopaedic
 orthopaedics
 ostracised
@@ -49728,6 +49758,7 @@
 uncauterised
 uncauterised's
 uncauteriseds
+uncomment
 undemocratises
 underutilisation
 underutilised
diff --git a/org.eclipse.jdt.ui/dictionaries/en_US.dictionary b/org.eclipse.jdt.ui/dictionaries/en_US.dictionary
index 6f78016..f729b82 100644
--- a/org.eclipse.jdt.ui/dictionaries/en_US.dictionary
+++ b/org.eclipse.jdt.ui/dictionaries/en_US.dictionary
@@ -80,6 +80,7 @@
 Antarctica's
 Aphrodite
 Aphrodite's
+Apache
 Apollo
 Apollo's
 Apollonian
@@ -1320,6 +1321,7 @@
 acknowledge
 acknowledged
 acknowledgedly
+acknowledgement
 acknowledger
 acknowledgers
 acknowledges
@@ -7473,6 +7475,7 @@
 bugling
 bugs
 build
+buildable
 builded
 builder
 builders
@@ -8799,6 +8802,7 @@
 checkering
 checkers
 checking
+checklist
 checkout
 checkouts
 checkpoint
@@ -9439,6 +9443,7 @@
 cloners
 clones
 cloning
+closable
 close
 closed
 closely
@@ -9956,6 +9961,7 @@
 committee
 committee's
 committees
+committer
 committing
 commodities
 commodity
@@ -10157,6 +10163,7 @@
 complexness
 compliance
 compliances
+compliancy
 compliant
 complicate
 complicated
@@ -16403,6 +16410,7 @@
 euphemism's
 euphemisms
 euphoria
+euro
 evacuate
 evacuated
 evacuates
@@ -16425,6 +16433,7 @@
 evaluator
 evaluator's
 evaluators
+evangelist
 evaporate
 evaporated
 evaporates
@@ -17777,6 +17786,7 @@
 fingerer
 fingering
 fingerings
+fingerprint
 fingers
 fining
 finish
@@ -20460,6 +20470,7 @@
 handles
 handling
 hands
+handset
 handshake
 handshake's
 handshaker
@@ -20725,6 +20736,7 @@
 headland
 headland's
 headlands
+headless
 headline
 headlined
 headliner
@@ -21702,6 +21714,7 @@
 ideally
 ideals
 ideas
+idempotent
 identical
 identically
 identicalness
@@ -21724,6 +21737,8 @@
 ideology
 idiocies
 idiocy
+idiom
+idioms
 idiosyncrasies
 idiosyncrasy
 idiosyncrasy's
@@ -21746,6 +21761,7 @@
 idolatry
 idols
 if
+iff
 ignition
 ignoble
 ignobleness
@@ -26005,6 +26021,7 @@
 malefactors
 maleness
 males
+malformed
 malfunction
 malfunctioned
 malfunctioning
@@ -26940,6 +26957,7 @@
 millstone
 millstone's
 millstones
+mime
 mimic
 mimicked
 mimicking
@@ -28868,6 +28886,7 @@
 officiously
 officiousness
 offing
+offline
 offs
 offset
 offset's
@@ -29144,6 +29163,7 @@
 orgy
 orgy's
 orient
+orientated
 orientation
 orientation's
 orientations
@@ -32331,6 +32351,7 @@
 programmability
 programmable
 programmatic
+programmatically
 programmed
 programmer
 programmer's
@@ -32910,6 +32931,7 @@
 pursers
 purses
 pursing
+pursuance
 pursue
 pursued
 pursuer
@@ -32958,6 +32980,7 @@
 quacked
 quacking
 quacks
+quad
 quadrant
 quadrant's
 quadrants
@@ -34052,6 +34075,7 @@
 rectangles
 rectangular
 rectangularly
+rectify
 rector
 rector's
 rectors
@@ -41740,6 +41764,7 @@
 teamed
 teaming
 teams
+teapot
 tear
 tear's
 teared
@@ -41833,6 +41858,7 @@
 telephonic
 telephoning
 telephony
+teleport
 telescope
 telescoped
 telescopes
@@ -42344,6 +42370,7 @@
 throughout
 throughput
 throw
+throwable
 thrower
 throwing
 thrown
@@ -45614,6 +45641,7 @@
 viewpoint
 viewpoint's
 viewpoints
+viewport
 views
 vigilance
 vigilant
@@ -49243,6 +49271,7 @@
 extemporizers
 extemporizes
 extemporizing
+externalize
 externalization
 externalization's
 externalizations
@@ -49446,6 +49475,7 @@
 operationalized
 orthogonalization
 orthogonalized
+orthographic
 orthopedic
 orthopedics
 ostracized
@@ -49665,6 +49695,7 @@
 uncauterized
 uncauterized's
 uncauterizeds
+uncomment
 undemocratizes
 underutilization
 underutilized
diff --git a/org.eclipse.jdt.ui/internal compatibility/org/eclipse/jdt/internal/corext/dom/NodeFinder.java b/org.eclipse.jdt.ui/internal compatibility/org/eclipse/jdt/internal/corext/dom/NodeFinder.java
index a791481..2277365 100644
--- a/org.eclipse.jdt.ui/internal compatibility/org/eclipse/jdt/internal/corext/dom/NodeFinder.java
+++ b/org.eclipse.jdt.ui/internal compatibility/org/eclipse/jdt/internal/corext/dom/NodeFinder.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -28,6 +28,7 @@
  * @since 2.1
  * @deprecated As of 3.6, replaced by {@link org.eclipse.jdt.core.dom.NodeFinder}
  */
+@SuppressWarnings("all")
 public class NodeFinder extends GenericVisitor {
 
 	/**
diff --git a/org.eclipse.jdt.ui/internal compatibility/org/eclipse/jdt/internal/ui/dialogs/TypeInfoViewer.java b/org.eclipse.jdt.ui/internal compatibility/org/eclipse/jdt/internal/ui/dialogs/TypeInfoViewer.java
index 0f1577f..beab9f9 100644
--- a/org.eclipse.jdt.ui/internal compatibility/org/eclipse/jdt/internal/ui/dialogs/TypeInfoViewer.java
+++ b/org.eclipse.jdt.ui/internal compatibility/org/eclipse/jdt/internal/ui/dialogs/TypeInfoViewer.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -96,6 +96,7 @@
  * DO NOT REMOVE, used in a product.
  * @deprecated As of 3.5, replaced by {@link org.eclipse.ui.dialogs.FilteredItemsSelectionDialog}
  */
+@SuppressWarnings("all")
 public class TypeInfoViewer {
 	
 	private static class SearchRequestor extends TypeNameMatchRequestor {
diff --git a/org.eclipse.jdt.ui/internal compatibility/org/eclipse/jdt/internal/ui/dialogs/TypeSelectionComponent.java b/org.eclipse.jdt.ui/internal compatibility/org/eclipse/jdt/internal/ui/dialogs/TypeSelectionComponent.java
index 4ed0ca2..c95c03f 100644
--- a/org.eclipse.jdt.ui/internal compatibility/org/eclipse/jdt/internal/ui/dialogs/TypeSelectionComponent.java
+++ b/org.eclipse.jdt.ui/internal compatibility/org/eclipse/jdt/internal/ui/dialogs/TypeSelectionComponent.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -81,6 +81,7 @@
  * DO NOT REMOVE, used in a product.
  * @deprecated As of 3.5, replaced by {@link org.eclipse.ui.dialogs.FilteredItemsSelectionDialog}
  */
+@SuppressWarnings("all")
 public class TypeSelectionComponent extends Composite implements ITypeSelectionComponent {
 	
 	private IDialogSettings fSettings;
diff --git a/org.eclipse.jdt.ui/internal compatibility/org/eclipse/jdt/internal/ui/dialogs/TypeSelectionDialog2.java b/org.eclipse.jdt.ui/internal compatibility/org/eclipse/jdt/internal/ui/dialogs/TypeSelectionDialog2.java
index 60f1bc8..3a11682 100644
--- a/org.eclipse.jdt.ui/internal compatibility/org/eclipse/jdt/internal/ui/dialogs/TypeSelectionDialog2.java
+++ b/org.eclipse.jdt.ui/internal compatibility/org/eclipse/jdt/internal/ui/dialogs/TypeSelectionDialog2.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -14,13 +14,6 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.core.runtime.jobs.IJobManager;
-import org.eclipse.core.runtime.jobs.Job;
-
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
@@ -29,6 +22,13 @@
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Shell;
 
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.core.runtime.jobs.IJobManager;
+import org.eclipse.core.runtime.jobs.Job;
+
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.operation.IRunnableContext;
 import org.eclipse.jface.operation.IRunnableWithProgress;
@@ -70,6 +70,7 @@
  * DO NOT REMOVE, used in a product.
  * @deprecated As of 3.5, replaced by {@link org.eclipse.ui.dialogs.FilteredItemsSelectionDialog}
  */
+@SuppressWarnings("all")
 public class TypeSelectionDialog2 extends SelectionStatusDialog {
 
 	private String fTitle;
diff --git a/org.eclipse.jdt.ui/internal compatibility/org/eclipse/jdt/internal/ui/refactoring/RefactoringSaveHelper.java b/org.eclipse.jdt.ui/internal compatibility/org/eclipse/jdt/internal/ui/refactoring/RefactoringSaveHelper.java
index d021b55..3e8ff02 100644
--- a/org.eclipse.jdt.ui/internal compatibility/org/eclipse/jdt/internal/ui/refactoring/RefactoringSaveHelper.java
+++ b/org.eclipse.jdt.ui/internal compatibility/org/eclipse/jdt/internal/ui/refactoring/RefactoringSaveHelper.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -52,6 +52,7 @@
  * DO NOT REMOVE, used in a product.
  * @deprecated As of 3.5, replaced by {@link org.eclipse.jdt.ui.refactoring.RefactoringSaveHelper}
  */
+@SuppressWarnings("all")
 public class RefactoringSaveHelper {
 
 	private boolean fFilesSaved;
diff --git a/org.eclipse.jdt.ui/plugin.properties b/org.eclipse.jdt.ui/plugin.properties
index 9bb7baa..ba29808 100644
--- a/org.eclipse.jdt.ui/plugin.properties
+++ b/org.eclipse.jdt.ui/plugin.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2000, 2013 IBM Corporation and others.
+# Copyright (c) 2000, 2014 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
@@ -9,6 +9,7 @@
 #     IBM Corporation - initial API and implementation
 #     Ferenc Hechler, ferenc_hechler@users.sourceforge.net - 83258 [jar exporter] Deploy java application as executable jar
 #     Troy Bishop <tjbishop@ca.ibm.com> - Add support for importing/exporting Java Code Style preferences - https://bugs.eclipse.org/bugs/show_bug.cgi?id=304395
+#     Eugene Lucash <e.lucash@gmail.com> - [quick assist] Add key binding for Extract method Quick Assist - https://bugs.eclipse.org/424166
 ###############################################################################
 
 pluginName= Java Development Tools UI
@@ -778,6 +779,9 @@
 ActionDefinition.corrections.extractConstant.name=Quick Assist - Extract constant
 ActionDefinition.corrections.extractConstant.description=Invokes quick assist and selects 'Extract constant'
 
+ActionDefinition.corrections.extractMethodInplace.name=Quick Assist - Extract method
+ActionDefinition.corrections.extractMethodInplace.description=Invokes quick assist and selects 'Extract to method'
+
 ActionDefinition.corrections.convertLocalToField.name=Quick Assist - Convert local variable to field
 ActionDefinition.corrections.convertLocalToField.description=Invokes quick assist and selects 'Convert local variable to field'
 
diff --git a/org.eclipse.jdt.ui/plugin.xml b/org.eclipse.jdt.ui/plugin.xml
index 7286f83..02949e7 100644
--- a/org.eclipse.jdt.ui/plugin.xml
+++ b/org.eclipse.jdt.ui/plugin.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?eclipse version="3.0"?>
 <!-- ====================================================================== -->
-<!-- Copyright (c) 2000, 2012 IBM Corporation and others.                   -->
+<!-- Copyright (c) 2000, 2014 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               -->
@@ -15,6 +15,7 @@
 <!--     IBM Corporation - initial API and implementation                   -->
 <!--     Francis Upton IV, Oakland Software <francisu@ieee.org> - Add support for Go Into with the ProjectExplorer - https://bugs.eclipse.org/bugs/show_bug.cgi?id=262091 -->
 <!--     Troy Bishop <tjbishop@ca.ibm.com> - Add support for importing/exporting Java Code Style preferences - https://bugs.eclipse.org/bugs/show_bug.cgi?id=304395 -->
+<!--     Eugene Lucash <e.lucash@gmail.com> - [quick assist] Add key binding for Extract method Quick Assist - https://bugs.eclipse.org/424166 -->
 <!-- ====================================================================== -->
 <plugin>
 
@@ -3698,6 +3699,12 @@
             id="org.eclipse.jdt.ui.correction.extractConstant.assist">
       </command>
       <command
+            name="%ActionDefinition.corrections.extractMethodInplace.name"
+            description="%ActionDefinition.corrections.extractMethodInplace.description"
+            categoryId="org.eclipse.jdt.ui.category.source"
+            id="org.eclipse.jdt.ui.correction.extractMethodInplace.assist">
+      </command>
+      <command
             name="%ActionDefinition.corrections.convertLocalToField.name"
             description="%ActionDefinition.corrections.convertLocalToField.description"
             categoryId="org.eclipse.jdt.ui.category.source"
@@ -4204,7 +4211,7 @@
             schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/>
       <key
             platform="carbon"
-            sequence="CTRL+SHIFT+ARROW_UP"
+            sequence="CTRL+ALT+SHIFT+ARROW_UP"
             contextId="org.eclipse.jdt.ui.javaEditorScope"
             commandId="org.eclipse.jdt.ui.edit.text.java.select.enclosing"
             schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/>
@@ -4222,7 +4229,7 @@
             schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/>
       <key
             platform="carbon"
-            sequence="CTRL+SHIFT+ARROW_RIGHT"
+            sequence="CTRL+ALT+SHIFT+ARROW_RIGHT"
             contextId="org.eclipse.jdt.ui.javaEditorScope"
             commandId="org.eclipse.jdt.ui.edit.text.java.select.next"
             schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/>
@@ -4239,7 +4246,7 @@
             schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/>
       <key
             platform="carbon"
-            sequence="CTRL+SHIFT+ARROW_LEFT"
+            sequence="CTRL+ALT+SHIFT+ARROW_LEFT"
             contextId="org.eclipse.jdt.ui.javaEditorScope"
             commandId="org.eclipse.jdt.ui.edit.text.java.select.previous"
             schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/>
@@ -4256,7 +4263,7 @@
             schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/>
       <key
             platform="carbon"
-            sequence="CTRL+SHIFT+ARROW_DOWN"
+            sequence="CTRL+ALT+SHIFT+ARROW_DOWN"
             contextId="org.eclipse.jdt.ui.javaEditorScope"
             commandId="org.eclipse.jdt.ui.edit.text.java.select.last"
             schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/>
@@ -4415,6 +4422,11 @@
             commandId="org.eclipse.jdt.ui.correction.renameInFile.assist"
             schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/>
        <key
+            sequence="M1+2 M"
+            contextId="org.eclipse.jdt.ui.javaEditorScope"
+            commandId="org.eclipse.jdt.ui.correction.extractMethodInplace.assist"
+            schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/>
+       <key
             sequence="M1+2 L"
             contextId="org.eclipse.jdt.ui.javaEditorScope"
             commandId="org.eclipse.jdt.ui.correction.assignToLocal.assist"
@@ -5836,11 +5848,12 @@
 					overrides="org.eclipse.ui.navigator.resources.GoIntoActions"> 
 				<enablement>
 					<or>
-						<and>
-							<adapt type="org.eclipse.core.resources.IProject" />
-							<test property="org.eclipse.core.resources.open" 
-								value="true"/>
-						</and>
+						<adapt
+							type="org.eclipse.core.resources.IProject">
+							<test
+								property="org.eclipse.core.resources.open">
+							</test>
+						</adapt>
 						<adapt type="org.eclipse.core.resources.IFolder" /> 	
 						<adapt type="org.eclipse.ui.IWorkingSet" /> 	
 						<instanceof value="org.eclipse.jdt.core.IJavaProject" />
@@ -6236,7 +6249,7 @@
          id="org.eclipse.jdt.ui.staticFinalFieldHighlighting"
          isEditable="false"
          label="%Dummy.label"
-         value="0,0,0">
+         value="0,0,192">
       </colorDefinition>
       <colorDefinition
          id="org.eclipse.jdt.ui.fieldHighlighting"
@@ -6290,19 +6303,19 @@
          id="org.eclipse.jdt.ui.localVariableDeclarationHighlighting"
          isEditable="false"
          label="%Dummy.label"
-         value="0,0,0">
+         value="106,62,62">
       </colorDefinition>
       <colorDefinition
          id="org.eclipse.jdt.ui.localVariableHighlighting"
          isEditable="false"
          label="%Dummy.label"
-         value="0,0,0">
+         value="106,62,62">
       </colorDefinition>
       <colorDefinition
          id="org.eclipse.jdt.ui.parameterVariableHighlighting"
          isEditable="false"
          label="%Dummy.label"
-         value="0,0,0">
+         value="106,62,62">
       </colorDefinition>
       <colorDefinition
          id="org.eclipse.jdt.ui.deprecatedMemberHighlighting"
diff --git a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/ExtractClassWizard.java b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/ExtractClassWizard.java
index a06a441..a1bb2bd 100644
--- a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/ExtractClassWizard.java
+++ b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/ExtractClassWizard.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007, 2011 IBM Corporation and others.
+ * Copyright (c) 2007, 2014 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
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Lars Vogel <Lars.Vogel@gmail.com> - Bug 427883
  *******************************************************************************/
 package org.eclipse.jdt.internal.ui.refactoring;
 
@@ -33,6 +34,7 @@
 import org.eclipse.jface.dialogs.InputDialog;
 import org.eclipse.jface.fieldassist.ControlDecoration;
 import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
+import org.eclipse.jface.viewers.ArrayContentProvider;
 import org.eclipse.jface.viewers.CellEditor;
 import org.eclipse.jface.viewers.CellLabelProvider;
 import org.eclipse.jface.viewers.CheckStateChangedEvent;
@@ -43,12 +45,10 @@
 import org.eclipse.jface.viewers.ICheckStateListener;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.SelectionChangedEvent;
 import org.eclipse.jface.viewers.TableViewerColumn;
 import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.jface.viewers.ViewerCell;
 import org.eclipse.jface.window.Window;
 
@@ -75,24 +75,6 @@
 
 public class ExtractClassWizard extends RefactoringWizard {
 
-	public class FieldContentProvider implements IStructuredContentProvider {
-
-		public void dispose() {
-		}
-
-		public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-		}
-
-		public Object[] getElements(Object inputElement) {
-			if (inputElement instanceof ExtractClassDescriptor) {
-				ExtractClassDescriptor descriptor= (ExtractClassDescriptor) inputElement;
-				return descriptor.getFields();
-			}
-			return null;
-		}
-
-	}
-
 	private ExtractClassDescriptor fDescriptor;
 
 	public ExtractClassWizard(ExtractClassDescriptor descriptor, Refactoring refactoring) {
@@ -275,7 +257,7 @@
 			layoutComposite.addColumnData(new ColumnWeightData(40, convertWidthInCharsToPixels(20), true));
 			layoutComposite.addColumnData(new ColumnWeightData(60, convertWidthInCharsToPixels(20), true));
 			final CheckboxTableViewer tv= CheckboxTableViewer.newCheckList(layoutComposite, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI);
-			tv.setContentProvider(new FieldContentProvider());
+			tv.setContentProvider(ArrayContentProvider.getInstance());
 			createColumns(tv);
 
 			Table table= tv.getTable();
@@ -283,13 +265,13 @@
 			table.setHeaderVisible(true);
 			gridData= new GridData(GridData.FILL_BOTH);
 			table.setLayoutData(gridData);
-			tv.setInput(fDescriptor);
-			final Field[] fields= fDescriptor.getFields();
+			Field[] fields= fDescriptor.getFields();
+			tv.setInput(fields);
 			for (int i= 0; i < fields.length; i++) {
 				Field field= fields[i];
 				tv.setChecked(field, field.isCreateField());
 			}
-			tv.refresh(true);
+
 			gridData= new GridData(GridData.FILL_BOTH);
 			gridData.heightHint= SWTUtil.getTableHeightHint(table, Math.max(fields.length,5));
 			gridData.widthHint= convertWidthInCharsToPixels(50);
diff --git a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/nls/search/NLSSearchQuery.java b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/nls/search/NLSSearchQuery.java
index 5ef77c2..bcdc8dc 100644
--- a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/nls/search/NLSSearchQuery.java
+++ b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/nls/search/NLSSearchQuery.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -78,7 +78,7 @@
 				IFile propertieFile= fPropertiesFile[i];
 				if (! wrapperClass.exists())
 					return JavaUIStatus.createError(0, Messages.format(NLSSearchMessages.NLSSearchQuery_wrapperNotExists, JavaElementLabels.getElementLabel(wrapperClass, JavaElementLabels.ALL_DEFAULT)), null);
-				if (! wrapperClass.exists())
+				if (! propertieFile.exists())
 					return JavaUIStatus.createError(0, Messages.format(NLSSearchMessages.NLSSearchQuery_propertiesNotExists, BasicElementLabels.getResourceName(propertieFile)), null);
 
 				SearchPattern pattern= SearchPattern.createPattern(wrapperClass, IJavaSearchConstants.REFERENCES, SearchUtils.GENERICS_AGNOSTIC_MATCH_RULE);
diff --git a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/nls/search/NLSSearchResultRequestor.java b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/nls/search/NLSSearchResultRequestor.java
index de55a94..996725d 100644
--- a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/nls/search/NLSSearchResultRequestor.java
+++ b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/nls/search/NLSSearchResultRequestor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -301,6 +301,12 @@
 				}
 				return NO_KEY;
 			} else {
+				IJavaElement[] keys= unit.codeSelect(tokenStart, tokenEnd - tokenStart + 1);
+
+				// an interface can't be a key
+				if (keys.length == 1 && keys[0].getElementType() == IJavaElement.TYPE && ((IType) keys[0]).isInterface())
+					return null;
+
 				keyPositionResult.setOffset(tokenStart);
 				keyPositionResult.setLength(tokenEnd - tokenStart + 1);
 				return src;
diff --git a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/DeleteAction.java b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/DeleteAction.java
index f39013e..1b9d538 100644
--- a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/DeleteAction.java
+++ b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/DeleteAction.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -151,7 +151,9 @@
 					manager.removeWorkingSet(workingSet);
 			}
 		} else if (dialogResponse == HIDE_BUTTON) {
-			hideWorkingSets((List<IWorkingSet>) SelectionUtil.toList(selection));
+			@SuppressWarnings("unchecked")
+			List<IWorkingSet> workingSets= (List<IWorkingSet>) SelectionUtil.toList(selection);
+			hideWorkingSets(workingSets);
 		}
 	}
 
diff --git a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/PasteAction.java b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/PasteAction.java
index a9a034f..214e153 100644
--- a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/PasteAction.java
+++ b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/PasteAction.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 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
@@ -753,6 +753,7 @@
 								editorPart[0]= openCu(cu); //Open editor before overwriting to allow undo to restore original package declaration
 							}
 
+							parsedText= parsedText.replaceAll("\r\n?|\n", StubUtility.getLineDelimiterUsed(cu)); //$NON-NLS-1$
 							destinationPack.createCompilationUnit(cuName, parsedText, true, new SubProgressMonitor(pm, 1));
 
 							if (! alreadyExists) {
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/InterfaceIndicatorLabelDecorator.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/InterfaceIndicatorLabelDecorator.java
index 1695514..c5cc710 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/InterfaceIndicatorLabelDecorator.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/InterfaceIndicatorLabelDecorator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -52,6 +52,31 @@
 		}
 		
 		/*
+		 * @see java.lang.Object#equals(java.lang.Object)
+		 * @since 3.9
+		 */
+		@Override
+		public boolean equals(Object obj) {
+			if (this == obj)
+				return true;
+			if (obj == null)
+				return false;
+			if (getClass() != obj.getClass())
+				return false;
+			TypeIndicatorOverlay other= (TypeIndicatorOverlay) obj;
+			if (fDeprecated != other.fDeprecated)
+				return false;
+			if (fPackageDefault != other.fPackageDefault)
+				return false;
+			if (fType == null) {
+				if (other.fType != null)
+					return false;
+			} else if (!fType.equals(other.fType))
+				return false;
+			return true;
+		}
+
+		/*
 		 * @see org.eclipse.jface.resource.CompositeImageDescriptor#drawCompositeImage(int, int)
 		 */
 		@Override
@@ -81,6 +106,20 @@
 			}
 			return fgSize;
 		}
+
+		/*
+		 * @see java.lang.Object#hashCode()
+		 * @since 3.9
+		 */
+		@Override
+		public int hashCode() {
+			final int prime= 31;
+			int result= 1;
+			result= prime * result + (fDeprecated ? 1231 : 1237);
+			result= prime * result + (fPackageDefault ? 1231 : 1237);
+			result= prime * result + ((fType == null) ? 0 : fType.hashCode());
+			return result;
+		}
 	}
 
 	/**
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/ActionMessages.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/ActionMessages.java
index 15b838f..20eeb40 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/ActionMessages.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/ActionMessages.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -296,6 +296,8 @@
 	public static String FormatAllAction_tooltip;
 	public static String FormatAllAction_description;
 
+	public static String MultiFormatAction_name;
+
 	public static String SortMembersAction_label;
 	public static String SortMembersAction_tooltip;
 	public static String SortMembersAction_description;
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/ActionMessages.properties b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/ActionMessages.properties
index a1e6223..3b0f105 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/ActionMessages.properties
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/ActionMessages.properties
@@ -266,6 +266,8 @@
 FormatAllAction_tooltip=Format all selected Java files
 FormatAllAction_description=Format all selected Java files
 
+MultiFormatAction_name=Format
+
 SortMembersAction_label=Sort &Members...
 SortMembersAction_tooltip=Sorts all Members using the Member Order Preference
 SortMembersAction_description=Sorts all members using the member order preference
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/MultiFormatAction.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/MultiFormatAction.java
index bb0c317..116e927 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/MultiFormatAction.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/MultiFormatAction.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007, 2011 IBM Corporation and others.
+ * Copyright (c) 2007, 2013 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
@@ -51,7 +51,7 @@
 	 */
 	@Override
 	protected String getActionName() {
-		return ActionMessages.FormatAllAction_label;
+		return ActionMessages.MultiFormatAction_name;
 	}
 
 }
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ASTProvider.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ASTProvider.java
index ccc56e7..6b7320f 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ASTProvider.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ASTProvider.java
@@ -213,7 +213,7 @@
 	private static final String DEBUG_PREFIX= "ASTProvider > "; //$NON-NLS-1$
 
 
-	private ITypeRoot fReconcilingJavaElement;
+	private volatile ITypeRoot fReconcilingJavaElement;
 	private ITypeRoot fActiveJavaElement;
 	private CompilationUnit fAST;
 	private ActivationListener fActivationListener;
@@ -458,7 +458,7 @@
 					if (isReconciling(input)) {
 						if (DEBUG)
 							System.out.println(getThreadName() + " - " + DEBUG_PREFIX + "waiting for AST for: " + input.getElementName()); //$NON-NLS-1$ //$NON-NLS-2$
-						fWaitLock.wait();
+						fWaitLock.wait(30000); // XXX: The 30 seconds timeout is an attempt to at least avoid a deadlock. See https://bugs.eclipse.org/366048#c21
 					}
 				}
 
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditorMessages.properties b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditorMessages.properties
index c2ad183..49a40f1 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditorMessages.properties
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditorMessages.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2000, 2013 IBM Corporation and others.
+# Copyright (c) 2000, 2014 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
@@ -105,7 +105,7 @@
 SemanticHighlighting_job= Semantic Highlighting Job
 SemanticHighlighting_field= Fields
 SemanticHighlighting_staticField= Static fields
-SemanticHighlighting_staticFinalField= Constants
+SemanticHighlighting_staticFinalField= Static final fields
 SemanticHighlighting_inheritedField= Inherited fields
 SemanticHighlighting_methodDeclaration= Method declarations
 SemanticHighlighting_staticMethodInvocation= Static method invocations
@@ -113,7 +113,7 @@
 SemanticHighlighting_abstractMethodInvocation= Abstract method invocations
 SemanticHighlighting_inheritedMethodInvocation= Inherited method invocations
 SemanticHighlighting_localVariableDeclaration= Local variable declarations
-SemanticHighlighting_localVariable= Local variable references
+SemanticHighlighting_localVariable= Local variables
 SemanticHighlighting_parameterVariable= Parameter variables
 SemanticHighlighting_deprecatedMember= Deprecated members
 SemanticHighlighting_typeVariables= Type variables
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/SemanticHighlightings.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/SemanticHighlightings.java
index ad97386..8b7ed5f 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/SemanticHighlightings.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/SemanticHighlightings.java
@@ -220,7 +220,7 @@
 		 */
 		@Override
 		public RGB getDefaultDefaultTextColor() {
-			return new RGB(0, 0, 0);
+			return new RGB(0, 0, 192);
 		}
 
 		/*
@@ -228,7 +228,7 @@
 		 */
 		@Override
 		public boolean isBoldByDefault() {
-			return false;
+			return true;
 		}
 
 		/*
@@ -236,7 +236,7 @@
 		 */
 		@Override
 		public boolean isItalicByDefault() {
-			return false;
+			return true;
 		}
 
 		/*
@@ -244,7 +244,7 @@
 		 */
 		@Override
 		public boolean isEnabledByDefault() {
-			return false;
+			return true;
 		}
 
 		/*
@@ -934,7 +934,7 @@
 		 */
 		@Override
 		public RGB getDefaultDefaultTextColor() {
-			return new RGB(0, 0, 0);
+			return new RGB(106, 62, 62);
 		}
 
 		/*
@@ -942,7 +942,7 @@
 		 */
 		@Override
 		public boolean isBoldByDefault() {
-			return false;
+			return true;
 		}
 
 		/*
@@ -1005,7 +1005,7 @@
 		 */
 		@Override
 		public RGB getDefaultDefaultTextColor() {
-			return new RGB(0, 0, 0);
+			return new RGB(106, 62, 62);
 		}
 
 		/*
@@ -1029,7 +1029,7 @@
 		 */
 		@Override
 		public boolean isEnabledByDefault() {
-			return false;
+			return true;
 		}
 
 		/*
@@ -1072,7 +1072,7 @@
 		 */
 		@Override
 		public RGB getDefaultDefaultTextColor() {
-			return new RGB(0, 0, 0);
+			return new RGB(106, 62, 62);
 		}
 
 		/*
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/selectionactions/StructureSelectionAction.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/selectionactions/StructureSelectionAction.java
index 2b2f8e2..b4ed02e 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/selectionactions/StructureSelectionAction.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/selectionactions/StructureSelectionAction.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -26,9 +26,11 @@
 import org.eclipse.jdt.core.JavaModelException;
 import org.eclipse.jdt.core.SourceRange;
 import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.ChildListPropertyDescriptor;
 import org.eclipse.jdt.core.dom.CompilationUnit;
 import org.eclipse.jdt.core.dom.StructuralPropertyDescriptor;
 
+import org.eclipse.jdt.internal.corext.dom.ASTNodes;
 import org.eclipse.jdt.internal.corext.dom.Selection;
 import org.eclipse.jdt.internal.corext.dom.SelectionAnalyzer;
 
@@ -166,7 +168,7 @@
 		ASTNode parent= node.getParent();
 		StructuralPropertyDescriptor locationInParent= node.getLocationInParent();
 		if (locationInParent.isChildListProperty()) {
-			List<? extends ASTNode> siblings= (List<? extends ASTNode>) parent.getStructuralProperty(locationInParent);
+			List<? extends ASTNode> siblings= ASTNodes.getChildListProperty(parent, (ChildListPropertyDescriptor) locationInParent);
 			return siblings.toArray(new ASTNode[siblings.size()]);
 		}
 		return null;
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaEditorColoringConfigurationBlock.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaEditorColoringConfigurationBlock.java
index ba512d1..4f5c72d 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaEditorColoringConfigurationBlock.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaEditorColoringConfigurationBlock.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 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
@@ -588,7 +588,8 @@
 		layout.marginHeight= 0;
 		layout.marginWidth= 0;
 		editorComposite.setLayout(layout);
-		GridData gd= new GridData(SWT.FILL, SWT.BEGINNING, true, false);
+		GridData gd= new GridData(SWT.FILL, SWT.FILL, true, true);
+		gd.heightHint= convertHeightInCharsToPixels(7);
 		editorComposite.setLayoutData(gd);
 
 		fTreeViewer= new TreeViewer(editorComposite, SWT.SINGLE | SWT.BORDER);
@@ -610,8 +611,8 @@
 				return 0;
 			}
 		});
-		gd= new GridData(SWT.BEGINNING, SWT.BEGINNING, false, true);
-		gd.heightHint= convertHeightInCharsToPixels(9);
+		gd= new GridData(SWT.BEGINNING, SWT.FILL, false, true);
+		gd.heightHint= convertHeightInCharsToPixels(7);
 		int maxWidth= 0;
 		for (Iterator<HighlightingColorListItem> it= fListModel.iterator(); it.hasNext();) {
 			HighlightingColorListItem item= it.next();
@@ -631,7 +632,7 @@
 		layout.marginWidth= 0;
 		layout.numColumns= 2;
 		stylesComposite.setLayout(layout);
-		stylesComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
+		stylesComposite.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, true, false));
 
 		fEnableCheckbox= new Button(stylesComposite, SWT.CHECK);
 		fEnableCheckbox.setText(PreferencesMessages.JavaEditorPreferencePage_enable);
@@ -684,9 +685,8 @@
 		label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
 
 		Control previewer= createPreviewer(colorComposite);
-		gd= new GridData(GridData.FILL_BOTH);
+		gd= new GridData(GridData.FILL_HORIZONTAL);
 		gd.widthHint= convertWidthInCharsToPixels(20);
-		gd.heightHint= convertHeightInCharsToPixels(5);
 		previewer.setLayoutData(gd);
 
 		fTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
@@ -766,7 +766,7 @@
 			}
 		});
 
-		colorComposite.layout(false);
+		colorComposite.layout();
 
 		return colorComposite;
 	}
@@ -804,7 +804,7 @@
 
 		IPreferenceStore generalTextStore= EditorsUI.getPreferenceStore();
 		IPreferenceStore store= new ChainedPreferenceStore(new IPreferenceStore[] { getPreferenceStore(), new PreferencesAdapter(createTemporaryCorePreferenceStore()), generalTextStore });
-		fPreviewViewer= new JavaSourceViewer(parent, null, null, false, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER, store);
+		fPreviewViewer= new JavaSourceViewer(parent, null, null, false, SWT.H_SCROLL | SWT.BORDER, store);
 		SimpleJavaSourceViewerConfiguration configuration= new SimpleJavaSourceViewerConfiguration(fColorManager, store, null, IJavaPartitions.JAVA_PARTITIONING, false);
 		fPreviewViewer.configure(configuration);
 		// fake 1.5 source to get 1.5 features right.
@@ -852,6 +852,7 @@
 				buffer.append(line);
 				buffer.append(separator);
 			}
+			buffer.setLength(buffer.length() - separator.length());
 		} catch (IOException io) {
 			JavaPlugin.log(io);
 		} finally {
@@ -897,36 +898,36 @@
 	 */
 	private SemanticHighlightingManager.HighlightedRange[][] createPreviewerRanges() {
 		return new SemanticHighlightingManager.HighlightedRange[][] {
-			{ createHighlightedRange( 6, 13,  9, SemanticHighlightings.DEPRECATED_MEMBER), createHighlightedRange( 6, 13,  9, SemanticHighlightings.CLASS),  },
-			{ createHighlightedRange( 6, 23,  1, SemanticHighlightings.TYPE_VARIABLE), createHighlightedRange( 6, 23,  1, SemanticHighlightings.TYPE_ARGUMENT), },
-			{ createHighlightedRange( 6, 34,  8, SemanticHighlightings.CLASS) },
-			{ createHighlightedRange( 6, 54, 13, SemanticHighlightings.INTERFACE) },
-			{ createHighlightedRange( 6, 68,  6, SemanticHighlightings.TYPE_ARGUMENT), createHighlightedRange( 6, 68,  6, SemanticHighlightings.CLASS) },
-			{ createHighlightedRange( 7,  6,  5, SemanticHighlightings.ENUM), },
-			{ createHighlightedRange( 7, 14,  3, SemanticHighlightings.STATIC_FINAL_FIELD), createHighlightedRange( 7, 14,  3, SemanticHighlightings.STATIC_FIELD), createHighlightedRange(7, 14, 3, SemanticHighlightings.FIELD) },
-			{ createHighlightedRange( 7, 19,  5, SemanticHighlightings.STATIC_FINAL_FIELD), createHighlightedRange( 7, 19,  5, SemanticHighlightings.STATIC_FIELD), createHighlightedRange(7, 19, 5, SemanticHighlightings.FIELD) },
-			{ createHighlightedRange( 7, 26,  4, SemanticHighlightings.STATIC_FINAL_FIELD), createHighlightedRange( 7, 26,  4, SemanticHighlightings.STATIC_FIELD), createHighlightedRange(7, 26, 4, SemanticHighlightings.FIELD) },
-			{ createHighlightedRange( 9,  8,  6, SemanticHighlightings.CLASS), },
-			{ createHighlightedRange( 9, 15, 11, SemanticHighlightings.STATIC_FIELD), createHighlightedRange( 9, 15, 11, SemanticHighlightings.FIELD) },
-			{ createHighlightedRange(11,  9,  1, SemanticHighlightings.TYPE_VARIABLE) },
-			{ createHighlightedRange(11, 11,  5, SemanticHighlightings.FIELD) },
-			{ createHighlightedRange(12,  9, 17, SemanticHighlightings.ABSTRACT_CLASS), createHighlightedRange(12,  9, 17, SemanticHighlightings.CLASS) },
-			{ createHighlightedRange(12, 27,  6, SemanticHighlightings.FIELD) },
-			{ createHighlightedRange(14,  2, 16, SemanticHighlightings.ANNOTATION) },
-			{ createHighlightedRange(14, 19,  5, SemanticHighlightings.ANNOTATION_ELEMENT_REFERENCE) },
-			{ createHighlightedRange(15, 12,  3, SemanticHighlightings.METHOD_DECLARATION), createHighlightedRange(15, 12,  3, SemanticHighlightings.METHOD) },
-			{ createHighlightedRange(15, 16,  7, SemanticHighlightings.CLASS) },
-			{ createHighlightedRange(15, 24,  9, SemanticHighlightings.PARAMETER_VARIABLE) },
-			{ createHighlightedRange(16,  2, 14, SemanticHighlightings.ABSTRACT_METHOD_INVOCATION), createHighlightedRange(16,  2, 14, SemanticHighlightings.METHOD) },
-			{ createHighlightedRange(16, 17, 14, SemanticHighlightings.INHERITED_FIELD), createHighlightedRange(16, 17, 14, SemanticHighlightings.FIELD) },
-			{ createHighlightedRange(17,  6,  5, SemanticHighlightings.LOCAL_VARIABLE_DECLARATION) },
-			{ createHighlightedRange(17, 13,  2, SemanticHighlightings.NUMBER) },
-			{ createHighlightedRange(17, 16,  8, SemanticHighlightings.INHERITED_METHOD_INVOCATION), createHighlightedRange(17, 16,  8, SemanticHighlightings.METHOD) },
-			{ createHighlightedRange(18,  2, 12, SemanticHighlightings.STATIC_METHOD_INVOCATION), createHighlightedRange(18,  2, 12, SemanticHighlightings.METHOD) },
-			{ createHighlightedRange(19,  9,  3, SemanticHighlightings.METHOD) },
-			{ createHighlightedRange(19, 13,  5, SemanticHighlightings.LOCAL_VARIABLE) },
-			{ createHighlightedRange(19, 22,  9, SemanticHighlightings.AUTOBOXING), createHighlightedRange(19, 22, 9, SemanticHighlightings.PARAMETER_VARIABLE) },
-		};
+				{ createHighlightedRange( 6, 13,  9, SemanticHighlightings.DEPRECATED_MEMBER), createHighlightedRange( 6, 13,  9, SemanticHighlightings.CLASS),  },
+				{ createHighlightedRange( 6, 23,  1, SemanticHighlightings.TYPE_VARIABLE), createHighlightedRange( 6, 23,  1, SemanticHighlightings.TYPE_ARGUMENT), },
+				{ createHighlightedRange( 6, 34,  8, SemanticHighlightings.CLASS) },
+				{ createHighlightedRange( 6, 54, 13, SemanticHighlightings.INTERFACE) },
+				{ createHighlightedRange( 6, 68,  6, SemanticHighlightings.TYPE_ARGUMENT), createHighlightedRange( 6, 68,  6, SemanticHighlightings.CLASS) },
+				{ createHighlightedRange( 7,  6,  5, SemanticHighlightings.ENUM), },
+				{ createHighlightedRange( 7, 14,  3, SemanticHighlightings.STATIC_FINAL_FIELD), createHighlightedRange( 7, 14,  3, SemanticHighlightings.STATIC_FIELD), createHighlightedRange(7, 14, 3, SemanticHighlightings.FIELD) },
+				{ createHighlightedRange( 7, 19,  5, SemanticHighlightings.STATIC_FINAL_FIELD), createHighlightedRange( 7, 19,  5, SemanticHighlightings.STATIC_FIELD), createHighlightedRange(7, 19, 5, SemanticHighlightings.FIELD) },
+				{ createHighlightedRange( 7, 26,  4, SemanticHighlightings.STATIC_FINAL_FIELD), createHighlightedRange( 7, 26,  4, SemanticHighlightings.STATIC_FIELD), createHighlightedRange(7, 26, 4, SemanticHighlightings.FIELD) },
+				{ createHighlightedRange( 9,  8,  6, SemanticHighlightings.CLASS), },
+				{ createHighlightedRange( 9, 15, 11, SemanticHighlightings.STATIC_FIELD), createHighlightedRange( 9, 15, 11, SemanticHighlightings.FIELD) },
+				{ createHighlightedRange(11,  9,  1, SemanticHighlightings.TYPE_VARIABLE) },
+				{ createHighlightedRange(11, 11,  5, SemanticHighlightings.FIELD) },
+				{ createHighlightedRange(12,  9, 17, SemanticHighlightings.ABSTRACT_CLASS), createHighlightedRange(12,  9, 17, SemanticHighlightings.CLASS) },
+				{ createHighlightedRange(12, 27,  6, SemanticHighlightings.FIELD) },
+				{ createHighlightedRange(14,  2, 16, SemanticHighlightings.ANNOTATION) },
+				{ createHighlightedRange(14, 19,  5, SemanticHighlightings.ANNOTATION_ELEMENT_REFERENCE) },
+				{ createHighlightedRange(15, 12,  3, SemanticHighlightings.METHOD_DECLARATION), createHighlightedRange(15, 12,  3, SemanticHighlightings.METHOD) },
+				{ createHighlightedRange(15, 16,  7, SemanticHighlightings.CLASS) },
+				{ createHighlightedRange(15, 24,  9, SemanticHighlightings.PARAMETER_VARIABLE), createHighlightedRange(15, 24, 9, SemanticHighlightings.LOCAL_VARIABLE_DECLARATION), createHighlightedRange(15, 24, 9, SemanticHighlightings.LOCAL_VARIABLE) },
+				{ createHighlightedRange(16,  2, 14, SemanticHighlightings.ABSTRACT_METHOD_INVOCATION), createHighlightedRange(16,  2, 14, SemanticHighlightings.METHOD) },
+				{ createHighlightedRange(16, 17, 14, SemanticHighlightings.INHERITED_FIELD), createHighlightedRange(16, 17, 14, SemanticHighlightings.FIELD) },
+				{ createHighlightedRange(17,  6,  5, SemanticHighlightings.LOCAL_VARIABLE_DECLARATION), createHighlightedRange(17, 6, 5, SemanticHighlightings.LOCAL_VARIABLE) },
+				{ createHighlightedRange(17, 13,  2, SemanticHighlightings.NUMBER) },
+				{ createHighlightedRange(17, 16,  8, SemanticHighlightings.INHERITED_METHOD_INVOCATION), createHighlightedRange(17, 16,  8, SemanticHighlightings.METHOD) },
+				{ createHighlightedRange(18,  2, 12, SemanticHighlightings.STATIC_METHOD_INVOCATION), createHighlightedRange(18,  2, 12, SemanticHighlightings.METHOD) },
+				{ createHighlightedRange(19,  9,  3, SemanticHighlightings.METHOD) },
+				{ createHighlightedRange(19, 13,  5, SemanticHighlightings.LOCAL_VARIABLE) },
+				{ createHighlightedRange(19, 22,  9, SemanticHighlightings.AUTOBOXING), createHighlightedRange(19, 22, 9, SemanticHighlightings.PARAMETER_VARIABLE), createHighlightedRange(19, 22,  9, SemanticHighlightings.LOCAL_VARIABLE) },
+			};
 	}
 
 
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/PreferencesMessages.properties b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/PreferencesMessages.properties
index 3d3b4d9..9b5b2a5 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/PreferencesMessages.properties
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/PreferencesMessages.properties
@@ -242,7 +242,7 @@
 JavadocConfigurationBlock_workspace_archive_selection_dialog_title=Javadoc Archive Selection Dialog
 JavadocConfigurationBlock_workspace_archive_selection_dialog_description=&Choose the archive containing the documentation:
 JavadocConfigurationPropertyPage_IsIncorrectElement_description=Javadoc location can only be attached to Java projects or archives and class folders in Java projects. Source folders use the location specified at their project.
-JavadocConfigurationPropertyPage_IsJavaProject_description=Specify the location of the project\'s Javadoc documentation. This location is used by the Javadoc export wizard as the default value and by the \'Open Attached Javadoc\' action. For example: \'file:/c:/myworkspace/myproject/doc\'.
+JavadocConfigurationPropertyPage_IsJavaProject_description=Specify the location of the project\'s Javadoc documentation. This location is used by the Javadoc export wizard as the default value and by the \'Open Attached Javadoc\' action. For example: \'file:///c:/myworkspace/myproject/doc\'.
 JavadocConfigurationPropertyPage_invalid_container=The current class path entry belongs to container ''{0}'' which can not be configured.
 JavadocConfigurationPropertyPage_location_path=&Location path:
 JavadocConfigurationPropertyPage_locationPath_none=(none)
@@ -262,7 +262,7 @@
 JavadocConfigurationBlock_Open_label=O&pen in Browser
 JavadocConfigurationBlock_UnableToValidateLocation_message=Cannot validate Javadoc location.
 JavadocConfigurationBlock_MessageDialog_title=Validating Javadoc Location
-JavadocConfigurationBlock_location_type_path_label=Javadoc &URL (e.g. 'http://www.sample-url.org/doc/' or 'file:/c:/myworkspace/myproject/doc')
+JavadocConfigurationBlock_location_type_path_label=Javadoc &URL (e.g. 'http://www.sample-url.org/doc/' or 'file:///c:/myworkspace/myproject/doc')
 JavadocConfigurationBlock_location_type_jar_label=Javadoc in ar&chive
 JavadocConfigurationBlock_location_path_label=&Javadoc location path:
 JavadocConfigurationBlock_location_jar_label=Archive &path:
@@ -416,7 +416,7 @@
 ProblemSeveritiesConfigurationBlock_inherit_null_annotations=Inherit null annotations
 
 ProblemSeveritiesConfigurationBlock_common_description=&Select the severity level for the following optional problems:
-ProblemSeveritiesConfigurationBlock_pb_unavoidable_generic_type_problems=Ignore unavoidable generic type problems
+ProblemSeveritiesConfigurationBlock_pb_unavoidable_generic_type_problems=Ignore unavoidable generic type problems due to raw APIs
 ProblemSeveritiesConfigurationBlock_pb_unsafe_type_op_label=Unchecked generic type operation:
 ProblemSeveritiesConfigurationBlock_pb_raw_type_reference=Usage of a raw type:
 ProblemSeveritiesConfigurationBlock_pb_final_param_bound_label=Generic t&ype parameter declared with a final type bound:
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/propertiesfileeditor/PropertiesFileEditor.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/propertiesfileeditor/PropertiesFileEditor.java
index b5a35ce..d9967d4 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/propertiesfileeditor/PropertiesFileEditor.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/propertiesfileeditor/PropertiesFileEditor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -302,6 +302,13 @@
 	}
 
 	public IType getAccessorType() {
+		if (fJob != null) {
+			try {
+				fJob.join();
+			} catch (InterruptedException e) {
+				JavaPlugin.log(e);
+			}
+		}
 		return fAccessorTypes.get(getEditorInput());
 	}
 
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaElementLine.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaElementLine.java
index 4e28779..a621217 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaElementLine.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaElementLine.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -8,7 +8,6 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/
-
 package org.eclipse.jdt.internal.ui.search;
 
 import org.eclipse.core.runtime.CoreException;
@@ -25,6 +24,7 @@
 
 import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels;
 
+
 public class JavaElementLine {
 
 
@@ -37,7 +37,7 @@
 
 	/**
 	 * @param element either an ICompilationUnit or an IClassFile
-	 * @param lineNumber the line number
+	 * @param lineNumber the line number, starting at 0
 	 * @param lineStartOffset the start offset of the line
 	 * @throws CoreException thrown when accessing of the buffer failed
 	 */
@@ -87,7 +87,12 @@
 		return fElement;
 	}
 
-	public int getLine() {
+	/**
+	 * Returns the line number.
+	 * 
+	 * @return the line number, starting at 0
+	 */
+	public int getLineNumber() {
 		return fLineNumber;
 	}
 
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/OccurrencesSearchLabelProvider.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/OccurrencesSearchLabelProvider.java
index 201a76e..21aa744 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/OccurrencesSearchLabelProvider.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/OccurrencesSearchLabelProvider.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -8,13 +8,12 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/
-
 package org.eclipse.jdt.internal.ui.search;
 
 import org.eclipse.swt.graphics.Image;
 
-import org.eclipse.jface.viewers.StyledString;
 import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;
+import org.eclipse.jface.viewers.StyledString;
 import org.eclipse.jface.viewers.StyledString.Styler;
 
 import org.eclipse.search.ui.text.AbstractTextSearchViewPage;
@@ -25,6 +24,7 @@
 import org.eclipse.jdt.internal.ui.JavaPluginImages;
 import org.eclipse.jdt.internal.ui.viewsupport.ColoringLabelProvider;
 
+
 class OccurrencesSearchLabelProvider extends TextSearchLabelProvider implements IStyledLabelProvider {
 
 	public OccurrencesSearchLabelProvider(AbstractTextSearchViewPage page) {
@@ -40,7 +40,7 @@
 	}
 
 	private String getLineNumberLabel(JavaElementLine element) {
-		return Messages.format(SearchMessages.OccurrencesSearchLabelProvider_line_number, new Integer(element.getLine()));
+		return Messages.format(SearchMessages.OccurrencesSearchLabelProvider_line_number, new Integer(element.getLineNumber() + 1));
 	}
 
 	private String internalGetText(Object element) {
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/OccurrencesSearchResultPage.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/OccurrencesSearchResultPage.java
index 2bc6f94..3a95d3b 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/OccurrencesSearchResultPage.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/OccurrencesSearchResultPage.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -8,7 +8,6 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/
-
 package org.eclipse.jdt.internal.ui.search;
 
 import org.eclipse.swt.widgets.Composite;
@@ -273,7 +272,7 @@
 			public int compare(Viewer v, Object e1, Object e2) {
 				JavaElementLine jel1= (JavaElementLine) e1;
 				JavaElementLine jel2= (JavaElementLine) e2;
-				return jel1.getLine() - jel2.getLine();
+				return jel1.getLineNumber() - jel2.getLineNumber();
 			}
 		});
 		viewer.setLabelProvider(new ColoringLabelProvider(new OccurrencesSearchLabelProvider(this)));
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/JavaIndenter.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/JavaIndenter.java
index 12929a8..efd5e1e 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/JavaIndenter.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/JavaIndenter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 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
@@ -1003,6 +1003,12 @@
 			return matchCaseAlignment();
 		}
 
+		int storedPos= fPosition;
+		if (peekChar(offset) == Symbols.TokenLBRACE && looksLikeMethodDeclLBrace(offset)) {
+			return skipToStatementStart(danglingElse, false);
+		}
+		fPosition= storedPos;
+
 		nextToken();
 		switch (fToken) {
 			case Symbols.TokenGREATERTHAN:
@@ -1087,9 +1093,6 @@
 						return fPosition;
 					}
 					fPosition= scope;
-					if (looksLikeMethodDecl()) {
-						return skipToStatementStart(danglingElse, false);
-					}
 					if (fToken == Symbols.TokenCATCH) {
 						return skipToStatementStart(danglingElse, false);
 					}
@@ -1141,6 +1144,53 @@
 	}
 
 	/**
+	 * Checks whether the Symbols.TokenLBRACE after <code>offset</code> probably represents the
+	 * beginning of a method body declaration.
+	 * 
+	 * @param offset the document offset for which {@link #peekChar(int) peekChar(offset)} returns
+	 *            Symbols.TokenLBRACE
+	 * @return <code>true</code> if the left brace after <code>offset</code> looks like the
+	 *         beginning of a method body declaration, <code>false</code> otherwise
+	 * 
+	 * @since 3.9
+	 */
+	private boolean looksLikeMethodDeclLBrace(int offset) {
+		nextToken();
+		while (true) {
+			switch (fToken) {
+				case Symbols.TokenTHROWS:
+				case Symbols.TokenIDENT: // identifier for exception/annotation/annotation value
+				case Symbols.TokenCOMMA:
+				case Symbols.TokenAT:
+				case Symbols.TokenLBRACKET: // for array valued return type
+				case Symbols.TokenRBRACKET:
+					break; // possible tokens between '{' and ')' in method declaration
+				case Symbols.TokenOTHER: // dot of qualification
+					try {
+						if (fDocument.getChar(fPosition) != '.') {
+							return false;
+						}
+					} catch (BadLocationException e) {
+						return false;
+					}
+					break;
+				case Symbols.TokenRPAREN: // parenthesis for annotation value / method declaration
+					skipScope();
+					int storedPos= fPosition;
+					if (looksLikeMethodDecl())
+						return true;
+					fPosition= storedPos;
+					break;
+				case Symbols.TokenEOF:
+					return false;
+				default:
+					return false;
+			}
+			nextToken();
+		}
+	}
+
+	/**
 	 * Checks if the statement at position is itself a continuation of the previous, else sets the
 	 * indentation to Continuation Indent.
 	 * 
@@ -1536,6 +1586,8 @@
 				int storedToken= fToken;
 				nextToken();
 				switch (fToken) {
+					case Symbols.TokenLESSTHAN:
+						return true;
 					case Symbols.TokenIDENT:
 						boolean isGenericStarter;
 						try {
@@ -1551,7 +1603,7 @@
 						if (skipScope(Symbols.TokenLESSTHAN, Symbols.TokenGREATERTHAN))
 							return true;
 				}
-				// <> are harder to detect - restore the position if we fail
+				// <...> are harder to detect - restore the position if we fail
 				fPosition= storedPosition;
 				fToken= storedToken;
 				return false;
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/CorrectionMessages.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/CorrectionMessages.java
index e9e9fd5..f537a67 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/CorrectionMessages.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/CorrectionMessages.java
@@ -13,6 +13,7 @@
  *     IBM Corporation - initial API and implementation
  *     Benjamin Muskalla <b.muskalla@gmx.net> - [quick fix] Quick fix for missing synchronized modifier - https://bugs.eclipse.org/bugs/show_bug.cgi?id=245250
  *     Billy Huang <billyhuang31@gmail.com> - [quick assist] concatenate/merge string literals - https://bugs.eclipse.org/77632
+ *     Lukas Hanke <hanke@yatta.de> - Bug 241696 [quick fix] quickfix to iterate over a collection - https://bugs.eclipse.org/bugs/show_bug.cgi?id=241696
  *******************************************************************************/
 package org.eclipse.jdt.internal.ui.text.correction;
 
@@ -48,6 +49,10 @@
 	public static String QuickAssistProcessor_convert_local_to_field_description;
 	public static String QuickAssistProcessor_convert_to_indexed_for_loop;
 	public static String QuickAssistProcessor_convert_to_iterator_for_loop;
+	public static String QuickAssistProcessor_generate_enhanced_for_loop;
+	public static String QuickAssistProcessor_generate_iterator_for_loop;
+	public static String QuickAssistProcessor_generate_for_loop;
+	public static String QuickAssistProcessor_generate_index_for_loop;
 	public static String QuickAssistProcessor_convert_to_message_format;
 	public static String QuickAssistProcessor_convert_to_multiple_singletype_catch_blocks;
 	public static String QuickAssistProcessor_convert_to_single_multicatch_block;
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/CorrectionMessages.properties b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/CorrectionMessages.properties
index 2fae38a..eb2f343 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/CorrectionMessages.properties
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/CorrectionMessages.properties
@@ -13,6 +13,7 @@
 #     IBM Corporation - initial API and implementation
 #     Benjamin Muskalla <b.muskalla@gmx.net> - [quick fix] Quick fix for missing synchronized modifier - https://bugs.eclipse.org/bugs/show_bug.cgi?id=245250
 #     Billy Huang <billyhuang31@gmail.com> - [quick assist] concatenate/merge string literals - https://bugs.eclipse.org/77632
+#     Lukas Hanke <hanke@yatta.de> - Bug 241696 [quick fix] quickfix to iterate over a collection - https://bugs.eclipse.org/bugs/show_bug.cgi?id=241696
 ###############################################################################
 
 # ------ SerialVersionProposal
@@ -348,8 +349,12 @@
 QuickAssistProcessor_name_extension_from_class={0}Implementation
 QuickAssistProcessor_typetoarrayInitializer_description=Add type to initializer
 QuickAssistProcessor_convert_local_to_field_description=Convert local variable to field
-QuickAssistProcessor_convert_to_indexed_for_loop=Convert to indexed 'for' loop
-QuickAssistProcessor_convert_to_iterator_for_loop=Convert to Iterator-based 'for' loop
+QuickAssistProcessor_convert_to_indexed_for_loop=Convert to 'for' loop using index
+QuickAssistProcessor_convert_to_iterator_for_loop=Convert to 'for' loop using Iterator
+QuickAssistProcessor_generate_enhanced_for_loop=Create enhanced 'for' loop
+QuickAssistProcessor_generate_iterator_for_loop=Create 'for' loop using Iterator
+QuickAssistProcessor_generate_for_loop=Create 'for' loop
+QuickAssistProcessor_generate_index_for_loop=Create 'for' loop using index
 QuickAssistProcessor_convert_to_message_format=Use 'MessageFormat' for string concatenation
 QuickAssistProcessor_convert_to_multiple_singletype_catch_blocks=Use separate catch blocks
 QuickAssistProcessor_convert_to_single_multicatch_block=Combine catch blocks
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/IProposalRelevance.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/IProposalRelevance.java
index d79eb07..8a54d75 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/IProposalRelevance.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/IProposalRelevance.java
@@ -12,6 +12,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Billy Huang <billyhuang31@gmail.com> - [quick assist] concatenate/merge string literals - https://bugs.eclipse.org/77632
+ *     Lukas Hanke <hanke@yatta.de> - Bug 241696 [quick fix] quickfix to iterate over a collection - https://bugs.eclipse.org/bugs/show_bug.cgi?id=241696
  *******************************************************************************/
 package org.eclipse.jdt.internal.ui.text.correction;
 
@@ -209,6 +210,7 @@
 	public static final int CHANGE_TO_ATTRIBUTE= 3;
 
 	public static final int CONVERT_TO_INDEXED_FOR_LOOP= 2;
+	public static final int GENERATE_ENHANCED_FOR_LOOP= 2;
 	public static final int USE_SEPARATE_CATCH_BLOCKS= 2;
 	public static final int INSERT_NULL_CHECK= 2;
 	public static final int COMBINE_CATCH_BLOCKS= 2;
@@ -220,6 +222,7 @@
 	public static final int JOIN_VARIABLE_DECLARATION= 1;
 	public static final int INVERT_EQUALS= 1;
 	public static final int CONVERT_TO_ITERATOR_FOR_LOOP= 1;
+	public static final int GENERATE_FOR_LOOP= 1;
 	public static final int ADD_TYPE_TO_ARRAY_INITIALIZER= 1;
 	public static final int REMOVE_EXTRA_PARENTHESES= 1;
 	public static final int CONVERT_ITERABLE_LOOP_TO_ENHANCED= 1;
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java
index b6fb481..0834508 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java
@@ -13,10 +13,12 @@
  *     IBM Corporation - initial API and implementation
  *     Renaud Waldura &lt;renaud+eclipse@waldura.com&gt; - Access to static proposal
  *     Benjamin Muskalla <bmuskalla@innoopract.com> - [quick fix] Shouldn't offer "Add throws declaration" quickfix for overriding signature if result would conflict with overridden signature
+ *     Lukas Hanke <hanke@yatta.de> - Bug 241696 [quick fix] quickfix to iterate over a collection - https://bugs.eclipse.org/bugs/show_bug.cgi?id=241696
  *******************************************************************************/
 package org.eclipse.jdt.internal.ui.text.correction;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Hashtable;
@@ -59,6 +61,7 @@
 import org.eclipse.jdt.core.dom.BodyDeclaration;
 import org.eclipse.jdt.core.dom.CastExpression;
 import org.eclipse.jdt.core.dom.CatchClause;
+import org.eclipse.jdt.core.dom.ChildListPropertyDescriptor;
 import org.eclipse.jdt.core.dom.ClassInstanceCreation;
 import org.eclipse.jdt.core.dom.CompilationUnit;
 import org.eclipse.jdt.core.dom.ConditionalExpression;
@@ -291,7 +294,8 @@
 				List<CatchClause> catchClauses= surroundingTry.catchClauses();
 
 				if (catchClauses != null && catchClauses.size() == 1) {
-					String label= uncaughtExceptions.length > 1
+					List<ITypeBinding> filteredExceptions= filterSubtypeExceptions(uncaughtExceptions);
+					String label= filteredExceptions.size() > 1
 							? CorrectionMessages.LocalCorrectionsSubProcessor_addexceptionstoexistingcatch_description
 							: CorrectionMessages.LocalCorrectionsSubProcessor_addexceptiontoexistingcatch_description;
 					Image image= JavaPluginImages.get(JavaPluginImages.IMG_OBJS_EXCEPTION);
@@ -305,8 +309,8 @@
 					if (type instanceof UnionType) {
 						UnionType unionType= (UnionType) type;
 						ListRewrite listRewrite= rewrite.getListRewrite(unionType, UnionType.TYPES_PROPERTY);
-						for (int i= 0; i < uncaughtExceptions.length; i++) {
-							ITypeBinding excBinding= uncaughtExceptions[i];
+						for (int i= 0; i < filteredExceptions.size(); i++) {
+							ITypeBinding excBinding= filteredExceptions.get(i);
 							Type type2= imports.addImport(excBinding, ast, importRewriteContext);
 							listRewrite.insertLast(type2, null);
 
@@ -319,8 +323,8 @@
 						List<Type> types= newUnionType.types();
 
 						types.add((Type) rewrite.createCopyTarget(type));
-						for (int i= 0; i < uncaughtExceptions.length; i++) {
-							ITypeBinding excBinding= uncaughtExceptions[i];
+						for (int i= 0; i < filteredExceptions.size(); i++) {
+							ITypeBinding excBinding= filteredExceptions.get(i);
 							Type type2= imports.addImport(excBinding, ast, importRewriteContext);
 							types.add(type2);
 
@@ -437,6 +441,23 @@
 		}
 	}
 
+	private static List<ITypeBinding> filterSubtypeExceptions(ITypeBinding[] exceptions) {
+		List<ITypeBinding> filteredExceptions= new ArrayList<ITypeBinding>();
+		filteredExceptions.addAll(Arrays.asList(exceptions));
+
+		for (Iterator<ITypeBinding> subtypeIterator= filteredExceptions.iterator(); subtypeIterator.hasNext();) {
+			ITypeBinding iTypeBinding= subtypeIterator.next();
+			for (Iterator<ITypeBinding> supertypeIterator= filteredExceptions.iterator(); supertypeIterator.hasNext();) {
+				ITypeBinding superTypeBinding= supertypeIterator.next();
+				if (!iTypeBinding.equals(superTypeBinding) && iTypeBinding.isSubTypeCompatible(superTypeBinding)) {
+					subtypeIterator.remove();
+					break;
+				}
+			}
+		}
+		return filteredExceptions;
+	}
+
 	private static void addExceptionTypeLinkProposals(LinkedCorrectionProposal proposal, ITypeBinding exc, String key) {
 		// all super classes except Object
 		while (exc != null && !"java.lang.Object".equals(exc.getQualifiedName())) { //$NON-NLS-1$
@@ -1096,7 +1117,7 @@
 			
 		} else if (selectedNode instanceof Statement && selectedNode.getLocationInParent().isChildListProperty()) {
 			// remove all statements following the unreachable:
-			List<Statement> statements= (List<Statement>) selectedNode.getParent().getStructuralProperty(selectedNode.getLocationInParent());
+			List<Statement> statements= ASTNodes.<Statement>getChildListProperty(selectedNode.getParent(), (ChildListPropertyDescriptor) selectedNode.getLocationInParent());
 			int idx= statements.indexOf(selectedNode);
 			
 			ASTRewrite rewrite= ASTRewrite.create(selectedNode.getAST());
@@ -1848,5 +1869,12 @@
 		
 		proposals.add(proposal2);
 	}
+	
+	public static void getGenerateForLoopProposals(IInvocationContext context, IProblemLocation problem, Collection<ICommandAccess> proposals) {
+		ASTNode coveringNode= problem.getCoveringNode(context.getASTRoot());
+		if (coveringNode != null) {
+			QuickAssistProcessor.getGenerateForLoopProposals(context, coveringNode, null, proposals);
+		}
+	}
 
 }
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/QuickAssistProcessor.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/QuickAssistProcessor.java
index e25aaf5..9fb9e70 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/QuickAssistProcessor.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/QuickAssistProcessor.java
@@ -14,6 +14,8 @@
  *     Sebastian Davids <sdavids@gmx.de> - Bug 37432 getInvertEqualsProposal
  *     Benjamin Muskalla <b.muskalla@gmx.net> - Bug 36350 convertToStringBufferPropsal
  *     Chris West (Faux) <eclipse@goeswhere.com> - [quick assist] "Use 'StringBuilder' for string concatenation" could fix existing misuses - https://bugs.eclipse.org/bugs/show_bug.cgi?id=282755
+ *     Lukas Hanke <hanke@yatta.de> - Bug 241696 [quick fix] quickfix to iterate over a collection - https://bugs.eclipse.org/bugs/show_bug.cgi?id=241696
+ *     Eugene Lucash <e.lucash@gmail.com> - [quick assist] Add key binding for Extract method Quick Assist - https://bugs.eclipse.org/424166
  *******************************************************************************/
 package org.eclipse.jdt.internal.ui.text.correction;
 
@@ -68,6 +70,7 @@
 import org.eclipse.jdt.core.dom.EnhancedForStatement;
 import org.eclipse.jdt.core.dom.Expression;
 import org.eclipse.jdt.core.dom.ExpressionStatement;
+import org.eclipse.jdt.core.dom.FieldAccess;
 import org.eclipse.jdt.core.dom.ForStatement;
 import org.eclipse.jdt.core.dom.IBinding;
 import org.eclipse.jdt.core.dom.IMethodBinding;
@@ -165,6 +168,7 @@
 import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
 import org.eclipse.jdt.internal.ui.text.correction.proposals.AssignToVariableAssistProposal;
 import org.eclipse.jdt.internal.ui.text.correction.proposals.FixCorrectionProposal;
+import org.eclipse.jdt.internal.ui.text.correction.proposals.GenerateForLoopAssistProposal;
 import org.eclipse.jdt.internal.ui.text.correction.proposals.LinkedCorrectionProposal;
 import org.eclipse.jdt.internal.ui.text.correction.proposals.LinkedNamesAssistProposal;
 import org.eclipse.jdt.internal.ui.text.correction.proposals.NewDefiningMethodProposal;
@@ -191,6 +195,7 @@
 	public static final String CONVERT_ANONYMOUS_TO_LOCAL_ID= "org.eclipse.jdt.ui.correction.convertAnonymousToLocal.assist"; //$NON-NLS-1$
 	public static final String CONVERT_TO_STRING_BUFFER_ID= "org.eclipse.jdt.ui.correction.convertToStringBuffer.assist"; //$NON-NLS-1$
 	public static final String CONVERT_TO_MESSAGE_FORMAT_ID= "org.eclipse.jdt.ui.correction.convertToMessageFormat.assist"; //$NON-NLS-1$;
+	public static final String EXTRACT_METHOD_INPLACE_ID= "org.eclipse.jdt.ui.correction.extractMethodInplace.assist"; //$NON-NLS-1$;
 
 	public QuickAssistProcessor() {
 		super();
@@ -220,6 +225,7 @@
 				|| getConvertForLoopProposal(context, coveringNode, null)
 				|| getConvertIterableLoopProposal(context, coveringNode, null)
 				|| getConvertEnhancedForLoopProposal(context, coveringNode, null)
+				|| getGenerateForLoopProposals(context, coveringNode, null, null)
 				|| getExtractVariableProposal(context, false, null)
 				|| getExtractMethodProposal(context, coveringNode, false, null)
 				|| getInlineLocalProposal(context, coveringNode, null)
@@ -251,6 +257,7 @@
 			getAssignToVariableProposals(context, coveringNode, locations, resultingCollections);
 			getAssignParamToFieldProposals(context, coveringNode, resultingCollections);
 			getInferDiamondArgumentsProposal(context, coveringNode, locations, resultingCollections);
+			getGenerateForLoopProposals(context, coveringNode, locations, resultingCollections);
 
 			if (noErrorsAtLocation) {
 				boolean problemsAtLocation= locations.length != 0;
@@ -348,6 +355,7 @@
 			Image image= JavaPluginImages.get(JavaPluginImages.IMG_MISC_PUBLIC);
 			int relevance= problemsAtLocation ? IProposalRelevance.EXTRACT_METHOD_ERROR : IProposalRelevance.EXTRACT_METHOD;
 			RefactoringCorrectionProposal proposal= new RefactoringCorrectionProposal(label, cu, extractMethodRefactoring, relevance, image);
+			proposal.setCommandId(EXTRACT_METHOD_INPLACE_ID);
 			proposal.setLinkedProposalModel(linkedProposalModel);
 			proposals.add(proposal);
 		}
@@ -893,7 +901,7 @@
 			return false;
 		}
 
-		List<? extends ASTNode> list= (List<? extends ASTNode>) statementParent.getStructuralProperty(property);
+		List<? extends ASTNode> list= ASTNodes.getChildListProperty(statementParent, (ChildListPropertyDescriptor) property);
 
 		if (resultingCollections == null) {
 			return true;
@@ -2468,7 +2476,7 @@
 		ITypeBinding initializerListType= Bindings.findTypeInHierarchy(initializerTypeBinding, "java.util.List"); //$NON-NLS-1$
 		ITypeBinding initializerIterableType= Bindings.findTypeInHierarchy(initializerTypeBinding, "java.lang.Iterable"); //$NON-NLS-1$
 		
-		if (initializerIterableType != null && initializerIterableType.getTypeArguments().length == 1) {
+		if (initializerIterableType != null) {
 			String label= CorrectionMessages.QuickAssistProcessor_convert_to_iterator_for_loop;
 			Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
 			
@@ -2484,9 +2492,13 @@
 			iterInitializer.setName(ast.newSimpleName("iterator")); //$NON-NLS-1$
 			ImportRewrite imports= proposal.createImportRewrite(context.getASTRoot());
 			ImportRewriteContext importRewriteContext= new ContextSensitiveImportRewriteContext(node, imports);
-			Type iterTypeArgument= imports.addImport(Bindings.normalizeTypeBinding(initializerIterableType.getTypeArguments()[0]), ast, importRewriteContext);
-			ParameterizedType iterType= ast.newParameterizedType(ast.newSimpleType(ast.newName(imports.addImport("java.util.Iterator", importRewriteContext)))); //$NON-NLS-1$
-			iterType.typeArguments().add(iterTypeArgument);
+			Type iterType= ast.newSimpleType(ast.newName(imports.addImport("java.util.Iterator", importRewriteContext))); //$NON-NLS-1$
+			if (initializerIterableType.getTypeArguments().length == 1) {
+				Type iterTypeArgument= imports.addImport(Bindings.normalizeTypeBinding(initializerIterableType.getTypeArguments()[0]), ast, importRewriteContext);
+				ParameterizedType parameterizedIterType= ast.newParameterizedType(iterType);
+				parameterizedIterType.typeArguments().add(iterTypeArgument);
+				iterType= parameterizedIterType;
+			}
 			String[] iterNames= StubUtility.getVariableNameSuggestions(NamingConventions.VK_LOCAL, project, iterType, iterInitializer, usedVarNames);
 			String iterName= iterNames[0];
 			SimpleName initializerIterName= ast.newSimpleName(iterName);
@@ -2756,6 +2768,54 @@
 		return true;
 	}
 
+	public static boolean getGenerateForLoopProposals(IInvocationContext context, ASTNode coveringNode, IProblemLocation[] locations, Collection<ICommandAccess> resultingCollections) {
+		Statement statement= ASTResolving.findParentStatement(coveringNode);
+		if (!(statement instanceof ExpressionStatement)) {
+			return false;
+		}
+
+		if (containsMatchingProblem(locations, IProblem.ParsingErrorInsertToComplete))
+			return false;
+
+		Expression expression= ((ExpressionStatement) statement).getExpression();
+		ICompilationUnit cu= context.getCompilationUnit();
+		ITypeBinding expressionType= null;
+
+		if (expression instanceof MethodInvocation
+				|| expression instanceof SimpleName
+				|| expression instanceof FieldAccess) {
+			expressionType= expression.resolveTypeBinding();
+		} else if (expression instanceof Assignment
+				&& ((Assignment) expression).getRightHandSide().resolveTypeBinding() == null
+				&& ((Assignment) expression).getLeftHandSide().resolveTypeBinding() != null) {
+			expressionType= ((Assignment) expression).getLeftHandSide().resolveTypeBinding();
+		}
+
+		if (expressionType == null)
+			return false;
+
+		if (Bindings.findTypeInHierarchy(expressionType, "java.lang.Iterable") != null) { //$NON-NLS-1$
+			if (resultingCollections == null)
+				return true;
+			resultingCollections.add(new GenerateForLoopAssistProposal(cu, statement, expression, GenerateForLoopAssistProposal.GENERATE_ITERATOR_FOR));
+			if (Bindings.findTypeInHierarchy(expressionType, "java.util.List") != null) { //$NON-NLS-1$
+				resultingCollections.add(new GenerateForLoopAssistProposal(cu, statement, expression, GenerateForLoopAssistProposal.GENERATE_ITERATE_LIST));
+			}
+		} else if (expressionType.isArray()) {
+			if (resultingCollections == null)
+				return true;
+			resultingCollections.add(new GenerateForLoopAssistProposal(cu, statement, expression, GenerateForLoopAssistProposal.GENERATE_ITERATE_ARRAY));
+		} else {
+			return false;
+		}
+
+		if (JavaModelUtil.is50OrHigher(cu.getJavaProject())) {
+			resultingCollections.add(new GenerateForLoopAssistProposal(cu, statement, expression, GenerateForLoopAssistProposal.GENERATE_FOREACH));
+		}
+
+		return true;
+	}
+
 	private static ForStatement getEnclosingForStatementHeader(ASTNode node) {
 		return getEnclosingHeader(node, ForStatement.class, ForStatement.INITIALIZERS_PROPERTY, ForStatement.EXPRESSION_PROPERTY, ForStatement.UPDATERS_PROPERTY);
 	}
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/QuickFixProcessor.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/QuickFixProcessor.java
index c3cf072..1efcf78 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/QuickFixProcessor.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/QuickFixProcessor.java
@@ -17,6 +17,7 @@
  *								[quick fix] The fix change parameter type to @Nonnull generated a null change - https://bugs.eclipse.org/400668 
  *								[quick fix] don't propose null annotations when those are disabled - https://bugs.eclipse.org/405086
  *								[quickfix] Update null annotation quick fixes for bug 388281 - https://bugs.eclipse.org/395555
+ *     Lukas Hanke <hanke@yatta.de> - Bug 241696 [quick fix] quickfix to iterate over a collection - https://bugs.eclipse.org/bugs/show_bug.cgi?id=241696
  *******************************************************************************/
 package org.eclipse.jdt.internal.ui.text.correction;
 
@@ -266,6 +267,7 @@
 			case IProblem.NullableFieldReference:
 			case IProblem.ConflictingNullAnnotations:
 			case IProblem.ConflictingInheritedNullAnnotations:
+			case IProblem.ParsingErrorInsertToComplete:
 			case IProblem.ExplicitThisParameterNotBelow18:
 			case IProblem.DefaultMethodNotBelow18:
 			case IProblem.StaticInterfaceMethodNotBelow18:
@@ -759,6 +761,9 @@
 				NullAnnotationsCorrectionProcessor.addReturnAndArgumentTypeProposal(context, problem, ChangeKind.LOCAL, proposals);
 				NullAnnotationsCorrectionProcessor.addReturnAndArgumentTypeProposal(context, problem, ChangeKind.INVERSE, proposals);
 				break;
+			case IProblem.ParsingErrorInsertToComplete:
+				LocalCorrectionsSubProcessor.getGenerateForLoopProposals(context, problem, proposals);
+				break;
 			default:
 		}
 		if (JavaModelUtil.is50OrHigher(context.getCompilationUnit().getJavaProject())) {
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/SuppressWarningsSubProcessor.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/SuppressWarningsSubProcessor.java
index 14003c1..79e5775 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/SuppressWarningsSubProcessor.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/SuppressWarningsSubProcessor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -77,7 +77,8 @@
 			String optionId= JavaCore.getOptionForConfigurableSeverity(problemId);
 			if (optionId != null) {
 				String optionValue= javaProject.getOption(optionId, true);
-				return JavaCore.WARNING.equals(optionValue);
+				return JavaCore.WARNING.equals(optionValue) ||
+						(JavaCore.ERROR.equals(optionValue) && JavaCore.ENABLED.equals(javaProject.getOption(JavaCore.COMPILER_PB_SUPPRESS_OPTIONAL_ERRORS, true)));
 			}
 		}
 		return false;
@@ -166,7 +167,7 @@
 			StringLiteral newStringLiteral= ast.newStringLiteral();
 			newStringLiteral.setLiteralValue(fWarningToken);
 
-			Annotation existing= findExistingAnnotation((List<? extends ASTNode>) fNode.getStructuralProperty(fProperty));
+			Annotation existing= findExistingAnnotation(ASTNodes.getChildListProperty(fNode, fProperty));
 			if (existing == null) {
 				ListRewrite listRewrite= rewrite.getListRewrite(fNode, fProperty);
 
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/AbstractMethodCorrectionProposal.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/AbstractMethodCorrectionProposal.java
index c073603..e5f940d 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/AbstractMethodCorrectionProposal.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/AbstractMethodCorrectionProposal.java
@@ -102,7 +102,7 @@
 			MethodDeclaration newStub= getStub(rewrite, newTypeDecl);
 
 			ChildListPropertyDescriptor property= ASTNodes.getBodyDeclarationsProperty(newTypeDecl);
-			List<BodyDeclaration> members= (List<BodyDeclaration>) newTypeDecl.getStructuralProperty(property);
+			List<BodyDeclaration> members= ASTNodes.getBodyDeclarations(newTypeDecl);
 
 			int insertIndex;
 			if (isConstructor()) {
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/AssignToVariableAssistProposal.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/AssignToVariableAssistProposal.java
index 322f89f..81a8afe 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/AssignToVariableAssistProposal.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/AssignToVariableAssistProposal.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -319,7 +319,7 @@
 		}
 
 		ChildListPropertyDescriptor property= ASTNodes.getBodyDeclarationsProperty(newTypeDecl);
-		List<BodyDeclaration> decls= (List<BodyDeclaration>) newTypeDecl.getStructuralProperty(property);
+		List<BodyDeclaration> decls= ASTNodes.getBodyDeclarations(newTypeDecl);
 		AST ast= newTypeDecl.getAST();
 		String[] varNames= suggestFieldNames(fTypeBinding, expression, modifiers);
 		for (int i= 0; i < varNames.length; i++) {
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/GenerateForLoopAssistProposal.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/GenerateForLoopAssistProposal.java
new file mode 100644
index 0000000..50e87d0
--- /dev/null
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/GenerateForLoopAssistProposal.java
@@ -0,0 +1,562 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Yatta Solutions GmbH 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
+ *
+ * Contributors:
+ *     Lukas Hanke <hanke@yatta.de> - Bug 241696 [quick fix] quickfix to iterate over a collection - https://bugs.eclipse.org/bugs/show_bug.cgi?id=241696
+ *******************************************************************************/
+package org.eclipse.jdt.internal.ui.text.correction.proposals;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+
+import org.eclipse.jface.text.link.LinkedPosition;
+import org.eclipse.jface.text.link.LinkedPositionGroup;
+
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.ArrayAccess;
+import org.eclipse.jdt.core.dom.Assignment;
+import org.eclipse.jdt.core.dom.Block;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.EnhancedForStatement;
+import org.eclipse.jdt.core.dom.Expression;
+import org.eclipse.jdt.core.dom.FieldAccess;
+import org.eclipse.jdt.core.dom.ForStatement;
+import org.eclipse.jdt.core.dom.IMethodBinding;
+import org.eclipse.jdt.core.dom.ITypeBinding;
+import org.eclipse.jdt.core.dom.InfixExpression;
+import org.eclipse.jdt.core.dom.MethodInvocation;
+import org.eclipse.jdt.core.dom.NumberLiteral;
+import org.eclipse.jdt.core.dom.PostfixExpression;
+import org.eclipse.jdt.core.dom.PrimitiveType;
+import org.eclipse.jdt.core.dom.SimpleName;
+import org.eclipse.jdt.core.dom.SingleVariableDeclaration;
+import org.eclipse.jdt.core.dom.Statement;
+import org.eclipse.jdt.core.dom.VariableDeclarationExpression;
+import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
+import org.eclipse.jdt.core.dom.rewrite.ASTRewrite;
+
+import org.eclipse.jdt.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext;
+import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility;
+import org.eclipse.jdt.internal.corext.dom.Bindings;
+import org.eclipse.jdt.internal.corext.dom.ScopeAnalyzer;
+
+import org.eclipse.jdt.internal.ui.JavaPluginImages;
+import org.eclipse.jdt.internal.ui.text.correction.CorrectionMessages;
+import org.eclipse.jdt.internal.ui.text.correction.IProposalRelevance;
+
+/**
+ * Generates a proposal for quick assist, to loop over a variable or method result which represents
+ * an {@link Iterable} or an array.
+ */
+public class GenerateForLoopAssistProposal extends LinkedCorrectionProposal {
+
+	public static final int GENERATE_FOREACH= 0;
+
+	public static final int GENERATE_ITERATOR_FOR= 1;
+
+	public static final int GENERATE_ITERATE_ARRAY= 2;
+
+	public static final int GENERATE_ITERATE_LIST= 3;
+
+	private ASTNode fCurrentNode;
+
+	private Expression fCurrentExpression;
+
+	private Expression fSubExpression;
+
+	private int fLoopTypeToGenerate= -1;
+
+	/**
+	 * Creates an instance of a {@link GenerateForLoopAssistProposal}.
+	 * 
+	 * @param cu the current {@link ICompilationUnit}
+	 * @param currentNode the {@link ASTNode} instance representing the statement on which the
+	 *            assist was called
+	 * @param currentExpression the {@link Expression} contained in the currentNode
+	 * @param loopTypeToGenerate the type of the loop to generate, possible values are
+	 *            {@link GenerateForLoopAssistProposal#GENERATE_FOREACH},
+	 *            {@link GenerateForLoopAssistProposal#GENERATE_ITERATOR_FOR} or
+	 *            {@link GenerateForLoopAssistProposal#GENERATE_ITERATE_ARRAY}
+	 */
+	public GenerateForLoopAssistProposal(ICompilationUnit cu, ASTNode currentNode, Expression currentExpression, int loopTypeToGenerate) {
+		super("", cu, null, IProposalRelevance.GENERATE_FOR_LOOP, JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE)); //$NON-NLS-1$
+		fCurrentNode= currentNode;
+		fCurrentExpression= currentExpression;
+		fLoopTypeToGenerate= loopTypeToGenerate;
+
+		switch (loopTypeToGenerate) {
+			case GenerateForLoopAssistProposal.GENERATE_FOREACH:
+				setDisplayName(CorrectionMessages.QuickAssistProcessor_generate_enhanced_for_loop);
+				setRelevance(IProposalRelevance.GENERATE_ENHANCED_FOR_LOOP);
+				break;
+			case GenerateForLoopAssistProposal.GENERATE_ITERATOR_FOR:
+				setDisplayName(CorrectionMessages.QuickAssistProcessor_generate_iterator_for_loop);
+				break;
+			case GenerateForLoopAssistProposal.GENERATE_ITERATE_ARRAY:
+				setDisplayName(CorrectionMessages.QuickAssistProcessor_generate_for_loop);
+				break;
+			case GenerateForLoopAssistProposal.GENERATE_ITERATE_LIST:
+				setDisplayName(CorrectionMessages.QuickAssistProcessor_generate_index_for_loop);
+				break;
+			default:
+				break;
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.jdt.ui.text.java.correction.ASTRewriteCorrectionProposal#getRewrite()
+	 */
+	@Override
+	protected ASTRewrite getRewrite() throws CoreException {
+
+		AST ast= fCurrentNode.getAST();
+		createImportRewrite((CompilationUnit) fCurrentExpression.getRoot());
+
+		// generate the subexpression which represents the expression to iterate over
+		if (fCurrentExpression instanceof Assignment) {
+			this.fSubExpression= ((Assignment) fCurrentExpression).getLeftHandSide();
+		} else {
+			this.fSubExpression= fCurrentExpression;
+		}
+
+		switch (fLoopTypeToGenerate) {
+			case GenerateForLoopAssistProposal.GENERATE_FOREACH:
+				return generateForEachRewrite(ast);
+			case GenerateForLoopAssistProposal.GENERATE_ITERATOR_FOR:
+				return generateIteratorBasedForRewrite(ast);
+			case GenerateForLoopAssistProposal.GENERATE_ITERATE_ARRAY:
+				return generateForRewrite(ast);
+			case GenerateForLoopAssistProposal.GENERATE_ITERATE_LIST:
+				return generateIndexBasedForRewrite(ast);
+			default:
+				return null;
+		}
+	}
+
+
+	/**
+	 * Helper to generate a <code>foreach</code> loop to iterate over an {@link Iterable}.
+	 * 
+	 * @param ast the {@link AST} instance to rewrite the loop to
+	 * @return the complete {@link ASTRewrite} object
+	 */
+	private ASTRewrite generateForEachRewrite(AST ast) {
+
+		EnhancedForStatement loopStatement= ast.newEnhancedForStatement();
+
+		ASTRewrite rewrite= ASTRewrite.create(ast);
+		ITypeBinding loopOverType= extractElementType(ast);
+
+		// generate name proposals and add them to the variable declaration
+		SimpleName forDeclarationName= resolveLinkedVariableNameWithProposals(rewrite, loopOverType.getName(), null, true);
+
+		SingleVariableDeclaration forLoopInitializer= ast.newSingleVariableDeclaration();
+		forLoopInitializer.setType(getImportRewrite().addImport(loopOverType, ast, new ContextSensitiveImportRewriteContext(fCurrentNode, getImportRewrite())));
+		forLoopInitializer.setName(forDeclarationName);
+
+		loopStatement.setParameter(forLoopInitializer);
+		loopStatement.setExpression((Expression) rewrite.createCopyTarget(fSubExpression));
+
+		Block forLoopBody= ast.newBlock();
+		forLoopBody.statements().add(createBlankLineStatementWithCursorPosition(rewrite));
+
+		loopStatement.setBody(forLoopBody);
+
+		rewrite.replace(fCurrentNode, loopStatement, null);
+
+		return rewrite;
+	}
+
+	/**
+	 * Helper to generate an iterator based <code>for</code> loop to iterate over an
+	 * {@link Iterable}.
+	 * 
+	 * @param ast the {@link AST} instance to rewrite the loop to
+	 * @return the complete {@link ASTRewrite} object
+	 */
+	private ASTRewrite generateIteratorBasedForRewrite(AST ast) {
+		ASTRewrite rewrite= ASTRewrite.create(ast);
+		ForStatement loopStatement= ast.newForStatement();
+
+		ITypeBinding loopOverType= extractElementType(ast);
+
+		SimpleName loopVariableName= resolveLinkedVariableNameWithProposals(rewrite, "iterator", null, true); //$NON-NLS-1$
+		loopStatement.initializers().add(getIteratorBasedForInitializer(rewrite, loopVariableName));
+
+		MethodInvocation loopExpression= ast.newMethodInvocation();
+		loopExpression.setName(ast.newSimpleName("hasNext")); //$NON-NLS-1$
+		SimpleName expressionName= ast.newSimpleName(loopVariableName.getIdentifier());
+		addLinkedPosition(rewrite.track(expressionName), LinkedPositionGroup.NO_STOP, expressionName.getIdentifier());
+		loopExpression.setExpression(expressionName);
+
+		loopStatement.setExpression(loopExpression);
+
+		Block forLoopBody= ast.newBlock();
+		Assignment assignResolvedVariable= getIteratorBasedForBodyAssignment(rewrite, loopOverType, loopVariableName);
+		forLoopBody.statements().add(ast.newExpressionStatement(assignResolvedVariable));
+		forLoopBody.statements().add(createBlankLineStatementWithCursorPosition(rewrite));
+
+		loopStatement.setBody(forLoopBody);
+
+		rewrite.replace(fCurrentNode, loopStatement, null);
+
+		return rewrite;
+	}
+
+	/**
+	 * Generates the initializer for an iterator based <code>for</code> loop, which declares and
+	 * initializes the variable to loop over.
+	 * 
+	 * @param rewrite the instance of {@link ASTRewrite}
+	 * @param loopVariableName the proposed name of the loop variable
+	 * @return a {@link VariableDeclarationExpression} to use as initializer
+	 */
+	private VariableDeclarationExpression getIteratorBasedForInitializer(ASTRewrite rewrite, SimpleName loopVariableName) {
+		AST ast= rewrite.getAST();
+		IMethodBinding iteratorMethodBinding= Bindings.findMethodInHierarchy(fCurrentExpression.resolveTypeBinding(), "iterator", new ITypeBinding[] {}); //$NON-NLS-1$
+		// initializing fragment
+		VariableDeclarationFragment varDeclarationFragment= ast.newVariableDeclarationFragment();
+		varDeclarationFragment.setName(loopVariableName);
+		MethodInvocation iteratorExpression= ast.newMethodInvocation();
+		iteratorExpression.setName(ast.newSimpleName(iteratorMethodBinding.getName()));
+		iteratorExpression.setExpression((Expression) rewrite.createCopyTarget(fCurrentExpression));
+		varDeclarationFragment.setInitializer(iteratorExpression);
+
+		// declaration
+		VariableDeclarationExpression varDeclarationExpression= ast.newVariableDeclarationExpression(varDeclarationFragment);
+		varDeclarationExpression.setType(getImportRewrite().addImport(iteratorMethodBinding.getReturnType(), ast, new ContextSensitiveImportRewriteContext(fCurrentNode, getImportRewrite())));
+
+		return varDeclarationExpression;
+	}
+
+	/**
+	 * Generates the Assignment in an iterator based for, used in the first statement of an iterator
+	 * based <code>for</code> loop body, to retrieve the next element of the {@link Iterable}
+	 * instance.
+	 * 
+	 * @param rewrite the current instance of {@link ASTRewrite}
+	 * @param loopOverType the {@link ITypeBinding} of the loop variable
+	 * @param loopVariableName the name of the loop variable
+	 * @return an {@link Assignment}, which retrieves the next element of the {@link Iterable} using
+	 *         the active {@link Iterator}
+	 */
+	private Assignment getIteratorBasedForBodyAssignment(ASTRewrite rewrite, ITypeBinding loopOverType, SimpleName loopVariableName) {
+		AST ast= rewrite.getAST();
+		Assignment assignResolvedVariable= ast.newAssignment();
+
+		// left hand side
+		SimpleName resolvedVariableName= resolveLinkedVariableNameWithProposals(rewrite, loopOverType.getName(), loopVariableName.getIdentifier(), false);
+		VariableDeclarationFragment resolvedVariableDeclarationFragment= ast.newVariableDeclarationFragment();
+		resolvedVariableDeclarationFragment.setName(resolvedVariableName);
+		VariableDeclarationExpression resolvedVariableDeclaration= ast.newVariableDeclarationExpression(resolvedVariableDeclarationFragment);
+		resolvedVariableDeclaration.setType(getImportRewrite().addImport(loopOverType, ast, new ContextSensitiveImportRewriteContext(fCurrentNode, getImportRewrite())));
+		assignResolvedVariable.setLeftHandSide(resolvedVariableDeclaration);
+
+		// right hand side
+		MethodInvocation invokeIteratorNextExpression= ast.newMethodInvocation();
+		invokeIteratorNextExpression.setName(ast.newSimpleName("next")); //$NON-NLS-1$
+		SimpleName currentElementName= ast.newSimpleName(loopVariableName.getIdentifier());
+		addLinkedPosition(rewrite.track(currentElementName), LinkedPositionGroup.NO_STOP, currentElementName.getIdentifier());
+		invokeIteratorNextExpression.setExpression(currentElementName);
+		assignResolvedVariable.setRightHandSide(invokeIteratorNextExpression);
+
+		assignResolvedVariable.setOperator(Assignment.Operator.ASSIGN);
+
+		return assignResolvedVariable;
+	}
+
+	/**
+	 * Helper to generate an index based <code>for</code> loop to iterate over an array.
+	 * 
+	 * @param ast the current {@link AST} instance to generate the {@link ASTRewrite} for
+	 * @return an applicable {@link ASTRewrite} instance
+	 */
+	private ASTRewrite generateForRewrite(AST ast) {
+		ASTRewrite rewrite= ASTRewrite.create(ast);
+
+		ForStatement loopStatement= ast.newForStatement();
+		SimpleName loopVariableName= resolveLinkedVariableNameWithProposals(rewrite, "int", null, true); //$NON-NLS-1$
+		loopStatement.initializers().add(getForInitializer(ast, loopVariableName));
+
+		FieldAccess getArrayLengthExpression= ast.newFieldAccess();
+		getArrayLengthExpression.setExpression((Expression) rewrite.createCopyTarget(fSubExpression));
+		getArrayLengthExpression.setName(ast.newSimpleName("length")); //$NON-NLS-1$
+
+		loopStatement.setExpression(getLinkedInfixExpression(rewrite, loopVariableName.getIdentifier(), getArrayLengthExpression, InfixExpression.Operator.LESS));
+		loopStatement.updaters().add(getLinkedIncrementExpression(rewrite, loopVariableName.getIdentifier()));
+
+		Block forLoopBody= ast.newBlock();
+		forLoopBody.statements().add(ast.newExpressionStatement(getForBodyAssignment(rewrite, loopVariableName)));
+		forLoopBody.statements().add(createBlankLineStatementWithCursorPosition(rewrite));
+		loopStatement.setBody(forLoopBody);
+		rewrite.replace(fCurrentNode, loopStatement, null);
+
+		return rewrite;
+	}
+
+	/**
+	 * Creates an {@link Assignment} as first expression appearing in a <code>for</code> loop's
+	 * body. This Assignment declares a local variable and initializes it using the array's current
+	 * element identified by the loop index.
+	 * 
+	 * @param rewrite the current {@link ASTRewrite} instance
+	 * @param loopVariableName the name of the index variable in String representation
+	 * @return a completed {@link Assignment} containing the mentioned declaration and
+	 *         initialization
+	 */
+	private Assignment getForBodyAssignment(ASTRewrite rewrite, SimpleName loopVariableName) {
+		AST ast= rewrite.getAST();
+		ITypeBinding loopOverType= extractElementType(ast);
+
+		Assignment assignResolvedVariable= ast.newAssignment();
+
+		// left hand side
+		SimpleName resolvedVariableName= resolveLinkedVariableNameWithProposals(rewrite, loopOverType.getName(), loopVariableName.getIdentifier(), false);
+		VariableDeclarationFragment resolvedVariableDeclarationFragment= ast.newVariableDeclarationFragment();
+		resolvedVariableDeclarationFragment.setName(resolvedVariableName);
+		VariableDeclarationExpression resolvedVariableDeclaration= ast.newVariableDeclarationExpression(resolvedVariableDeclarationFragment);
+		resolvedVariableDeclaration.setType(getImportRewrite().addImport(loopOverType, ast, new ContextSensitiveImportRewriteContext(fCurrentNode, getImportRewrite())));
+		assignResolvedVariable.setLeftHandSide(resolvedVariableDeclaration);
+
+		// right hand side
+		ArrayAccess access= ast.newArrayAccess();
+		access.setArray((Expression) rewrite.createCopyTarget(fSubExpression));
+		SimpleName indexName= ast.newSimpleName(loopVariableName.getIdentifier());
+		addLinkedPosition(rewrite.track(indexName), LinkedPositionGroup.NO_STOP, indexName.getIdentifier());
+		access.setIndex(indexName);
+		assignResolvedVariable.setRightHandSide(access);
+
+		assignResolvedVariable.setOperator(Assignment.Operator.ASSIGN);
+
+		return assignResolvedVariable;
+	}
+
+	/**
+	 * Creates an {@link InfixExpression} which is linked to the group of the variableToIncrement.
+	 * 
+	 * @param rewrite the current {@link ASTRewrite} instance
+	 * @param variableToIncrement the name of the variable to generate the {@link InfixExpression}
+	 *            for
+	 * @param rightHandSide the right hand side expression which shall be included in the
+	 *            {@link InfixExpression}
+	 * @param operator the {@link org.eclipse.jdt.core.dom.InfixExpression.Operator} to use in the
+	 *            {@link InfixExpression} to create
+	 * @return a filled, new {@link InfixExpression} instance
+	 */
+	private InfixExpression getLinkedInfixExpression(ASTRewrite rewrite, String variableToIncrement, Expression rightHandSide, InfixExpression.Operator operator) {
+		AST ast= rewrite.getAST();
+		InfixExpression loopExpression= ast.newInfixExpression();
+		SimpleName name= ast.newSimpleName(variableToIncrement);
+		addLinkedPosition(rewrite.track(name), LinkedPositionGroup.NO_STOP, name.getIdentifier());
+		loopExpression.setLeftOperand(name);
+
+		loopExpression.setOperator(operator);
+
+		loopExpression.setRightOperand(rightHandSide);
+		return loopExpression;
+	}
+
+	/**
+	 * Creates a {@link PostfixExpression} used to increment the loop variable of a <code>for</code>
+	 * loop to iterate over an array.
+	 * 
+	 * @param rewrite the current {@link ASTRewrite} instance
+	 * @param variableToIncrement the name of the variable to increment
+	 * @return a filled {@link PostfixExpression} realizing an incrementation of the specified
+	 *         variable
+	 */
+	private Expression getLinkedIncrementExpression(ASTRewrite rewrite, String variableToIncrement) {
+		AST ast= rewrite.getAST();
+		PostfixExpression incrementLoopVariable= ast.newPostfixExpression();
+		SimpleName name= ast.newSimpleName(variableToIncrement);
+		addLinkedPosition(rewrite.track(name), LinkedPositionGroup.NO_STOP, name.getIdentifier());
+		incrementLoopVariable.setOperand(name);
+		incrementLoopVariable.setOperator(PostfixExpression.Operator.INCREMENT);
+		return incrementLoopVariable;
+	}
+
+	/**
+	 * Generates a {@link VariableDeclarationExpression}, which initializes the loop variable to
+	 * iterate over an array.
+	 * 
+	 * @param ast the current {@link AST} instance
+	 * @param loopVariableName the name of the variable which should be initialized
+	 * @return a filled {@link VariableDeclarationExpression}, declaring a int variable, which is
+	 *         initializes with 0
+	 */
+	private VariableDeclarationExpression getForInitializer(AST ast, SimpleName loopVariableName) {
+		// initializing fragment
+		VariableDeclarationFragment firstDeclarationFragment= ast.newVariableDeclarationFragment();
+		firstDeclarationFragment.setName(loopVariableName);
+		NumberLiteral startIndex= ast.newNumberLiteral();
+		firstDeclarationFragment.setInitializer(startIndex);
+
+		// declaration
+		VariableDeclarationExpression variableDeclaration= ast.newVariableDeclarationExpression(firstDeclarationFragment);
+		PrimitiveType variableType= ast.newPrimitiveType(PrimitiveType.INT);
+		variableDeclaration.setType(variableType);
+
+		return variableDeclaration;
+	}
+
+	/**
+	 * Helper to generate an index based <code>for</code> loop to iterate over a {@link List}
+	 * implementation.
+	 * 
+	 * @param ast the current {@link AST} instance to generate the {@link ASTRewrite} for
+	 * @return an applicable {@link ASTRewrite} instance
+	 */
+	private ASTRewrite generateIndexBasedForRewrite(AST ast) {
+		ASTRewrite rewrite= ASTRewrite.create(ast);
+
+		ForStatement loopStatement= ast.newForStatement();
+		SimpleName loopVariableName= resolveLinkedVariableNameWithProposals(rewrite, "int", null, true); //$NON-NLS-1$
+		loopStatement.initializers().add(getForInitializer(ast, loopVariableName));
+
+		MethodInvocation listSizeExpression= ast.newMethodInvocation();
+		listSizeExpression.setName(ast.newSimpleName("size")); //$NON-NLS-1$
+		Expression listExpression= (Expression) rewrite.createCopyTarget(fSubExpression);
+		listSizeExpression.setExpression(listExpression);
+
+		loopStatement.setExpression(getLinkedInfixExpression(rewrite, loopVariableName.getIdentifier(), listSizeExpression, InfixExpression.Operator.LESS));
+		loopStatement.updaters().add(getLinkedIncrementExpression(rewrite, loopVariableName.getIdentifier()));
+
+		Block forLoopBody= ast.newBlock();
+		forLoopBody.statements().add(ast.newExpressionStatement(getIndexBasedForBodyAssignment(rewrite, loopVariableName)));
+		forLoopBody.statements().add(createBlankLineStatementWithCursorPosition(rewrite));
+		loopStatement.setBody(forLoopBody);
+		rewrite.replace(fCurrentNode, loopStatement, null);
+
+		return rewrite;
+	}
+
+	/**
+	 * Creates an {@link Assignment} as first expression appearing in an index based
+	 * <code>for</code> loop's body. This Assignment declares a local variable and initializes it
+	 * using the {@link List}'s current element identified by the loop index.
+	 * 
+	 * @param rewrite the current {@link ASTRewrite} instance
+	 * @param loopVariableName the name of the index variable in String representation
+	 * @return a completed {@link Assignment} containing the mentioned declaration and
+	 *         initialization
+	 */
+	private Expression getIndexBasedForBodyAssignment(ASTRewrite rewrite, SimpleName loopVariableName) {
+		AST ast= rewrite.getAST();
+		ITypeBinding loopOverType= extractElementType(ast);
+
+		Assignment assignResolvedVariable= ast.newAssignment();
+
+		// left hand side
+		SimpleName resolvedVariableName= resolveLinkedVariableNameWithProposals(rewrite, loopOverType.getName(), loopVariableName.getIdentifier(), false);
+		VariableDeclarationFragment resolvedVariableDeclarationFragment= ast.newVariableDeclarationFragment();
+		resolvedVariableDeclarationFragment.setName(resolvedVariableName);
+		VariableDeclarationExpression resolvedVariableDeclaration= ast.newVariableDeclarationExpression(resolvedVariableDeclarationFragment);
+		resolvedVariableDeclaration.setType(getImportRewrite().addImport(loopOverType, ast, new ContextSensitiveImportRewriteContext(fCurrentNode, getImportRewrite())));
+		assignResolvedVariable.setLeftHandSide(resolvedVariableDeclaration);
+
+		// right hand side
+		MethodInvocation invokeGetExpression= ast.newMethodInvocation();
+		invokeGetExpression.setName(ast.newSimpleName("get")); //$NON-NLS-1$
+		SimpleName indexVariableName= ast.newSimpleName(loopVariableName.getIdentifier());
+		addLinkedPosition(rewrite.track(indexVariableName), LinkedPositionGroup.NO_STOP, indexVariableName.getIdentifier());
+		invokeGetExpression.arguments().add(indexVariableName);
+		invokeGetExpression.setExpression((Expression) rewrite.createCopyTarget(fSubExpression));
+		assignResolvedVariable.setRightHandSide(invokeGetExpression);
+
+		assignResolvedVariable.setOperator(Assignment.Operator.ASSIGN);
+
+		return assignResolvedVariable;
+	}
+
+	/**
+	 * Resolves name proposals by the given basename and adds a {@link LinkedPosition} to the
+	 * returned {@link SimpleName} expression.
+	 * 
+	 * @param rewrite the current instance of an {@link ASTRewrite}
+	 * @param basename the base string to use for proposal calculation
+	 * @param excludedName a name that cannot be used for the variable; <code>null</code> if none
+	 * @param firstLinkedProposal true if the generated name is the first {@link LinkedPosition} to
+	 *            edit in the current {@link CompilationUnit}, false otherwise
+	 * @return the linked {@link SimpleName} instance based on the name proposals
+	 */
+	private SimpleName resolveLinkedVariableNameWithProposals(ASTRewrite rewrite, String basename, String excludedName, boolean firstLinkedProposal) {
+		AST ast= rewrite.getAST();
+		String[] nameProposals= getVariableNameProposals(basename, excludedName);
+		SimpleName forDeclarationName= ast.newSimpleName(nameProposals.length > 0 ? nameProposals[0] : basename);
+		for (int i= 0; i < nameProposals.length; i++) {
+			addLinkedPositionProposal(forDeclarationName.getIdentifier(), nameProposals[i], null);
+		}
+
+		// mark declaration name as editable
+		addLinkedPosition(rewrite.track(forDeclarationName), firstLinkedProposal, forDeclarationName.getIdentifier());
+		return forDeclarationName;
+	}
+
+	/**
+	 * Generates an empty statement, which is shown as blank line and is set as end position for the
+	 * cursor.
+	 * 
+	 * @param rewrite the current {@link ASTRewrite} instance
+	 * @return an empty statement, shown as blank line
+	 */
+	private Statement createBlankLineStatementWithCursorPosition(ASTRewrite rewrite) {
+		Statement blankLineStatement= (Statement) rewrite.createStringPlaceholder("", ASTNode.EMPTY_STATEMENT); //$NON-NLS-1$
+		setEndPosition(rewrite.track(blankLineStatement));
+		return blankLineStatement;
+	}
+
+	/**
+	 * Retrieves name proposals for a fresh local variable.
+	 * 
+	 * @param basename the basename of the proposals
+	 * @param excludedName a name that cannot be used for the variable; <code>null</code> if none
+	 * @return an array of proposal strings
+	 */
+	private String[] getVariableNameProposals(String basename, String excludedName) {
+		ASTNode surroundingBlock= fCurrentNode;
+		while ((surroundingBlock= surroundingBlock.getParent()) != null) {
+			if (surroundingBlock instanceof Block) {
+				break;
+			}
+		}
+		Collection<String> localUsedNames= new ScopeAnalyzer((CompilationUnit) fCurrentExpression.getRoot()).getUsedVariableNames(surroundingBlock.getStartPosition(), surroundingBlock.getLength());
+		if (excludedName != null) {
+			localUsedNames.add(excludedName);
+		}
+		String[] names= StubUtility.getLocalNameSuggestions(getCompilationUnit().getJavaProject(), basename, 0, localUsedNames.toArray(new String[localUsedNames.size()]));
+		return names;
+	}
+
+	/**
+	 * Extracts the type parameter of the variable contained in fSubExpression or the elements type
+	 * to iterate over an array using <code>foreach</code>.
+	 * 
+	 * @param ast the current {@link AST} instance
+	 * @return the {@link ITypeBinding} of the elements to iterate over
+	 */
+	private ITypeBinding extractElementType(AST ast) {
+		ITypeBinding binding= fSubExpression.resolveTypeBinding();
+		if (binding.isArray()) {
+			return Bindings.normalizeForDeclarationUse(binding.getElementType(), ast);
+		}
+
+		// extract elements type directly out of the bindings
+		IMethodBinding iteratorMethodBinding= Bindings.findMethodInHierarchy(fCurrentExpression.resolveTypeBinding(), "iterator", new ITypeBinding[] {}); //$NON-NLS-1$
+		IMethodBinding iteratorNextMethodBinding= Bindings.findMethodInHierarchy(iteratorMethodBinding.getReturnType(), "next", new ITypeBinding[] {}); //$NON-NLS-1$
+
+		ITypeBinding currentElementBinding= iteratorNextMethodBinding.getReturnType();
+		
+		return Bindings.normalizeForDeclarationUse(currentElementBinding, ast);
+	}
+
+}
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/NewAnnotationMemberProposal.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/NewAnnotationMemberProposal.java
index 70b0e1c..b5a21f1 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/NewAnnotationMemberProposal.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/NewAnnotationMemberProposal.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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,6 @@
 import org.eclipse.jdt.core.dom.AnnotationTypeDeclaration;
 import org.eclipse.jdt.core.dom.AnnotationTypeMemberDeclaration;
 import org.eclipse.jdt.core.dom.BodyDeclaration;
-import org.eclipse.jdt.core.dom.ChildListPropertyDescriptor;
 import org.eclipse.jdt.core.dom.CompilationUnit;
 import org.eclipse.jdt.core.dom.Expression;
 import org.eclipse.jdt.core.dom.ITypeBinding;
@@ -35,7 +34,6 @@
 
 import org.eclipse.jdt.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext;
 import org.eclipse.jdt.internal.corext.dom.ASTNodeFactory;
-import org.eclipse.jdt.internal.corext.dom.ASTNodes;
 
 import org.eclipse.jdt.internal.ui.text.correction.ASTResolving;
 import org.eclipse.jdt.internal.ui.text.correction.ModifierCorrectionSubProcessor;
@@ -68,15 +66,16 @@
 		createImportRewrite(astRoot);
 
 		if (newTypeDecl instanceof AnnotationTypeDeclaration) {
+			AnnotationTypeDeclaration newAnnotationTypeDecl= (AnnotationTypeDeclaration) newTypeDecl;
+			
 			ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
 
-			AnnotationTypeMemberDeclaration newStub= getStub(rewrite, (AnnotationTypeDeclaration) newTypeDecl);
+			AnnotationTypeMemberDeclaration newStub= getStub(rewrite, newAnnotationTypeDecl);
 
-			ChildListPropertyDescriptor property= ASTNodes.getBodyDeclarationsProperty(newTypeDecl);
-			List<? extends ASTNode> members= (List<? extends ASTNode>) newTypeDecl.getStructuralProperty(property);
+			List<BodyDeclaration> members= newAnnotationTypeDecl.bodyDeclarations();
 			int insertIndex= members.size();
 
-			ListRewrite listRewriter= rewrite.getListRewrite(newTypeDecl, property);
+			ListRewrite listRewriter= rewrite.getListRewrite(newAnnotationTypeDecl, AnnotationTypeDeclaration.BODY_DECLARATIONS_PROPERTY);
 			listRewriter.insertAt(newStub, insertIndex, null);
 
 			return rewrite;
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/NewVariableCorrectionProposal.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/NewVariableCorrectionProposal.java
index 2350cfb..479fac4 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/NewVariableCorrectionProposal.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/NewVariableCorrectionProposal.java
@@ -432,7 +432,7 @@
 			}
 
 			ChildListPropertyDescriptor property= ASTNodes.getBodyDeclarationsProperty(newTypeDecl);
-			List<BodyDeclaration> decls= (List<BodyDeclaration>) newTypeDecl.getStructuralProperty(property);
+			List<BodyDeclaration> decls= ASTNodes.<BodyDeclaration>getChildListProperty(newTypeDecl, property);
 
 			int maxOffset= isInDifferentCU ? -1 : node.getStartPosition();
 
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/AbstractJavaCompletionProposal.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/AbstractJavaCompletionProposal.java
index edcd774..ececa16 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/AbstractJavaCompletionProposal.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/AbstractJavaCompletionProposal.java
@@ -185,11 +185,13 @@
 				case ';':
 					return new ExitFlags(ILinkedModeListener.NONE, true);
 				case SWT.CR:
-					// when entering an anonymous class as a parameter, we don't want
+					// 1) when entering an anonymous class as a parameter, we don't want
 					// to jump after the parenthesis when return is pressed
+					// 2) after auto completion of methods without parameters, exit from linked mode when return is pressed
 					if (offset > 0) {
 						try {
-							if (fDocument.getChar(offset - 1) == '{')
+							char prevOffsetChar= fDocument.getChar(offset - 1);
+							if (prevOffsetChar == '{' || prevOffsetChar == ';')
 								return new ExitFlags(ILinkedModeListener.EXIT_ALL, true);
 						} catch (BadLocationException e) {
 						}
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaTextMessages.properties b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaTextMessages.properties
index ccd55cd..2a88a35 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaTextMessages.properties
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaTextMessages.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2000, 2009 IBM Corporation and others.
+# Copyright (c) 2000, 2013 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
@@ -43,7 +43,7 @@
 
 GetterSetterCompletionProposal_getter_label=Getter for ''{0}''
 GetterSetterCompletionProposal_setter_label=Setter for ''{0}''
-MethodCompletionProposal_constructor_label=Default constructor
+MethodCompletionProposal_constructor_label=Constructor
 MethodCompletionProposal_method_label=Method stub
 
 ContentAssistProcessor_computing_proposals=Computing completion proposals
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/ParameterGuessingProposal.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/ParameterGuessingProposal.java
index 6b9c707..9e417a5 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/ParameterGuessingProposal.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/ParameterGuessingProposal.java
@@ -94,7 +94,7 @@
 
 	private final CompletionContext fCoreContext;
 
- 	private ParameterGuessingProposal(CompletionProposal proposal, JavaContentAssistInvocationContext context, CompletionContext coreContext, boolean fillBestGuess) {
+ 	public ParameterGuessingProposal(CompletionProposal proposal, JavaContentAssistInvocationContext context, CompletionContext coreContext, boolean fillBestGuess) {
  		super(proposal, context);
 		fCoreContext= coreContext;
 		fFillBestGuess= fillBestGuess;
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/AbstractAnnotationHover.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/AbstractAnnotationHover.java
index 924eb58..67ab713 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/AbstractAnnotationHover.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/AbstractAnnotationHover.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -491,7 +491,7 @@
 			}
 
 			Link proposalLink= new Link(parent, SWT.NONE);
-			GridData layoutData= new GridData(SWT.BEGINNING, SWT.CENTER, false, false);
+			GridData layoutData= new GridData(SWT.FILL, SWT.CENTER, true, false);
 			String linkText;
 			if (isMultiFix) {
 				linkText= Messages.format(JavaHoverMessages.AbstractAnnotationHover_multifix_variable_description, new Integer(count));
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/javadoc/JavaDocScanner.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/javadoc/JavaDocScanner.java
index a30c3f6..948903d 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/javadoc/JavaDocScanner.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/javadoc/JavaDocScanner.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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,6 +25,7 @@
 import org.eclipse.jface.text.rules.IRule;
 import org.eclipse.jface.text.rules.IToken;
 import org.eclipse.jface.text.rules.IWordDetector;
+import org.eclipse.jface.text.rules.MultiLineRule;
 import org.eclipse.jface.text.rules.SingleLineRule;
 import org.eclipse.jface.text.rules.Token;
 import org.eclipse.jface.text.rules.WhitespaceRule;
@@ -157,7 +158,7 @@
 
 		List<IRule> list= new ArrayList<IRule>();
 
-		// Add rule for tags.
+		// Add rule for tags
 		Token token= getToken(IJavaColorConstants.JAVADOC_TAG);
 		list.add(new TagRule(token));
 
@@ -169,14 +170,18 @@
 		list.add(wordRule);
 
 
-		// Add rule for links.
+		// Add rules for links
 		token= getToken(IJavaColorConstants.JAVADOC_LINK);
-		list.add(new SingleLineRule("{@link", "}", token)); //$NON-NLS-2$ //$NON-NLS-1$
-		list.add(new SingleLineRule("{@value", "}", token)); //$NON-NLS-2$ //$NON-NLS-1$
-		list.add(new SingleLineRule("{@inheritDoc", "}", token)); //$NON-NLS-2$ //$NON-NLS-1$
+		list.add(new MultiLineRule("{@link", "}", token)); //$NON-NLS-2$ //$NON-NLS-1$
+		list.add(new MultiLineRule("{@value", "}", token)); //$NON-NLS-2$ //$NON-NLS-1$
+		list.add(new MultiLineRule("{@inheritDoc", "}", token)); //$NON-NLS-2$ //$NON-NLS-1$
 
+		// Add rules for @code and @literals
+		token= getToken(IJavaColorConstants.JAVADOC_DEFAULT);
+		list.add(new MultiLineRule("{@code", "}", token)); //$NON-NLS-2$ //$NON-NLS-1$
+		list.add(new MultiLineRule("{@literal", "}", token)); //$NON-NLS-2$ //$NON-NLS-1$
 
-		// Add generic whitespace rule.
+		// Add generic whitespace rule
 		token= getToken(IJavaColorConstants.JAVADOC_DEFAULT);
 		list.add(new WhitespaceRule(new JavaWhitespaceDetector(), token));
 
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/ImageDescriptorRegistry.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/ImageDescriptorRegistry.java
index 0fd2b28..0a7fb85 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/ImageDescriptorRegistry.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/ImageDescriptorRegistry.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -10,8 +10,10 @@
  *******************************************************************************/
 package org.eclipse.jdt.internal.ui.viewsupport;
 
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.Map;
 
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.widgets.Display;
@@ -27,7 +29,7 @@
  */
 public class ImageDescriptorRegistry {
 
-	private HashMap<ImageDescriptor, Image> fRegistry= new HashMap<ImageDescriptor, Image>(10);
+	private Map<ImageDescriptor, Image> fRegistry= Collections.synchronizedMap(new HashMap<ImageDescriptor, Image>(10));
 	private Display fDisplay;
 
 	/**
@@ -74,9 +76,13 @@
 	}
 
 	private void hookDisplay() {
-		fDisplay.disposeExec(new Runnable() {
+		fDisplay.asyncExec(new Runnable() {
 			public void run() {
-				dispose();
+				fDisplay.disposeExec(new Runnable() {
+					public void run() {
+						dispose();
+					}
+				});
 			}
 		});
 	}
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementLinks.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementLinks.java
index de675a1..0f94af9 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementLinks.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementLinks.java
@@ -313,7 +313,7 @@
 	 *
 	 * @param scheme a scheme
 	 * @param element the declaring element
-	 * @param refTypeName a (possibly qualified) type name, can be <code>null</code>
+	 * @param refTypeName a (possibly qualified) type or package name, can be <code>null</code>
 	 * @param refMemberName a member name, can be <code>null</code>
 	 * @param refParameterTypes a (possibly empty) array of (possibly qualified) parameter type
 	 *            names, can be <code>null</code>
@@ -387,7 +387,13 @@
 			
 			if (element instanceof IPackageFragment) {
 				try {
-					element= resolvePackageInfoType((IPackageFragment) element, refTypeName);
+					IPackageFragment root= (IPackageFragment) element;
+					element= resolvePackageInfoType(root, refTypeName);
+					if (element == null) {
+						// find it as package
+						IJavaProject javaProject= root.getJavaProject();
+						return JavaModelUtil.findTypeContainer(javaProject, refTypeName);
+					}
 				} catch (JavaModelException e) {
 					JavaPlugin.log(e);
 				}
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/CheckedListDialogField.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/CheckedListDialogField.java
index e9a3a54..0b49c35 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/CheckedListDialogField.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/CheckedListDialogField.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -254,7 +254,9 @@
 
 	private void doCheckStateChanged(CheckStateChangedEvent e) {
 		if (e.getChecked()) {
-			fCheckedElements.add((E) e.getElement());
+			@SuppressWarnings("unchecked")
+			E element= (E) e.getElement();
+			fCheckedElements.add(element);
 		} else {
 			fCheckedElements.remove(e.getElement());
 		}
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/ListDialogField.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/ListDialogField.java
index 1ec492d..1929a56 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/ListDialogField.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/ListDialogField.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -907,6 +907,7 @@
 			if (selection instanceof IStructuredSelection) {
 				Iterator<?> iter= ((IStructuredSelection)selection).iterator();
 				while (iter.hasNext()) {
+					@SuppressWarnings("unchecked")
 					E element= (E) iter.next();
 					result.add(element);
 				}
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/CustomFiltersActionGroup.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/CustomFiltersActionGroup.java
index 2cf9f07..0808b78 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/CustomFiltersActionGroup.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/CustomFiltersActionGroup.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -558,6 +558,7 @@
 	}
 
 	private boolean hasChanges(HashSet<String> patterns, String[] oldPatterns) {
+		@SuppressWarnings("unchecked")
 		HashSet<String> copy= (HashSet<String>) patterns.clone();
 		for (int i= 0; i < oldPatterns.length; i++) {
 			boolean found= copy.remove(oldPatterns[i]);
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/NewJavaProjectWizardPageOne.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/NewJavaProjectWizardPageOne.java
index 1346364..97a4217 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/NewJavaProjectWizardPageOne.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/NewJavaProjectWizardPageOne.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 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
@@ -23,6 +23,8 @@
 import java.util.Observable;
 import java.util.Observer;
 
+import org.eclipse.equinox.bidi.StructuredTextTypeHandlerFactory;
+
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
@@ -51,6 +53,7 @@
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.util.BidiUtils;
 import org.eclipse.jface.util.Policy;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.ITreeSelection;
@@ -97,8 +100,6 @@
 import org.eclipse.jdt.internal.ui.wizards.dialogfields.StringButtonDialogField;
 import org.eclipse.jdt.internal.ui.wizards.dialogfields.StringDialogField;
 import org.eclipse.jdt.internal.ui.workingsets.IWorkingSetIDs;
-import org.eclipse.jface.util.BidiUtils;
-import org.eclipse.equinox.bidi.StructuredTextTypeHandlerFactory;
 
 /**
  * The first page of the New Java Project wizard. This page is typically used in combination with
@@ -592,12 +593,9 @@
 				}
 			}
 
-			String defaultCC;
-			if (defaultVM instanceof IVMInstall2) {
-				defaultCC= JavaModelUtil.getCompilerCompliance((IVMInstall2)defaultVM, JavaCore.VERSION_1_4);
-			} else {
-				defaultCC= JavaCore.VERSION_1_4;
-			}
+			String defaultCC=JavaModelUtil.VERSION_LATEST;
+			if (defaultVM instanceof IVMInstall2)
+				defaultCC= JavaModelUtil.getCompilerCompliance((IVMInstall2)defaultVM, defaultCC);
 
 			for (int i= 0; i < environments.length; i++) {
 				String eeCompliance= JavaModelUtil.getExecutionEnvironmentCompliance(environments[i]);
@@ -605,7 +603,7 @@
 					return environments[i].getId();
 			}
 
-			return "JavaSE-1.6"; //$NON-NLS-1$
+			return "JavaSE-1.7"; //$NON-NLS-1$
 		}
 
 		private String getDefaultJVMLabel() {
diff --git a/org.eclipse.ltk.core.refactoring.tests/META-INF/MANIFEST.MF b/org.eclipse.ltk.core.refactoring.tests/META-INF/MANIFEST.MF
index c3066c1..e1c08b4 100644
--- a/org.eclipse.ltk.core.refactoring.tests/META-INF/MANIFEST.MF
+++ b/org.eclipse.ltk.core.refactoring.tests/META-INF/MANIFEST.MF
@@ -3,7 +3,6 @@
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.ltk.core.refactoring.tests; singleton:=true
 Bundle-Version: 3.6.100.qualifier
-Bundle-ClassPath: refcoretests.jar
 Bundle-Activator: org.eclipse.ltk.core.refactoring.tests.RefactoringCoreTestPlugin
 Bundle-ActivationPolicy: lazy
 Bundle-Vendor: %providerName
diff --git a/org.eclipse.ltk.core.refactoring.tests/build.properties b/org.eclipse.ltk.core.refactoring.tests/build.properties
index 0099679..57d1cd0 100644
--- a/org.eclipse.ltk.core.refactoring.tests/build.properties
+++ b/org.eclipse.ltk.core.refactoring.tests/build.properties
@@ -12,7 +12,7 @@
                test.xml,\
                about.html,\
                plugin.properties,\
-               refcoretests.jar,\
+               .,\
                META-INF/
 src.includes = about.html
-source.refcoretests.jar = src/
+source.. = src/
diff --git a/org.eclipse.ltk.core.refactoring.tests/pom.xml b/org.eclipse.ltk.core.refactoring.tests/pom.xml
index 3374e6a..685d93d 100644
--- a/org.eclipse.ltk.core.refactoring.tests/pom.xml
+++ b/org.eclipse.ltk.core.refactoring.tests/pom.xml
@@ -12,9 +12,10 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <parent>
-    <artifactId>eclipse.jdt.ui</artifactId>
+    <artifactId>tests-pom</artifactId>
     <groupId>eclipse.jdt.ui</groupId>
     <version>4.3.0-SNAPSHOT</version>
+    <relativePath>../tests-pom/</relativePath>
   </parent>
   <groupId>org.eclipse.ltk</groupId>
   <artifactId>org.eclipse.ltk.core.refactoring.tests</artifactId>
diff --git a/org.eclipse.ltk.core.refactoring.tests/src/org/eclipse/ltk/core/refactoring/tests/history/MockRefactoringDescriptor.java b/org.eclipse.ltk.core.refactoring.tests/src/org/eclipse/ltk/core/refactoring/tests/history/MockRefactoringDescriptor.java
index 3c666da..d8647ba 100644
--- a/org.eclipse.ltk.core.refactoring.tests/src/org/eclipse/ltk/core/refactoring/tests/history/MockRefactoringDescriptor.java
+++ b/org.eclipse.ltk.core.refactoring.tests/src/org/eclipse/ltk/core/refactoring/tests/history/MockRefactoringDescriptor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 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
@@ -12,6 +12,7 @@
 
 import java.util.HashMap;
 import java.util.Map;
+import java.util.TreeMap;
 
 import org.eclipse.core.runtime.CoreException;
 
@@ -67,7 +68,7 @@
 			buffer.append(",comment="); //$NON-NLS-1$
 			buffer.append(getComment());
 			buffer.append(",arguments="); //$NON-NLS-1$
-			buffer.append(getArguments());
+			buffer.append(new TreeMap(getArguments()));
 			buffer.append(",flags="); //$NON-NLS-1$
 			buffer.append(getFlags());
 			buffer.append("]"); //$NON-NLS-1$
diff --git a/org.eclipse.ltk.core.refactoring.tests/src/org/eclipse/ltk/core/refactoring/tests/participants/CancelingParticipantTests.java b/org.eclipse.ltk.core.refactoring.tests/src/org/eclipse/ltk/core/refactoring/tests/participants/CancelingParticipantTests.java
index 363d44b..6c86bb6 100644
--- a/org.eclipse.ltk.core.refactoring.tests/src/org/eclipse/ltk/core/refactoring/tests/participants/CancelingParticipantTests.java
+++ b/org.eclipse.ltk.core.refactoring.tests/src/org/eclipse/ltk/core/refactoring/tests/participants/CancelingParticipantTests.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -14,9 +14,10 @@
 import java.util.Collections;
 import java.util.List;
 
-import junit.framework.Assert;
 import junit.framework.TestCase;
 
+import org.junit.Assert;
+
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.ILogListener;
 import org.eclipse.core.runtime.IProgressMonitor;
diff --git a/org.eclipse.ltk.core.refactoring.tests/src/org/eclipse/ltk/core/refactoring/tests/participants/FailingParticipantTests.java b/org.eclipse.ltk.core.refactoring.tests/src/org/eclipse/ltk/core/refactoring/tests/participants/FailingParticipantTests.java
index afcc3fe..8366b38 100644
--- a/org.eclipse.ltk.core.refactoring.tests/src/org/eclipse/ltk/core/refactoring/tests/participants/FailingParticipantTests.java
+++ b/org.eclipse.ltk.core.refactoring.tests/src/org/eclipse/ltk/core/refactoring/tests/participants/FailingParticipantTests.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -15,9 +15,10 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import junit.framework.Assert;
 import junit.framework.TestCase;
 
+import org.junit.Assert;
+
 import org.eclipse.core.runtime.ILogListener;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.NullProgressMonitor;
diff --git a/org.eclipse.ltk.ui.refactoring.tests/META-INF/MANIFEST.MF b/org.eclipse.ltk.ui.refactoring.tests/META-INF/MANIFEST.MF
index 209ce77..8229280 100644
--- a/org.eclipse.ltk.ui.refactoring.tests/META-INF/MANIFEST.MF
+++ b/org.eclipse.ltk.ui.refactoring.tests/META-INF/MANIFEST.MF
@@ -3,7 +3,6 @@
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.ltk.ui.refactoring.tests;singleton:=true
 Bundle-Version: 3.7.100.qualifier
-Bundle-ClassPath: refuitests.jar
 Bundle-Activator: org.eclipse.ltk.ui.refactoring.tests.RefactoringUITestPlugin
 Bundle-ActivationPolicy: lazy
 Bundle-Vendor: %providerName
diff --git a/org.eclipse.ltk.ui.refactoring.tests/build.properties b/org.eclipse.ltk.ui.refactoring.tests/build.properties
index 9253508..4624018 100644
--- a/org.eclipse.ltk.ui.refactoring.tests/build.properties
+++ b/org.eclipse.ltk.ui.refactoring.tests/build.properties
@@ -11,8 +11,8 @@
 bin.includes = test.xml,\
                about.html,\
                plugin.properties,\
-               refuitests.jar,\
+               .,\
                META-INF/,\
                plugin.xml
 src.includes = about.html
-source.refuitests.jar = src/
+source.. = src/
diff --git a/org.eclipse.ltk.ui.refactoring.tests/pom.xml b/org.eclipse.ltk.ui.refactoring.tests/pom.xml
index 5fd7baf..1b15ded 100644
--- a/org.eclipse.ltk.ui.refactoring.tests/pom.xml
+++ b/org.eclipse.ltk.ui.refactoring.tests/pom.xml
@@ -8,16 +8,22 @@
  
   Contributors:
      Igor Fedorenko - initial implementation
+     Mickael Istria (Red Hat Inc.) - 416915: tycho-surefire-plugin configuration
 -->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <parent>
-    <artifactId>eclipse.jdt.ui</artifactId>
+    <artifactId>tests-pom</artifactId>
     <groupId>eclipse.jdt.ui</groupId>
     <version>4.3.0-SNAPSHOT</version>
+    <relativePath>../tests-pom/</relativePath>
   </parent>
   <groupId>org.eclipse.ltk</groupId>
   <artifactId>org.eclipse.ltk.ui.refactoring.tests</artifactId>
   <version>3.7.100-SNAPSHOT</version>
   <packaging>eclipse-test-plugin</packaging>
+  <properties>
+    <testSuite>${project.artifactId}</testSuite>
+    <testClass>org.eclipse.ltk.ui.refactoring.tests.AllTests</testClass>
+  </properties>
 </project>
diff --git a/tests-pom/pom.xml b/tests-pom/pom.xml
new file mode 100644
index 0000000..de078b5
--- /dev/null
+++ b/tests-pom/pom.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright (c) 2013, 2014 Eclipse Foundation and others.
+  All rights reserved. This program and the accompanying materials
+  are made available under the terms of the Eclipse Distribution License v1.0
+  which accompanies this distribution, and is available at
+  http://www.eclipse.org/org/documents/edl-v10.php
+ 
+  Contributors:
+     IBM Corporation - initial API and implementation
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <artifactId>eclipse.jdt.ui</artifactId>
+    <groupId>eclipse.jdt.ui</groupId>
+    <version>4.3.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>tests-pom</artifactId>
+  <version>4.3.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+  <properties>
+    <code.ignoredWarnings>${tests.ignoredWarnings}</code.ignoredWarnings>
+  </properties>
+</project>