JDK_1_5-Merge with HEAD: v_412a
diff --git a/batch/org/eclipse/jdt/internal/compiler/batch/Main.java b/batch/org/eclipse/jdt/internal/compiler/batch/Main.java
index 3bea024..23ef0c0 100644
--- a/batch/org/eclipse/jdt/internal/compiler/batch/Main.java
+++ b/batch/org/eclipse/jdt/internal/compiler/batch/Main.java
@@ -89,7 +89,6 @@
 	public boolean systemExitWhenFinished = true;
 	public long startTime;
 	public boolean timing = false;
-	public boolean inlineJsrBytecode = false;
 	public boolean verbose = false;
 
 	public Main(PrintWriter outWriter, PrintWriter errWriter, boolean systemExitWhenFinished) {
@@ -636,7 +635,9 @@
 			}
 			if (currentArg.equals("-inlineJSR")) { //$NON-NLS-1$
 			    mode = Default;
-			    this.inlineJsrBytecode = true;
+				this.options.put(
+						CompilerOptions.OPTION_InlineJsr,
+						CompilerOptions.ENABLED);
 			    continue;
 			}
 			if (currentArg.startsWith("-g")) { //$NON-NLS-1$
@@ -1569,7 +1570,6 @@
 		// set the non-externally configurable options.
 		this.compilerOptions.verbose = this.verbose;
 		this.compilerOptions.produceReferenceInfo = this.produceRefInfo;
-		this.compilerOptions.inlineJsrBytecode = this.inlineJsrBytecode;
 		batchCompiler.compile(getCompilationUnits());
 
 		printStats();
diff --git a/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties b/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties
index 7055bd5..24ea53f 100644
--- a/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties
+++ b/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties
@@ -12,7 +12,7 @@
 
 ### compiler 
 compiler.name = Eclipse Java Compiler
-compiler.version = 0.412
+compiler.version = 0.413
 compiler.copyright = Copyright IBM Corp 2000, 2004. All rights reserved.
 
 ### scanning
diff --git a/buildnotes_jdt-core.html b/buildnotes_jdt-core.html
index 8b3346a..97bb441 100644
--- a/buildnotes_jdt-core.html
+++ b/buildnotes_jdt-core.html
@@ -54,6 +54,41 @@
 ArrayStoreException in 1.5 parser
 
 
+<a name="v_413"></a>
+<p><hr><h1>
+Eclipse Platform Build Notes&nbsp;<br>
+Java Development Tooling Core</h1>
+Eclipse SDK 3.0M8 Build - ?th March 2004
+<br>Project org.eclipse.jdt.core v_413
+(<a href="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jdt.core/?only_with_tag=v_413">cvs</a>).
+<h2>
+What's new in this drop</h2>
+<ul> 
+<li> Added compiler option JavaCore.COMPILER_TASK_CASE_SENSITIVE to control whether the task detection
+should be case sensitive or not. By default, it is.
+<pre>
+	 * COMPILER / Determine whether task tags are case-sensitive
+	 *    When enabled, task tags are considered in a case-sensitive way.
+	 *     - option id:         "org.eclipse.jdt.core.compiler.taskCaseSensitive"
+	 *     - possible values:   { "enabled", "disabled" }
+	 *     - default:           "enabled"
+</pre>
+</li>
+<li> Added 2 default task tags: "FIXME" and "XXX".
+</li>
+</ul>
+
+<h3>Problem Reports Fixed</h3>
+<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=54294">54294</a>
+No default for JavaCore.COMPILER_CODEGEN_INLINE_JSR_BYTECODE
+<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=48435">48435</a>
+Java Search for OR-pattern finds too much in strange project setup
+<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=40921">40921</a>
+Task tags should be case-insensitive
+<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=49266">49266</a>
+FIXME task tag
+
+
 <a name="v_412"></a>
 <p><hr><h1>
 Eclipse Platform Build Notes&nbsp;<br>
@@ -64,7 +99,7 @@
 <h2>
 What's new in this drop</h2>
 <ul>
-<li>Added new global JavaCore.COMPILER_DOC_COMMENT_SUPPORT option for doc comment (Javadoc) support. By default, this option is enabled for backward compatibility.
+<li> Added new global JavaCore.COMPILER_DOC_COMMENT_SUPPORT option for doc comment (Javadoc) support. By default, this option is enabled for backward compatibility.
 <pre>
 	 * COMPILER / Javadoc Comment Support
 	 *    When this support is disabled, the compiler will ignore all javadoc problems options settings
@@ -76,7 +111,7 @@
 </pre>
 See bug <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=52264">52264</a>.
 </li>
-<li>Added new JavaCore.COMPILER_CODEGEN_INLINE_JSR_BYTECODE option to allow user to inline subroutine code instead of generating JSR instructions. By default, this option is disabled.
+<li> Added new JavaCore.COMPILER_CODEGEN_INLINE_JSR_BYTECODE option to allow user to inline subroutine code instead of generating JSR instructions. By default, this option is disabled.
 <pre>
 	 * COMPILER / Inline JSR Bytecode Instruction
 	 *    When enabled, the compiler will no longer generate JSR instructions, but rather inline corresponding
@@ -88,11 +123,11 @@
 	 *     - default:           "disabled"
 	 * 
 </pre>
-Corresponding command line compiler option <code>-noJSR</code> has been changed to:
+Corresponding command line compiler option <code>-noJSR</code> has been renamed to:
 <pre>
     <code>-inlineJSR</code> : inline JSR bytecode
 </pre>
-Which means that JSR bytecode is used when this option will be specified in batch compiler command line.
+which means that when specified, the compiler will no longer generate JSR bytecodes, but instead inlining the corresponding subroutine (e.g. finally block).
 </li>
 </ul>
 
diff --git a/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java b/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java
index e067d10..190a90b 100644
--- a/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java
+++ b/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java
@@ -221,7 +221,8 @@
 				false /*nls*/, 
 				this.compilerOptions.sourceLevel, 
 				null /*taskTags*/, 
-				null/*taskPriorities*/);
+				null/*taskPriorities*/,
+				true/*taskCaseSensitive*/);
 	}
 
 	/**
diff --git a/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionScanner.java b/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionScanner.java
index 8f0187e..fbc714b 100644
--- a/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionScanner.java
+++ b/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionScanner.java
@@ -45,7 +45,8 @@
 		false /*nls*/, 
 		sourceLevel, 
 		null /*taskTags*/, 
