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

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java (-193 / +170 lines)
Lines 47-53 Link Here
47
//	org.eclipse.jdt.internal.codeassist.SelectionEngine.DEBUG = true;
47
//	org.eclipse.jdt.internal.codeassist.SelectionEngine.DEBUG = true;
48
//	TESTS_PREFIX =  "testBug110336";
48
//	TESTS_PREFIX =  "testBug110336";
49
//	TESTS_NAMES = new String[] { "testBug120816a" };
49
//	TESTS_NAMES = new String[] { "testBug120816a" };
50
//	TESTS_NUMBERS = new int[] { 122442 };
50
//	TESTS_NUMBERS = new int[] { 124469 };
51
//	TESTS_RANGE = new int[] { 83304, -1 };
51
//	TESTS_RANGE = new int[] { 83304, -1 };
52
	}
52
	}
53
53
Lines 1776-1787 Link Here
1776
		"}\n"
1776
		"}\n"
1777
		);
1777
		);
1778
	IType type = selectType(workingCopies[0], "Class", 3);
1778
	IType type = selectType(workingCopies[0], "Class", 3);
1779
	search(type, REFERENCES, ERASURE_RULE);
1779
	search(type, REFERENCES, ERASURE_RULE, getJavaSearchWorkingCopiesScope());
1780
	assertSearchResults(
1780
	assertSearchResults(
1781
		"src/b83304/Test.java void b83304.Test.foo() [Class] ERASURE_MATCH\n" + 
1781
		"src/b83304/Test.java void b83304.Test.foo() [Class] ERASURE_MATCH\n" + 
1782
		"src/b83304/Test.java void b83304.Test.foo() [Class] ERASURE_MATCH\n" + 
1782
		"src/b83304/Test.java void b83304.Test.foo() [Class] ERASURE_MATCH\n" + 
1783
		"src/b83304/Test.java void b83304.Test.foo() [Class] EXACT_MATCH\n" + 
1783
		"src/b83304/Test.java void b83304.Test.foo() [Class] EXACT_MATCH"
1784
		getExternalJCLPathString("1.5") + " java.lang.Class java.lang.Object.getClass() EQUIVALENT_RAW_MATCH"
1785
	);
1784
	);
1786
}
1785
}
1787
public void testBug83304_TypeParameterizedElementPattern() throws CoreException {
1786
public void testBug83304_TypeParameterizedElementPattern() throws CoreException {
Lines 2836-2895 Link Here
2836
		null,
2835
		null,
2837
		SearchPattern.R_PATTERN_MATCH, // case insensitive
2836
		SearchPattern.R_PATTERN_MATCH, // case insensitive
2838
		TYPE,
2837
		TYPE,
2839
		getJavaSearchScopeBugs(),
2838
		getJavaSearchScopeBugs("b92944", true),
2840
		requestor,
2839
		requestor,
2841
		IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
2840
		IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
2842
		null
2841
		null
2843
	);
2842
	);
2844
	assertSearchResults(
2843
	assertSearchResults(
2845
		"Unexpected all type names",
2844
		"Unexpected all type names",
2846
		"Test\n" + 
2847
		"Test$Inner\n" + 
2848
		"TestPrefix\n" + 
2849
		"b108088.A108088\n" + 
2850
		"b108088.B108088\n" + 
2851
		"b108088.Test108088\n" + 
2852
		"b81556.a.A81556\n" + 
2853
		"b81556.a.B81556\n" + 
2854
		"b81556.a.X81556\n" + 
2855
		"b81556.b.XX81556\n" + 
2856
		"b86380.Annot\n" + 
2857
		"b87627.Collection\n" + 
2858
		"b87627.List\n" + 
2859
		"b89848.Test\n" + 
2860
		"b89848.X\n" + 
2861
		"b92944.B92944\n" + 
2845
		"b92944.B92944\n" + 
2862
		"b92944.B92944_A\n" + 
2846
		"b92944.B92944_A\n" + 
2863
		"b92944.B92944_E\n" + 
2847
		"b92944.B92944_E\n" + 
2864
		"b92944.B92944_I\n" + 
2848
		"b92944.B92944_I",
2865
		"b95794.Test\n" + 
2866
		"b95794.Test$Color\n" + 
2867
		"g1.t.s.def.Generic\n" + 
2868
		"g1.t.s.def.Generic$Member\n" + 
2869
		"g1.t.s.def.Generic$MemberGeneric\n" + 
2870
		"g1.t.s.def.NonGeneric\n" + 
2871
		"g1.t.s.def.NonGeneric$GenericMember\n" + 
2872
		"g5.c.def.Multiple\n" + 
2873
		"g5.c.def.Single\n" + 
2874
		"g5.m.def.Multiple\n" + 
2875
		"g5.m.def.Single\n" + 
2876
		"java.io.Serializable\n" + 
2877
		"java.lang.CharSequence\n" + 
2878
		"java.lang.Class\n" + 
2879
		"java.lang.CloneNotSupportedException\n" + 
2880
		"java.lang.Comparable\n" + 
2881
		"java.lang.Enum\n" + 
2882
		"java.lang.Error\n" + 
2883
		"java.lang.Exception\n" + 
2884
		"java.lang.IllegalMonitorStateException\n" + 
2885
		"java.lang.InterruptedException\n" + 
2886
		"java.lang.Object\n" + 
2887
		"java.lang.RuntimeException\n" + 
2888
		"java.lang.String\n" + 
2889
		"java.lang.Throwable\n" + 
2890
		"java.lang.annotation.Annotation\n" + 
2891
		"pack.age.Test\n" + 
2892
		"pack.age.Test$Member",
2893
		requestor);
2849
		requestor);
