View | Details | Raw Unified | Return to bug 195489 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java (+82 lines)
Lines 4701-4706 Link Here
4701
}
4701
}
4702
4702
4703
/**
4703
/**
4704
 * @bug 108053: [search] SearchMatch.isInDocComment useless for SearchEngine.searchDeclarationsOfReferencedTypes
4705
 * @test Verify that the type declaration match is always outside the javadoc and that the workaround described in bug works well
4706
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=108088"
4707
 */
4708
public void testBug108053a() throws CoreException {
4709
	workingCopies = new ICompilationUnit[2];
4710
	workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b108053/Ref.java",
4711
		"package b108053;\n" +
4712
		"public class Ref {\n" +
4713
		"}\n"
4714
	);
4715
	workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b108053/Test.java",
4716
		"package b108053;\n" +
4717
		"/**\n" +
4718
		" * @see Ref\n" +
4719
		" */\n" +
4720
		"public class Test {\n" +
4721
		"	public Ref ref;\n" +
4722
		"	public Ref getRef() {\n" +
4723
		"		return this.ref;\n" +
4724
		"	}\n" +
4725
		"}\n"
4726
	);
4727
	this.resultCollector.showInsideDoc = true;
4728
	new SearchEngine(this.workingCopies).searchDeclarationsOfReferencedTypes(workingCopies[1], this.resultCollector, null);
4729
	assertSearchResults(
4730
		"src/b108053/Ref.java b108053.Ref [Ref] EXACT_MATCH OUTSIDE_JAVADOC"
4731
	);
4732
}
4733
public void testBug108053b() throws CoreException {
4734
	workingCopies = new ICompilationUnit[2];
4735
	workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b108053/Ref.java",
4736
		"package b108053;\n" +
4737
		"public class Ref {\n" +
4738
		"}\n"
4739
	);
4740
	workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b108053/Test.java",
4741
		"package b108053;\n" +
4742
		"public class Test {\n" +
4743
		"	public Ref ref;\n" +
4744
		"	/**\n" +
4745
		"	 * @see Ref\n" +
4746
		"	 */\n" +
4747
		"	public Ref getRef() {\n" +
4748
		"		return this.ref;\n" +
4749
		"	}\n" +
4750
		"}\n"
4751
	);
4752
	this.resultCollector.showInsideDoc = true;
4753
	new SearchEngine(this.workingCopies).searchDeclarationsOfReferencedTypes(workingCopies[1], this.resultCollector, null);
4754
	assertSearchResults(
4755
		"src/b108053/Ref.java b108053.Ref [Ref] EXACT_MATCH OUTSIDE_JAVADOC"
4756
	);
4757
}
4758
public void testBug108053c() throws CoreException {
4759
	workingCopies = new ICompilationUnit[2];
4760
	workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b108053/Ref.java",
4761
		"package b108053;\n" +
4762
		"public class Ref {\n" +
4763
		"}\n"
4764
	);
4765
	workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b108053/Test.java",
4766
		"package b108053;\n" +
4767
		"/**\n" +
4768
		" * @see Ref\n" +
4769
		" */\n" +
4770
		"public class Test {\n" +
4771
		"}\n"
4772
	);
4773
	this.resultCollector.showInsideDoc = true;
4774
	String docCommentSupport = JAVA_PROJECT.getOption(JavaCore.COMPILER_DOC_COMMENT_SUPPORT, true);
4775
	JAVA_PROJECT.setOption(JavaCore.COMPILER_DOC_COMMENT_SUPPORT, JavaCore.DISABLED);
4776
	try {
4777
		new SearchEngine(this.workingCopies).searchDeclarationsOfReferencedTypes(workingCopies[1], this.resultCollector, null);
4778
		assertSearchResults("");
4779
	}
4780
	finally {
4781
		JAVA_PROJECT.setOption(JavaCore.COMPILER_DOC_COMMENT_SUPPORT, docCommentSupport);
4782
	}
4783
}
4784
4785
/**
4704
 * Bug 108088: [search] Inaccurate search match for method invocations with literal arguments
4786
 * Bug 108088: [search] Inaccurate search match for method invocations with literal arguments
4705
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=108088"
4787
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=108088"
4706
 */
4788
 */

Return to bug 195489