-		null/*taskPriorities*/);
+		null/*taskPriorities*/,
+		true/*taskCaseSensitive*/);
 }
 /* 
  * Truncate the current identifier if it is containing the cursor location. Since completion is performed
diff --git a/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionScanner.java b/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionScanner.java
index 0b6763f..5ce63e2 100644
--- a/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionScanner.java
+++ b/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionScanner.java
@@ -29,7 +29,7 @@
  */
  
 public SelectionScanner(long sourceLevel) {
-	super(false /*comment*/, false /*whitespace*/, false /*nls*/, sourceLevel, null /*taskTags*/, null/*taskPriorities*/);
+	super(false /*comment*/, false /*whitespace*/, false /*nls*/, sourceLevel, null /*taskTags*/, null/*taskPriorities*/, true/*taskCaseSensitive*/);
 }
 
 public char[] getCurrentIdentifierSource() {
diff --git a/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java b/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java
index ccdbe7e..5e89296 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java
@@ -79,6 +79,8 @@
 	public static final String OPTION_MaxProblemPerUnit = "org.eclipse.jdt.core.compiler.maxProblemPerUnit"; //$NON-NLS-1$
 	public static final String OPTION_TaskTags = "org.eclipse.jdt.core.compiler.taskTags"; //$NON-NLS-1$
 	public static final String OPTION_TaskPriorities = "org.eclipse.jdt.core.compiler.taskPriorities"; //$NON-NLS-1$
+	public static final String OPTION_TaskCaseSensitive = "org.eclipse.jdt.core.compiler.taskCaseSensitive"; //$NON-NLS-1$
+	public static final String OPTION_InlineJsr = "org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode"; //$NON-NLS-1$
 	
 	// Backward compatibility
 	public static final String OPTION_ReportInvalidAnnotation = "org.eclipse.jdt.core.compiler.problem.invalidAnnotation"; //$NON-NLS-1$
@@ -198,9 +200,8 @@
 	
 	// tags used to recognize tasks in comments
 	public char[][] taskTags = null;
-
-	// priorities of tasks in comments
 	public char[][] taskPriorites = null;
+	public boolean isTaskCaseSensitive = true;
 
 	// deprecation report
 	public boolean reportDeprecationInsideDeprecatedCode = false;
@@ -304,11 +305,12 @@
 		}
 		optionsMap.put(OPTION_TaskTags, this.taskTags == null ? "" : new String(CharOperation.concatWith(this.taskTags,','))); //$NON-NLS-1$
 		optionsMap.put(OPTION_TaskPriorities, this.taskPriorites == null ? "" : new String(CharOperation.concatWith(this.taskPriorites,','))); //$NON-NLS-1$
+		optionsMap.put(OPTION_TaskCaseSensitive, this.isTaskCaseSensitive ? ENABLED : DISABLED);
 		optionsMap.put(OPTION_ReportUnusedParameterWhenImplementingAbstract, this.reportUnusedParameterWhenImplementingAbstract ? ENABLED : DISABLED); 
 		optionsMap.put(OPTION_ReportUnusedParameterWhenOverridingConcrete, this.reportUnusedParameterWhenOverridingConcrete ? ENABLED : DISABLED); 
 		optionsMap.put(OPTION_ReportSpecialParameterHidingField, this.reportSpecialParameterHidingField ? ENABLED : DISABLED); 
 		optionsMap.put(OPTION_MaxProblemPerUnit, String.valueOf(this.maxProblemsPerUnit));
-
+		optionsMap.put(OPTION_InlineJsr, this.inlineJsrBytecode ? ENABLED : DISABLED); 
 		return optionsMap;		
 	}
 	
@@ -475,6 +477,20 @@
 				}
 			}
 		}
+		if ((optionValue = optionsMap.get(OPTION_TaskCaseSensitive)) != null) {
+			if (ENABLED.equals(optionValue)) {
+				this.isTaskCaseSensitive = true;
+			} else if (DISABLED.equals(optionValue)) {
+				this.isTaskCaseSensitive = false;
+			}
+		}
+		if ((optionValue = optionsMap.get(OPTION_InlineJsr)) != null) {
+			if (ENABLED.equals(optionValue)) {
+				this.inlineJsrBytecode = true;
+			} else if (DISABLED.equals(optionValue)) {
+				this.inlineJsrBytecode = false;
+			}
+		}
 		if ((optionValue = optionsMap.get(OPTION_ReportMethodWithConstructorName)) != null) updateSeverity(MethodWithConstructorName, optionValue);
 		if ((optionValue = optionsMap.get(OPTION_ReportOverridingPackageDefaultMethod)) != null) updateSeverity(OverriddenPackageDefaultMethod, optionValue);
 		if ((optionValue = optionsMap.get(OPTION_ReportDeprecation)) != null) updateSeverity(UsingDeprecatedAPI, optionValue);