2894
}
2850
}
2895
public void testBug92944_CLASS() throws CoreException {
2851
public void testBug92944_CLASS() throws CoreException {
Lines 2903-2909 Link Here
2903
		IIndexConstants.ONE_STAR,
2859
		IIndexConstants.ONE_STAR,
2904
		SearchPattern.R_PATTERN_MATCH, // case insensitive
2860
		SearchPattern.R_PATTERN_MATCH, // case insensitive
2905
		CLASS,
2861
		CLASS,
2906
		getJavaSearchScopeBugs(),
2862
		getJavaSearchWorkingCopiesScope(),
2907
		requestor,
2863
		requestor,
2908
		IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
2864
		IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
2909
		null
2865
		null
Lines 2911-2958 Link Here
2911
	// Remove interface, enum and annotation
2867
	// Remove interface, enum and annotation
2912
	assertSearchResults(
2868
	assertSearchResults(
2913
		"Unexpected all type names",
2869
		"Unexpected all type names",
2914
		"Test\n" + 
2870
		"b92944.B92944",
2915
		"Test$Inner\n" + 
2916
		"TestPrefix\n" + 
2917
		"b108088.A108088\n" + 
2918
		"b108088.B108088\n" + 
2919
		"b108088.Test108088\n" + 
2920
		"b81556.a.A81556\n" + 
2921
		"b81556.a.B81556\n" + 
2922
		"b81556.a.X81556\n" + 
2923
		"b81556.b.XX81556\n" + 
2924
		"b89848.Test\n" + 
2925
		"b89848.X\n" + 
2926
		"b92944.B92944\n" + 
2927
		//"b92944.B92944_A\n" + 
2928
		//"b92944.B92944_E\n" + 
2929
		//"b92944.B92944_I\n" + 
2930
		"b95794.Test\n" + 
2931
		"g1.t.s.def.Generic\n" + 
2932
		"g1.t.s.def.Generic$Member\n" + 
2933
		"g1.t.s.def.Generic$MemberGeneric\n" + 
2934
		"g1.t.s.def.NonGeneric\n" + 
2935
		"g1.t.s.def.NonGeneric$GenericMember\n" + 
2936
		"g5.c.def.Multiple\n" + 
2937
		"g5.c.def.Single\n" + 
2938
		"g5.m.def.Multiple\n" + 
2939
		"g5.m.def.Single\n" + 
2940
		//"java.io.Serializable\n" + 
2941
		"java.lang.Class\n" + 
2942
		"java.lang.CloneNotSupportedException\n" + 
2943
		//"java.lang.Comparable\n" + 
2944
		"java.lang.Enum\n" +  // Enum is not an enum in java.lang
2945
		"java.lang.Error\n" + 
2946
		"java.lang.Exception\n" + 
2947
		"java.lang.IllegalMonitorStateException\n" + 
2948
		"java.lang.InterruptedException\n" + 
2949
		"java.lang.Object\n" + 
2950
		"java.lang.RuntimeException\n" + 
2951
		"java.lang.String\n" + 
2952
		"java.lang.Throwable\n" + 
2953
		//"java.lang.annotation.Annotation\n" +
2954
		"pack.age.Test\n" + 
2955
		"pack.age.Test$Member",
2956
		requestor);
2871
		requestor);
2957
}
2872
}
2958
public void testBug92944_CLASS_AND_INTERFACE() throws CoreException {
2873
public void testBug92944_CLASS_AND_INTERFACE() throws CoreException {
Lines 2966-2972 Link Here
2966
		null,
2881
		null,
2967
		SearchPattern.R_PATTERN_MATCH, // case insensitive
2882
		SearchPattern.R_PATTERN_MATCH, // case insensitive
2968
		CLASS_AND_INTERFACE,
2883
		CLASS_AND_INTERFACE,
2969
		getJavaSearchScopeBugs(),
2884
		getJavaSearchWorkingCopiesScope(),
2970
		requestor,
2885
		requestor,
2971
		IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
2886
		IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
2972
		null
2887
		null
Lines 2974-3024 Link Here
2974
	// Remove enum and annotation
2889
	// Remove enum and annotation
2975
	assertSearchResults(
2890
	assertSearchResults(
2976
		"Unexpected all type names",
2891
		"Unexpected all type names",
2977
		"Test\n" + 
2978
		"Test$Inner\n" + 
2979
		"TestPrefix\n" + 
2980
		"b108088.A108088\n" + 
2981
		"b108088.B108088\n" + 
2982
		"b108088.Test108088\n" + 
2983
		"b81556.a.A81556\n" + 
2984
		"b81556.a.B81556\n" + 
2985
		"b81556.a.X81556\n" + 
2986
		"b81556.b.XX81556\n" + 
2987
		"b87627.Collection\n" + 
2988
		"b87627.List\n" + 
2989
		"b89848.Test\n" + 
2990
		"b89848.X\n" + 
2991
		"b92944.B92944\n" + 
2892
		"b92944.B92944\n" + 
2992
		//"b92944.B92944_A\n" + 
2893
		"b92944.B92944_I",  // Annotation is an interface in java.lang
2993
		//"b92944.B92944_E\n" + 
2994
		"b92944.B92944_I\n" + 
2995
		"b95794.Test\n" + 
2996
		"g1.t.s.def.Generic\n" + 
2997
		"g1.t.s.def.Generic$Member\n" + 
2998
		"g1.t.s.def.Generic$MemberGeneric\n" + 
2999
		"g1.t.s.def.NonGeneric\n" + 
3000
		"g1.t.s.def.NonGeneric$GenericMember\n" + 
3001
		"g5.c.def.Multiple\n" + 
3002
		"g5.c.def.Single\n" + 
3003
		"g5.m.def.Multiple\n" + 
3004
		"g5.m.def.Single\n" + 
3005
		"java.io.Serializable\n" + 
3006
		"java.lang.CharSequence\n" + 
3007
		"java.lang.Class\n" + 
3008
		"java.lang.CloneNotSupportedException\n" + 
3009
		"java.lang.Comparable\n" + 
3010
		"java.lang.Enum\n" +  // Enum is not an enum in java.lang
3011
		"java.lang.Error\n" + 
3012
		"java.lang.Exception\n" + 
3013
		"java.lang.IllegalMonitorStateException\n" + 
3014
		"java.lang.InterruptedException\n" + 
3015
		"java.lang.Object\n" + 
3016
		"java.lang.RuntimeException\n" + 
3017
		"java.lang.String\n" + 
3018
		"java.lang.Throwable\n" +
3019
		"java.lang.annotation.Annotation\n" +  // Annotation is an interface in java.lang
3020
		"pack.age.Test\n" + 
3021
		"pack.age.Test$Member",
3022
		requestor);
2894
		requestor);
3023
}
2895
}
3024
public void testBug92944_CLASS_AND_ENUM() throws CoreException {
2896
public void testBug92944_CLASS_AND_ENUM() throws CoreException {
Lines 3032-3038 Link Here
3032
		null,
2904
		null,
3033
		SearchPattern.R_PATTERN_MATCH, // case insensitive
2905
		SearchPattern.R_PATTERN_MATCH, // case insensitive
3034
		CLASS_AND_ENUM,
2906
		CLASS_AND_ENUM,
3035
		getJavaSearchScopeBugs(),
2907
		getJavaSearchWorkingCopiesScope(),
3036
		requestor,
2908
		requestor,
3037
		IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
2909
		IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
3038
		null
2910
		null
Lines 3040-3088 Link Here
3040
	// Remove interface and annotation
2912
	// Remove interface and annotation
3041
	assertSearchResults(
2913
	assertSearchResults(
3042
		"Unexpected all type names",
2914
		"Unexpected all type names",
3043
		"Test\n" + 
3044
		"Test$Inner\n" + 
3045
		"TestPrefix\n" + 
3046
		"b108088.A108088\n" + 
3047
		"b108088.B108088\n" + 
3048
		"b108088.Test108088\n" + 
3049
		"b81556.a.A81556\n" + 
3050
		"b81556.a.B81556\n" + 
3051
		"b81556.a.X81556\n" + 
3052
		"b81556.b.XX81556\n" + 
3053
		"b89848.Test\n" + 
3054
		"b89848.X\n" + 
3055
		"b92944.B92944\n" + 
2915
		"b92944.B92944\n" + 
3056
		//"b92944.B92944_A\n" + 
2916
		"b92944.B92944_E",
3057
		"b92944.B92944_E\n" + 
3058
		//"b92944.B92944_I\n" + 
3059
		"b95794.Test\n" + 
3060
		"b95794.Test$Color\n" + 
3061
		"g1.t.s.def.Generic\n" + 
3062
		"g1.t.s.def.Generic$Member\n" + 
3063
		"g1.t.s.def.Generic$MemberGeneric\n" + 
3064
		"g1.t.s.def.NonGeneric\n" + 
3065
		"g1.t.s.def.NonGeneric$GenericMember\n" + 
3066
		"g5.c.def.Multiple\n" + 
3067
		"g5.c.def.Single\n" + 
3068
		"g5.m.def.Multiple\n" + 
3069
		"g5.m.def.Single\n" + 
3070
		//"java.io.Serializable\n" + 
3071
		"java.lang.Class\n" + 
3072
		"java.lang.CloneNotSupportedException\n" + 
3073
		//"java.lang.Comparable\n" + 
3074
		"java.lang.Enum\n" + 
3075
		"java.lang.Error\n" + 
3076
		"java.lang.Exception\n" + 
3077
		"java.lang.IllegalMonitorStateException\n" + 
3078
		"java.lang.InterruptedException\n" + 
3079
		"java.lang.Object\n" + 
3080
		"java.lang.RuntimeException\n" + 
3081
		"java.lang.String\n" + 
3082
		"java.lang.Throwable\n" +
3083
		//"java.lang.annotation.Annotation\n" +
3084
		"pack.age.Test\n" + 
3085
		"pack.age.Test$Member",
3086
		requestor);
2917
		requestor);
3087
}
2918
}
3088
public void testBug92944_INTERFACE() throws CoreException {
2919
public void testBug92944_INTERFACE() throws CoreException {
Lines 3096-3115 Link Here
3096
		null,
2927
		null,
3097
		SearchPattern.R_PATTERN_MATCH, // case insensitive
2928
		SearchPattern.R_PATTERN_MATCH, // case insensitive
3098
		INTERFACE,
2929
		INTERFACE,
3099
		getJavaSearchScopeBugs(),
2930
		getJavaSearchWorkingCopiesScope(),
3100
		requestor,
2931
		requestor,
3101
		IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
2932
		IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
3102
		null
2933
		null
3103
	);
2934
	);
