basic merge of jdt.core to v_B38.
diff --git a/org.eclipse.jdt.core/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jdt.core/.settings/org.eclipse.jdt.core.prefs
index 67b6307..07a6354 100644
--- a/org.eclipse.jdt.core/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jdt.core/.settings/org.eclipse.jdt.core.prefs
@@ -1,8 +1,9 @@
-#Thu Nov 25 02:18:35 CET 2010
+#Wed Feb 02 11:55:06 EST 2011
 eclipse.preferences.version=1
 org.eclipse.jdt.core.builder.cleanOutputFolder=clean
 org.eclipse.jdt.core.builder.duplicateResourceTask=warning
 org.eclipse.jdt.core.builder.invalidClasspath=abort
+org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore
 org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch,.svn/
 org.eclipse.jdt.core.circularClasspath=error
 org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
diff --git a/org.eclipse.jdt.core/.settings/org.eclipse.jdt.launching.prefs b/org.eclipse.jdt.core/.settings/org.eclipse.jdt.launching.prefs
new file mode 100644
index 0000000..e069008
--- /dev/null
+++ b/org.eclipse.jdt.core/.settings/org.eclipse.jdt.launching.prefs
@@ -0,0 +1,3 @@
+#Wed Feb 02 11:55:05 EST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.launching.PREF_STRICTLY_COMPATIBLE_JRE_NOT_AVAILABLE=error
diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties
index b964622..c5b593a 100644
--- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties
+++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties
@@ -1,7 +1,7 @@
 #Format: compiler.name = word1 word2 word3
 compiler.name = Eclipse Compiler for Java(TM)
 #Format: compiler.version = 0.XXX[, other words (don't forget the comma if adding other words)]
-compiler.version = 0.B35, 3.7.0 M5
+compiler.version = 0.B38, 3.7.0 M6
 compiler.copyright = Copyright IBM Corp 2000, 2010. All rights reserved.
 
 ###{ObjectTeams:
diff --git a/org.eclipse.jdt.core/buildnotes_jdt-core.html b/org.eclipse.jdt.core/buildnotes_jdt-core.html
index 8405276..57dbbfe 100644
--- a/org.eclipse.jdt.core/buildnotes_jdt-core.html
+++ b/org.eclipse.jdt.core/buildnotes_jdt-core.html
@@ -41,6 +41,108 @@
 	</td>
   </tr>
 </table>
+<a name="v_B38"></a>
+<hr><h1>
+Eclipse Platform Build Notes<br>
+Java development tools core</h1>
+Eclipse SDK 3.7M6 - February 22, 2011 - 3.7.0 M6
+<br>Project org.eclipse.jdt.core v_B38
+(<a href="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jdt.core/?only_with_tag=v_B38">cvs</a>).
+<h2>What's new in this drop</h2>
+<ul>
+<li>Added a new API to ease the retrieval of method parameter's annotations (see bug <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=334783">334783</a> for details):
+<pre>
+/**
+ * Returns the parameters of this method.
+ * An empty array is returned, if the method has no parameters.
+ * For binary types, associated source is used to retrieve the name range,
+ * source range and the flags.
+ * These local variables can be used to retrieve the parameter annotations.
+ * 
+ * @return the parameters of this method
+ * @throws JavaModelException if this element does not exist or if an
+ *      exception occurs while accessing its corresponding resource.
+ * @since 3.7
+ */
+ILocalVariable[] getParameters() throws JavaModelException;
+</pre>
+</li>
+</ul>
+<h3>Problem Reports Fixed</h3>
+<a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=334783">334783</a>
+[API] Add new API to ease the retrieval of the parameter annotations for an IMethod
+<br><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=336046">336046</a>
+Source attachment not recovered when importing Projects
+<br><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=313870">313870</a>
+Wrong warnings on Java.Compiler.Errors/Warnings &quot;Redundant null check&quot;
+<br><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=337275">337275</a>
+Incorrect/outdated javadoc for org.eclipse.jdt.core.dom.Expression
+<br><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=337093">337093</a>
+[compiler][generics] Javac-warning on vararg missing in Eclipse
+<br><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=336648">336648</a>
+wrong compiler problem &quot;The value of the local variable xxx is not used&quot;
+<br><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=336934">336934</a>
+[compiler] NPE in Scope.getTypeOrPackage
+
+<a name="v_B37"></a>
+<hr><h1>
+Eclipse Platform Build Notes<br>
+Java development tools core</h1>
+Eclipse SDK 3.7M6 - February 15, 2011
+<br>Project org.eclipse.jdt.core v_B37
+(<a href="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jdt.core/?only_with_tag=v_B37">cvs</a>).
+<h2>What's new in this drop</h2>
+<ul>
+<li>Adding a new token "javadoc" for @suppressWarnings to remove all warnings related to javadoc.</li>
+</ul>
+
+<h3>Problem Reports Fixed</h3>
+<a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=335751">335751</a>
+[1.7][compiler] Cycle inheritance in type arguments is not detected
+<br><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=335309">335309</a>
+[formatter] FUP of bug 332843: add regression test
+<br><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=334622">334622</a>
+Eclipse compiler allows access to private fields for typed variables
+<br><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=274737">274737</a>
+Relative Classpath entries should not be resolved relative to the workspace
+<br><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=179566">179566</a>
+[compiler] Support of @SuppressWarnings for JavaDoc Warnings
+<br><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=336821">336821</a>
+Javadoc reference to constructor does not work without parameter list
+<br><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=331138">331138</a>
+ASTRewrite#replace(..) does not consider the TargetSourceRangeComputer
+
+<a name="v_B36"></a>
+<hr><h1>
+Eclipse Platform Build Notes<br>
+Java development tools core</h1>
+Eclipse SDK 3.7M6 - February 8, 2011
+<br>Project org.eclipse.jdt.core v_B36
+(<a href="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jdt.core/?only_with_tag=v_B36">cvs</a>).
+<h2>What's new in this drop</h2>
+<ul>
+<li>All JDT/Core projects (tests included) have been set to force strict compatibility between the JRE used for the project
+and the BREE defined for the project.</li>
+</ul>
+
+<h3>Problem Reports Fixed</h3>
+<a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=336544">336544</a>
+[regression][compiler] Source flagged as dead code incorrectly.
+<br><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=189459">189459</a>
+[1.6][compiler] Doc comment support should not be systematically activated while processing annotations
+<br><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=332838">332838</a>
+Bogus potential null pointer access warning (regression; works with 3.6)
+<br><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=334377">334377</a>
+[1.5][compiler] Invalid 'type mismatch' error in conditional expression (if-else construct behaves correct)
+<br><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=335780">335780</a>
+Compiler says a method can be potentially static but this method contains 'this'
+<br><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=310747">310747</a>
+[content assist] Irrelevant proposals while completing inside array initializer.
+<br><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=335845">335845</a>
+[compiler] compiler wrongly suggests to add a static qualifier to a method
+<br><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=335602">335602</a>
+[search] Java indexing thread can index data outside of workspace
+
 <a name="v_B35"></a>
 <hr><h1>
 Eclipse Platform Build Notes<br>
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java
index 30e68bd..2660a01 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java
@@ -3553,6 +3553,11 @@
 			if(binding != null) {
 				if(!(variable.initialization instanceof ArrayInitializer)) {
 					addExpectedType(binding, scope);
+				} else { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=310747
+					// If the variable is of type X[], and we're in the initializer
+					// we should have X as the expected type for the variable initializers.
+					binding = binding.leafComponentType();
+					addExpectedType(binding, scope);
 				}
 			}
 		} else if(parent instanceof Assignment) {
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java
index 88d5305..4a85801 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java
@@ -918,8 +918,6 @@
 					this.expressionLengthPtr--;
 				}
 
-				this.lastCheckPoint = this.scanner.currentPosition;
-
 				if(topKnownElementKind(COMPLETION_OR_ASSIST_PARSER, 1) == K_ARRAY_CREATION) {
 					ArrayAllocationExpression allocationExpression = new ArrayAllocationExpression();
 					pushOnGenericsLengthStack(0);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java
index b7f4eb1..80eadf3 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java
@@ -636,6 +636,7 @@
 	int DuplicateTypes = TypeRelated + 323;
 	int IsClassPathCorrect = TypeRelated + 324;
 	int PublicClassMustMatchFileName = TypeRelated + 325;
+	/** @deprecated - problem is no longer generated */
 	int MustSpecifyPackage = Internal + 326;
 	int HierarchyHasProblems = TypeRelated + 327;
 	int PackageIsNotExpectedPackage = Internal + 328;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java
index f55183d..d98e6cb 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 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
@@ -187,6 +187,9 @@
 	// for all method/constructor invocations (msg, alloc, expl. constr call)
 	public static final int Unchecked = Bit17;
 	
+	// for javadoc - used to indicate whether the javadoc has to be resolved
+	public static final int ResolveJavadoc = Bit17;
+	
 	// for empty statement
 	public static final int IsUsefulEmptyStatement = Bit1;
 
@@ -327,7 +330,7 @@
 					invocationStatus |= checkInvocationArgument(scope, arguments[i], params[i] , argumentTypes[i], originalRawParam);
 				}
 			   int argLength = arguments.length;
-			   if (lastIndex < argLength) { // vararg argument was provided
+			   if (lastIndex <= argLength) { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=337093
 				   	TypeBinding parameterType = params[lastIndex];
 					TypeBinding originalRawParam = null;
 
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java
index 41730c4..efe1e15 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java
@@ -100,6 +100,11 @@
 			flowInfo.unconditionalCopy(),
 			currentScope);
 	}