diff --git a/compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java b/compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java
index d45898d..959e3dc 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java
@@ -79,7 +79,7 @@
 
 	protected AbstractCommentParser(Parser sourceParser) {
 		this.sourceParser = sourceParser;
-		this.scanner = new Scanner(false, false, false, ClassFileConstants.JDK1_3, null, null);
+		this.scanner = new Scanner(false, false, false, ClassFileConstants.JDK1_3, null, null, true/*taskCaseSensitive*/);
 		this.identifierStack = new char[20][];
 		this.identifierPositionStack = new long[20];
 		this.identifierLengthStack = new int[10];
diff --git a/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java b/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java
index 79b794a..3943382 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java
@@ -7511,7 +7511,8 @@
 		this.options.getSeverity(CompilerOptions.NonExternalizedString) != ProblemSeverities.Ignore /*nls*/, 
 		this.options.sourceLevel /*sourceLevel*/, 
 		this.options.taskTags/*taskTags*/,
-		this.options.taskPriorites/*taskPriorities*/);
+		this.options.taskPriorites/*taskPriorities*/,
+		this.options.isTaskCaseSensitive/*taskCaseSensitive*/);
 }
 public final void jumpOverMethodBody() {
 	//on diet parsing.....do not buffer method statements
diff --git a/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java b/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java
index 0b0c16a..00fbd46 100644
--- a/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java
+++ b/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java
@@ -75,6 +75,7 @@
 	public int foundTaskCount = 0;
 	public char[][] taskTags = null;
 	public char[][] taskPriorities = null;
+	public boolean isTaskCaseSensitive = true;
 	
 	//diet parsing support - jump over some method body when requested
 	public boolean diet = false;
@@ -165,7 +166,7 @@
 	public static final int BracketKinds = 3;
 
 public Scanner() {
-	this(false /*comment*/, false /*whitespace*/, false /*nls*/, ClassFileConstants.JDK1_3 /*sourceLevel*/, null/*taskTag*/, null/*taskPriorities*/);
+	this(false /*comment*/, false /*whitespace*/, false /*nls*/, ClassFileConstants.JDK1_3 /*sourceLevel*/, null/*taskTag*/, null/*taskPriorities*/, true /*taskCaseSensitive*/);
 }
 
 public Scanner(
@@ -174,7 +175,8 @@
 	boolean checkNonExternalizedStringLiterals, 
 	long sourceLevel,
 	char[][] taskTags,
-	char[][] taskPriorities) {
+	char[][] taskPriorities,
+	boolean isTaskCaseSensitive) {
 
 	this.eofPosition = Integer.MAX_VALUE;
 	this.tokenizeComments = tokenizeComments;
@@ -183,6 +185,7 @@
 	this.sourceLevel = sourceLevel;
 	this.taskTags = taskTags;
 	this.taskPriorities = taskPriorities;
+	this.isTaskCaseSensitive = isTaskCaseSensitive;
 }
 
 public  final boolean atEnd() {
@@ -227,8 +230,12 @@
 			}
 
 			for (int t = 0; t < tagLength; t++) {
-				if (src[i + t] != tag[t])
-					continue nextTag;
+				char sc, tc;
+				if ((sc = src[i + t]) != (tc = tag[t])) { 																					// case sensitive check
+					if (this.isTaskCaseSensitive || (Character.toLowerCase(sc) != Character.toLowerCase(tc))) { 	// case insensitive check
+						continue nextTag;
+					}
+				}
 			}
 			// ensure tag is not followed with letter if tag finishes with a letter
 			if (i+tagLength < commentEnd && Character.isJavaIdentifierPart(src[i+tagLength-1])) {
diff --git a/dom/org/eclipse/jdt/core/dom/AST.java b/dom/org/eclipse/jdt/core/dom/AST.java
index 1f5fac3..959afea 100644
--- a/dom/org/eclipse/jdt/core/dom/AST.java
+++ b/dom/org/eclipse/jdt/core/dom/AST.java
@@ -188,7 +188,8 @@
 				false /*nls*/, 
 				ClassFileConstants.JDK1_3 /*sourceLevel*/, 
 				null/*taskTag*/, 
-				null/*taskPriorities*/);
+				null/*taskPriorities*/,
+				true/*taskCaseSensitive*/);
 	}
 
 	/**
@@ -268,7 +269,8 @@
 				false /*nls*/, 
 				ClassFileConstants.JDK1_4 /*sourceLevel*/, 
 				null/*taskTag*/, 
-				null/*taskPriorities*/);
+				null/*taskPriorities*/,
+				true/*taskCaseSensitive*/);
 		}
 	}
 		
diff --git a/dom/org/eclipse/jdt/core/dom/ASTConverter.java b/dom/org/eclipse/jdt/core/dom/ASTConverter.java
index 7a292dd..67d88ae 100644
--- a/dom/org/eclipse/jdt/core/dom/ASTConverter.java
+++ b/dom/org/eclipse/jdt/core/dom/ASTConverter.java
@@ -55,7 +55,8 @@
 					false /*nls*/,
 					JavaCore.VERSION_1_4.equals(options.get(JavaCore.COMPILER_SOURCE)) ? ClassFileConstants.JDK1_4 : ClassFileConstants.JDK1_3 /*sourceLevel*/, 
 					null /*taskTags*/,
-					null/*taskPriorities*/);
+					null/*taskPriorities*/,
+					true/*taskCaseSensitive*/);
 		this.monitor = monitor;
 		this.insideComments = JavaCore.ENABLED.equals(options.get(JavaCore.COMPILER_DOC_COMMENT_SUPPORT));
 	}
diff --git a/dom/org/eclipse/jdt/core/dom/ASTConverter2.java b/dom/org/eclipse/jdt/core/dom/ASTConverter2.java
index 8a46fae..0218bda 100644
--- a/dom/org/eclipse/jdt/core/dom/ASTConverter2.java
+++ b/dom/org/eclipse/jdt/core/dom/ASTConverter2.java
@@ -55,7 +55,8 @@
 					false /*nls*/,
 					JavaCore.VERSION_1_4.equals(options.get(JavaCore.COMPILER_SOURCE)) ? ClassFileConstants.JDK1_4 : ClassFileConstants.JDK1_3 /*sourceLevel*/, 
 					null /*taskTags*/,
-					null/*taskPriorities*/);
+					null/*taskPriorities*/,
+					true/*taskCaseSensitive*/);
 		this.monitor = monitor;
 		this.insideComments = JavaCore.ENABLED.equals(options.get(JavaCore.COMPILER_DOC_COMMENT_SUPPORT));
 	}