3104
	assertSearchResults(
2935
	assertSearchResults(
3105
		"Unexpected all type names",
2936
		"Unexpected all type names",
3106
		"b87627.Collection\n" + 
2937
		"b92944.B92944_I",
3107
		"b87627.List\n" + 
3108
		"b92944.B92944_I\n" + 
3109
		"java.io.Serializable\n" + 
3110
		"java.lang.CharSequence\n" + 
3111
		"java.lang.Comparable\n" +
3112
		"java.lang.annotation.Annotation", // Annotation is an interface in java.lang
3113
		requestor);
2938
		requestor);
3114
}
2939
}
3115
public void testBug92944_ENUM() throws CoreException {
2940
public void testBug92944_ENUM() throws CoreException {
Lines 3123-3137 Link Here
3123
		null,
2948
		null,
3124
		SearchPattern.R_PATTERN_MATCH, // case insensitive
2949
		SearchPattern.R_PATTERN_MATCH, // case insensitive
3125
		ENUM,
2950
		ENUM,
3126
		getJavaSearchScopeBugs(),
2951
		getJavaSearchWorkingCopiesScope(),
3127
		requestor,
2952
		requestor,
3128
		IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
2953
		IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
3129
		null
2954
		null
3130
	);
2955
	);
3131
	assertSearchResults(
2956
	assertSearchResults(
3132
		"Unexpected all type names",
2957
		"Unexpected all type names",
3133
		"b92944.B92944_E\n" + 
2958
		"b92944.B92944_E",
3134
		"b95794.Test$Color",
3135
		requestor);
2959
		requestor);