+	if (this.binding.declaringClass.isMemberType() && !this.binding.declaringClass.isStatic()) {
+		// allocating a non-static member type without an enclosing instance of parent type
+		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=335845
+		currentScope.resetEnclosingMethodStaticFlag();
+	}
 	manageEnclosingInstanceAccessIfNecessary(currentScope, flowInfo);
 	manageSyntheticAccessIfNecessary(currentScope, flowInfo);
 
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AssertStatement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AssertStatement.java
index cfdaf90..12d989b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AssertStatement.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AssertStatement.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 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
@@ -86,7 +86,9 @@
 		CompilerOptions compilerOptions = currentScope.compilerOptions();
 		if (!compilerOptions.includeNullInfoFromAsserts) {
 			// keep just the initializations info, don't include assert's null info
-			return flowInfo.mergedWith(assertInfo.nullInfoLessUnconditionalCopy());
+			// merge initialization info's and then add back the null info from flowInfo to
+			// make sure that the empty null info of assertInfo doesnt change flowInfo's null info.
+			return ((flowInfo.nullInfoLessUnconditionalCopy()).mergedWith(assertInfo.nullInfoLessUnconditionalCopy())).addNullInfoFrom(flowInfo);
 		}
 		return flowInfo.mergedWith(assertInfo.nullInfoLessUnconditionalCopy()).
 			addInitializationsFrom(assertWhenTrueInfo.discardInitializationInfo());
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Assignment.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Assignment.java
index 642e379..f8bfd7e 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Assignment.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Assignment.java
@@ -76,6 +76,9 @@
 	if ((this.expression.implicitConversion & TypeIds.UNBOXING) != 0) {
 		this.expression.checkNPE(currentScope, flowContext, flowInfo);
 	}
+	flowInfo = ((Reference) this.lhs)
+		.analyseAssignment(currentScope, flowContext, flowInfo, this, false)
+		.unconditionalInits();
 	int nullStatus = this.expression.nullStatus(flowInfo);
 	if (local != null && (local.type.tagBits & TagBits.IsBaseType) == 0) {
 		if (nullStatus == FlowInfo.NULL) {
@@ -83,9 +86,6 @@
 				FlowContext.CAN_ONLY_NULL | FlowContext.IN_ASSIGNMENT, flowInfo);
 		}
 	}
-	flowInfo = ((Reference) this.lhs)
-		.analyseAssignment(currentScope, flowContext, flowInfo, this, false)
-		.unconditionalInits();
 	nullStatus = checkAgainstNullAnnotation(currentScope, local, nullStatus);
 	if (local != null && (local.type.tagBits & TagBits.IsBaseType) == 0) {
 		flowInfo.markNullStatus(local, nullStatus);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java
index a67914e..b9aced0 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 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
@@ -53,6 +53,7 @@
 	public Javadoc(int sourceStart, int sourceEnd) {
 		this.sourceStart = sourceStart;
 		this.sourceEnd = sourceEnd;
+		this.bits |= ASTNode.ResolveJavadoc;
 	}
 	/**
 	 * Returns whether a type can be seen at a given visibility level or not.
@@ -207,6 +208,9 @@
 	 * Resolve type javadoc
 	 */
 	public void resolve(ClassScope scope) {
+		if ((this.bits & ASTNode.ResolveJavadoc) == 0) {
+			return;
+		}
 		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=247037, @inheritDoc tag cannot
 		// be used in the documentation comment for a class or interface.
 		if (this.inheritedPositions != null) {
@@ -300,6 +304,9 @@
 	 * Resolve compilation unit javadoc
 	 */
 	public void resolve(CompilationUnitScope unitScope) {
+		if ((this.bits & ASTNode.ResolveJavadoc) == 0) {
+			return;
+		}
 		// Do nothing - This is to mimic the SDK's javadoc tool behavior, which neither
 		// sanity checks nor generates documentation using comments at the CU scope 
 		// (unless the unit happens to be package-info.java - in which case we don't come here.) 
@@ -309,7 +316,9 @@
 	 * Resolve method javadoc
 	 */
 	public void resolve(MethodScope methScope) {
-
+		if ((this.bits & ASTNode.ResolveJavadoc) == 0) {
+			return;
+		}
 		// get method declaration
 		AbstractMethodDeclaration methDecl = methScope.referenceMethod();
 		boolean overriding = methDecl == null /* field declaration */ || methDecl.binding == null /* compiler error */
@@ -446,7 +455,12 @@
 					if (scope.enclosingSourceType().isCompatibleWith(fieldRef.actualReceiverType)) {
 						fieldRef.bits |= ASTNode.SuperAccess;
 					}
-					fieldRef.methodBinding = scope.findMethod((ReferenceBinding)fieldRef.actualReceiverType, fieldRef.token, new TypeBinding[0], fieldRef);
+					ReferenceBinding resolvedType = (ReferenceBinding) fieldRef.actualReceiverType;
+					if (CharOperation.equals(resolvedType.sourceName(), fieldRef.token)) {
+						fieldRef.methodBinding = scope.getConstructor(resolvedType, Binding.NO_TYPES, fieldRef);
+					} else {
+						fieldRef.methodBinding = scope.findMethod(resolvedType, fieldRef.token, Binding.NO_TYPES, fieldRef);
+					}
 				}
 			}
 
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocFieldReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocFieldReference.java
index 4198930..b6bab94 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocFieldReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocFieldReference.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 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,6 +11,7 @@
  *******************************************************************************/
 package org.eclipse.jdt.internal.compiler.ast;
 
+import org.eclipse.jdt.core.compiler.CharOperation;
 import org.eclipse.jdt.internal.compiler.ASTVisitor;
 import org.eclipse.jdt.internal.compiler.impl.Constant;
 import org.eclipse.jdt.internal.compiler.lookup.*;
@@ -75,9 +76,15 @@
 			}
 			if (this.actualReceiverType instanceof ReferenceBinding) {
 				ReferenceBinding refBinding = (ReferenceBinding) this.actualReceiverType;
-				MethodBinding possibleMethod = this.receiver.isThis()
-					? scope.getImplicitMethod(this.token, Binding.NO_TYPES, this)
-					: scope.getMethod(refBinding, this.token, Binding.NO_TYPES, this);
+				char[] selector = this.token;
+				MethodBinding possibleMethod = null;
+				if (CharOperation.equals(this.actualReceiverType.sourceName(), selector)) {
+					possibleMethod = scope.getConstructor(refBinding, Binding.NO_TYPES, this);
+				} else {
+					possibleMethod = this.receiver.isThis()
+						? scope.getImplicitMethod(selector, Binding.NO_TYPES, this)
+						: scope.getMethod(refBinding, selector, Binding.NO_TYPES, this);
+				}
 				if (possibleMethod.isValidBinding()) {
 					this.methodBinding = possibleMethod;
 				} else {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java
index 23db328..c6c3bde 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java
@@ -115,11 +115,12 @@
 	if ((this.initialization.implicitConversion & TypeIds.UNBOXING) != 0) {
 		this.initialization.checkNPE(currentScope, flowContext, flowInfo);
 	}
-	int nullStatus = this.initialization.nullStatus(flowInfo);
+	
 	flowInfo =
 		this.initialization
 			.analyseCode(currentScope, flowContext, flowInfo)
 			.unconditionalInits();
+	int nullStatus = this.initialization.nullStatus(flowInfo);
 	if (!flowInfo.isDefinitelyAssigned(this.binding)){// for local variable debug attributes
 		this.bits |= FirstAssignmentToLocal;
 	} else {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ThisReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ThisReference.java
index 0a5e24c..670959b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ThisReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ThisReference.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 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
@@ -148,4 +148,13 @@
 		visitor.visit(this, blockScope);
 		visitor.endVisit(this, blockScope);
 	}
+
+	public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) {
+		if (!isImplicitThis()) {
+			// explicit this reference, not allowed in static context
+			// https://bugs.eclipse.org/bugs/show_bug.cgi?id=335780
+			currentScope.resetEnclosingMethodStaticFlag();
+		}
+		return super.analyseCode(currentScope, flowContext, flowInfo);
+	}
 }
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java
index 269e8bc..79408af 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java
@@ -1651,7 +1651,7 @@
 			// if Object writeReplace() throws java.io.ObjectStreamException is present, then no serialVersionUID is needed
 			// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=101476
 			CompilationUnitScope compilationUnitScope = this.scope.compilationUnitScope();
-			MethodBinding methodBinding = sourceType.getExactMethod(TypeConstants.WRITEREPLACE, new TypeBinding[0], compilationUnitScope);
+			MethodBinding methodBinding = sourceType.getExactMethod(TypeConstants.WRITEREPLACE, Binding.NO_TYPES, compilationUnitScope);
 			ReferenceBinding[] throwsExceptions;
 			needSerialVersion =
 				methodBinding == null
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/LoopingFlowContext.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/LoopingFlowContext.java
index 69fe575..6606cbe 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/LoopingFlowContext.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/LoopingFlowContext.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 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
@@ -519,7 +519,8 @@
 						flowInfo.initsWhenTrue().setReachMode(FlowInfo.UNREACHABLE);
 					}
 				}