diff --git a/dom/org/eclipse/jdt/core/dom/NaiveASTFlattener.java b/dom/org/eclipse/jdt/core/dom/NaiveASTFlattener.java
index 3341d0d..f5a0c9b 100644
--- a/dom/org/eclipse/jdt/core/dom/NaiveASTFlattener.java
+++ b/dom/org/eclipse/jdt/core/dom/NaiveASTFlattener.java
@@ -887,9 +887,7 @@
 		this.buffer.append("(");//$NON-NLS-1$
 		for (Iterator it = node.values().iterator(); it.hasNext(); ) {
 			MemberValuePair p = (MemberValuePair) it.next();
-			p.getName().accept(this);
-			this.buffer.append("=");//$NON-NLS-1$
-			p.getValue().accept(this);
+			p.accept(this);
 			if (it.hasNext()) {
 				this.buffer.append(",");//$NON-NLS-1$
 			}
@@ -1359,89 +1357,6 @@
 	}
 
 	/*
-	 * @see ASTVisitor#visit(TypeDeclaration)
-	 */
-	public boolean visito(TypeDeclaration node) {
-		if (node.getJavadoc() != null) {
-			node.getJavadoc().accept(this);
-		}
-		if (node.getAST().apiLevel() == AST.LEVEL_2_0) {
-			printModifiers(node.getModifiers());
-			this.buffer.append(node.isInterface() ? "interface " : "class ");//$NON-NLS-2$//$NON-NLS-1$
-			node.getName().accept(this);
-			this.buffer.append(" ");//$NON-NLS-1$
-			if (node.getSuperclass() != null) {
-				this.buffer.append("extends ");//$NON-NLS-1$
-				node.getSuperclass().accept(this);
-				this.buffer.append(" ");//$NON-NLS-1$
-			}
-			if (!node.superInterfaces().isEmpty()) {
-				this.buffer.append(node.isInterface() ? "extends " : "implements ");//$NON-NLS-2$//$NON-NLS-1$
-				for (Iterator it = node.superInterfaces().iterator(); it.hasNext(); ) {
-					Name n = (Name) it.next();
-					n.accept(this);
-					if (it.hasNext()) {
-						this.buffer.append(", ");//$NON-NLS-1$
-					}
-				}
-				this.buffer.append(" ");//$NON-NLS-1$
-			}
-		}
-		if (node.getAST().apiLevel() >= AST.LEVEL_3_0) {
-			printModifiers(node.modifiers());
-			this.buffer.append(node.isInterface() ? "interface " : "class ");//$NON-NLS-2$//$NON-NLS-1$
-			node.getName().accept(this);
-			if (!node.typeParameters().isEmpty()) {
-				this.buffer.append("<");//$NON-NLS-1$
-				for (Iterator it = node.typeParameters().iterator(); it.hasNext(); ) {
-					TypeParameter t = (TypeParameter) it.next();
-					t.accept(this);
-					if (it.hasNext()) {
-						this.buffer.append(",");//$NON-NLS-1$
-					}
-				}
-				this.buffer.append(">");//$NON-NLS-1$
-			}
-			this.buffer.append(" ");//$NON-NLS-1$
-			if (node.getSuperclassType() != null) {
-				this.buffer.append("extends ");//$NON-NLS-1$
-				node.getSuperclassType().accept(this);
-				this.buffer.append(" ");//$NON-NLS-1$
-			}
-			if (!node.superInterfaceTypes().isEmpty()) {
-				this.buffer.append(node.isInterface() ? "extends " : "implements ");//$NON-NLS-2$//$NON-NLS-1$
-				for (Iterator it = node.superInterfaceTypes().iterator(); it.hasNext(); ) {
-					Type t = (Type) it.next();
-					t.accept(this);
-					if (it.hasNext()) {
-						this.buffer.append(", ");//$NON-NLS-1$
-					}
-				}
-				this.buffer.append(" ");//$NON-NLS-1$
-			}
-		}
-		this.buffer.append("{");//$NON-NLS-1$
-		BodyDeclaration prev = null;
-		for (Iterator it = node.bodyDeclarations().iterator(); it.hasNext(); ) {
-			BodyDeclaration d = (BodyDeclaration) it.next();
-			if (prev instanceof EnumConstantDeclaration) {
-				// enum constant declarations do not include punctuation
-				if (d instanceof EnumConstantDeclaration) {
-					// enum constant declarations are separated by commas
-					this.buffer.append(", ");//$NON-NLS-1$
-				} else {
-					// semicolon separates last enum constant declaration from 
-					// first class body declarations
-					this.buffer.append("; ");//$NON-NLS-1$
-				}
-			}
-			d.accept(this);
-		}
-		this.buffer.append("}");//$NON-NLS-1$
-		return false;
-	}
-
-	/*
 	 * @see ASTVisitor#visit(TypeDeclarationStatement)
 	 */
 	public boolean visit(TypeDeclarationStatement node) {
diff --git a/formatter/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor.java b/formatter/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor.java
index ed23478..77d556d 100644
--- a/formatter/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor.java
+++ b/formatter/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor.java
@@ -158,12 +158,12 @@
 		if (settings != null) {
 			Object assertModeSetting = settings.get(JavaCore.COMPILER_SOURCE);
 			if (assertModeSetting != null) {
-				this.localScanner = new Scanner(true, false, false/*nls*/, JavaCore.VERSION_1_4.equals(assertModeSetting) ? ClassFileConstants.JDK1_4 : ClassFileConstants.JDK1_3/*sourceLevel*/, null/*taskTags*/, null/*taskPriorities*/);
+				this.localScanner = new Scanner(true, false, false/*nls*/, JavaCore.VERSION_1_4.equals(assertModeSetting) ? ClassFileConstants.JDK1_4 : ClassFileConstants.JDK1_3/*sourceLevel*/, null/*taskTags*/, null/*taskPriorities*/, true/*taskCaseSensitive*/);
 			} else {
-				this.localScanner = new Scanner(true, false, false/*nls*/, ClassFileConstants.JDK1_3/*sourceLevel*/, null/*taskTags*/, null/*taskPriorities*/);
+				this.localScanner = new Scanner(true, false, false/*nls*/, ClassFileConstants.JDK1_3/*sourceLevel*/, null/*taskTags*/, null/*taskPriorities*/, true/*taskCaseSensitive*/);
 			}
 		} else {
-			this.localScanner = new Scanner(true, false, false/*nls*/, ClassFileConstants.JDK1_3/*sourceLevel*/, null/*taskTags*/, null/*taskPriorities*/);
+			this.localScanner = new Scanner(true, false, false/*nls*/, ClassFileConstants.JDK1_3/*sourceLevel*/, null/*taskTags*/, null/*taskPriorities*/, true/*taskCaseSensitive*/);
 		}
 		
 		this.preferences = preferences;
diff --git a/formatter/org/eclipse/jdt/internal/formatter/Scribe.java b/formatter/org/eclipse/jdt/internal/formatter/Scribe.java
index 751770c..ad70771 100644
--- a/formatter/org/eclipse/jdt/internal/formatter/Scribe.java
+++ b/formatter/org/eclipse/jdt/internal/formatter/Scribe.java
@@ -72,12 +72,12 @@
 		if (settings != null) {
 			Object assertModeSetting = settings.get(JavaCore.COMPILER_SOURCE);
 			if (assertModeSetting != null) {
-				this.scanner = new Scanner(true, true, false/*nls*/, JavaCore.VERSION_1_4.equals(assertModeSetting) ? ClassFileConstants.JDK1_4 : ClassFileConstants.JDK1_3/*sourceLevel*/, null/*taskTags*/, null/*taskPriorities*/);
+				this.scanner = new Scanner(true, true, false/*nls*/, JavaCore.VERSION_1_4.equals(assertModeSetting) ? ClassFileConstants.JDK1_4 : ClassFileConstants.JDK1_3/*sourceLevel*/, null/*taskTags*/, null/*taskPriorities*/, true/*taskCaseSensitive*/);
 			} else {
-				this.scanner = new Scanner(true, true, false/*nls*/, ClassFileConstants.JDK1_3/*sourceLevel*/, null/*taskTags*/, null/*taskPriorities*/);
+				this.scanner = new Scanner(true, true, false/*nls*/, ClassFileConstants.JDK1_3/*sourceLevel*/, null/*taskTags*/, null/*taskPriorities*/, true/*taskCaseSensitive*/);
 			}
 		} else {
-			this.scanner = new Scanner(true, true, false/*nls*/, ClassFileConstants.JDK1_3/*sourceLevel*/, null/*taskTags*/, null/*taskPriorities*/);
+			this.scanner = new Scanner(true, true, false/*nls*/, ClassFileConstants.JDK1_3/*sourceLevel*/, null/*taskTags*/, null/*taskPriorities*/, true/*taskCaseSensitive*/);
 		}
 		this.formatter = formatter;
 		this.pageWidth = formatter.preferences.page_width;
diff --git a/model/org/eclipse/jdt/core/JavaCore.java b/model/org/eclipse/jdt/core/JavaCore.java
index 8fe0fd0..b6a8112 100644
--- a/model/org/eclipse/jdt/core/JavaCore.java
+++ b/model/org/eclipse/jdt/core/JavaCore.java
@@ -462,6 +462,12 @@
 	/**
 	 * Possible  configurable option ID.
 	 * @see #getDefaultOptions()
+	 * @since 3.0
+	 */
+	public static final String COMPILER_TASK_CASE_SENSITIVE = PLUGIN_ID + ".compiler.taskCaseSensitive"; //$NON-NLS-1$	
+	/**
+	 * Possible  configurable option ID.
+	 * @see #getDefaultOptions()
 	 */
 	public static final String CORE_JAVA_BUILD_ORDER = PLUGIN_ID + ".computeJavaBuildOrder"; //$NON-NLS-1$
 	/**
@@ -526,15 +532,27 @@
 	public static final String CORE_ENABLE_CLASSPATH_MULTIPLE_OUTPUT_LOCATIONS = PLUGIN_ID + ".classpath.multipleOutputLocations"; //$NON-NLS-1$
 	/**
 	 * Default task tag
+	 * @deprecated - should use #DEFAULT_TASK_TAGS instead 
 	 * @since 2.1
 	 */
 	public static final String DEFAULT_TASK_TAG = "TODO"; //$NON-NLS-1$
 	/**
 	 * Default task priority
+	 * @deprecated - should use #DEFAULT_TASK_PRIORITIES instead 
 	 * @since 2.1
 	 */
 	public static final String DEFAULT_TASK_PRIORITY = "NORMAL"; //$NON-NLS-1$
 	/**
+	 * Default task tag
+	 * @since 3.0
+	 */
+	public static final String DEFAULT_TASK_TAGS = "TODO,FIXME,XXX"; //$NON-NLS-1$
+	/**
+	 * Default task priority
+	 * @since 3.0
+	 */
+	public static final String DEFAULT_TASK_PRIORITIES = "NORMAL,HIGH,NORMAL"; //$NON-NLS-1$
+	/**
 	 * Possible  configurable option ID.
 	 * @see #getDefaultOptions()
 	 * @since 2.0
@@ -1754,7 +1772,7 @@
 	 *    be detected either for tag "ToDo" or "ToDo:").
 	 *     - option id:         "org.eclipse.jdt.core.compiler.taskTags"
 	 *     - possible values:   { "&lt;tag&gt;[,&lt;tag&gt;]*" } where &lt;tag&gt; is a String without any wild-card or leading/trailing spaces 
-	 *     - default:           ""
+	 *     - default:           "TODO,FIXME,XXX"
 	 * 
 	 * COMPILER / Define the Automatic Task Priorities
 	 *    In parallel with the Automatic Task Tags, this list defines the priorities (high, normal or low)
@@ -1762,7 +1780,13 @@
 	 *    If the default is specified, the priority of each task marker is "NORMAL".
 	 *     - option id:         "org.eclipse.jdt.core.compiler.taskPriorities"
 	 *     - possible values:   { "&lt;priority&gt;[,&lt;priority&gt;]*" } where &lt;priority&gt; is one of "HIGH", "NORMAL" or "LOW"
-	 *     - default:           ""
+	 *     - default:           "NORMAL,HIGH,NORMAL"
+	 * 
+	 * COMPILER / Determine whether task tags are case-sensitive
+	 *    When enabled, task tags are considered in a case-sensitive way.
+	 *     - option id:         "org.eclipse.jdt.core.compiler.taskCaseSensitive"
+	 *     - possible values:   { "enabled", "disabled" }
+	 *     - default:           "enabled"
 	 *
 	 * BUILDER / Specifying Filters for Resource Copying Control
 	 *    Allow to specify some filters to control the resource copy process.
@@ -2305,8 +2329,9 @@
 		// override some compiler defaults
 		preferences.setDefault(COMPILER_LOCAL_VARIABLE_ATTR, GENERATE);
 		preferences.setDefault(COMPILER_CODEGEN_UNUSED_LOCAL, PRESERVE);
-		preferences.setDefault(COMPILER_TASK_TAGS, DEFAULT_TASK_TAG);
-		preferences.setDefault(COMPILER_TASK_PRIORITIES, DEFAULT_TASK_PRIORITY);
+		preferences.setDefault(COMPILER_TASK_TAGS, DEFAULT_TASK_TAGS);
+		preferences.setDefault(COMPILER_TASK_PRIORITIES, DEFAULT_TASK_PRIORITIES);
+		preferences.setDefault(COMPILER_TASK_CASE_SENSITIVE, ENABLED);
 		preferences.setDefault(COMPILER_DOC_COMMENT_SUPPORT, ENABLED);
 
 		// Builder settings
diff --git a/model/org/eclipse/jdt/core/ToolFactory.java b/model/org/eclipse/jdt/core/ToolFactory.java
index 0e805f2..761454e 100644
--- a/model/org/eclipse/jdt/core/ToolFactory.java
+++ b/model/org/eclipse/jdt/core/ToolFactory.java
@@ -288,7 +288,7 @@
 	 */
 	public static IScanner createScanner(boolean tokenizeComments, boolean tokenizeWhiteSpace, boolean assertMode, boolean recordLineSeparator){
 
-		PublicScanner scanner = new PublicScanner(tokenizeComments, tokenizeWhiteSpace, false/*nls*/, assertMode ? ClassFileConstants.JDK1_4 : ClassFileConstants.JDK1_3/*sourceLevel*/, null/*taskTags*/, null/*taskPriorities*/);
+		PublicScanner scanner = new PublicScanner(tokenizeComments, tokenizeWhiteSpace, false/*nls*/, assertMode ? ClassFileConstants.JDK1_4 : ClassFileConstants.JDK1_3/*sourceLevel*/, null/*taskTags*/, null/*taskPriorities*/, true/*taskCaseSensitive*/);
 		scanner.recordLineSeparator = recordLineSeparator;
 		return scanner;
 	}
@@ -331,7 +331,7 @@
 		PublicScanner scanner = null;
 		long level = CompilerOptions.versionToJdkLevel(sourceLevel);
 		if (level == 0) level = ClassFileConstants.JDK1_3; // fault-tolerance
-		scanner = new PublicScanner(tokenizeComments, tokenizeWhiteSpace, false/*nls*/,level /*sourceLevel*/, null/*taskTags*/, null/*taskPriorities*/);
+		scanner = new PublicScanner(tokenizeComments, tokenizeWhiteSpace, false/*nls*/,level /*sourceLevel*/, null/*taskTags*/, null/*taskPriorities*/, true/*taskCaseSensitive*/);
 		scanner.recordLineSeparator = recordLineSeparator;
 		return scanner;
 	}	