3136
}
2960
}
3137
public void testBug92944_ANNOTATION_TYPE() throws CoreException {
2961
public void testBug92944_ANNOTATION_TYPE() throws CoreException {
Lines 3145-3158 Link Here
3145
		null,
2969
		null,
3146
		SearchPattern.R_PATTERN_MATCH, // case insensitive
2970
		SearchPattern.R_PATTERN_MATCH, // case insensitive
3147
		ANNOTATION_TYPE,
2971
		ANNOTATION_TYPE,
3148
		getJavaSearchScopeBugs(),
2972
		getJavaSearchWorkingCopiesScope(),
3149
		requestor,
2973
		requestor,
3150
		IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
2974
		IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
3151
		null
2975
		null
3152
	);
2976
	);
3153
	assertSearchResults(
2977
	assertSearchResults(
3154
		"Unexpected all type names",
2978
		"Unexpected all type names",
3155
		"b86380.Annot\n" + 
3156
		"b92944.B92944_A",
2979
		"b92944.B92944_A",
3157
		requestor);
2980
		requestor);
3158
}
2981
}
Lines 5776-5781 Link Here
5776
}
5599
}
5777
5600
5778
/**
5601
/**
5602
 * Bug 124469: [search] AIOOBE in PatternLocator when searching for dependency extent from manifest
5603
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=124469"
5604
 */