-			} else if (this.upstreamNullFlowInfo.isDefinitelyNonNull(local) && !flowInfo.isPotentiallyNull(local)) {    // https://bugs.eclipse.org/bugs/show_bug.cgi?id=291418
+			} else if (this.upstreamNullFlowInfo.isDefinitelyNonNull(local) && !flowInfo.isPotentiallyNull(local) && !flowInfo.isPotentiallyUnknown(local)) {    
+				// https://bugs.eclipse.org/bugs/show_bug.cgi?id=291418
 				flowInfo.markAsDefinitelyNonNull(local);
 				if ((this.tagBits & FlowContext.HIDE_NULL_COMPARISON_WARNING) == 0) {
 					recordNullReference(local, reference, checkType);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java
index 48bfa68..b0887f3 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java
@@ -482,6 +482,7 @@
 		"finally", //$NON-NLS-1$
 		"hiding", //$NON-NLS-1$
 		"incomplete-switch", //$NON-NLS-1$
+		"javadoc", //$NON-NLS-1$
 		"nls", //$NON-NLS-1$
 		"null", //$NON-NLS-1$
 		"restriction", //$NON-NLS-1$
@@ -977,6 +978,10 @@
 			case MethodCanBeStatic :
 			case MethodCanBePotentiallyStatic :
 				return "static-method"; //$NON-NLS-1$
+			case InvalidJavadoc :
+			case MissingJavadocComments :
+			case MissingJavadocTags:
+				return "javadoc"; //$NON-NLS-1$				
 //{ObjectTeams:
 			case NotExactlyOneBasecall :
 				return "basecall"; //$NON-NLS-1$
@@ -1058,6 +1063,10 @@
 				if ("incomplete-switch".equals(warningToken)) //$NON-NLS-1$
 					return IrritantSet.INCOMPLETE_SWITCH;
 				break;
+			case 'j' :
+				if ("javadoc".equals(warningToken)) //$NON-NLS-1$
+					return IrritantSet.JAVADOC;
+				break;
 			case 'n' :
 				if ("nls".equals(warningToken)) //$NON-NLS-1$
 					return IrritantSet.NLS;
@@ -1878,7 +1887,6 @@
 			if (ENABLED.equals(optionValue)) {
 				this.processAnnotations = true;
 				this.storeAnnotations = true; // annotation processing requires annotation to be stored
-				this.docCommentSupport = true;  // annotation processing requires javadoc processing
 			} else if (DISABLED.equals(optionValue)) {
 				this.processAnnotations = false;
 				this.storeAnnotations = false;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/IrritantSet.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/IrritantSet.java
index 96a1b3c..b780ef3 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/IrritantSet.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/IrritantSet.java
@@ -69,7 +69,8 @@
 	public static final IrritantSet UNCHECKED = new IrritantSet(CompilerOptions.UncheckedTypeOperation);
 	public static final IrritantSet UNQUALIFIED_FIELD_ACCESS = new IrritantSet(CompilerOptions.UnqualifiedFieldAccess);
 
-	public static final IrritantSet COMPILER_DEFAULT_ERRORS = new IrritantSet(0); // no optional error by default
+	public static final IrritantSet JAVADOC = new IrritantSet(CompilerOptions.InvalidJavadoc);
+	public static final IrritantSet COMPILER_DEFAULT_ERRORS = new IrritantSet(0); // no optional error by default	
 	public static final IrritantSet COMPILER_DEFAULT_WARNINGS = new IrritantSet(0); // see static initializer below
 //{ObjectTeams: new irritants:
 	public static final IrritantSet NOT_EXACTLY_ONE_BASECALL = new IrritantSet(
@@ -201,6 +202,10 @@
 		if (suppressRawWhenUnchecked != null && "true".equalsIgnoreCase(suppressRawWhenUnchecked)) { //$NON-NLS-1$
 			UNCHECKED.set(CompilerOptions.RawTypeReference);
 		}
+		
+		JAVADOC
+			.set(CompilerOptions.MissingJavadocComments)
+			.set(CompilerOptions.MissingJavadocTags);
 	}
 
 	// Internal state
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java
index f87cc4e..2dc202c 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 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
@@ -251,7 +251,10 @@
 				&& ((local.declaration.bits & ASTNode.IsLocalDeclarationReachable) != 0)) { // declaration is reachable
 
 				if (!(local.declaration instanceof Argument)) // do not report unused catch arguments
-					problemReporter().unusedLocalVariable(local.declaration);
+					// https://bugs.eclipse.org/bugs/show_bug.cgi?id=336648
+					if (!this.referenceCompilationUnit().compilationResult.hasErrors()) {
+						problemReporter().unusedLocalVariable(local.declaration);
+					}
 			}
 
 			// could be optimized out, but does need to preserve unread variables ?
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java
index f46003d..daa19be 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 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
@@ -122,13 +122,8 @@
   try {
 // SH}
 	if (this.currentPackageName == CharOperation.NO_CHAR_CHAR) {
-		if ((this.fPackage = this.environment.defaultPackage) == null) {
-			problemReporter().mustSpecifyPackage(this.referenceContext);
-//{ObjectTeams: mark error:
-			hasPackageError = true;
-// SH}
-			return;
-		}
+		// environment default package is never null
+		this.fPackage = this.environment.defaultPackage;
 	} else {
 //{ObjectTeams: ROFI consider team packages, different creation time, different conflict rule
 	  if (   this.referenceContext.currentPackage != null
@@ -174,8 +169,11 @@
 				&&  this.referenceContext.imports == null)
 				return;
 // orig:
-			if (this.referenceContext.currentPackage != null)
+			if (this.referenceContext.currentPackage != null) {
 				problemReporter().packageCollidesWithType(this.referenceContext); // only report when the unit has a package statement
+			}
+			// ensure fPackage is not null
+			this.fPackage = this.environment.defaultPackage;
 /* OT:  */	hasPackageError = true;
 			return;
 		} else if (this.referenceContext.isPackageInfo()) {
@@ -777,7 +775,7 @@
 
 	ReferenceBinding type;
 	if (binding == null) {
-		if (this.environment.defaultPackage == null || compilerOptions().complianceLevel >= ClassFileConstants.JDK1_4)
+		if (compilerOptions().complianceLevel >= ClassFileConstants.JDK1_4)
 			return new ProblemReferenceBinding(CharOperation.subarray(compoundName, 0, i), null, ProblemReasons.NotFound);
 		type = findType(compoundName[0], this.environment.defaultPackage, this.environment.defaultPackage);
 		if (type == null || !type.isValidBinding())
@@ -806,7 +804,7 @@
 	if (compoundName.length == 1) {
 		// findType records the reference
 		// the name cannot be a package
-		if (this.environment.defaultPackage == null || compilerOptions().complianceLevel >= ClassFileConstants.JDK1_4)
+		if (compilerOptions().complianceLevel >= ClassFileConstants.JDK1_4)
 			return new ProblemReferenceBinding(compoundName, null, ProblemReasons.NotFound);
 		ReferenceBinding typeBinding = findType(compoundName[0], this.environment.defaultPackage, this.fPackage);
 		if (typeBinding == null)
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/FieldBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/FieldBinding.java
index 2dfc86a..baf0618 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/FieldBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/FieldBinding.java
@@ -184,8 +184,8 @@
 		// AND the invocationType and the declaringClass have a common enclosingType
 		receiverCheck: {
 			if (receiverType != this.declaringClass) {
-				// special tolerance for type variable direct bounds
-				if (receiverType.isTypeVariable() && ((TypeVariableBinding) receiverType).isErasureBoundTo(this.declaringClass.erasure()))
+				// special tolerance for type variable direct bounds, but only if compliance <= 1.6, see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=334622
+				if (scope.compilerOptions().complianceLevel <= ClassFileConstants.JDK1_6 && receiverType.isTypeVariable() && ((TypeVariableBinding) receiverType).isErasureBoundTo(this.declaringClass.erasure()))
 					break receiverCheck;
 				return false;
 			}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java
index 802de05..8a8089e 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java
@@ -194,8 +194,6 @@
 
 ReferenceBinding askForType(PackageBinding packageBinding, char[] name) {
 	if (packageBinding == null) {
-		if (this.defaultPackage == null)
-			return null;
 		packageBinding = this.defaultPackage;
 	}
 	NameEnvironmentAnswer answer = this.nameEnvironment.findType(name, packageBinding.compoundName);
@@ -1176,8 +1174,6 @@
  */
 public ReferenceBinding getCachedType(char[][] compoundName) {
 	if (compoundName.length == 1) {
-		if (this.defaultPackage == null)
-			return null;
 		return this.defaultPackage.getType0(compoundName[0]);
 	}
 	PackageBinding packageBinding = getPackage0(compoundName[0]);
@@ -1247,9 +1243,6 @@
 	ReferenceBinding referenceBinding;
 
 	if (compoundName.length == 1) {
-		if (this.defaultPackage == null)
-			return null;
-
 		if ((referenceBinding = this.defaultPackage.getType0(compoundName[0])) == null) {
 			PackageBinding packageBinding = getPackage0(compoundName[0]);
 			if (packageBinding != null && packageBinding != TheNotFoundPackage)
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java
index 0015d17..5d397fa 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java
@@ -565,8 +565,8 @@
 		// AND the invocationType and the declaringClass have a common enclosingType
 		receiverCheck: {
 			if (receiverType != this.declaringClass) {
-				// special tolerance for type variable direct bounds
-				if (receiverType.isTypeVariable() && ((TypeVariableBinding) receiverType).isErasureBoundTo(this.declaringClass.erasure()))
+				// special tolerance for type variable direct bounds, but only if compliance <= 1.6, see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=334622
+				if (scope.compilerOptions().complianceLevel <= ClassFileConstants.JDK1_6 && receiverType.isTypeVariable() && ((TypeVariableBinding) receiverType).isErasureBoundTo(this.declaringClass.erasure()))
 					break receiverCheck;
 				return false;
 			}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java
index 6e76086..ca5ee84 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java
@@ -390,10 +390,10 @@
 		// AND the invocationType and the receiver have a common enclosingType
 		receiverCheck: {
 			if (!(receiverType == this || receiverType == enclosingType())) {
-				// special tolerance for type variable direct bounds
+				// special tolerance for type variable direct bounds, but only if compliance <= 1.6, see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=334622
 				if (receiverType.isTypeVariable()) {
 					TypeVariableBinding typeVariable = (TypeVariableBinding) receiverType;
-					if (typeVariable.isErasureBoundTo(erasure()) || typeVariable.isErasureBoundTo(enclosingType().erasure()))
+					if (typeVariable.environment.globalOptions.complianceLevel <= ClassFileConstants.JDK1_6 && (typeVariable.isErasureBoundTo(erasure()) || typeVariable.isErasureBoundTo(enclosingType().erasure())))
 						break receiverCheck;
 				}
 				return false;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java
index 54c8d62..504fad1 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 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
@@ -701,6 +701,24 @@
 									break firstBound; // do not keep first bound
 								}
 							}
+							// https://bugs.eclipse.org/bugs/show_bug.cgi?id=335751
+							if (compilerOptions().complianceLevel > ClassFileConstants.JDK1_6) {
+								if (typeVariable.rank >= varSuperType.rank && varSuperType.declaringElement == typeVariable.declaringElement) {
+									SimpleSet set = new SimpleSet(typeParameters.length);
+									set.add(typeVariable);
+									ReferenceBinding superBinding = varSuperType;
+									while (superBinding instanceof TypeVariableBinding) {
+										if (set.includes(superBinding)) {
+											problemReporter().hierarchyCircularity(typeVariable, varSuperType, typeRef);
+											typeVariable.tagBits |= TagBits.HierarchyHasProblems;
+											break firstBound; // do not keep first bound
+										} else {
+											set.add(superBinding);
+											superBinding = ((TypeVariableBinding)superBinding).superclass;
+										}
+									}
+								}
+							}
 							break;
 						default :
 							if (((ReferenceBinding) superType).isFinal()) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java
index e761db6..3396138 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 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,6 +49,7 @@
 
 	// Options
 	public boolean checkDocComment = false;
+	public boolean setJavadocPositions = false;
 	public boolean reportProblems;
 	protected long complianceLevel;
 	protected long sourceLevel;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java
index 48f3ee5..6de1514 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 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
@@ -47,6 +47,9 @@
 	public JavadocParser(Parser sourceParser) {
 		super(sourceParser);
 		this.kind = COMPIL_PARSER | TEXT_VERIF;
+		if (sourceParser != null && sourceParser.options != null) {
+			this.setJavadocPositions = sourceParser.options.processAnnotations;
+		}
 	}
 
 	/* (non-Javadoc)
@@ -68,6 +71,12 @@
 		// Init javadoc if necessary
 		if (this.checkDocComment) {
 			this.docComment = new Javadoc(this.javadocStart, this.javadocEnd);
+		} else if (this.setJavadocPositions) {
+			// https://bugs.eclipse.org/bugs/show_bug.cgi?id=189459
+			// if annotation processors are there, javadoc object is required but
+			// they need not be resolved
+			this.docComment = new Javadoc(this.javadocStart, this.javadocEnd);
+			this.docComment.bits &= ~ASTNode.ResolveJavadoc;
 		} else {
 			this.docComment = null;
 		}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java
index 331be1c..720cf73 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java
@@ -2347,6 +2347,29 @@
 			end);
 }
 
+public void hierarchyCircularity(TypeVariableBinding type, ReferenceBinding superType, TypeReference reference) {
+	int start = 0;
+	int end = 0;
+
+	start = reference.sourceStart;
+	end = reference.sourceEnd;
+
+	if (type == superType)
+		this.handle(
+			IProblem.HierarchyCircularitySelfReference,
+			new String[] {new String(type.readableName()) },
+			new String[] {new String(type.shortReadableName()) },
+			start,
+			end);
+	else
+		this.handle(
+			IProblem.HierarchyCircularity,
+			new String[] {new String(type.readableName()), new String(superType.readableName())},
+			new String[] {new String(type.shortReadableName()), new String(superType.shortReadableName())},
+			start,
+			end);
+}
+
 public void hierarchyHasProblems(SourceTypeBinding type) {
 //{ObjectTeams: ignore some internal types:
 	if (type.isRole()) {
@@ -5866,15 +5889,6 @@
 		expression.sourceStart,
 		expression.sourceEnd);
 }
-public void mustSpecifyPackage(CompilationUnitDeclaration compUnitDecl) {
-	String[] arguments = new String[] {new String(compUnitDecl.getFileName())};
-	this.handle(
-		IProblem.MustSpecifyPackage,
-		arguments,
-		arguments,
-		compUnitDecl.sourceStart,
-		compUnitDecl.sourceStart + 1);
-}
 public void mustUseAStaticMethod(MessageSend messageSend, MethodBinding method) {
 	this.handle(
 		IProblem.StaticMethodRequested,
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties
index 9b9b304..02be83b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties
@@ -260,7 +260,7 @@
 323 = The type {1} is already defined
 324 = The type {0} cannot be resolved. It is indirectly referenced from required .class files
 325 = The public type {1} must be defined in its own file
-326 = A package must be specified in {0} or a default package created
+###[obsolete] 326 = A package must be specified in {0} or a default package created
 327 = The hierarchy of the type {0} is inconsistent
 328 = The declared package "{1}" does not match the expected package "{0}"
 329 = The type java.lang.Object cannot have a superclass or superinterfaces
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Expression.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Expression.java
index 210d6c9..6f0ad72 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Expression.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Expression.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 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,8 +18,7 @@
  * <pre>
  * Expression:
  *    Name
- *    IntegerLiteral (includes decimal, hex, and octal forms; and long)
- *    FloatingPointLiteral (includes both float and double)
+ *    NumberLiteral
  *    CharacterLiteral
  *    NullLiteral
  *    BooleanLiteral
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java
index cdf870f..fe3f740 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 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
@@ -664,7 +664,30 @@
 						ASTNode changed= (ASTNode) currEvent.getNewValue();
 
 						updateIndent(prevMark, currPos, i, editGroup);
-
+						// make sure that comments between last modified source position and extended starting position of
+						// node to be replaced are not touched
+						try {
+							TokenScanner scanner = getScanner();
+							int newOffset = prevEnd;
+							int extendedOffset = getExtendedOffset(node);
+							// Try to find the end of the last comment which is not part of extended source
+							// range of the node.
+							while (TokenScanner.isComment(scanner.readNext(newOffset, false))) {
+								int tempOffset = scanner.getNextEndOffset(newOffset, false);
+								// check whether the comment is part of extended source range of the node.
+								// If it is then we need to stop.
+								if (tempOffset < extendedOffset) {
+									newOffset = tempOffset;
+								} else {
+									break;
+								}
+							}
+							if (currPos < newOffset) {
+								currPos = extendedOffset;
+							} 		
+						} catch (CoreException e) {
+							// ignore
+						}
 						doTextRemoveAndVisit(currPos, currEnd - currPos, node, editGroup);
 						doTextInsert(currPos, changed, getNodeIndent(i), true, editGroup);
 
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IMethod.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IMethod.java
index daa458a..cf4227e 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IMethod.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IMethod.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 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
@@ -100,6 +100,21 @@
  * @return the number of parameters of this method
  */
 int getNumberOfParameters();
+
+/**
+ * Returns the parameters of this method.
+ * <p>An empty array is returned, if the method has no parameters.</p>
+ * <p>For binary types, associated source is used to retrieve the {@link ILocalVariable#getNameRange() name range},
+ * {@link ILocalVariable#getSourceRange() source range} and the {@link ILocalVariable#getFlags() flags}.</p>
+ * <p>These local variables can be used to retrieve the {@link ILocalVariable#getAnnotations() parameter annotations}.</p>
+ * 
+ * @return the parameters of this method
+ * @throws JavaModelException if this element does not exist or if an
+ *      exception occurs while accessing its corresponding resource.
+ * @since 3.7
+ */
+ILocalVariable[] getParameters() throws JavaModelException;
+
 /**
  * Returns the binding key for this method only if the given method is {@link #isResolved() resolved}.
  * A binding key is a key that uniquely identifies this method. It allows access
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/ISourceElementRequestor.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/ISourceElementRequestor.java
index a8254ff..485c71f 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/ISourceElementRequestor.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/ISourceElementRequestor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 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,6 +22,7 @@
 import org.eclipse.jdt.internal.compiler.ast.FieldDeclaration;
 import org.eclipse.jdt.internal.compiler.ast.ImportReference;
 import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
+import org.eclipse.objectteams.otdt.internal.core.compiler.ast.MethodSpec;
 
 /*
  * Part of the source element parser responsible for building the output. It
@@ -107,8 +108,17 @@
 		public int declaringTypeModifiers;
 		public int extraFlags;
 		public AbstractMethodDeclaration node;
+		public ParameterInfo[] parameterInfos;
 	}
 
+	public static class ParameterInfo {
+		public int modifiers;
+		public int declarationStart;
+		public int declarationEnd;
+		public int nameSourceStart;
+		public int nameSourceEnd;
+		public char[] name;
+	}
 	public static class FieldInfo {
 		public int declarationStart;
 		public int modifiers;
@@ -210,6 +220,7 @@
 		public char[][] parameterTypes;
 		public char[][] parameterNames;
 		public TypeParameterInfo[] typeParameters;
+		public MethodSpec node;
 	}
 	public abstract static class MappingInfo {
 		public int declarationSourceStart, sourceStart;
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementNotifier.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementNotifier.java
index 161fe78..c09b159 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementNotifier.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementNotifier.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2008, 2010 IBM Corporation and others.
+ * Copyright (c) 2008, 2011 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,6 +19,7 @@
 
 import org.eclipse.jdt.core.Signature;
 import org.eclipse.jdt.core.compiler.CharOperation;
+import org.eclipse.jdt.internal.compiler.ISourceElementRequestor.ParameterInfo;
 import org.eclipse.jdt.internal.compiler.ISourceElementRequestor.TypeParameterInfo;
 import org.eclipse.jdt.internal.compiler.ast.ASTNode;
 import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;
@@ -118,16 +119,27 @@
 	this.superTypeNames = new char[4][];
 	this.nestedTypeIndex = 0;
 }
-protected char[][][] getArguments(Argument[] arguments) {
+protected Object[][] getArgumentInfos(Argument[] arguments) {
 	int argumentLength = arguments.length;
 	char[][] argumentTypes = new char[argumentLength][];
 	char[][] argumentNames = new char[argumentLength][];
+	ParameterInfo[] parameterInfos = new ParameterInfo[argumentLength];
 	for (int i = 0; i < argumentLength; i++) {
-		argumentTypes[i] = CharOperation.concatWith(arguments[i].type.getParameterizedTypeName(), '.');
-		argumentNames[i] = arguments[i].name;
+		Argument argument = arguments[i];
+		argumentTypes[i] = CharOperation.concatWith(argument.type.getParameterizedTypeName(), '.');
+		char[] name = argument.name;
+		argumentNames[i] = name;
+		ParameterInfo parameterInfo = new ParameterInfo();
+		parameterInfo.declarationStart = argument.declarationSourceStart;
+		parameterInfo.declarationEnd = argument.declarationSourceEnd;
+		parameterInfo.nameSourceStart = argument.sourceStart;
+		parameterInfo.nameSourceEnd = argument.sourceEnd;
+		parameterInfo.modifiers = argument.modifiers;
+		parameterInfo.name = name;
+		parameterInfos[i] = parameterInfo;
 	}
 
-	return new char[][][] {argumentTypes, argumentNames};
+	return new Object[][] { parameterInfos, new char[][][] { argumentTypes, argumentNames } };
 }
 protected char[][] getInterfaceNames(TypeDeclaration typeDeclaration) {
 	char[][] interfaceNames = null;
@@ -283,10 +295,12 @@
 	Argument[] arguments = MethodSignatureEnhancer.getSourceArguments(methodDeclaration);
 	boolean [] baseclassFlags = null;
 // SH}
+	ParameterInfo[] parameterInfos = null; 
 	if (arguments != null) {
-		char[][][] argumentTypesAndNames = getArguments(arguments);
-		argumentTypes = argumentTypesAndNames[0];
-		argumentNames = argumentTypesAndNames[1];
+		Object[][] argumentInfos = getArgumentInfos(arguments);
+		parameterInfos = (ParameterInfo[]) argumentInfos[0];
+		argumentTypes = (char[][]) argumentInfos[1][0];
+		argumentNames = (char[][]) argumentInfos[1][1];
 
 		isVarArgs = arguments[arguments.length-1].isVarArgs();
 
@@ -325,6 +339,7 @@
 // SH}
 			methodInfo.exceptionTypes = thrownExceptionTypes;
 			methodInfo.typeParameters = getTypeParameterInfos(methodDeclaration.typeParameters());
+			methodInfo.parameterInfos = parameterInfos;
 			methodInfo.categories = (char[][]) this.nodesToCategories.get(methodDeclaration);
 			methodInfo.annotations = methodDeclaration.annotations;
 			methodInfo.declaringPackageName = currentPackage == null ? CharOperation.NO_CHAR : CharOperation.concatWith(currentPackage.tokens, '.');
@@ -393,6 +408,7 @@
 // SH}
 		methodInfo.exceptionTypes = thrownExceptionTypes;
 		methodInfo.typeParameters = getTypeParameterInfos(methodDeclaration.typeParameters());
+		methodInfo.parameterInfos = parameterInfos;
 		methodInfo.categories = (char[][]) this.nodesToCategories.get(methodDeclaration);
 		methodInfo.annotations = methodDeclaration.annotations;
 		methodInfo.node = methodDeclaration;
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryMember.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryMember.java
index c4d4bc4..e8b3625 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryMember.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryMember.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 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
@@ -47,7 +47,11 @@
 		return standardAnnotations;
 	int length = binaryAnnotations.length;
 	int standardLength = standardAnnotations.length;
-	IAnnotation[] annotations = new IAnnotation[length + standardLength];
+	int fullLength = length + standardLength;
+	if (fullLength == 0) {
+		return Annotation.NO_ANNOTATIONS;
+	}
+	IAnnotation[] annotations = new IAnnotation[fullLength];
 	for (int i = 0; i < length; i++) {
 		annotations[i] = Util.getAnnotation(this, binaryAnnotations[i], null);
 	}
@@ -57,7 +61,7 @@
 private IAnnotation getAnnotation(char[][] annotationName) {
 	return new Annotation(this, new String(CharOperation.concatWith(annotationName, '.')));
 }
-private IAnnotation[] getStandardAnnotations(long tagBits) {
+protected IAnnotation[] getStandardAnnotations(long tagBits) {
 	if ((tagBits & TagBits.AllStandardAnnotationsMask) == 0)
 		return Annotation.NO_ANNOTATIONS;
 	ArrayList annotations = new ArrayList();
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryMethod.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryMethod.java
index 4697f81..c8a1fa8 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryMethod.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryMethod.java
@@ -11,7 +11,16 @@
 package org.eclipse.jdt.internal.core;
 
 import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.core.*;
+import org.eclipse.jdt.core.Flags;
+import org.eclipse.jdt.core.IAnnotation;
+import org.eclipse.jdt.core.ILocalVariable;
+import org.eclipse.jdt.core.IMemberValuePair;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.ITypeParameter;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.Signature;
 import org.eclipse.jdt.core.compiler.CharOperation;
 import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
 import org.eclipse.jdt.internal.compiler.env.IBinaryAnnotation;
@@ -61,6 +70,51 @@
 	IBinaryAnnotation[] binaryAnnotations = info.getAnnotations();
 	return getAnnotations(binaryAnnotations, info.getTagBits());
 }
+public ILocalVariable[] getParameters() throws JavaModelException {
+	IBinaryMethod info = (IBinaryMethod) getElementInfo();
+	int length = this.parameterTypes.length;
+	if (length == 0) {
+		return LocalVariable.NO_LOCAL_VARIABLES;
+	}
+	ILocalVariable[] localVariables = new ILocalVariable[length];
+	char[][] argumentNames = info.getArgumentNames();
+	if (argumentNames == null || argumentNames.length < length) {
+		argumentNames = new char[length][];
+		for (int j = 0; j < length; j++) {
+			argumentNames[j] = ("arg" + j).toCharArray(); //$NON-NLS-1$
+		}
+	}
+	for (int i= 0; i < length; i++) {
+		LocalVariable localVariable = new LocalVariable(
+				this,
+				new String(argumentNames[i]),
+				0,
+				-1,
+				0,
+				-1,
+				this.parameterTypes[i],
+				null,
+				-1,
+				true);
+		localVariables[i] = localVariable;
+		IAnnotation[] annotations = getAnnotations(localVariable, info.getParameterAnnotations(i), info.getTagBits());
+		localVariable.annotations = annotations;
+	}
+	return localVariables;
+}
+private IAnnotation[] getAnnotations(JavaElement annotationParent, IBinaryAnnotation[] binaryAnnotations, long tagBits) {
+	IAnnotation[] standardAnnotations = getStandardAnnotations(tagBits);
+	if (binaryAnnotations == null)
+		return standardAnnotations;
+	int length = binaryAnnotations.length;
+	int standardLength = standardAnnotations.length;
+	IAnnotation[] annotations = new IAnnotation[length + standardLength];
+	for (int i = 0; i < length; i++) {
+		annotations[i] = Util.getAnnotation(annotationParent, binaryAnnotations[i], null);
+	}
+	System.arraycopy(standardAnnotations, 0, annotations, length, standardLength);
+	return annotations;
+}
 public IMemberValuePair getDefaultValue() throws JavaModelException {
 	IBinaryMethod info = (IBinaryMethod) getElementInfo();
 	Object defaultValue = info.getDefaultValue();
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClassFileInfo.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClassFileInfo.java
index d035355..95f71d7 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClassFileInfo.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClassFileInfo.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 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
@@ -59,23 +59,26 @@
 	 */
 	protected ITypeParameter[] typeParameters;
 
+private void generateAnnotationsInfos(JavaElement member, IBinaryAnnotation[] binaryAnnotations, long tagBits, HashMap newElements) {
+	generateAnnotationsInfos(member, null, binaryAnnotations, tagBits, newElements);
+}
 /**
  * Creates the handles and infos for the annotations of the given binary member.
  * Adds new handles to the given vector.
  */
-private void generateAnnotationsInfos(BinaryMember member, IBinaryAnnotation[] binaryAnnotations, long tagBits, HashMap newElements) {
+private void generateAnnotationsInfos(JavaElement member, char[] parameterName, IBinaryAnnotation[] binaryAnnotations, long tagBits, HashMap newElements) {
 	if (binaryAnnotations != null) {
 		for (int i = 0, length = binaryAnnotations.length; i < length; i++) {
 			IBinaryAnnotation annotationInfo = binaryAnnotations[i];
-			generateAnnotationInfo(member, newElements, annotationInfo);
+			generateAnnotationInfo(member, parameterName, newElements, annotationInfo, null);
 		}
 	}
-	generateStandardAnnotationsInfos(member, tagBits, newElements);
-}
-private void generateAnnotationInfo(JavaElement parent, HashMap newElements, IBinaryAnnotation annotationInfo) {
-	generateAnnotationInfo(parent, newElements, annotationInfo, null);
+	generateStandardAnnotationsInfos(member, parameterName, tagBits, newElements);
 }
 private void generateAnnotationInfo(JavaElement parent, HashMap newElements, IBinaryAnnotation annotationInfo, String memberValuePairName) {
+	generateAnnotationInfo(parent, null, newElements, annotationInfo, memberValuePairName);
+}
+private void generateAnnotationInfo(JavaElement parent, char[] parameterName, HashMap newElements, IBinaryAnnotation annotationInfo, String memberValuePairName) {
 	char[] typeName = org.eclipse.jdt.core.Signature.toCharArray(CharOperation.replaceOnCopy(annotationInfo.getTypeName(), '/', '.'));
 	Annotation annotation = new Annotation(parent, new String(typeName), memberValuePairName);
 	while (newElements.containsKey(annotation)) {
@@ -99,29 +102,29 @@
 		}
 	}
 }
-private void generateStandardAnnotationsInfos(BinaryMember member, long tagBits, HashMap newElements) {
+private void generateStandardAnnotationsInfos(JavaElement javaElement, char[] parameterName, long tagBits, HashMap newElements) {
 	if ((tagBits & TagBits.AllStandardAnnotationsMask) == 0)
 		return;
 	if ((tagBits & TagBits.AnnotationTargetMASK) != 0) {
-		generateStandardAnnotation(member, TypeConstants.JAVA_LANG_ANNOTATION_TARGET, getTargetElementTypes(tagBits), newElements);
+		generateStandardAnnotation(javaElement, TypeConstants.JAVA_LANG_ANNOTATION_TARGET, getTargetElementTypes(tagBits), newElements);
 	}
 	if ((tagBits & TagBits.AnnotationRetentionMASK) != 0) {
-		generateStandardAnnotation(member, TypeConstants.JAVA_LANG_ANNOTATION_RETENTION, getRetentionPolicy(tagBits), newElements);
+		generateStandardAnnotation(javaElement, TypeConstants.JAVA_LANG_ANNOTATION_RETENTION, getRetentionPolicy(tagBits), newElements);
 	}
 	if ((tagBits & TagBits.AnnotationDeprecated) != 0) {
-		generateStandardAnnotation(member, TypeConstants.JAVA_LANG_DEPRECATED, Annotation.NO_MEMBER_VALUE_PAIRS, newElements);
+		generateStandardAnnotation(javaElement, TypeConstants.JAVA_LANG_DEPRECATED, Annotation.NO_MEMBER_VALUE_PAIRS, newElements);
 	}
 	if ((tagBits & TagBits.AnnotationDocumented) != 0) {
-		generateStandardAnnotation(member, TypeConstants.JAVA_LANG_ANNOTATION_DOCUMENTED, Annotation.NO_MEMBER_VALUE_PAIRS, newElements);
+		generateStandardAnnotation(javaElement, TypeConstants.JAVA_LANG_ANNOTATION_DOCUMENTED, Annotation.NO_MEMBER_VALUE_PAIRS, newElements);
 	}
 	if ((tagBits & TagBits.AnnotationInherited) != 0) {
-		generateStandardAnnotation(member, TypeConstants.JAVA_LANG_ANNOTATION_INHERITED, Annotation.NO_MEMBER_VALUE_PAIRS, newElements);
+		generateStandardAnnotation(javaElement, TypeConstants.JAVA_LANG_ANNOTATION_INHERITED, Annotation.NO_MEMBER_VALUE_PAIRS, newElements);
 	}
 	// note that JAVA_LANG_SUPPRESSWARNINGS and JAVA_LANG_OVERRIDE cannot appear in binaries
 }
 
-private void generateStandardAnnotation(BinaryMember member, char[][] typeName, IMemberValuePair[] members, HashMap newElements) {
-	IAnnotation annotation = new Annotation(member, new String(CharOperation.concatWith(typeName, '.')));
+private void generateStandardAnnotation(JavaElement javaElement, char[][] typeName, IMemberValuePair[] members, HashMap newElements) {
+	IAnnotation annotation = new Annotation(javaElement, new String(CharOperation.concatWith(typeName, '.')));
 	AnnotationInfo annotationInfo = new AnnotationInfo();
 	annotationInfo.members = members;
 	newElements.put(annotation, annotationInfo);
@@ -383,7 +386,7 @@
 				final String[] parameterTypes = Signature.getParameterTypes(new String(descriptor));
 				pNames[0] = parameterTypes[0];
 			}
-		}catch (IllegalArgumentException e) {
+		} catch (IllegalArgumentException e) {
 			// protect against malformed .class file (e.g. com/sun/crypto/provider/SunJCE_b.class has a 'a' generic signature)
 			signature = methodInfo.getMethodDescriptor();
 			pNames = Signature.getParameterTypes(new String(signature));
@@ -405,13 +408,38 @@
 		BinaryMethod method = new BinaryMethod((JavaElement)type, selector, pNames);
 		childrenHandles.add(method);
 
-		// ensure that 2 binary methods with the same signature but with different return types have different occurence counts.
+		// ensure that 2 binary methods with the same signature but with different return types have different occurrence counts.
 		// (case of bridge methods in 1.5)
 		while (newElements.containsKey(method))
 			method.occurrenceCount++;
 
 		newElements.put(method, methodInfo);
 
+		int max = pNames.length;
+		char[][] argumentNames = methodInfo.getArgumentNames();
+		if (argumentNames == null || argumentNames.length < max) {
+			argumentNames = new char[max][];
+			for (int j = 0; j < max; j++) {
+				argumentNames[j] = ("arg" + j).toCharArray(); //$NON-NLS-1$
+			}
+		}
+		for (int j = 0; j < max; j++) {
+			IBinaryAnnotation[] parameterAnnotations = methodInfo.getParameterAnnotations(j);
+			if (parameterAnnotations != null) {
+				LocalVariable localVariable = new LocalVariable(
+						method,
+						new String(argumentNames[j]),
+						0,
+						-1,
+						0,
+						-1,
+						method.parameterTypes[j],
+						null,
+						-1,
+						true);
+				generateAnnotationsInfos(localVariable, argumentNames[j], parameterAnnotations, methodInfo.getTagBits(), newElements);
+			}
+		}
 		generateTypeParameterInfos(method, signature, newElements, typeParameterHandles);
 		generateAnnotationsInfos(method, methodInfo.getAnnotations(), methodInfo.getTagBits(), newElements);
 		Object defaultValue = methodInfo.getDefaultValue();
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathEntry.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathEntry.java
index 67277ed..d8086ff 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathEntry.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathEntry.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 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
@@ -1002,33 +1002,48 @@
 	/*
 	 * Resolves the ".." in the given path. Returns the given path if it contains no ".." segment.
 	 */
-	public static IPath resolveDotDot(IPath path) {
+	public static IPath resolveDotDot(IPath reference, IPath path) {
 		IPath newPath = null;
-		IPath workspaceLocation = null;
-		for (int i = 0, length = path.segmentCount(); i < length; i++) {
-			String segment = path.segment(i);
-			if (DOT_DOT.equals(segment)) {
-				if (newPath == null) {
-					if (i == 0) {
-						workspaceLocation = workspaceRoot.getLocation();
-						newPath = workspaceLocation;
+		IPath workspaceLocation = workspaceRoot.getLocation();
+		if (reference == null || workspaceLocation.isPrefixOf(reference)) {
+			for (int i = 0, length = path.segmentCount(); i < length; i++) {
+				String segment = path.segment(i);
+				if (DOT_DOT.equals(segment)) {
+					if (newPath == null) {
+						if (i == 0) {
+							newPath = workspaceLocation;
+						} else {
+							newPath = path.removeFirstSegments(i);
+						}
 					} else {
-						newPath = path.removeFirstSegments(i);
+						if (newPath.segmentCount() > 0) {
+							newPath = newPath.removeLastSegments(1);
+						} else {
+							newPath = workspaceLocation;
+						}
 					}
-				} else {
+				} else if (newPath != null) {
+					if (newPath.equals(workspaceLocation) && workspaceRoot.getProject(segment).isAccessible()) {
+						newPath = new Path(segment).makeAbsolute();
+					} else {
+						newPath = newPath.append(segment);
+					}
+				}
+			}
+		}
+		else {
+			for (int i = 0, length = path.segmentCount(); i < length; i++) {
+				String segment = path.segment(i);
+				if (DOT_DOT.equals(segment)) {
+					if (newPath == null){
+						newPath = reference;
+					}
 					if (newPath.segmentCount() > 0) {
 						newPath = newPath.removeLastSegments(1);
-					} else {
-						workspaceLocation = workspaceRoot.getLocation();
-						newPath = workspaceLocation;
-					}
-				}
-			} else if (newPath != null) {
-				if (newPath.equals(workspaceLocation) && workspaceRoot.getProject(segment).isAccessible()) {
-					newPath = new Path(segment).makeAbsolute();
-				} else {
+	 				}
+				} else if (newPath != null) {
 					newPath = newPath.append(segment);
-				}
+	 			}
 			}
 		}
 		if (newPath == null)
@@ -1419,8 +1434,8 @@
 		return buffer.toString();
 	}
 	
-	public ClasspathEntry resolvedDotDot() {
-		IPath resolvedPath = resolveDotDot(this.path);
+	public ClasspathEntry resolvedDotDot(IPath reference) {
+		IPath resolvedPath = resolveDotDot(reference, this.path);
 		if (resolvedPath == this.path)
 			return this;
 		return new ClasspathEntry(
@@ -1919,7 +1934,7 @@
 
 			// library entry check
 			case IClasspathEntry.CPE_LIBRARY :
-				path = ClasspathEntry.resolveDotDot(path);
+				path = ClasspathEntry.resolveDotDot(project.getProject().getLocation(), path);
 				
 				// do not validate entries from Class-Path: in manifest
 				// (these entries are considered optional since the user cannot act on them)
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitStructureRequestor.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitStructureRequestor.java
index 9596970..c64c99f 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitStructureRequestor.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitStructureRequestor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 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,12 +20,20 @@
 import java.util.Stack;
 
 import org.eclipse.core.runtime.Assert;
-import org.eclipse.jdt.core.*;
+import org.eclipse.jdt.core.Flags;
+import org.eclipse.jdt.core.IAnnotation;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IMemberValuePair;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.ITypeParameter;
+import org.eclipse.jdt.core.Signature;
 import org.eclipse.jdt.core.compiler.CategorizedProblem;
 import org.eclipse.jdt.core.compiler.CharOperation;
 import org.eclipse.jdt.core.compiler.IProblem;
 import org.eclipse.jdt.internal.compiler.ISourceElementRequestor;
 import org.eclipse.jdt.internal.compiler.ast.ASTNode;
+import org.eclipse.jdt.internal.compiler.ast.Argument;
 import org.eclipse.jdt.internal.compiler.ast.ArrayInitializer;
 import org.eclipse.jdt.internal.compiler.ast.ClassLiteralAccess;
 import org.eclipse.jdt.internal.compiler.ast.Expression;
@@ -449,8 +457,53 @@
 			acceptAnnotation(annotation, info, handle);
 		}
 	}
+	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=334783
+	// Process the parameter annotations from the arguments
+	if (methodInfo.node != null && methodInfo.node.arguments != null) {
+		info.arguments = acceptMethodParameters(methodInfo.node.arguments, handle, methodInfo);
+	}
 	return info;
 }
+private LocalVariable[] acceptMethodParameters(Argument[] arguments, JavaElement methodHandle, MethodInfo methodInfo) {
+	if (arguments == null) return null;
+	LocalVariable[] result = new LocalVariable[arguments.length];
+	Annotation[][] paramAnnotations = new Annotation[arguments.length][];
+	for(int i = 0; i < arguments.length; i++) {
+		Argument argument = arguments[i];
+		AnnotatableInfo localVarInfo = new AnnotatableInfo();
+		localVarInfo.setSourceRangeStart(argument.declarationSourceStart);
+		localVarInfo.setSourceRangeEnd(argument.declarationSourceStart);
+		localVarInfo.setNameSourceStart(argument.sourceStart);
+		localVarInfo.setNameSourceEnd(argument.sourceEnd);
+		
+		String paramTypeSig = JavaModelManager.getJavaModelManager().intern(Signature.createTypeSignature(methodInfo.parameterTypes[i], false)); 
+		result[i] = new LocalVariable(
+				methodHandle,
+				new String(argument.name),
+				argument.declarationSourceStart,
+				argument.declarationSourceEnd,
+				argument.sourceStart,
+				argument.sourceEnd,
+				paramTypeSig,
+				argument.annotations,
+				argument.modifiers, 
+				true);
+		this.newElements.put(result[i], localVarInfo);
+		this.infoStack.push(localVarInfo);
+		this.handleStack.push(result[i]);
+		if (argument.annotations != null) {
+			paramAnnotations[i] = new Annotation[argument.annotations.length];
+			for (int  j = 0; j < argument.annotations.length; j++ ) {
+				org.eclipse.jdt.internal.compiler.ast.Annotation annotation = argument.annotations[j];
+				acceptAnnotation(annotation, localVarInfo, result[i]);
+			}
+		}
+		this.infoStack.pop();
+		this.handleStack.pop();
+	}
+	return result;
+}
+
 /**
  * @see ISourceElementRequestor
  */
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java
index 2513f15..4260740 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java
@@ -2422,7 +2422,8 @@
 		IPath resolvedPath = getResolvedVariablePath(entry.getPath(), usePreviousSession);
 		if (resolvedPath == null)
 			return null;
-		resolvedPath = ClasspathEntry.resolveDotDot(resolvedPath);
+		// By passing a null reference path, we keep it relative to workspace root.
+		resolvedPath = ClasspathEntry.resolveDotDot(null, resolvedPath);
 
 		Object target = JavaModel.getTarget(resolvedPath, false);
 		if (target == null)
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProject.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProject.java
index bd62a28..7a78164 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProject.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProject.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 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
@@ -2640,7 +2640,7 @@
 			for (int index = 0; index < rawClasspath.length; index++) {
 				IClasspathEntry currentEntry = rawClasspath[index]; 
 				if (currentEntry.getEntryKind() == IClasspathEntry.CPE_LIBRARY) {
-					rawLibrariesPath.add(ClasspathEntry.resolveDotDot(currentEntry.getPath()));
+					rawLibrariesPath.add(ClasspathEntry.resolveDotDot(getProject().getLocation(), currentEntry.getPath()));
 				}
 			}
 			if (referencedEntries != null) {
@@ -2728,7 +2728,7 @@
 						
 						if (cEntry.getEntryKind() == IClasspathEntry.CPE_LIBRARY) {
 							// resolve ".." in library path
-							cEntry = cEntry.resolvedDotDot();
+							cEntry = cEntry.resolvedDotDot(getProject().getLocation());
 							// https://bugs.eclipse.org/bugs/show_bug.cgi?id=313965
 							// Do not resolve if the system attribute is set to false	
 							if (resolveChainedLibraries
@@ -2749,7 +2749,7 @@
 
 				case IClasspathEntry.CPE_LIBRARY:
 					// resolve ".." in library path
-					resolvedEntry = ((ClasspathEntry) rawEntry).resolvedDotDot();
+					resolvedEntry = ((ClasspathEntry) rawEntry).resolvedDotDot(getProject().getLocation());
 					
 					if (resolveChainedLibraries && result.rawReverseMap.get(resolvedEntry.getPath()) == null) {
 						// resolve Class-Path: in manifest
@@ -2796,6 +2796,12 @@
 		if (resolvedEntry.getEntryKind() == IClasspathEntry.CPE_LIBRARY && ExternalFoldersManager.isExternalFolderPath(resolvedPath)) {
 			externalFoldersManager.addFolder(resolvedPath, true/*scheduleForCreation*/); // no-op if not an external folder or if already registered
 		}
+		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=336046
+		// The source attachment path could be external too and in which case, must be added.
+		IPath sourcePath = resolvedEntry.getSourceAttachmentPath();
+		if (sourcePath != null && ExternalFoldersManager.isExternalFolderPath(sourcePath)) {
+			externalFoldersManager.addFolder(sourcePath, true);
+		}
 	}
 
 	private void copyFromOldChainedEntry(ClasspathEntry resolvedEntry, ClasspathEntry chainedEntry) {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/LocalVariable.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/LocalVariable.java
index 06a24eb..911097e 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/LocalVariable.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/LocalVariable.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -34,6 +34,8 @@
 
 public class LocalVariable extends SourceRefElement implements ILocalVariable {
 
+	public static final ILocalVariable[] NO_LOCAL_VARIABLES = new ILocalVariable[0];
+	
 	String name;
 	public int declarationSourceStart, declarationSourceEnd;
 	public int nameStart, nameEnd;
@@ -288,10 +290,59 @@
 	 * @since 3.7
 	 */
 	public int getFlags() {
+		if (this.flags == -1) {
+			SourceMapper mapper= getSourceMapper();
+			if (mapper != null) {
+				try {
+					// ensure the class file's buffer is open so that source ranges are computed
+					ClassFile classFile = (ClassFile)getClassFile();
+					if (classFile != null) {
+						classFile.getBuffer();
+						return mapper.getFlags(this);
+					}
+				} catch(JavaModelException e) {
+					// ignore
+				}
+			}
+			return 0;
+		}
 		return this.flags;
 	}
 
+	/**
+	 * @see IMember#getClassFile()
+	 */
+	public IClassFile getClassFile() {
+		IJavaElement element = getParent();
+		while (element instanceof IMember) {
+			element= element.getParent();
+		}
+		if (element instanceof IClassFile) {
+			return (IClassFile) element;
+		}
+		return null;
+	}
+	/**
+	 * {@inheritDoc}
+	 * @since 3.7
+	 */
 	public ISourceRange getNameRange() {
+		if (this.nameEnd == -1) {
+			SourceMapper mapper= getSourceMapper();
+			if (mapper != null) {
+				try {
+					// ensure the class file's buffer is open so that source ranges are computed
+					ClassFile classFile = (ClassFile)getClassFile();
+					if (classFile != null) {
+						classFile.getBuffer();
+						return mapper.getNameRange(this);
+					}
+				} catch(JavaModelException e) {
+					// ignore
+				}
+			}
+			return SourceMapper.UNKNOWN_RANGE;
+		}
 		return new SourceRange(this.nameStart, this.nameEnd-this.nameStart+1);
 	}
 
@@ -326,9 +377,22 @@
 	}
 
 	/**
-	 * @see ISourceReference
+	 * {@inheritDoc}
+	 * @since 3.7
 	 */
-	public ISourceRange getSourceRange() {
+	public ISourceRange getSourceRange() throws JavaModelException {
+		if (this.declarationSourceEnd == -1) {
+			SourceMapper mapper= getSourceMapper();
+			if (mapper != null) {
+				// ensure the class file's buffer is open so that source ranges are computed
+				ClassFile classFile = (ClassFile)getClassFile();
+				if (classFile != null) {
+					classFile.getBuffer();
+					return mapper.getSourceRange(this);
+				}
+			}
+			return SourceMapper.UNKNOWN_RANGE;
+		}
 		return new SourceRange(this.declarationSourceStart, this.declarationSourceEnd-this.declarationSourceStart+1);
 	}
 
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMapper.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMapper.java
index e6d57f7..8d195f8 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMapper.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMapper.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 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
@@ -79,6 +79,66 @@
 	extends ReferenceInfoAdapter
 	implements ISourceElementRequestor, SuffixConstants {
 
+	public static class LocalVariableElementKey {
+		String parent;
+		String name;
+		
+		public LocalVariableElementKey(IJavaElement method, String name) {
+			StringBuffer buffer = new StringBuffer();
+			buffer
+				.append(method.getParent().getHandleIdentifier())
+				.append('#')
+				.append(method.getElementName())
+				.append('(');
+			if (method.getElementType() == IJavaElement.METHOD) {
+				String[] parameterTypes = ((IMethod) method).getParameterTypes();
+				for (int i = 0, max = parameterTypes.length; i < max; i++) {
+					if (i > 0) {
+						buffer.append(',');
+					}
+					buffer.append(Signature.getSignatureSimpleName(parameterTypes[i]));
+				}
+			}
+			buffer.append(')');
+			this.parent = String.valueOf(buffer);
+			this.name = name;
+		}
+
+		public int hashCode() {
+			final int prime = 31;
+			int result = 1;
+			result = prime * result + ((this.name == null) ? 0 : this.name.hashCode());
+			result = prime * result + ((this.parent == null) ? 0 : this.parent.hashCode());
+			return result;
+		}
+
+		public boolean equals(Object obj) {
+			if (this == obj)
+				return true;
+			if (obj == null)
+				return false;
+			if (getClass() != obj.getClass())
+				return false;
+			LocalVariableElementKey other = (LocalVariableElementKey) obj;
+			if (this.name == null) {
+				if (other.name != null)
+					return false;
+			} else if (!this.name.equals(other.name))
+				return false;
+			if (this.parent == null) {
+				if (other.parent != null)
+					return false;
+			} else if (!this.parent.equals(other.parent))
+				return false;
+			return true;
+		}
+		public String toString() {
+			StringBuffer buffer = new StringBuffer();
+			buffer.append('(').append(this.parent).append('.').append(this.name).append(')');
+			return String.valueOf(buffer);
+		}
+	}
+
 	public static boolean VERBOSE = false;
 	/**
 	 * Specifies the location of the package fragment roots within
@@ -122,6 +182,16 @@
 	 */
 	protected HashMap categories;
 
+	/**
+	 * Table that contains all source ranges for local variables.
+	 * Keys are the special local variable elements, entries are <code>char[][]</code>.
+	 */
+	protected HashMap parametersRanges;
+	
+	/**
+	 * Set that contains all final local variables.
+	 */
+	protected HashSet finalParameters;
 
 	/**
 	 * The unknown source range {-1, 0}
@@ -212,6 +282,7 @@
 		}
 		this.sourcePath = sourcePath;
 		this.sourceRanges = new HashMap();
+		this.parametersRanges = new HashMap();
 		this.parameterNames = new HashMap();
 		this.importsTable = new HashMap();
 		this.importsCounterTable = new HashMap();
@@ -291,6 +362,8 @@
 	public void close() {
 		this.sourceRanges = null;
 		this.parameterNames = null;
+		this.parametersRanges = null;
+		this.finalParameters = null;
 	}
 
 	/**
@@ -754,6 +827,30 @@
 							typeParameterInfo.nameSourceEnd - typeParameterInfo.nameSourceStart + 1));
 				}
 			}
+			// parameters infos
+			if (methodInfo.parameterInfos != null) {
+				for (int i = 0, length = methodInfo.parameterInfos.length; i < length; i++) {
+					ParameterInfo parameterInfo = methodInfo.parameterInfos[i];
+					LocalVariableElementKey key = new LocalVariableElementKey(method, new String(parameterInfo.name));
+					SourceRange[] allRanges = new SourceRange[] {
+						new SourceRange(
+							parameterInfo.declarationStart,
+							parameterInfo.declarationEnd - parameterInfo.declarationStart + 1),
+						new SourceRange(
+							parameterInfo.nameSourceStart,
+							parameterInfo.nameSourceEnd - parameterInfo.nameSourceStart + 1)
+					};
+					this.parametersRanges.put(
+						key,
+						allRanges);
+					if (parameterInfo.modifiers != 0) {
+						if (this.finalParameters == null) {
+							this.finalParameters = new HashSet();
+						}
+						this.finalParameters.add(key);
+					}
+				}
+			}
 
 			// categories
 			addCategories(method, methodInfo.categories);
@@ -962,6 +1059,16 @@
 	}
 
 
+	public int getFlags(IJavaElement element) {
+		switch(element.getElementType()) {
+			case IJavaElement.LOCAL_VARIABLE :
+				LocalVariableElementKey key = new LocalVariableElementKey(element.getParent(), element.getElementName());
+				if (this.finalParameters != null && this.finalParameters.contains(key)) {
+					return Flags.AccFinal;
+				}
+		}
+		return 0;
+	}
 
 	/**
 	 * Returns the SourceRange for the name of the given element, or
@@ -993,6 +1100,15 @@
 						element = method.getTypeParameter(element.getElementName());
 					}
 				}
+				break;
+			case IJavaElement.LOCAL_VARIABLE :
+				LocalVariableElementKey key = new LocalVariableElementKey(element.getParent(), element.getElementName());
+				SourceRange[] ranges = (SourceRange[]) this.parametersRanges.get(key);
+				if (ranges == null) {
+					return UNKNOWN_RANGE;
+				} else {
+					return ranges[1];
+				}
 		}
 		SourceRange[] ranges = (SourceRange[]) this.sourceRanges.get(element);
 		if (ranges == null) {
@@ -1053,6 +1169,15 @@
 						element = method.getTypeParameter(element.getElementName());
 					}
 				}
+				break;
+			case IJavaElement.LOCAL_VARIABLE :
+				LocalVariableElementKey key = new LocalVariableElementKey(element.getParent(), element.getElementName());
+				SourceRange[] ranges = (SourceRange[]) this.parametersRanges.get(key);
+				if (ranges == null) {
+					return UNKNOWN_RANGE;
+				} else {
+					return ranges[0];
+				}
 		}
 		SourceRange[] ranges = (SourceRange[]) this.sourceRanges.get(element);
 		if (ranges == null) {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMethod.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMethod.java
index fbe2e3b..19b0d1b 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMethod.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMethod.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 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
@@ -156,7 +156,12 @@
 	SourceMethodElementInfo info = (SourceMethodElementInfo) getElementInfo();
 	return info.typeParameters;
 }
-
+public ILocalVariable[] getParameters() throws JavaModelException {
+	ILocalVariable[] arguments = ((SourceMethodElementInfo) getElementInfo()).arguments;
+	if (arguments == null)
+		return LocalVariable.NO_LOCAL_VARIABLES;
+	return arguments;
+}
 /**
  * @see IMethod#getTypeParameterSignatures()
  * @since 3.0
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMethodElementInfo.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMethodElementInfo.java
index a6c5206..1449404 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMethodElementInfo.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMethodElementInfo.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 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
@@ -39,6 +39,8 @@
 	 * For example, Hashtable or java.util.Hashtable.
 	 */
 	protected char[][] exceptionTypes;
+	
+	protected ILocalVariable[] arguments;
 
 	/*
 	 * The type parameters of this source type. Empty if none.
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/CalloutMapping.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/CalloutMapping.java
index 4c76fd2..36f2a94 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/CalloutMapping.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/CalloutMapping.java
@@ -22,6 +22,7 @@
 
 
 import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.ILocalVariable;
 import org.eclipse.jdt.core.IMethod;
 import org.eclipse.jdt.core.IType;
 import org.eclipse.jdt.core.JavaModelException;
@@ -269,4 +270,10 @@
 		}
 	    return getIMethod().getExceptionTypes();
 	}
+
+	public ILocalVariable[] getParameters() throws JavaModelException {
+		// TODO Auto-generated method stub
+		// see Bug 338593 - [otmodel] Add new API to ease the retrieval of the parameter annotations for an IMethodMapping
+		return null;
+	}
 }
\ No newline at end of file
diff --git a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/CalloutToFieldMapping.java b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/CalloutToFieldMapping.java
index b799d3b..9920b52 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/CalloutToFieldMapping.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/objectteams/otdt/internal/core/CalloutToFieldMapping.java
@@ -22,6 +22,7 @@
 
 import org.eclipse.jdt.core.IField;
 import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.ILocalVariable;
 import org.eclipse.jdt.core.IMethod;
 import org.eclipse.jdt.core.IType;
 import org.eclipse.jdt.core.JavaModelException;
@@ -303,4 +304,10 @@
 	public String[] getExceptionTypes() throws JavaModelException {
 		return new String[0];
 	}
+
+	public ILocalVariable[] getParameters() throws JavaModelException {
+		// TODO Auto-generated method stub
+		// see Bug 338593 - [otmodel] Add new API to ease the retrieval of the parameter annotations for an IMethodMapping
+		return null;
+	}
 }
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchParticipant.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchParticipant.java
index b034b6f..738d571 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchParticipant.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchParticipant.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 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
@@ -201,7 +201,7 @@
 		if (file instanceof IResource) {
 			containerPath = ((IResource)file).getProject().getFullPath();
 		} else if (file == null) {
-			containerPath = documentPath.removeLastSegments(documentPath.segmentCount()-1);
+			containerPath = documentPath.removeLastSegments(1);
 		}
 		IndexManager manager = JavaModelManager.getIndexManager();
 		// TODO (frederic) should not have to create index manually, should expose API that recreates index instead