diff --git a/compiler/org/eclipse/jdt/internal/compiler/DocumentElementParser.java b/model/org/eclipse/jdt/internal/compiler/DocumentElementParser.java
similarity index 100%
rename from compiler/org/eclipse/jdt/internal/compiler/DocumentElementParser.java
rename to model/org/eclipse/jdt/internal/compiler/DocumentElementParser.java
diff --git a/compiler/org/eclipse/jdt/internal/compiler/IDocumentElementRequestor.java b/model/org/eclipse/jdt/internal/compiler/IDocumentElementRequestor.java
similarity index 100%
rename from compiler/org/eclipse/jdt/internal/compiler/IDocumentElementRequestor.java
rename to model/org/eclipse/jdt/internal/compiler/IDocumentElementRequestor.java
diff --git a/compiler/org/eclipse/jdt/internal/compiler/ISourceElementRequestor.java b/model/org/eclipse/jdt/internal/compiler/ISourceElementRequestor.java
similarity index 100%
rename from compiler/org/eclipse/jdt/internal/compiler/ISourceElementRequestor.java
rename to model/org/eclipse/jdt/internal/compiler/ISourceElementRequestor.java
diff --git a/compiler/org/eclipse/jdt/internal/compiler/SourceElementParser.java b/model/org/eclipse/jdt/internal/compiler/SourceElementParser.java
similarity index 100%
rename from compiler/org/eclipse/jdt/internal/compiler/SourceElementParser.java
rename to model/org/eclipse/jdt/internal/compiler/SourceElementParser.java
diff --git a/compiler/org/eclipse/jdt/internal/compiler/SourceElementRequestorAdapter.java b/model/org/eclipse/jdt/internal/compiler/SourceElementRequestorAdapter.java
similarity index 100%
rename from compiler/org/eclipse/jdt/internal/compiler/SourceElementRequestorAdapter.java
rename to model/org/eclipse/jdt/internal/compiler/SourceElementRequestorAdapter.java
diff --git a/compiler/org/eclipse/jdt/internal/compiler/parser/SourceConstructorDeclaration.java b/model/org/eclipse/jdt/internal/compiler/parser/SourceConstructorDeclaration.java
similarity index 100%
rename from compiler/org/eclipse/jdt/internal/compiler/parser/SourceConstructorDeclaration.java
rename to model/org/eclipse/jdt/internal/compiler/parser/SourceConstructorDeclaration.java
diff --git a/compiler/org/eclipse/jdt/internal/compiler/parser/SourceFieldDeclaration.java b/model/org/eclipse/jdt/internal/compiler/parser/SourceFieldDeclaration.java
similarity index 100%
rename from compiler/org/eclipse/jdt/internal/compiler/parser/SourceFieldDeclaration.java
rename to model/org/eclipse/jdt/internal/compiler/parser/SourceFieldDeclaration.java
diff --git a/compiler/org/eclipse/jdt/internal/compiler/parser/SourceMethodDeclaration.java b/model/org/eclipse/jdt/internal/compiler/parser/SourceMethodDeclaration.java
similarity index 100%
rename from compiler/org/eclipse/jdt/internal/compiler/parser/SourceMethodDeclaration.java
rename to model/org/eclipse/jdt/internal/compiler/parser/SourceMethodDeclaration.java
diff --git a/compiler/org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter.java b/model/org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter.java
similarity index 100%
rename from compiler/org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter.java
rename to model/org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter.java
diff --git a/model/org/eclipse/jdt/internal/core/InternalNamingConventions.java b/model/org/eclipse/jdt/internal/core/InternalNamingConventions.java
index 8bf92cb..cf4c8fc 100644
--- a/model/org/eclipse/jdt/internal/core/InternalNamingConventions.java
+++ b/model/org/eclipse/jdt/internal/core/InternalNamingConventions.java
@@ -33,7 +33,8 @@
 				false /*nls*/, 
 				compilerOptions.sourceLevel /*sourceLevel*/, 
 				null /*taskTags*/, 