5605
public void testBug124469a() throws CoreException {
5606
	IType type = getClassFile("JavaSearchBugs", "lib/b124469.jar", "pack", "E.class").getType();
5607
	search(type, REFERENCES);
5608
	assertSearchResults(
5609
		"lib/b124469.jar pack.E pack.A1.value() EXACT_MATCH\n" + 
5610
		"lib/b124469.jar pack.E pack.A2.value() EXACT_MATCH\n" + 
5611
		"lib/b124469.jar pack.E pack.A3.value() EXACT_MATCH\n" + 
5612
		"lib/b124469.jar test.C EXACT_MATCH\n" + 
5613
		"lib/b124469.jar test.C EXACT_MATCH\n" + 
5614
		"lib/b124469.jar test.C EXACT_MATCH\n" + 
5615
		"lib/b124469.jar test.C EXACT_MATCH\n" + 
5616
		"lib/b124469.jar test.C EXACT_MATCH\n" + 
5617
		"lib/b124469.jar test.C EXACT_MATCH\n" + 
5618
		"lib/b124469.jar test.C EXACT_MATCH\n" + 
5619
		"lib/b124469.jar test.F.field EXACT_MATCH\n" + 
5620
		"lib/b124469.jar test.F.field EXACT_MATCH\n" + 
5621
		"lib/b124469.jar test.F.field EXACT_MATCH\n" + 
5622
		"lib/b124469.jar test.F.field EXACT_MATCH\n" + 
5623
		"lib/b124469.jar test.F.field EXACT_MATCH\n" + 
5624
		"lib/b124469.jar test.F.field EXACT_MATCH\n" + 
5625
		"lib/b124469.jar void test.M.foo() EXACT_MATCH\n" + 
5626
		"lib/b124469.jar void test.M.foo() EXACT_MATCH\n" + 
5627
		"lib/b124469.jar void test.M.foo() EXACT_MATCH\n" + 
5628
		"lib/b124469.jar void test.M.foo() EXACT_MATCH\n" + 
5629
		"lib/b124469.jar void test.M.foo() EXACT_MATCH\n" + 
5630
		"lib/b124469.jar void test.M.foo() EXACT_MATCH"
5631
	);
5632
}
5633
public void testBug124469b() throws CoreException {
5634
	IType type = getClassFile("JavaSearchBugs", "lib/b124469.jar", "pack", "A1.class").getType();
5635
	search(type, REFERENCES);
5636
	assertSearchResults(
5637
		"lib/b124469.jar pack.A1 pack.A2.annot() EXACT_MATCH\n" + 
5638
		"lib/b124469.jar test.C EXACT_MATCH\n" + 
5639
		"lib/b124469.jar test.C EXACT_MATCH\n" + 
5640
		"lib/b124469.jar test.F.field EXACT_MATCH\n" + 
5641
		"lib/b124469.jar void test.M.foo() EXACT_MATCH"
5642
	);
5643
}
5644
public void testBug124469c() throws CoreException {
5645
	IType type = getClassFile("JavaSearchBugs", "lib/b124469.jar", "pack", "A2.class").getType();
5646
	search(type, REFERENCES);
5647
	assertSearchResults(
5648
		"lib/b124469.jar pack.A2 pack.A3.annot() EXACT_MATCH\n" + 
5649
		"lib/b124469.jar test.C EXACT_MATCH\n" + 
5650
		"lib/b124469.jar test.C EXACT_MATCH\n" + 
5651
		"lib/b124469.jar test.F.field EXACT_MATCH\n" + 
5652
		"lib/b124469.jar void test.M.foo() EXACT_MATCH"
5653
	);
5654
}
5655
public void testBug124469d() throws CoreException {
5656
	IType type = getClassFile("JavaSearchBugs", "lib/b124469.jar", "pack", "A3.class").getType();
5657
	search(type, REFERENCES);
5658
	assertSearchResults(
5659
		"lib/b124469.jar test.C EXACT_MATCH\n" + 
5660
		"lib/b124469.jar test.C EXACT_MATCH\n" + 
5661
		"lib/b124469.jar test.F.field EXACT_MATCH\n" + 
5662
		"lib/b124469.jar void test.M.foo() EXACT_MATCH"
5663
	);
5664
}
5665
public void testBug124469e() throws CoreException {
5666
	IType type = getClassFile("JavaSearchBugs", "lib/b124469.jar", "pack", "E.class").getType();
5667
	IField field = type.getField("CC");
5668
	search(field, REFERENCES);
5669
	assertSearchResults(
5670
		"lib/b124469.jar test.C EXACT_MATCH\n" + 
5671
		"lib/b124469.jar test.C EXACT_MATCH\n" + 
5672
		"lib/b124469.jar test.C EXACT_MATCH"
5673
	);
5674
}
5675
public void testBug124469f() throws CoreException {
5676
	IType type = getClassFile("JavaSearchBugs", "lib/b124469.jar", "pack", "E.class").getType();
5677
	IField field = type.getField("CF");
5678
	search(field, REFERENCES);
5679
	assertSearchResults(
5680
		"lib/b124469.jar test.F.field EXACT_MATCH\n" + 
5681
		"lib/b124469.jar test.F.field EXACT_MATCH\n" + 
5682
		"lib/b124469.jar test.F.field EXACT_MATCH"
5683
	);
5684
}
5685
public void testBug124469g() throws CoreException {
5686
	IType type = getClassFile("JavaSearchBugs", "lib/b124469.jar", "pack", "E.class").getType();
5687
	IField field = type.getField("CM");
5688
	search(field, REFERENCES);
5689
	assertSearchResults(
5690
		"lib/b124469.jar void test.M.foo() EXACT_MATCH\n" + 
5691
		"lib/b124469.jar void test.M.foo() EXACT_MATCH\n" + 
5692
		"lib/b124469.jar void test.M.foo() EXACT_MATCH"
5693
	);
5694
}
5695
public void testBug124469h() throws CoreException {
5696
	IType type = getClassFile("JavaSearchBugs", "lib/b124469.jar", "pack", "E.class").getType();
5697
	IField field = type.getField("CP");
5698
	search(field, REFERENCES);
5699
	assertSearchResults(
5700
		"" // expected no result as parameters annotations are not stored in class file
5701
	);
5702
}
5703
public void testBug124469i() throws CoreException {
5704
	IType type = getClassFile("JavaSearchBugs", "lib/b124469.jar", "pack", "E.class").getType();
5705
	IField field = type.getField("CV");
5706
	search(field, REFERENCES);
5707
	assertSearchResults(
5708
		"" // expected no result as parameters annotations are not stored in class file
5709
	);
5710
}
5711
// TODO (frederic) enable when bug 130xxx will be fixed
5712
public void _testBug124469j() throws CoreException {
5713
	IType type = getClassFile("JavaSearchBugs", "lib/b124469.jar", "pack", "E.class").getType();
5714
	IField field = type.getField("CAC");
5715
	search(field, REFERENCES);
5716
	assertSearchResults(
5717
		"???"
5718
	);
5719
}
5720
// TODO (frederic) enable when bug 130xxx will be fixed
5721
public void _testBug124469k() throws CoreException {
5722
	IType type = getClassFile("JavaSearchBugs", "lib/b124469.jar", "pack", "E.class").getType();
5723
	IField field = type.getField("CAF");
5724
	search(field, REFERENCES);
5725
	assertSearchResults(
5726
		"???"
5727
	);
5728
}
5729
// TODO (frederic) enable when bug 130xxx will be fixed
5730
public void _testBug124469l() throws CoreException {
5731
	IType type = getClassFile("JavaSearchBugs", "lib/b124469.jar", "pack", "E.class").getType();
5732
	IField field = type.getField("CAM");
5733
	search(field, REFERENCES);
5734
	assertSearchResults(
5735
		"???"
5736
	);
5737
}
5738
public void testBug124469m() throws CoreException {
5739
	IType type = getClassFile("JavaSearchBugs", "lib/b124469.jar", "pack", "E.class").getType();
5740
	IField field = type.getField("CAP");
5741
	search(field, REFERENCES);
5742
	assertSearchResults(
5743
		"" // expected no result as parameters annotations are not stored in class file
5744
	);
5745
}
5746
public void testBug124469n() throws CoreException {
5747
	IType type = getClassFile("JavaSearchBugs", "lib/b124469.jar", "pack", "E.class").getType();
5748
	IField field = type.getField("CAV");
5749
	search(field, REFERENCES);
5750
	assertSearchResults(
5751
		"" // expected no result as parameters annotations are not stored in class file
5752
	);
5753
}
5754
5755
/**
5779
 * Bug 125178: [search] AIOOBE in PatternLocator when searching for dependency extent from manifest
5756
 * Bug 125178: [search] AIOOBE in PatternLocator when searching for dependency extent from manifest
5780
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=125178"
5757
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=125178"
5781
 */