-				null/*taskPriorities*/);
+				null/*taskPriorities*/,
+				true/*taskCaseSensitive*/);
 	}
 	public static void suggestArgumentNames(IJavaProject javaProject, char[] packageName, char[] qualifiedTypeName, int dim, char[][] excludedNames, INamingRequestor requestor) {
 		Map options = javaProject.getOptions(true);
diff --git a/model/org/eclipse/jdt/internal/core/SortElementBuilder.java b/model/org/eclipse/jdt/internal/core/SortElementBuilder.java
index bae0284..33d9157 100644
--- a/model/org/eclipse/jdt/internal/core/SortElementBuilder.java
+++ b/model/org/eclipse/jdt/internal/core/SortElementBuilder.java
@@ -931,7 +931,7 @@
 		this.source = source;
 		this.comparator = comparator;
 		this.positionsToMap = positionsToMap;
-		this.scanner = new Scanner(false, false, false, ClassFileConstants.JDK1_3/*sourceLevel*/, null, null);
+		this.scanner = new Scanner(false, false, false, ClassFileConstants.JDK1_3/*sourceLevel*/, null, null, true/*taskCaseSensitive*/);
 		this.ast = new AST();
 	}
 	
diff --git a/model/org/eclipse/jdt/internal/core/util/CommentRecorderParser.java b/model/org/eclipse/jdt/internal/core/util/CommentRecorderParser.java
index 6199584..b1a37c0 100644
--- a/model/org/eclipse/jdt/internal/core/util/CommentRecorderParser.java
+++ b/model/org/eclipse/jdt/internal/core/util/CommentRecorderParser.java
@@ -221,7 +221,8 @@
 				this.options.getSeverity(CompilerOptions.NonExternalizedString) != ProblemSeverities.Ignore /*nls*/, 
 				this.options.sourceLevel /*sourceLevel*/, 
 				this.options.taskTags/*taskTags*/,
-				this.options.taskPriorites/*taskPriorities*/);
+				this.options.taskPriorites/*taskPriorities*/,
+				this.options.isTaskCaseSensitive/*taskCaseSensitive*/);
 	}
 
 	/*
diff --git a/model/org/eclipse/jdt/internal/core/util/CommentRecorderScanner.java b/model/org/eclipse/jdt/internal/core/util/CommentRecorderScanner.java
index 828dd43..9c20bef 100644
--- a/model/org/eclipse/jdt/internal/core/util/CommentRecorderScanner.java
+++ b/model/org/eclipse/jdt/internal/core/util/CommentRecorderScanner.java
@@ -25,8 +25,9 @@
 		boolean checkNonExternalizedStringLiterals,
 		long sourceLevel,
 		char[][] taskTags,
-		char[][] taskPriorities) {
-		super(tokenizeComments, tokenizeWhiteSpace, checkNonExternalizedStringLiterals, sourceLevel, taskTags, taskPriorities);
+		char[][] taskPriorities,
+		boolean isTaskCaseSensitive) {
+		super(tokenizeComments, tokenizeWhiteSpace, checkNonExternalizedStringLiterals, sourceLevel, taskTags, taskPriorities, isTaskCaseSensitive);
 	}
 	
 	/**
diff --git a/model/org/eclipse/jdt/internal/core/util/PublicScanner.java b/model/org/eclipse/jdt/internal/core/util/PublicScanner.java
index 63bce13..e32148f 100644
--- a/model/org/eclipse/jdt/internal/core/util/PublicScanner.java
+++ b/model/org/eclipse/jdt/internal/core/util/PublicScanner.java
@@ -72,6 +72,7 @@
 	public int foundTaskCount = 0;
 	public char[][] taskTags = null;
 	public char[][] taskPriorities = null;
+	public boolean isTaskCaseSensitive = true;
 	
 	//diet parsing support - jump over some method body when requested
 	public boolean diet = false;
@@ -162,7 +163,7 @@
 	public static final int BracketKinds = 3;
 
 public PublicScanner() {
-	this(false /*comment*/, false /*whitespace*/, false /*nls*/, ClassFileConstants.JDK1_3 /*sourceLevel*/, null/*taskTag*/, null/*taskPriorities*/);
+	this(false /*comment*/, false /*whitespace*/, false /*nls*/, ClassFileConstants.JDK1_3 /*sourceLevel*/, null/*taskTag*/, null/*taskPriorities*/, true /*taskCaseSensitive*/);
 }
 
 public PublicScanner(
@@ -171,7 +172,8 @@
 	boolean checkNonExternalizedStringLiterals, 
 	long sourceLevel,
 	char[][] taskTags,
-	char[][] taskPriorities) {
+	char[][] taskPriorities,
+	boolean isTaskCaseSensitive) {
 
 	this.eofPosition = Integer.MAX_VALUE;
 	this.tokenizeComments = tokenizeComments;
@@ -180,6 +182,7 @@
 	this.assertMode = sourceLevel >= ClassFileConstants.JDK1_4;
 	this.taskTags = taskTags;
 	this.taskPriorities = taskPriorities;
+	this.isTaskCaseSensitive = isTaskCaseSensitive;
 }
 
 public  final boolean atEnd() {
@@ -224,8 +227,12 @@
 			}
 
 			for (int t = 0; t < tagLength; t++) {
-				if (src[i + t] != tag[t])
-					continue nextTag;
+				char sc, tc;
+				if ((sc = src[i + t]) != (tc = tag[t])) { 																					// case sensitive check
+					if (this.isTaskCaseSensitive || (Character.toLowerCase(sc) != Character.toLowerCase(tc))) { 	// case insensitive check
+						continue nextTag;
+					}
+				}
 			}
 			// ensure tag is not followed with letter if tag finishes with a letter
 			if (i+tagLength < commentEnd && Character.isJavaIdentifierPart(src[i+tagLength-1])) {
diff --git a/search/org/eclipse/jdt/core/search/SearchPattern.java b/search/org/eclipse/jdt/core/search/SearchPattern.java
index 08e2df1..e0f8733 100644
--- a/search/org/eclipse/jdt/core/search/SearchPattern.java
+++ b/search/org/eclipse/jdt/core/search/SearchPattern.java
@@ -76,7 +76,7 @@
 	
 		int matchRule = isCaseSensitive ? matchMode | R_CASE_SENSITIVE : matchMode;
 		
-		Scanner scanner = new Scanner(false /*comment*/, true /*whitespace*/, false /*nls*/, ClassFileConstants.JDK1_3/*sourceLevel*/, null /*taskTags*/, null/*taskPriorities*/);
+		Scanner scanner = new Scanner(false /*comment*/, true /*whitespace*/, false /*nls*/, ClassFileConstants.JDK1_3/*sourceLevel*/, null /*taskTags*/, null/*taskPriorities*/, true/*taskCaseSensitive*/);
 		scanner.setSource(patternString.toCharArray());
 		final int InsideName = 1;
 		final int InsideParameter = 2;
@@ -230,7 +230,7 @@
 		
 		int matchRule = isCaseSensitive ? matchMode | R_CASE_SENSITIVE : matchMode;
 	
-		Scanner scanner = new Scanner(false /*comment*/, true /*whitespace*/, false /*nls*/, ClassFileConstants.JDK1_3/*sourceLevel*/, null /*taskTags*/, null/*taskPriorities*/); 
+		Scanner scanner = new Scanner(false /*comment*/, true /*whitespace*/, false /*nls*/, ClassFileConstants.JDK1_3/*sourceLevel*/, null /*taskTags*/, null/*taskPriorities*/, true/*taskCaseSensitive*/); 
 		scanner.setSource(patternString.toCharArray());
 		final int InsideDeclaringPart = 1;
 		final int InsideType = 2;
@@ -403,7 +403,7 @@
 		
 		int matchRule = isCaseSensitive ? matchMode | R_CASE_SENSITIVE : matchMode;
 	
-		Scanner scanner = new Scanner(false /*comment*/, true /*whitespace*/, false /*nls*/, ClassFileConstants.JDK1_3/*sourceLevel*/, null /*taskTags*/, null/*taskPriorities*/); 
+		Scanner scanner = new Scanner(false /*comment*/, true /*whitespace*/, false /*nls*/, ClassFileConstants.JDK1_3/*sourceLevel*/, null /*taskTags*/, null/*taskPriorities*/, true/*taskCaseSensitive*/); 
 		scanner.setSource(patternString.toCharArray());
 		final int InsideSelector = 1;
 		final int InsideParameter = 2;
@@ -1009,7 +1009,7 @@
 		
 		int matchRule = isCaseSensitive ? matchMode | R_CASE_SENSITIVE : matchMode;
 	
-		Scanner scanner = new Scanner(false /*comment*/, true /*whitespace*/, false /*nls*/, ClassFileConstants.JDK1_3/*sourceLevel*/, null /*taskTags*/, null/*taskPriorities*/); 
+		Scanner scanner = new Scanner(false /*comment*/, true /*whitespace*/, false /*nls*/, ClassFileConstants.JDK1_3/*sourceLevel*/, null /*taskTags*/, null/*taskPriorities*/, true/*taskCaseSensitive*/); 
 		scanner.setSource(patternString.toCharArray());
 		String type = null;
 		int token;
diff --git a/search/org/eclipse/jdt/internal/core/index/DiskIndex.java b/search/org/eclipse/jdt/internal/core/index/DiskIndex.java
index 60ca390..e037d14 100644
--- a/search/org/eclipse/jdt/internal/core/index/DiskIndex.java
+++ b/search/org/eclipse/jdt/internal/core/index/DiskIndex.java
@@ -81,8 +81,8 @@
 }
 SimpleSet addDocumentNames(String substring, MemoryIndex memoryIndex) throws IOException {
 	// must skip over documents which have been added/changed/deleted in the memory index
-	SimpleSet results = new SimpleSet();
 	String[] docNames = readAllDocumentNames();
+	SimpleSet results = new SimpleSet(docNames.length);
 	if (substring == null) {
 		if (memoryIndex == null) {
 			for (int i = 0, l = docNames.length; i < l; i++)
diff --git a/search/org/eclipse/jdt/internal/core/index/EntryResult.java b/search/org/eclipse/jdt/internal/core/index/EntryResult.java
index d783953..2d271f7 100644
--- a/search/org/eclipse/jdt/internal/core/index/EntryResult.java
+++ b/search/org/eclipse/jdt/internal/core/index/EntryResult.java
@@ -26,7 +26,7 @@
 }
 public void addDocumentName(String documentName) {
 	if (this.documentNames == null)
-		this.documentNames = new SimpleSet();
+		this.documentNames = new SimpleSet(3);
 	this.documentNames.add(documentName);
 }
 public void addDocumentTable(HashtableOfObject table) {
diff --git a/search/org/eclipse/jdt/internal/core/search/matching/AndPattern.java b/search/org/eclipse/jdt/internal/core/search/matching/AndPattern.java
index 0ecded0..992cbb8 100644
--- a/search/org/eclipse/jdt/internal/core/search/matching/AndPattern.java
+++ b/search/org/eclipse/jdt/internal/core/search/matching/AndPattern.java
@@ -40,7 +40,7 @@
 			if (entries == null) return;
 
 			SearchPattern decodedResult = pattern.getBlankPattern();
-			SimpleSet newIntersectedNames = new SimpleSet();
+			SimpleSet newIntersectedNames = new SimpleSet(3);
 			for (int i = 0, l = entries.length; i < l; i++) {
 				if (progressMonitor != null && progressMonitor.isCanceled()) throw new OperationCanceledException();
 
diff --git a/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java b/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java
index 1baff44..7faab24 100644
--- a/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java
+++ b/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java
@@ -1246,7 +1246,7 @@
 				nodeSet.addMatch(node, this.patternLocator.resolveLevel(node));
 			}
 		}
-		nodeSet.possibleMatchingNodesSet = new SimpleSet();
+		nodeSet.possibleMatchingNodesSet = new SimpleSet(3);
 	}
 
 	if (nodeSet.matchingNodes.elementSize == 0) return; // no matching nodes were found
diff --git a/search/org/eclipse/jdt/internal/core/search/matching/PackageReferenceLocator.java b/search/org/eclipse/jdt/internal/core/search/matching/PackageReferenceLocator.java
index 04137ee..6909d10 100644
--- a/search/org/eclipse/jdt/internal/core/search/matching/PackageReferenceLocator.java
+++ b/search/org/eclipse/jdt/internal/core/search/matching/PackageReferenceLocator.java
@@ -26,14 +26,9 @@
 public class PackageReferenceLocator extends PatternLocator {
 
 protected PackageReferencePattern pattern;
-	
-public PackageReferenceLocator(PackageReferencePattern pattern) {
-	super(pattern);
 
-	this.pattern = pattern;
-}
 // check that referenced type is actually defined in this package fragment
-public boolean isDeclaringPackageFragment(IPackageFragment packageFragment, ReferenceBinding typeBinding) {
+public static boolean isDeclaringPackageFragment(IPackageFragment packageFragment, ReferenceBinding typeBinding) {
 	char[] fileName = typeBinding.getFileName();
 	if (fileName != null) {
 		// retrieve the actual file name from the full path (sources are generally only containing it already)
@@ -64,6 +59,12 @@
 	}
 	return true; // by default, do not eliminate 
 }
+
+public PackageReferenceLocator(PackageReferencePattern pattern) {
+	super(pattern);
+
+	this.pattern = pattern;
+}
 public int match(ASTNode node, MatchingNodeSet nodeSet) { // interested in ImportReference
 	if (!(node instanceof ImportReference)) return IMPOSSIBLE_MATCH;
 
diff --git a/search/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.java b/search/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.java
index 867c6a3..39b3d80 100644
--- a/search/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.java
+++ b/search/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.java
@@ -353,6 +353,13 @@
 	if (typeBinding instanceof ProblemReferenceBinding)
 		typeBinding = ((ProblemReferenceBinding) typeBinding).original;
 
+	if (this.pattern.focus instanceof IType && typeBinding instanceof ReferenceBinding) {
+		IPackageFragment pkg = ((IType) this.pattern.focus).getPackageFragment();
+		// check that type is located inside this instance of a package fragment
+		if (!PackageReferenceLocator.isDeclaringPackageFragment(pkg, (ReferenceBinding) typeBinding))
+			return IMPOSSIBLE_MATCH;
+	}
+
 	return resolveLevelForTypeOrEnclosingTypes(this.pattern.simpleName, this.pattern.qualification, typeBinding);
 }
 protected int resolveLevel(NameReference nameRef) {