5758
 */
(-)workspace/JavaSearchBugs/.classpath (+1 lines)
Lines 6-11 Link Here
6
	<classpathentry kind="lib" path="lib/test75816.jar" sourcepath="/JavaSearchBugs/lib/test75816.jar" rootpath=""/>
6
	<classpathentry kind="lib" path="lib/test75816.jar" sourcepath="/JavaSearchBugs/lib/test75816.jar" rootpath=""/>
7
	<classpathentry kind="lib" path="lib/b87627.jar" sourcepath="/JavaSearchBugs/lib/b87627.jar" rootpath=""/>
7
	<classpathentry kind="lib" path="lib/b87627.jar" sourcepath="/JavaSearchBugs/lib/b87627.jar" rootpath=""/>
8
	<classpathentry kind="lib" path="lib/b110422.jar" sourcepath="" rootpath=""/>
8
	<classpathentry kind="lib" path="lib/b110422.jar" sourcepath="" rootpath=""/>
9
	<classpathentry kind="lib" path="lib/b124469.jar" sourcepath="/JavaSearchBugs/lib/b124469.jar" rootpath=""/>
9
	<classpathentry kind="lib" path="lib/b125178.jar" sourcepath="" rootpath=""/>
10
	<classpathentry kind="lib" path="lib/b125178.jar" sourcepath="" rootpath=""/>
10
	<classpathentry kind="lib" path="lib/JavaSearch15.jar" sourcepath="/JavaSearchBugs/lib/JavaSearch15.jar" rootpath=""/>
11
	<classpathentry kind="lib" path="lib/JavaSearch15.jar" sourcepath="/JavaSearchBugs/lib/JavaSearch15.jar" rootpath=""/>
11
	<classpathentry sourcepath="lib" kind="lib" path="lib"/>
12
	<classpathentry sourcepath="lib" kind="lib" path="lib"/>
(-)search/org/eclipse/jdt/internal/core/index/DiskIndex.java (-1 / +1 lines)
Lines 35-41 Link Here
35
private HashtableOfObject categoryTables; // category name -> HashtableOfObject(words -> int[] of document #'s) or offset if not read yet
35
private HashtableOfObject categoryTables; // category name -> HashtableOfObject(words -> int[] of document #'s) or offset if not read yet
36
private char[] cachedCategoryName;
36
private char[] cachedCategoryName;
37
37
38
public static final String SIGNATURE= "INDEX VERSION 1.107"; //$NON-NLS-1$
38
public static final String SIGNATURE= "INDEX VERSION 1.108"; //$NON-NLS-1$
39
public static boolean DEBUG = false;
39
public static boolean DEBUG = false;
40
40
41
private static final int RE_INDEXED = -1;
41
private static final int RE_INDEXED = -1;
(-)search/org/eclipse/jdt/internal/core/search/indexing/BinaryIndexer.java (-1 / +62 lines)
Lines 19-24 Link Here
19
import org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException;
19
import org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException;
20
import org.eclipse.jdt.internal.compiler.classfmt.FieldInfo;
20
import org.eclipse.jdt.internal.compiler.classfmt.FieldInfo;
21
import org.eclipse.jdt.internal.compiler.classfmt.MethodInfo;
21
import org.eclipse.jdt.internal.compiler.classfmt.MethodInfo;
22
import org.eclipse.jdt.internal.compiler.env.ClassSignature;
23
import org.eclipse.jdt.internal.compiler.env.EnumConstantSignature;
24
import org.eclipse.jdt.internal.compiler.env.IBinaryAnnotation;
25
import org.eclipse.jdt.internal.compiler.env.IBinaryElementValuePair;
22
import org.eclipse.jdt.internal.compiler.util.SuffixConstants;
26
import org.eclipse.jdt.internal.compiler.util.SuffixConstants;
23
27
24
public class BinaryIndexer extends AbstractIndexer implements SuffixConstants {
28
public class BinaryIndexer extends AbstractIndexer implements SuffixConstants {
Lines 36-41 Link Here
36
	public BinaryIndexer(SearchDocument document) {
40
	public BinaryIndexer(SearchDocument document) {
37
		super(document);
41
		super(document);
38
	}
42
	}
43
	private void addBinaryAnnotation(IBinaryAnnotation annotation) {
44
		addTypeReference(replace('/', '.', Signature.toCharArray(annotation.getTypeName())));
45
		IBinaryElementValuePair[] valuePairs = annotation.getElementValuePairs();
46
		if (valuePairs != null) {
47
			for (int j=0, vpLength=valuePairs.length; j<vpLength; j++) {
48
				IBinaryElementValuePair valuePair = valuePairs[j];
49
				addMethodReference(valuePair.getName(), 0);
50
				Object pairValue = valuePair.getValue();
51
				addPairValue(pairValue);
52
			}
53
		}
54
	}
55
	private void addPairValue(Object pairValue) {
56
		if (pairValue instanceof EnumConstantSignature) {
57
			EnumConstantSignature enumConstant = (EnumConstantSignature) pairValue;
58
			addTypeReference(replace('/', '.', Signature.toCharArray(enumConstant.getTypeName())));
59
			addNameReference(enumConstant.getEnumConstantName());
60
		} else if (pairValue instanceof ClassSignature) {
61
			ClassSignature classConstant = (ClassSignature) pairValue;
62
			addTypeReference(replace('/', '.', Signature.toCharArray(classConstant.getTypeName())));
63
		} else if (pairValue instanceof ClassSignature) {
64
			ClassSignature classConstant = (ClassSignature) pairValue;
65
			addTypeReference(replace('/', '.', Signature.toCharArray(classConstant.getTypeName())));
66
		} else if (pairValue instanceof IBinaryAnnotation) {
67
			addBinaryAnnotation((IBinaryAnnotation) pairValue);
68
		} else if (pairValue instanceof Object[]) {
69
			Object[] objects = (Object[]) pairValue;
70
			for (int i=0,l=objects.length; i<l; i++) {
71
				addPairValue(objects[i]);
72
			}
73
		}
74
	}
39
	public void addTypeReference(char[] typeName) {
75
	public void addTypeReference(char[] typeName) {
40
		int length = typeName.length;
76
		int length = typeName.length;
41
		if (length > 2 && typeName[length - 2] == '$') {
77
		if (length > 2 && typeName[length - 2] == '$') {
Lines 508-514 Link Here
508
					addAnnotationTypeDeclaration(modifiers, packageName, name, enclosingTypeNames, false);
544
					addAnnotationTypeDeclaration(modifiers, packageName, name, enclosingTypeNames, false);
509
					break;
545
					break;
510
			}			
546
			}			
511
	
547
548
			// Look for references in class annotations
549
			IBinaryAnnotation[] annotations = reader.getAnnotations();
550
			if (annotations != null) {
551
				for (int a=0, length=annotations.length; a<length; a++) {
552
					IBinaryAnnotation annotation = annotations[a];
553
					addBinaryAnnotation(annotation);
554
				}
555
			}
556
512
			// first reference all methods declarations and field declarations
557
			// first reference all methods declarations and field declarations
513
			MethodInfo[] methods = (MethodInfo[]) reader.getMethods();
558
			MethodInfo[] methods = (MethodInfo[]) reader.getMethods();
514
			if (methods != null) {
559
			if (methods != null) {
Lines 525-530 Link Here
525
							addMethodDeclaration(method.getSelector(), parameterTypes, returnType, exceptionTypes);
570
							addMethodDeclaration(method.getSelector(), parameterTypes, returnType, exceptionTypes);
526
						}
571
						}
527
					}
572
					}
573
					// look for references in method annotations
574
					annotations = method.getAnnotations();
575
					if (annotations != null) {
576
						for (int a=0, length=annotations.length; a<length; a++) {
577
							IBinaryAnnotation annotation = annotations[a];
578
							addBinaryAnnotation(annotation);
579
						}
580
					}
528
				}
581
				}
529
			}
582
			}
530
			FieldInfo[] fields = (FieldInfo[]) reader.getFields();
583
			FieldInfo[] fields = (FieldInfo[]) reader.getFields();
Lines 534-539 Link Here
534
					char[] fieldName = field.getName();
587
					char[] fieldName = field.getName();
535
					char[] fieldType = decodeFieldType(replace('/', '.', field.getTypeName()));
588
					char[] fieldType = decodeFieldType(replace('/', '.', field.getTypeName()));
536
					addFieldDeclaration(fieldType, fieldName);
589
					addFieldDeclaration(fieldType, fieldName);
590
					// look for references in field annotations
591
					annotations = field.getAnnotations();
592
					if (annotations != null) {
593
						for (int a=0, length=annotations.length; a<length; a++) {
594
							IBinaryAnnotation annotation = annotations[a];
595
							addBinaryAnnotation(annotation);
596
						}
597
					}
537
				}
598
				}
538
			}
599
			}
539
	
600
	

Return to bug 124469