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

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/model/AbstractJavadocCompletionModelTest.java (-3 / +3 lines)
Lines 158-169 Link Here
158
		"R_DICUNREETIT",
158
		"R_DICUNREETIT",
159
	};
159
	};
160
160
161
	// Write file contants
161
	// Write file contents
162
	protected static final String WRITE_DIR = System.getProperty("writeDir");
162
	protected static final String WRITE_DIR = System.getProperty("writeDir");
163
	protected static final File WRITE_DIR_FILE;
163
	protected static final File WRITE_DIR_FILE;
164
	protected static final Set PACKAGE_FILES = new HashSet();
164
	protected static final Set PACKAGE_FILES = new HashSet();
165
	
166
	CompletionTestsRequestor2 requestor;
167
	static {
165
	static {
168
		File writeDir = null;
166
		File writeDir = null;
169
		if (WRITE_DIR != null) {
167
		if (WRITE_DIR != null) {
Lines 179-184 Link Here
179
		}
177
		}
180
		WRITE_DIR_FILE = writeDir;
178
		WRITE_DIR_FILE = writeDir;
181
	}
179
	}
180
181
	CompletionTestsRequestor2 requestor;
182
	protected int cursorLocation;
182
	protected int cursorLocation;
183
	protected int completionStart;
183
	protected int completionStart;
184
	protected String replacedText;
184
	protected String replacedText;
(-)src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_4.java (-29 / +96 lines)
Lines 2866-2872 Link Here
2866
			"1. ERROR in comment6\\Invalid.java (at line 4)\r\n" + 
2866
			"1. ERROR in comment6\\Invalid.java (at line 4)\r\n" + 
2867
			"	* @see Inner\r\n" + 
2867
			"	* @see Inner\r\n" + 
2868
			"	       ^^^^^\n" + 
2868
			"	       ^^^^^\n" + 
2869
			"Javadoc: Not visible reference\n" + 
2869
			"Javadoc: Invalid member type qualification\n" + 
2870
			"----------\n"
2870
			"----------\n"
2871
		);
2871
		);
2872
	}
2872
	}
Lines 2897-2902 Link Here
2897
				" * @see Test.Inner\n" + 
2897
				" * @see Test.Inner\n" + 
2898
				" */\n" + 
2898
				" */\n" + 
2899
				"public class Invalid2 extends Test { \n" + 
2899
				"public class Invalid2 extends Test { \n" + 
2900
				"}",
2901
				"comment6a/test/Valid.java",
2902
				"package comment6a.test;\n" + 
2903
				"import comment6a.def.Test;\n" + 
2904
				"/**\n" + 
2905
				" * @see comment6a.def.Test.Inner\n" + 
2906
				" */\n" + 
2907
				"public class Valid extends Test { \n" + 
2900
				"}"
2908
				"}"
2901
			},
2909
			},
2902
//			comment6a\def\Test.java:6: warning - Tag @see: reference not found: Inner
2910
//			comment6a\def\Test.java:6: warning - Tag @see: reference not found: Inner
Lines 2906-2924 Link Here
2906
			"1. ERROR in comment6a\\def\\Test.java (at line 4)\n" + 
2914
			"1. ERROR in comment6a\\def\\Test.java (at line 4)\n" + 
2907
			"	* @see Inner\n" + 
2915
			"	* @see Inner\n" + 
2908
			"	       ^^^^^\n" + 
2916
			"	       ^^^^^\n" + 
2909
			"Javadoc: Not visible reference\n" + 
2917
			"Javadoc: Invalid member type qualification\n" + 
2910
			"----------\n" + 
2918
			"----------\n" + 
2911
			"----------\n" + 
2919
			"----------\n" + 
2912
			"1. ERROR in comment6a\\test\\Invalid.java (at line 4)\n" + 
2920
			"1. ERROR in comment6a\\test\\Invalid.java (at line 4)\n" + 
2913
			"	* See also {@link Inner}\n" + 
2921
			"	* See also {@link Inner}\n" + 
2914
			"	                  ^^^^^\n" + 
2922
			"	                  ^^^^^\n" + 
2915
			"Javadoc: Not visible reference\n" + 
2923
			"Javadoc: Invalid member type qualification\n" + 
2916
			"----------\n" + 
2924
			"----------\n" + 
2917
			"----------\n" + 
2925
			"----------\n" + 
2918
			"1. ERROR in comment6a\\test\\Invalid2.java (at line 4)\n" + 
2926
			"1. ERROR in comment6a\\test\\Invalid2.java (at line 4)\n" + 
2919
			"	* @see Test.Inner\n" + 
2927
			"	* @see Test.Inner\n" + 
2920
			"	       ^^^^^^^^^^\n" + 
2928
			"	       ^^^^^^^^^^\n" + 
2921
			"Javadoc: Not visible reference\n" + 
2929
			"Javadoc: Invalid member type qualification\n" + 
2922
			"----------\n"
2930
			"----------\n"
2923
		);
2931
		);
2924
	}
2932
	}
Lines 2957-2969 Link Here
2957
			"1. ERROR in comment6b\\Invalid.java (at line 4)\n" + 
2965
			"1. ERROR in comment6b\\Invalid.java (at line 4)\n" + 
2958
			"	* @see Inner\n" + 
2966
			"	* @see Inner\n" + 
2959
			"	       ^^^^^\n" + 
2967
			"	       ^^^^^\n" + 
2960
			"Javadoc: Not visible reference\n" + 
2968
			"Javadoc: Invalid member type qualification\n" + 
2961
			"----------\n" + 
2969
			"----------\n" + 
2962
			"----------\n" + 
2970
			"----------\n" + 
2963
			"1. ERROR in comment6b\\Test.java (at line 4)\n" + 
2971
			"1. ERROR in comment6b\\Test.java (at line 4)\n" + 
2964
			"	* @see Inner\n" + 
2972
			"	* @see Inner\n" + 
2965
			"	       ^^^^^\n" + 
2973
			"	       ^^^^^\n" + 
2966
			"Javadoc: Not visible reference\n" + 
2974
			"Javadoc: Invalid member type qualification\n" + 
2967
			"----------\n"
2975
			"----------\n"
2968
		);
2976
		);
2969
	}
2977
	}
Lines 3107-3112 Link Here
3107
			"----------\n"
3115
			"----------\n"
3108
		);
3116
		);
3109
	}
3117
	}
3118
	public void testBug96237_Public08() {
3119
		this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
3120
		runNegativeTest(
3121
			new String[] {
3122
				"test/d/Reference.java",
3123
				"package test.d;\n" + 
3124
				"class Reference {\n" + 
3125
				"}\n",
3126
				"test/d/Test.java",
3127
				"package test.d;\n" + 
3128
				"/**\n" + 
3129
				" * @see Secondary\n" + 
3130
				" * @see Reference\n" + 
3131
				" */\n" + 
3132
				"public class Test {\n" + 
3133
				"}\n" + 
3134
				"class Secondary {}"
3135
			},
3136
			"----------\n" + 
3137
			"1. ERROR in test\\d\\Test.java (at line 3)\n" + 
3138
			"	* @see Secondary\n" + 
3139
			"	       ^^^^^^^^^\n" + 
3140
			"Javadoc: Not visible reference\n" + 
3141
			"----------\n" + 
3142
			"2. ERROR in test\\d\\Test.java (at line 4)\n" + 
3143
			"	* @see Reference\n" + 
3144
			"	       ^^^^^^^^^\n" + 
3145
			"Javadoc: Not visible reference\n" + 
3146
			"----------\n"
3147
		);
3148
	}
3110
	public void testBug96237_Private01() {
3149
	public void testBug96237_Private01() {
3111
		this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
3150
		this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
3112
		runConformTest(
3151
		runConformTest(
Lines 3149-3160 Link Here
3149
			"1. ERROR in comment6\\Invalid.java (at line 4)\n" + 
3188
			"1. ERROR in comment6\\Invalid.java (at line 4)\n" + 
3150
			"	* @see Inner\n" + 
3189
			"	* @see Inner\n" + 
3151
			"	       ^^^^^\n" + 
3190
			"	       ^^^^^\n" + 
3152
			"Javadoc: Not visible reference\n" + 
3191
			"Javadoc: Invalid member type qualification\n" + 
3153
			"----------\n" + 
3192
			"----------\n" + 
3154
			"2. ERROR in comment6\\Invalid.java (at line 9)\n" + 
3193
			"2. ERROR in comment6\\Invalid.java (at line 9)\n" + 
3155
			"	* See also {@link Inner} \n" + 
3194
			"	* See also {@link Inner} \n" + 
3156
			"	                  ^^^^^\n" + 
3195
			"	                  ^^^^^\n" + 
3157
			"Javadoc: Not visible reference\n" + 
3196
			"Javadoc: Invalid member type qualification\n" + 
3158
			"----------\n"
3197
			"----------\n"
3159
		);
3198
		);
3160
	}
3199
	}
Lines 3185-3190 Link Here
3185
				" * @see Test.Inner\n" + 
3224
				" * @see Test.Inner\n" + 
3186
				" */\n" + 
3225
				" */\n" + 
3187
				"public class Invalid2 extends Test { \n" + 
3226
				"public class Invalid2 extends Test { \n" + 
3227
				"}",
3228
				"comment6a/test/Valid.java",
3229
				"package comment6a.test;\n" + 
3230
				"import comment6a.def.Test;\n" + 
3231
				"/**\n" + 
3232
				" * @see comment6a.def.Test.Inner\n" + 
3233
				" */\n" + 
3234
				"public class Valid extends Test { \n" + 
3188
				"}"
3235
				"}"
3189
			},
3236
			},
3190
//			comment6a\def\Test.java:6: warning - Tag @see: reference not found: Inner
3237
//			comment6a\def\Test.java:6: warning - Tag @see: reference not found: Inner
Lines 3194-3212 Link Here
3194
			"1. ERROR in comment6a\\def\\Test.java (at line 4)\n" + 
3241
			"1. ERROR in comment6a\\def\\Test.java (at line 4)\n" + 
3195
			"	* @see Inner\n" + 
3242
			"	* @see Inner\n" + 
3196
			"	       ^^^^^\n" + 
3243
			"	       ^^^^^\n" + 
3197
			"Javadoc: Not visible reference\n" + 
3244
			"Javadoc: Invalid member type qualification\n" + 
3198
			"----------\n" + 
3245
			"----------\n" + 
3199
			"----------\n" + 
3246
			"----------\n" + 
3200
			"1. ERROR in comment6a\\test\\Invalid.java (at line 4)\n" + 
3247
			"1. ERROR in comment6a\\test\\Invalid.java (at line 4)\n" + 
3201
			"	* See also {@link Inner}\n" + 
3248
			"	* See also {@link Inner}\n" + 
3202
			"	                  ^^^^^\n" + 
3249
			"	                  ^^^^^\n" + 
3203
			"Javadoc: Not visible reference\n" + 
3250
			"Javadoc: Invalid member type qualification\n" + 
3204
			"----------\n" + 
3251
			"----------\n" + 
3205
			"----------\n" + 
3252
			"----------\n" + 
3206
			"1. ERROR in comment6a\\test\\Invalid2.java (at line 4)\n" + 
3253
			"1. ERROR in comment6a\\test\\Invalid2.java (at line 4)\n" + 
3207
			"	* @see Test.Inner\n" + 
3254
			"	* @see Test.Inner\n" + 
3208
			"	       ^^^^^^^^^^\n" + 
3255
			"	       ^^^^^^^^^^\n" + 
3209
			"Javadoc: Not visible reference\n" + 
3256
			"Javadoc: Invalid member type qualification\n" + 
3210
			"----------\n"
3257
			"----------\n"
3211
		);
3258
		);
3212
	}
3259
	}
Lines 3245-3257 Link Here
3245
			"1. ERROR in comment6b\\Invalid.java (at line 4)\n" + 
3292
			"1. ERROR in comment6b\\Invalid.java (at line 4)\n" + 
3246
			"	* @see Inner\n" + 
3293
			"	* @see Inner\n" + 
3247
			"	       ^^^^^\n" + 
3294
			"	       ^^^^^\n" + 
3248
			"Javadoc: Not visible reference\n" + 
3295
			"Javadoc: Invalid member type qualification\n" + 
3249
			"----------\n" + 
3296
			"----------\n" + 
3250
			"----------\n" + 
3297
			"----------\n" + 
3251
			"1. ERROR in comment6b\\Test.java (at line 4)\n" + 
3298
			"1. ERROR in comment6b\\Test.java (at line 4)\n" + 
3252
			"	* @see Inner\n" + 
3299
			"	* @see Inner\n" + 
3253
			"	       ^^^^^\n" + 
3300
			"	       ^^^^^\n" + 
3254
			"Javadoc: Not visible reference\n" + 
3301
			"Javadoc: Invalid member type qualification\n" + 
3255
			"----------\n"
3302
			"----------\n"
3256
		);
3303
		);
3257
	}
3304
	}
Lines 3320-3325 Link Here
3320
			}
3367
			}
3321
		);
3368
		);
3322
	}
3369
	}
3370
	public void testBug96237_Private08() {
3371
		this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
3372
		runConformTest(
3373
			new String[] {
3374
				"test/d/Reference.java",
3375
				"package test.d;\n" + 
3376
				"class Reference {\n" + 
3377
				"}\n",
3378
				"test/d/Test.java",
3379
				"package test.d;\n" + 
3380
				"/**\n" + 
3381
				" * @see Secondary\n" + 
3382
				" * @see Reference\n" + 
3383
				" */\n" + 
3384
				"public class Test {\n" + 
3385
				"}\n" + 
3386
				"class Secondary {}"
3387
			}
3388
		);
3389
	}
3323
3390
3324
	/**
3391
	/**
3325
	 * Bug 101283: [1.5][javadoc] Javadoc validation raises missing implementation in compiler
3392
	 * Bug 101283: [1.5][javadoc] Javadoc validation raises missing implementation in compiler
Lines 3568-3574 Link Here
3568
			"1. ERROR in boden\\TestValid.java (at line 4)\r\n" + 
3635
			"1. ERROR in boden\\TestValid.java (at line 4)\r\n" + 
3569
			"	* @see ValidationException\r\n" + 
3636
			"	* @see ValidationException\r\n" + 
3570
			"	       ^^^^^^^^^^^^^^^^^^^\n" + 
3637
			"	       ^^^^^^^^^^^^^^^^^^^\n" + 
3571
			"Javadoc: Not visible reference\n" + 
3638
			"Javadoc: Invalid member type qualification\n" + 
3572
			"----------\n"
3639
			"----------\n"
3573
		);
3640
		);
3574
	}
3641
	}
Lines 3630-3648 Link Here
3630
			"1. ERROR in boden\\TestInvalid1.java (at line 5)\n" + 
3697
			"1. ERROR in boden\\TestInvalid1.java (at line 5)\n" + 
3631
			"	* @see ValidationException#ValidationException(String, IAFAState)\n" + 
3698
			"	* @see ValidationException#ValidationException(String, IAFAState)\n" + 
3632
			"	                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
3699
			"	                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
3633
			"Javadoc: Invalid qualification for member type constructor\n" + 
3700
			"Javadoc: Invalid member type qualification\n" + 
3634
			"----------\n" +
3701
			"----------\n" +
3635
			"----------\n" + 
3702
			"----------\n" + 
3636
			"1. ERROR in boden\\TestInvalid2.java (at line 5)\n" + 
3703
			"1. ERROR in boden\\TestInvalid2.java (at line 5)\n" + 
3637
			"	* @see IAFAState.ValidationException#ValidationException(String, IAFAState)\n" + 
3704
			"	* @see IAFAState.ValidationException#ValidationException(String, IAFAState)\n" + 
3638
			"	                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
3705
			"	                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
3639
			"Javadoc: Invalid qualification for member type constructor\n" + 
3706
			"Javadoc: Invalid member type qualification\n" + 
3640
			"----------\n" +
3707
			"----------\n" +
3641
			"----------\n" + 
3708
			"----------\n" + 
3642
			"1. ERROR in boden\\TestInvalid3.java (at line 5)\n" + 
3709
			"1. ERROR in boden\\TestInvalid3.java (at line 5)\n" + 
3643
			"	* @see IAFAState.ValidationException#IAFA.State.ValidationException(String, IAFAState)\n" + 
3710
			"	* @see IAFAState.ValidationException#IAFA.State.ValidationException(String, IAFAState)\n" + 
3644
			"	                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
3711
		"	                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
3645
			"Javadoc: Invalid qualification for member type constructor\n" + 
3712
			"Javadoc: Invalid member type qualification\n" + 
3646
			"----------\n" + 
3713
			"----------\n" + 
3647
			"----------\n" + 
3714
			"----------\n" + 
3648
			"1. ERROR in boden\\TestInvalid4.java (at line 5)\n" + 
3715
			"1. ERROR in boden\\TestInvalid4.java (at line 5)\n" + 
Lines 3685-3691 Link Here
3685
			"1. ERROR in test\\C.java (at line 8)\n" + 
3752
			"1. ERROR in test\\C.java (at line 8)\n" + 
3686
			"	* @see Test.Level0#Level0()\n" + 
3753
			"	* @see Test.Level0#Level0()\n" + 
3687
			"	                   ^^^^^^^^\n" + 
3754
			"	                   ^^^^^^^^\n" + 
3688
			"Javadoc: Invalid qualification for member type constructor\n" + 
3755
			"Javadoc: Invalid member type qualification\n" + 
3689
			"----------\n"
3756
			"----------\n"
3690
		);
3757
		);
3691
	}
3758
	}
Lines 3727-3738 Link Here
3727
			"1. ERROR in test\\C2.java (at line 8)\n" + 
3794
			"1. ERROR in test\\C2.java (at line 8)\n" + 
3728
			"	* @see Test.Member.Level1#Level1()\n" + 
3795
			"	* @see Test.Member.Level1#Level1()\n" + 
3729
			"	                          ^^^^^^^^\n" + 
3796
			"	                          ^^^^^^^^\n" + 
3730
			"Javadoc: Invalid qualification for member type constructor\n" + 
3797
			"Javadoc: Invalid member type qualification\n" + 
3731
			"----------\n" + 
3798
			"----------\n" + 
3732
			"2. ERROR in test\\C2.java (at line 12)\n" + 
3799
			"2. ERROR in test\\C2.java (at line 12)\n" + 
3733
			"	* @see Test.Member.Level1#Test.Level1()\n" + 
3800
			"	* @see Test.Member.Level1#Test.Level1()\n" + 
3734
			"	                          ^^^^^^^^^^^^^\n" + 
3801
			"	                          ^^^^^^^^^^^^^\n" + 
3735
			"Javadoc: Invalid qualification for member type constructor\n" + 
3802
			"Javadoc: Invalid member type qualification\n" + 
3736
			"----------\n"
3803
			"----------\n"
3737
		);
3804
		);
3738
	}
3805
	}
Lines 3814-3855 Link Here
3814
			"1. ERROR in implicit\\Invalid.java (at line 5)\n" + 
3881
			"1. ERROR in implicit\\Invalid.java (at line 5)\n" + 
3815
			"	* @see #Level0() Invalid\n" + 
3882
			"	* @see #Level0() Invalid\n" + 
3816
			"	        ^^^^^^^^\n" + 
3883
			"	        ^^^^^^^^\n" + 
3817
			"Javadoc: Invalid qualification for member type constructor\n" + 
3884
			"Javadoc: Invalid member type qualification\n" + 
3818
			"----------\n" + 
3885
			"----------\n" + 
3819
			"2. ERROR in implicit\\Invalid.java (at line 9)\n" + 
3886
			"2. ERROR in implicit\\Invalid.java (at line 9)\n" + 
3820
			"	* @see #Level0(String) Invalid\n" + 
3887
			"	* @see #Level0(String) Invalid\n" + 
3821
			"	        ^^^^^^^^^^^^^^\n" + 
3888
			"	        ^^^^^^^^^^^^^^\n" + 
3822
			"Javadoc: Invalid qualification for member type constructor\n" + 
3889
			"Javadoc: Invalid member type qualification\n" + 
3823
			"----------\n" + 
3890
			"----------\n" + 
3824
			"3. ERROR in implicit\\Invalid.java (at line 16)\n" + 
3891
			"3. ERROR in implicit\\Invalid.java (at line 16)\n" + 
3825
			"	* @see #Level1() Invalid\n" + 
3892
			"	* @see #Level1() Invalid\n" + 
3826
			"	        ^^^^^^^^\n" + 
3893
			"	        ^^^^^^^^\n" + 
3827
			"Javadoc: Invalid qualification for member type constructor\n" + 
3894
			"Javadoc: Invalid member type qualification\n" + 
3828
			"----------\n" + 
3895
			"----------\n" + 
3829
			"4. ERROR in implicit\\Invalid.java (at line 17)\n" + 
3896
			"4. ERROR in implicit\\Invalid.java (at line 17)\n" + 
3830
			"	* @see #Member.Level1() Invalid\n" + 
3897
			"	* @see #Member.Level1() Invalid\n" + 
3831
			"	        ^^^^^^^^^^^^^^^\n" + 
3898
			"	        ^^^^^^^^^^^^^^^\n" + 
3832
			"Javadoc: Invalid qualification for member type constructor\n" + 
3899
			"Javadoc: Invalid member type qualification\n" + 
3833
			"----------\n" + 
3900
			"----------\n" + 
3834
			"5. ERROR in implicit\\Invalid.java (at line 18)\n" + 
3901
			"5. ERROR in implicit\\Invalid.java (at line 18)\n" + 
3835
			"	* @see #Invalid.Level1() Invalid\n" + 
3902
			"	* @see #Invalid.Level1() Invalid\n" + 
3836
			"	        ^^^^^^^^^^^^^^^^\n" + 
3903
			"	        ^^^^^^^^^^^^^^^^\n" + 
3837
			"Javadoc: Invalid qualification for member type constructor\n" + 
3904
			"Javadoc: Invalid member type qualification\n" + 
3838
			"----------\n" + 
3905
			"----------\n" + 
3839
			"6. ERROR in implicit\\Invalid.java (at line 22)\n" + 
3906
			"6. ERROR in implicit\\Invalid.java (at line 22)\n" + 
3840
			"	* @see #Level1(int) Invalid\n" + 
3907
			"	* @see #Level1(int) Invalid\n" + 
3841
			"	        ^^^^^^^^^^^\n" + 
3908
			"	        ^^^^^^^^^^^\n" + 
3842
			"Javadoc: Invalid qualification for member type constructor\n" + 
3909
			"Javadoc: Invalid member type qualification\n" + 
3843
			"----------\n" + 
3910
			"----------\n" + 
3844
			"7. ERROR in implicit\\Invalid.java (at line 23)\n" + 
3911
			"7. ERROR in implicit\\Invalid.java (at line 23)\n" + 
3845
			"	* @see #Invalid.Level1(int) Invalid\n" + 
3912
			"	* @see #Invalid.Level1(int) Invalid\n" + 
3846
			"	        ^^^^^^^^^^^^^^^^^^^\n" + 
3913
			"	        ^^^^^^^^^^^^^^^^^^^\n" + 
3847
			"Javadoc: Invalid qualification for member type constructor\n" + 
3914
			"Javadoc: Invalid member type qualification\n" + 
3848
			"----------\n" + 
3915
			"----------\n" + 
3849
			"8. ERROR in implicit\\Invalid.java (at line 24)\n" + 
3916
			"8. ERROR in implicit\\Invalid.java (at line 24)\n" + 
3850
			"	* @see #Member.Level1(int) Invalid\n" + 
3917
			"	* @see #Member.Level1(int) Invalid\n" + 
3851
			"	        ^^^^^^^^^^^^^^^^^^\n" + 
3918
			"	        ^^^^^^^^^^^^^^^^^^\n" + 
3852
			"Javadoc: Invalid qualification for member type constructor\n" + 
3919
			"Javadoc: Invalid member type qualification\n" + 
3853
			"----------\n"
3920
			"----------\n"
3854
		);
3921
		);
3855
	}
3922
	}
(-)src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_3.java (-29 / +96 lines)
Lines 2596-2602 Link Here
2596
			"1. ERROR in comment6\\Invalid.java (at line 4)\r\n" + 
2596
			"1. ERROR in comment6\\Invalid.java (at line 4)\r\n" + 
2597
			"	* @see Inner\r\n" + 
2597
			"	* @see Inner\r\n" + 
2598
			"	       ^^^^^\n" + 
2598
			"	       ^^^^^\n" + 
2599
			"Javadoc: Not visible reference\n" + 
2599
			"Javadoc: Invalid member type qualification\n" + 
2600
			"----------\n"
2600
			"----------\n"
2601
		);
2601
		);
2602
	}
2602
	}
Lines 2627-2632 Link Here
2627
				" * @see Test.Inner\n" + 
2627
				" * @see Test.Inner\n" + 
2628
				" */\n" + 
2628
				" */\n" + 
2629
				"public class Invalid2 extends Test { \n" + 
2629
				"public class Invalid2 extends Test { \n" + 
2630
				"}",
2631
				"comment6a/test/Valid.java",
2632
				"package comment6a.test;\n" + 
2633
				"import comment6a.def.Test;\n" + 
2634
				"/**\n" + 
2635
				" * @see comment6a.def.Test.Inner\n" + 
2636
				" */\n" + 
2637
				"public class Valid extends Test { \n" + 
2630
				"}"
2638
				"}"
2631
			},
2639
			},
2632
//			comment6a\def\Test.java:6: warning - Tag @see: reference not found: Inner
2640
//			comment6a\def\Test.java:6: warning - Tag @see: reference not found: Inner
Lines 2636-2654 Link Here
2636
			"1. ERROR in comment6a\\def\\Test.java (at line 4)\n" + 
2644
			"1. ERROR in comment6a\\def\\Test.java (at line 4)\n" + 
2637
			"	* @see Inner\n" + 
2645
			"	* @see Inner\n" + 
2638
			"	       ^^^^^\n" + 
2646
			"	       ^^^^^\n" + 
2639
			"Javadoc: Not visible reference\n" + 
2647
			"Javadoc: Invalid member type qualification\n" + 
2640
			"----------\n" + 
2648
			"----------\n" + 
2641
			"----------\n" + 
2649
			"----------\n" + 
2642
			"1. ERROR in comment6a\\test\\Invalid.java (at line 4)\n" + 
2650
			"1. ERROR in comment6a\\test\\Invalid.java (at line 4)\n" + 
2643
			"	* See also {@link Inner}\n" + 
2651
			"	* See also {@link Inner}\n" + 
2644
			"	                  ^^^^^\n" + 
2652
			"	                  ^^^^^\n" + 
2645
			"Javadoc: Not visible reference\n" + 
2653
			"Javadoc: Invalid member type qualification\n" + 
2646
			"----------\n" + 
2654
			"----------\n" + 
2647
			"----------\n" + 
2655
			"----------\n" + 
2648
			"1. ERROR in comment6a\\test\\Invalid2.java (at line 4)\n" + 
2656
			"1. ERROR in comment6a\\test\\Invalid2.java (at line 4)\n" + 
2649
			"	* @see Test.Inner\n" + 
2657
			"	* @see Test.Inner\n" + 
2650
			"	       ^^^^^^^^^^\n" + 
2658
			"	       ^^^^^^^^^^\n" + 
2651
			"Javadoc: Not visible reference\n" + 
2659
			"Javadoc: Invalid member type qualification\n" + 
2652
			"----------\n"
2660
			"----------\n"
2653
		);
2661
		);
2654
	}
2662
	}
Lines 2687-2699 Link Here
2687
			"1. ERROR in comment6b\\Invalid.java (at line 4)\n" + 
2695
			"1. ERROR in comment6b\\Invalid.java (at line 4)\n" + 
2688
			"	* @see Inner\n" + 
2696
			"	* @see Inner\n" + 
2689
			"	       ^^^^^\n" + 
2697
			"	       ^^^^^\n" + 
2690
			"Javadoc: Not visible reference\n" + 
2698
			"Javadoc: Invalid member type qualification\n" + 
2691
			"----------\n" + 
2699
			"----------\n" + 
2692
			"----------\n" + 
2700
			"----------\n" + 
2693
			"1. ERROR in comment6b\\Test.java (at line 4)\n" + 
2701
			"1. ERROR in comment6b\\Test.java (at line 4)\n" + 
2694
			"	* @see Inner\n" + 
2702
			"	* @see Inner\n" + 
2695
			"	       ^^^^^\n" + 
2703
			"	       ^^^^^\n" + 
2696
			"Javadoc: Not visible reference\n" + 
2704
			"Javadoc: Invalid member type qualification\n" + 
2697
			"----------\n"
2705
			"----------\n"
2698
		);
2706
		);
2699
	}
2707
	}
Lines 2837-2842 Link Here
2837
			"----------\n"
2845
			"----------\n"
2838
		);
2846
		);
2839
	}
2847
	}
2848
	public void testBug96237_Public08() {
2849
		this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
2850
		runNegativeTest(
2851
			new String[] {
2852
				"test/d/Reference.java",
2853
				"package test.d;\n" + 
2854
				"class Reference {\n" + 
2855
				"}\n",
2856
				"test/d/Test.java",
2857
				"package test.d;\n" + 
2858
				"/**\n" + 
2859
				" * @see Secondary\n" + 
2860
				" * @see Reference\n" + 
2861
				" */\n" + 
2862
				"public class Test {\n" + 
2863
				"}\n" + 
2864
				"class Secondary {}"
2865
			},
2866
			"----------\n" + 
2867
			"1. ERROR in test\\d\\Test.java (at line 3)\n" + 
2868
			"	* @see Secondary\n" + 
2869
			"	       ^^^^^^^^^\n" + 
2870
			"Javadoc: Not visible reference\n" + 
2871
			"----------\n" + 
2872
			"2. ERROR in test\\d\\Test.java (at line 4)\n" + 
2873
			"	* @see Reference\n" + 
2874
			"	       ^^^^^^^^^\n" + 
2875
			"Javadoc: Not visible reference\n" + 
2876
			"----------\n"
2877
		);
2878
	}
2840
	public void testBug96237_Private01() {
2879
	public void testBug96237_Private01() {
2841
		this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
2880
		this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
2842
		runConformTest(
2881
		runConformTest(
Lines 2879-2890 Link Here
2879
			"1. ERROR in comment6\\Invalid.java (at line 4)\n" + 
2918
			"1. ERROR in comment6\\Invalid.java (at line 4)\n" + 
2880
			"	* @see Inner\n" + 
2919
			"	* @see Inner\n" + 
2881
			"	       ^^^^^\n" + 
2920
			"	       ^^^^^\n" + 
2882
			"Javadoc: Not visible reference\n" + 
2921
			"Javadoc: Invalid member type qualification\n" + 
2883
			"----------\n" + 
2922
			"----------\n" + 
2884
			"2. ERROR in comment6\\Invalid.java (at line 9)\n" + 
2923
			"2. ERROR in comment6\\Invalid.java (at line 9)\n" + 
2885
			"	* See also {@link Inner} \n" + 
2924
			"	* See also {@link Inner} \n" + 
2886
			"	                  ^^^^^\n" + 
2925
			"	                  ^^^^^\n" + 
2887
			"Javadoc: Not visible reference\n" + 
2926
			"Javadoc: Invalid member type qualification\n" + 
2888
			"----------\n"
2927
			"----------\n"
2889
		);
2928
		);
2890
	}
2929
	}
Lines 2915-2920 Link Here
2915
				" * @see Test.Inner\n" + 
2954
				" * @see Test.Inner\n" + 
2916
				" */\n" + 
2955
				" */\n" + 
2917
				"public class Invalid2 extends Test { \n" + 
2956
				"public class Invalid2 extends Test { \n" + 
2957
				"}",
2958
				"comment6a/test/Valid.java",
2959
				"package comment6a.test;\n" + 
2960
				"import comment6a.def.Test;\n" + 
2961
				"/**\n" + 
2962
				" * @see comment6a.def.Test.Inner\n" + 
2963
				" */\n" + 
2964
				"public class Valid extends Test { \n" + 
2918
				"}"
2965
				"}"
2919
			},
2966
			},
2920
//			comment6a\def\Test.java:6: warning - Tag @see: reference not found: Inner
2967
//			comment6a\def\Test.java:6: warning - Tag @see: reference not found: Inner
Lines 2924-2942 Link Here
2924
			"1. ERROR in comment6a\\def\\Test.java (at line 4)\n" + 
2971
			"1. ERROR in comment6a\\def\\Test.java (at line 4)\n" + 
2925
			"	* @see Inner\n" + 
2972
			"	* @see Inner\n" + 
2926
			"	       ^^^^^\n" + 
2973
			"	       ^^^^^\n" + 
2927
			"Javadoc: Not visible reference\n" + 
2974
			"Javadoc: Invalid member type qualification\n" + 
2928
			"----------\n" + 
2975
			"----------\n" + 
2929
			"----------\n" + 
2976
			"----------\n" + 
2930
			"1. ERROR in comment6a\\test\\Invalid.java (at line 4)\n" + 
2977
			"1. ERROR in comment6a\\test\\Invalid.java (at line 4)\n" + 
2931
			"	* See also {@link Inner}\n" + 
2978
			"	* See also {@link Inner}\n" + 
2932
			"	                  ^^^^^\n" + 
2979
			"	                  ^^^^^\n" + 
2933
			"Javadoc: Not visible reference\n" + 
2980
			"Javadoc: Invalid member type qualification\n" + 
2934
			"----------\n" + 
2981
			"----------\n" + 
2935
			"----------\n" + 
2982
			"----------\n" + 
2936
			"1. ERROR in comment6a\\test\\Invalid2.java (at line 4)\n" + 
2983
			"1. ERROR in comment6a\\test\\Invalid2.java (at line 4)\n" + 
2937
			"	* @see Test.Inner\n" + 
2984
			"	* @see Test.Inner\n" + 
2938
			"	       ^^^^^^^^^^\n" + 
2985
			"	       ^^^^^^^^^^\n" + 
2939
			"Javadoc: Not visible reference\n" + 
2986
			"Javadoc: Invalid member type qualification\n" + 
2940
			"----------\n"
2987
			"----------\n"
2941
		);
2988
		);
2942
	}
2989
	}
Lines 2975-2987 Link Here
2975
			"1. ERROR in comment6b\\Invalid.java (at line 4)\n" + 
3022
			"1. ERROR in comment6b\\Invalid.java (at line 4)\n" + 
2976
			"	* @see Inner\n" + 
3023
			"	* @see Inner\n" + 
2977
			"	       ^^^^^\n" + 
3024
			"	       ^^^^^\n" + 
2978
			"Javadoc: Not visible reference\n" + 
3025
			"Javadoc: Invalid member type qualification\n" + 
2979
			"----------\n" + 
3026
			"----------\n" + 
2980
			"----------\n" + 
3027
			"----------\n" + 
2981
			"1. ERROR in comment6b\\Test.java (at line 4)\n" + 
3028
			"1. ERROR in comment6b\\Test.java (at line 4)\n" + 
2982
			"	* @see Inner\n" + 
3029
			"	* @see Inner\n" + 
2983
			"	       ^^^^^\n" + 
3030
			"	       ^^^^^\n" + 
2984
			"Javadoc: Not visible reference\n" + 
3031
			"Javadoc: Invalid member type qualification\n" + 
2985
			"----------\n"
3032
			"----------\n"
2986
		);
3033
		);
2987
	}
3034
	}
Lines 3050-3055 Link Here
3050
			}
3097
			}
3051
		);
3098
		);
3052
	}
3099
	}
3100
	public void testBug96237_Private08() {
3101
		this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
3102
		runConformTest(
3103
			new String[] {
3104
				"test/d/Reference.java",
3105
				"package test.d;\n" + 
3106
				"class Reference {\n" + 
3107
				"}\n",
3108
				"test/d/Test.java",
3109
				"package test.d;\n" + 
3110
				"/**\n" + 
3111
				" * @see Secondary\n" + 
3112
				" * @see Reference\n" + 
3113
				" */\n" + 
3114
				"public class Test {\n" + 
3115
				"}\n" + 
3116
				"class Secondary {}"
3117
			}
3118
		);
3119
	}
3053
3120
3054
	/**
3121
	/**
3055
	 * Bug 95286: [1.5][javadoc] package-info.java incorrectly flags "Missing comment for public declaration"
3122
	 * Bug 95286: [1.5][javadoc] package-info.java incorrectly flags "Missing comment for public declaration"
Lines 3574-3580 Link Here
3574
			"1. ERROR in boden\\TestValid.java (at line 4)\r\n" + 
3641
			"1. ERROR in boden\\TestValid.java (at line 4)\r\n" + 
3575
			"	* @see ValidationException\r\n" + 
3642
			"	* @see ValidationException\r\n" + 
3576
			"	       ^^^^^^^^^^^^^^^^^^^\n" + 
3643
			"	       ^^^^^^^^^^^^^^^^^^^\n" + 
3577
			"Javadoc: Not visible reference\n" + 
3644
			"Javadoc: Invalid member type qualification\n" + 
3578
			"----------\n"
3645
			"----------\n"
3579
		);
3646
		);
3580
	}
3647
	}
Lines 3636-3654 Link Here
3636
			"1. ERROR in boden\\TestInvalid1.java (at line 5)\n" + 
3703
			"1. ERROR in boden\\TestInvalid1.java (at line 5)\n" + 
3637
			"	* @see ValidationException#ValidationException(String, IAFAState)\n" + 
3704
			"	* @see ValidationException#ValidationException(String, IAFAState)\n" + 
3638
			"	                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
3705
			"	                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
3639
			"Javadoc: Invalid qualification for member type constructor\n" + 
3706
			"Javadoc: Invalid member type qualification\n" + 
3640
			"----------\n" +
3707
			"----------\n" +
3641
			"----------\n" + 
3708
			"----------\n" + 
3642
			"1. ERROR in boden\\TestInvalid2.java (at line 5)\n" + 
3709
			"1. ERROR in boden\\TestInvalid2.java (at line 5)\n" + 
3643
			"	* @see IAFAState.ValidationException#ValidationException(String, IAFAState)\n" + 
3710
			"	* @see IAFAState.ValidationException#ValidationException(String, IAFAState)\n" + 
3644
			"	                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
3711
			"	                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
3645
			"Javadoc: Invalid qualification for member type constructor\n" + 
3712
			"Javadoc: Invalid member type qualification\n" + 
3646
			"----------\n" +
3713
			"----------\n" +
3647
			"----------\n" + 
3714
			"----------\n" + 
3648
			"1. ERROR in boden\\TestInvalid3.java (at line 5)\n" + 
3715
			"1. ERROR in boden\\TestInvalid3.java (at line 5)\n" + 
3649
			"	* @see IAFAState.ValidationException#IAFA.State.ValidationException(String, IAFAState)\n" + 
3716
			"	* @see IAFAState.ValidationException#IAFA.State.ValidationException(String, IAFAState)\n" + 
3650
			"	                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
3717
		"	                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
3651
			"Javadoc: Invalid qualification for member type constructor\n" + 
3718
			"Javadoc: Invalid member type qualification\n" + 
3652
			"----------\n" + 
3719
			"----------\n" + 
3653
			"----------\n" + 
3720
			"----------\n" + 
3654
			"1. ERROR in boden\\TestInvalid4.java (at line 5)\n" + 
3721
			"1. ERROR in boden\\TestInvalid4.java (at line 5)\n" + 
Lines 3691-3697 Link Here
3691
			"1. ERROR in test\\C.java (at line 8)\n" + 
3758
			"1. ERROR in test\\C.java (at line 8)\n" + 
3692
			"	* @see Test.Level0#Level0()\n" + 
3759
			"	* @see Test.Level0#Level0()\n" + 
3693
			"	                   ^^^^^^^^\n" + 
3760
			"	                   ^^^^^^^^\n" + 
3694
			"Javadoc: Invalid qualification for member type constructor\n" + 
3761
			"Javadoc: Invalid member type qualification\n" + 
3695
			"----------\n"
3762
			"----------\n"
3696
		);
3763
		);
3697
	}
3764
	}
Lines 3733-3744 Link Here
3733
			"1. ERROR in test\\C2.java (at line 8)\n" + 
3800
			"1. ERROR in test\\C2.java (at line 8)\n" + 
3734
			"	* @see Test.Member.Level1#Level1()\n" + 
3801
			"	* @see Test.Member.Level1#Level1()\n" + 
3735
			"	                          ^^^^^^^^\n" + 
3802
			"	                          ^^^^^^^^\n" + 
3736
			"Javadoc: Invalid qualification for member type constructor\n" + 
3803
			"Javadoc: Invalid member type qualification\n" + 
3737
			"----------\n" + 
3804
			"----------\n" + 
3738
			"2. ERROR in test\\C2.java (at line 12)\n" + 
3805
			"2. ERROR in test\\C2.java (at line 12)\n" + 
3739
			"	* @see Test.Member.Level1#Test.Level1()\n" + 
3806
			"	* @see Test.Member.Level1#Test.Level1()\n" + 
3740
			"	                          ^^^^^^^^^^^^^\n" + 
3807
			"	                          ^^^^^^^^^^^^^\n" + 
3741
			"Javadoc: Invalid qualification for member type constructor\n" + 
3808
			"Javadoc: Invalid member type qualification\n" + 
3742
			"----------\n"
3809
			"----------\n"
3743
		);
3810
		);
3744
	}
3811
	}
Lines 3820-3861 Link Here
3820
			"1. ERROR in implicit\\Invalid.java (at line 5)\n" + 
3887
			"1. ERROR in implicit\\Invalid.java (at line 5)\n" + 
3821
			"	* @see #Level0() Invalid\n" + 
3888
			"	* @see #Level0() Invalid\n" + 
3822
			"	        ^^^^^^^^\n" + 
3889
			"	        ^^^^^^^^\n" + 
3823
			"Javadoc: Invalid qualification for member type constructor\n" + 
3890
			"Javadoc: Invalid member type qualification\n" + 
3824
			"----------\n" + 
3891
			"----------\n" + 
3825
			"2. ERROR in implicit\\Invalid.java (at line 9)\n" + 
3892
			"2. ERROR in implicit\\Invalid.java (at line 9)\n" + 
3826
			"	* @see #Level0(String) Invalid\n" + 
3893
			"	* @see #Level0(String) Invalid\n" + 
3827
			"	        ^^^^^^^^^^^^^^\n" + 
3894
			"	        ^^^^^^^^^^^^^^\n" + 
3828
			"Javadoc: Invalid qualification for member type constructor\n" + 
3895
			"Javadoc: Invalid member type qualification\n" + 
3829
			"----------\n" + 
3896
			"----------\n" + 
3830
			"3. ERROR in implicit\\Invalid.java (at line 16)\n" + 
3897
			"3. ERROR in implicit\\Invalid.java (at line 16)\n" + 
3831
			"	* @see #Level1() Invalid\n" + 
3898
			"	* @see #Level1() Invalid\n" + 
3832
			"	        ^^^^^^^^\n" + 
3899
			"	        ^^^^^^^^\n" + 
3833
			"Javadoc: Invalid qualification for member type constructor\n" + 
3900
			"Javadoc: Invalid member type qualification\n" + 
3834
			"----------\n" + 
3901
			"----------\n" + 
3835
			"4. ERROR in implicit\\Invalid.java (at line 17)\n" + 
3902
			"4. ERROR in implicit\\Invalid.java (at line 17)\n" + 
3836
			"	* @see #Member.Level1() Invalid\n" + 
3903
			"	* @see #Member.Level1() Invalid\n" + 
3837
			"	        ^^^^^^^^^^^^^^^\n" + 
3904
			"	        ^^^^^^^^^^^^^^^\n" + 
3838
			"Javadoc: Invalid qualification for member type constructor\n" + 
3905
			"Javadoc: Invalid member type qualification\n" + 
3839
			"----------\n" + 
3906
			"----------\n" + 
3840
			"5. ERROR in implicit\\Invalid.java (at line 18)\n" + 
3907
			"5. ERROR in implicit\\Invalid.java (at line 18)\n" + 
3841
			"	* @see #Invalid.Level1() Invalid\n" + 
3908
			"	* @see #Invalid.Level1() Invalid\n" + 
3842
			"	        ^^^^^^^^^^^^^^^^\n" + 
3909
			"	        ^^^^^^^^^^^^^^^^\n" + 
3843
			"Javadoc: Invalid qualification for member type constructor\n" + 
3910
			"Javadoc: Invalid member type qualification\n" + 
3844
			"----------\n" + 
3911
			"----------\n" + 
3845
			"6. ERROR in implicit\\Invalid.java (at line 22)\n" + 
3912
			"6. ERROR in implicit\\Invalid.java (at line 22)\n" + 
3846
			"	* @see #Level1(int) Invalid\n" + 
3913
			"	* @see #Level1(int) Invalid\n" + 
3847
			"	        ^^^^^^^^^^^\n" + 
3914
			"	        ^^^^^^^^^^^\n" + 
3848
			"Javadoc: Invalid qualification for member type constructor\n" + 
3915
			"Javadoc: Invalid member type qualification\n" + 
3849
			"----------\n" + 
3916
			"----------\n" + 
3850
			"7. ERROR in implicit\\Invalid.java (at line 23)\n" + 
3917
			"7. ERROR in implicit\\Invalid.java (at line 23)\n" + 
3851
			"	* @see #Invalid.Level1(int) Invalid\n" + 
3918
			"	* @see #Invalid.Level1(int) Invalid\n" + 
3852
			"	        ^^^^^^^^^^^^^^^^^^^\n" + 
3919
			"	        ^^^^^^^^^^^^^^^^^^^\n" + 
3853
			"Javadoc: Invalid qualification for member type constructor\n" + 
3920
			"Javadoc: Invalid member type qualification\n" + 
3854
			"----------\n" + 
3921
			"----------\n" + 
3855
			"8. ERROR in implicit\\Invalid.java (at line 24)\n" + 
3922
			"8. ERROR in implicit\\Invalid.java (at line 24)\n" + 
3856
			"	* @see #Member.Level1(int) Invalid\n" + 
3923
			"	* @see #Member.Level1(int) Invalid\n" + 
3857
			"	        ^^^^^^^^^^^^^^^^^^\n" + 
3924
			"	        ^^^^^^^^^^^^^^^^^^\n" + 
3858
			"Javadoc: Invalid qualification for member type constructor\n" + 
3925
			"Javadoc: Invalid member type qualification\n" + 
3859
			"----------\n"
3926
			"----------\n"
3860
		);
3927
		);
3861
	}
3928
	}
(-)src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_5.java (-23 / +90 lines)
Lines 1972-1977 Link Here
1972
				" * @see Test.Inner\n" + 
1972
				" * @see Test.Inner\n" + 
1973
				" */\n" + 
1973
				" */\n" + 
1974
				"public class Invalid2 extends Test { \n" + 
1974
				"public class Invalid2 extends Test { \n" + 
1975
				"}",
1976
				"comment6a/test/Valid.java",
1977
				"package comment6a.test;\n" + 
1978
				"import comment6a.def.Test;\n" + 
1979
				"/**\n" + 
1980
				" * @see comment6a.def.Test.Inner\n" + 
1981
				" */\n" + 
1982
				"public class Valid extends Test { \n" + 
1975
				"}"
1983
				"}"
1976
			},
1984
			},
1977
//			comment6a\test\Invalid.java:8: warning - Tag @link: reference not found: Inner
1985
//			comment6a\test\Invalid.java:8: warning - Tag @link: reference not found: Inner
Lines 1980-1992 Link Here
1980
			"1. ERROR in comment6a\\test\\Invalid.java (at line 4)\n" + 
1988
			"1. ERROR in comment6a\\test\\Invalid.java (at line 4)\n" + 
1981
			"	* See also {@link Inner}\n" + 
1989
			"	* See also {@link Inner}\n" + 
1982
			"	                  ^^^^^\n" + 
1990
			"	                  ^^^^^\n" + 
1983
			"Javadoc: Not visible reference\n" + 
1991
			"Javadoc: Invalid member type qualification\n" + 
1984
			"----------\n" + 
1992
			"----------\n" + 
1985
			"----------\n" + 
1993
			"----------\n" + 
1986
			"1. ERROR in comment6a\\test\\Invalid2.java (at line 4)\n" + 
1994
			"1. ERROR in comment6a\\test\\Invalid2.java (at line 4)\n" + 
1987
			"	* @see Test.Inner\n" + 
1995
			"	* @see Test.Inner\n" + 
1988
			"	       ^^^^^^^^^^\n" + 
1996
			"	       ^^^^^^^^^^\n" + 
1989
			"Javadoc: Not visible reference\n" + 
1997
			"Javadoc: Invalid member type qualification\n" + 
1990
			"----------\n"
1998
			"----------\n"
1991
		);
1999
		);
1992
	}
2000
	}
Lines 2024-2030 Link Here
2024
			"1. ERROR in comment6b\\Invalid.java (at line 4)\n" + 
2032
			"1. ERROR in comment6b\\Invalid.java (at line 4)\n" + 
2025
			"	* @see Inner\n" + 
2033
			"	* @see Inner\n" + 
2026
			"	       ^^^^^\n" + 
2034
			"	       ^^^^^\n" + 
2027
			"Javadoc: Not visible reference\n" + 
2035
			"Javadoc: Invalid member type qualification\n" + 
2028
			"----------\n"
2036
			"----------\n"
2029
		);
2037
		);
2030
	}
2038
	}
Lines 2168-2173 Link Here
2168
			"----------\n"
2176
			"----------\n"
2169
		);
2177
		);
2170
	}
2178
	}
2179
	public void testBug96237_Public08() {
2180
		this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
2181
		runNegativeTest(
2182
			new String[] {
2183
				"test/d/Reference.java",
2184
				"package test.d;\n" + 
2185
				"class Reference {\n" + 
2186
				"}\n",
2187
				"test/d/Test.java",
2188
				"package test.d;\n" + 
2189
				"/**\n" + 
2190
				" * @see Secondary\n" + 
2191
				" * @see Reference\n" + 
2192
				" */\n" + 
2193
				"public class Test {\n" + 
2194
				"}\n" + 
2195
				"class Secondary {}"
2196
			},
2197
			"----------\n" + 
2198
			"1. ERROR in test\\d\\Test.java (at line 3)\n" + 
2199
			"	* @see Secondary\n" + 
2200
			"	       ^^^^^^^^^\n" + 
2201
			"Javadoc: Not visible reference\n" + 
2202
			"----------\n" + 
2203
			"2. ERROR in test\\d\\Test.java (at line 4)\n" + 
2204
			"	* @see Reference\n" + 
2205
			"	       ^^^^^^^^^\n" + 
2206
			"Javadoc: Not visible reference\n" + 
2207
			"----------\n"
2208
		);
2209
	}
2171
	public void testBug96237_Private01() {
2210
	public void testBug96237_Private01() {
2172
		this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
2211
		this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
2173
		runConformTest(
2212
		runConformTest(
Lines 2209-2215 Link Here
2209
			"1. ERROR in comment6\\Invalid.java (at line 9)\n" + 
2248
			"1. ERROR in comment6\\Invalid.java (at line 9)\n" + 
2210
			"	* See also {@link Inner} \n" + 
2249
			"	* See also {@link Inner} \n" + 
2211
			"	                  ^^^^^\n" + 
2250
			"	                  ^^^^^\n" + 
2212
			"Javadoc: Not visible reference\n" + 
2251
			"Javadoc: Invalid member type qualification\n" + 
2213
			"----------\n"
2252
			"----------\n"
2214
		);
2253
		);
2215
	}
2254
	}
Lines 2240-2245 Link Here
2240
				" * @see Test.Inner\n" + 
2279
				" * @see Test.Inner\n" + 
2241
				" */\n" + 
2280
				" */\n" + 
2242
				"public class Invalid2 extends Test { \n" + 
2281
				"public class Invalid2 extends Test { \n" + 
2282
				"}",
2283
				"comment6a/test/Valid.java",
2284
				"package comment6a.test;\n" + 
2285
				"import comment6a.def.Test;\n" + 
2286
				"/**\n" + 
2287
				" * @see comment6a.def.Test.Inner\n" + 
2288
				" */\n" + 
2289
				"public class Valid extends Test { \n" + 
2243
				"}"
2290
				"}"
2244
			},
2291
			},
2245
//			comment6a\test\Invalid.java:8: warning - Tag @link: reference not found: Inner
2292
//			comment6a\test\Invalid.java:8: warning - Tag @link: reference not found: Inner
Lines 2248-2260 Link Here
2248
			"1. ERROR in comment6a\\test\\Invalid.java (at line 4)\n" + 
2295
			"1. ERROR in comment6a\\test\\Invalid.java (at line 4)\n" + 
2249
			"	* See also {@link Inner}\n" + 
2296
			"	* See also {@link Inner}\n" + 
2250
			"	                  ^^^^^\n" + 
2297
			"	                  ^^^^^\n" + 
2251
			"Javadoc: Not visible reference\n" + 
2298
			"Javadoc: Invalid member type qualification\n" + 
2252
			"----------\n" + 
2299
			"----------\n" + 
2253
			"----------\n" + 
2300
			"----------\n" + 
2254
			"1. ERROR in comment6a\\test\\Invalid2.java (at line 4)\n" + 
2301
			"1. ERROR in comment6a\\test\\Invalid2.java (at line 4)\n" + 
2255
			"	* @see Test.Inner\n" + 
2302
			"	* @see Test.Inner\n" + 
2256
			"	       ^^^^^^^^^^\n" + 
2303
			"	       ^^^^^^^^^^\n" + 
2257
			"Javadoc: Not visible reference\n" + 
2304
			"Javadoc: Invalid member type qualification\n" + 
2258
			"----------\n"
2305
			"----------\n"
2259
		);
2306
		);
2260
	}
2307
	}
Lines 2292-2298 Link Here
2292
			"1. ERROR in comment6b\\Invalid.java (at line 4)\n" + 
2339
			"1. ERROR in comment6b\\Invalid.java (at line 4)\n" + 
2293
			"	* @see Inner\n" + 
2340
			"	* @see Inner\n" + 
2294
			"	       ^^^^^\n" + 
2341
			"	       ^^^^^\n" + 
2295
			"Javadoc: Not visible reference\n" + 
2342
			"Javadoc: Invalid member type qualification\n" + 
2296
			"----------\n"
2343
			"----------\n"
2297
		);
2344
		);
2298
	}
2345
	}
Lines 2361-2366 Link Here
2361
			}
2408
			}
2362
		);
2409
		);
2363
	}
2410
	}
2411
	public void testBug96237_Private08() {
2412
		this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
2413
		runConformTest(
2414
			new String[] {
2415
				"test/d/Reference.java",
2416
				"package test.d;\n" + 
2417
				"class Reference {\n" + 
2418
				"}\n",
2419
				"test/d/Test.java",
2420
				"package test.d;\n" + 
2421
				"/**\n" + 
2422
				" * @see Secondary\n" + 
2423
				" * @see Reference\n" + 
2424
				" */\n" + 
2425
				"public class Test {\n" + 
2426
				"}\n" + 
2427
				"class Secondary {}"
2428
			}
2429
		);
2430
	}
2364
2431
2365
	/**
2432
	/**
2366
	 * Bug 101283: [1.5][javadoc] Javadoc validation raises missing implementation in compiler
2433
	 * Bug 101283: [1.5][javadoc] Javadoc validation raises missing implementation in compiler
Lines 2663-2669 Link Here
2663
			"1. ERROR in boden\\TestValid.java (at line 4)\r\n" + 
2730
			"1. ERROR in boden\\TestValid.java (at line 4)\r\n" + 
2664
			"	* @see ValidationException\r\n" + 
2731
			"	* @see ValidationException\r\n" + 
2665
			"	       ^^^^^^^^^^^^^^^^^^^\n" + 
2732
			"	       ^^^^^^^^^^^^^^^^^^^\n" + 
2666
			"Javadoc: Not visible reference\n" + 
2733
			"Javadoc: Invalid member type qualification\n" + 
2667
			"----------\n"
2734
			"----------\n"
2668
		);
2735
		);
2669
	}
2736
	}
Lines 2725-2743 Link Here
2725
			"1. ERROR in boden\\TestInvalid1.java (at line 5)\n" + 
2792
			"1. ERROR in boden\\TestInvalid1.java (at line 5)\n" + 
2726
			"	* @see ValidationException#ValidationException(String, IAFAState)\n" + 
2793
			"	* @see ValidationException#ValidationException(String, IAFAState)\n" + 
2727
			"	                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
2794
			"	                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
2728
			"Javadoc: Invalid qualification for member type constructor\n" + 
2795
			"Javadoc: Invalid member type qualification\n" + 
2729
			"----------\n" +
2796
			"----------\n" +
2730
			"----------\n" + 
2797
			"----------\n" + 
2731
			"1. ERROR in boden\\TestInvalid2.java (at line 5)\n" + 
2798
			"1. ERROR in boden\\TestInvalid2.java (at line 5)\n" + 
2732
			"	* @see IAFAState.ValidationException#ValidationException(String, IAFAState)\n" + 
2799
			"	* @see IAFAState.ValidationException#ValidationException(String, IAFAState)\n" + 
2733
			"	                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
2800
			"	                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
2734
			"Javadoc: Invalid qualification for member type constructor\n" + 
2801
			"Javadoc: Invalid member type qualification\n" + 
2735
			"----------\n" +
2802
			"----------\n" +
2736
			"----------\n" + 
2803
			"----------\n" + 
2737
			"1. ERROR in boden\\TestInvalid3.java (at line 5)\n" + 
2804
			"1. ERROR in boden\\TestInvalid3.java (at line 5)\n" + 
2738
			"	* @see IAFAState.ValidationException#IAFA.State.ValidationException(String, IAFAState)\n" + 
2805
			"	* @see IAFAState.ValidationException#IAFA.State.ValidationException(String, IAFAState)\n" + 
2739
			"	                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
2806
			"	                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
2740
			"Javadoc: Invalid qualification for member type constructor\n" + 
2807
			"Javadoc: Invalid member type qualification\n" + 
2741
			"----------\n" + 
2808
			"----------\n" + 
2742
			"----------\n" + 
2809
			"----------\n" + 
2743
			"1. ERROR in boden\\TestInvalid4.java (at line 5)\n" + 
2810
			"1. ERROR in boden\\TestInvalid4.java (at line 5)\n" + 
Lines 2780-2786 Link Here
2780
			"1. ERROR in test\\C.java (at line 8)\n" + 
2847
			"1. ERROR in test\\C.java (at line 8)\n" + 
2781
			"	* @see Test.Level0#Level0()\n" + 
2848
			"	* @see Test.Level0#Level0()\n" + 
2782
			"	                   ^^^^^^^^\n" + 
2849
			"	                   ^^^^^^^^\n" + 
2783
			"Javadoc: Invalid qualification for member type constructor\n" + 
2850
			"Javadoc: Invalid member type qualification\n" + 
2784
			"----------\n"
2851
			"----------\n"
2785
		);
2852
		);
2786
	}
2853
	}
Lines 2822-2833 Link Here
2822
			"1. ERROR in test\\C2.java (at line 8)\n" + 
2889
			"1. ERROR in test\\C2.java (at line 8)\n" + 
2823
			"	* @see Test.Member.Level1#Level1()\n" + 
2890
			"	* @see Test.Member.Level1#Level1()\n" + 
2824
			"	                          ^^^^^^^^\n" + 
2891
			"	                          ^^^^^^^^\n" + 
2825
			"Javadoc: Invalid qualification for member type constructor\n" + 
2892
			"Javadoc: Invalid member type qualification\n" + 
2826
			"----------\n" + 
2893
			"----------\n" + 
2827
			"2. ERROR in test\\C2.java (at line 12)\n" + 
2894
			"2. ERROR in test\\C2.java (at line 12)\n" + 
2828
			"	* @see Test.Member.Level1#Test.Level1()\n" + 
2895
			"	* @see Test.Member.Level1#Test.Level1()\n" + 
2829
			"	                          ^^^^^^^^^^^^^\n" + 
2896
			"	                          ^^^^^^^^^^^^^\n" + 
2830
			"Javadoc: Invalid qualification for member type constructor\n" + 
2897
			"Javadoc: Invalid member type qualification\n" + 
2831
			"----------\n"
2898
			"----------\n"
2832
		);
2899
		);
2833
	}
2900
	}
Lines 2909-2950 Link Here
2909
			"1. ERROR in implicit\\Invalid.java (at line 5)\n" + 
2976
			"1. ERROR in implicit\\Invalid.java (at line 5)\n" + 
2910
			"	* @see #Level0() Invalid\n" + 
2977
			"	* @see #Level0() Invalid\n" + 
2911
			"	        ^^^^^^^^\n" + 
2978
			"	        ^^^^^^^^\n" + 
2912
			"Javadoc: Invalid qualification for member type constructor\n" + 
2979
			"Javadoc: Invalid member type qualification\n" + 
2913
			"----------\n" + 
2980
			"----------\n" + 
2914
			"2. ERROR in implicit\\Invalid.java (at line 9)\n" + 
2981
			"2. ERROR in implicit\\Invalid.java (at line 9)\n" + 
2915
			"	* @see #Level0(String) Invalid\n" + 
2982
			"	* @see #Level0(String) Invalid\n" + 
2916
			"	        ^^^^^^^^^^^^^^\n" + 
2983
			"	        ^^^^^^^^^^^^^^\n" + 
2917
			"Javadoc: Invalid qualification for member type constructor\n" + 
2984
			"Javadoc: Invalid member type qualification\n" + 
2918
			"----------\n" + 
2985
			"----------\n" + 
2919
			"3. ERROR in implicit\\Invalid.java (at line 16)\n" + 
2986
			"3. ERROR in implicit\\Invalid.java (at line 16)\n" + 
2920
			"	* @see #Level1() Invalid\n" + 
2987
			"	* @see #Level1() Invalid\n" + 
2921
			"	        ^^^^^^^^\n" + 
2988
			"	        ^^^^^^^^\n" + 
2922
			"Javadoc: Invalid qualification for member type constructor\n" + 
2989
			"Javadoc: Invalid member type qualification\n" + 
2923
			"----------\n" + 
2990
			"----------\n" + 
2924
			"4. ERROR in implicit\\Invalid.java (at line 17)\n" + 
2991
			"4. ERROR in implicit\\Invalid.java (at line 17)\n" + 
2925
			"	* @see #Member.Level1() Invalid\n" + 
2992
			"	* @see #Member.Level1() Invalid\n" + 
2926
			"	        ^^^^^^^^^^^^^^^\n" + 
2993
			"	        ^^^^^^^^^^^^^^^\n" + 
2927
			"Javadoc: Invalid qualification for member type constructor\n" + 
2994
			"Javadoc: Invalid member type qualification\n" + 
2928
			"----------\n" + 
2995
			"----------\n" + 
2929
			"5. ERROR in implicit\\Invalid.java (at line 18)\n" + 
2996
			"5. ERROR in implicit\\Invalid.java (at line 18)\n" + 
2930
			"	* @see #Invalid.Level1() Invalid\n" + 
2997
			"	* @see #Invalid.Level1() Invalid\n" + 
2931
			"	        ^^^^^^^^^^^^^^^^\n" + 
2998
			"	        ^^^^^^^^^^^^^^^^\n" + 
2932
			"Javadoc: Invalid qualification for member type constructor\n" + 
2999
			"Javadoc: Invalid member type qualification\n" + 
2933
			"----------\n" + 
3000
			"----------\n" + 
2934
			"6. ERROR in implicit\\Invalid.java (at line 22)\n" + 
3001
			"6. ERROR in implicit\\Invalid.java (at line 22)\n" + 
2935
			"	* @see #Level1(int) Invalid\n" + 
3002
			"	* @see #Level1(int) Invalid\n" + 
2936
			"	        ^^^^^^^^^^^\n" + 
3003
			"	        ^^^^^^^^^^^\n" + 
2937
			"Javadoc: Invalid qualification for member type constructor\n" + 
3004
			"Javadoc: Invalid member type qualification\n" + 
2938
			"----------\n" + 
3005
			"----------\n" + 
2939
			"7. ERROR in implicit\\Invalid.java (at line 23)\n" + 
3006
			"7. ERROR in implicit\\Invalid.java (at line 23)\n" + 
2940
			"	* @see #Invalid.Level1(int) Invalid\n" + 
3007
			"	* @see #Invalid.Level1(int) Invalid\n" + 
2941
			"	        ^^^^^^^^^^^^^^^^^^^\n" + 
3008
			"	        ^^^^^^^^^^^^^^^^^^^\n" + 
2942
			"Javadoc: Invalid qualification for member type constructor\n" + 
3009
			"Javadoc: Invalid member type qualification\n" + 
2943
			"----------\n" + 
3010
			"----------\n" + 
2944
			"8. ERROR in implicit\\Invalid.java (at line 24)\n" + 
3011
			"8. ERROR in implicit\\Invalid.java (at line 24)\n" + 
2945
			"	* @see #Member.Level1(int) Invalid\n" + 
3012
			"	* @see #Member.Level1(int) Invalid\n" + 
2946
			"	        ^^^^^^^^^^^^^^^^^^\n" + 
3013
			"	        ^^^^^^^^^^^^^^^^^^\n" + 
2947
			"Javadoc: Invalid qualification for member type constructor\n" + 
3014
			"Javadoc: Invalid member type qualification\n" + 
2948
			"----------\n"
3015
			"----------\n"
2949
		);
3016
		);
2950
	}
3017
	}
(-)compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java (-113 / +144 lines)
Lines 64-69 Link Here
64
	}
64
	}
65
65
66
	/*
66
	/*
67
	 * Search node with a given staring position in javadoc objects arrays.
68
	 */
69
	public ASTNode getNodeStartingAt(int start) {
70
		int length = 0;
71
		// parameters array
72
		if (this.paramReferences != null) {
73
			length = this.paramReferences.length;
74
			for (int i=0; i<length; i++) {
75
				JavadocSingleNameReference param = this.paramReferences[i];
76
				if (param.sourceStart==start) {
77
					return param;
78
				}
79
			}
80
		}
81
		// array of invalid syntax tags parameters
82
		if (this.invalidParameters != null) {
83
			length = this.invalidParameters.length;
84
			for (int i=0; i<length; i++) {
85
				JavadocSingleNameReference param = this.invalidParameters[i];
86
				if (param.sourceStart==start) {
87
					return param;
88
				}
89
			}
90
		}
91
		// type parameters array
92
		if (this.paramTypeParameters != null) {
93
			length = this.paramTypeParameters.length;
94
			for (int i=0; i<length; i++) {
95
				JavadocSingleTypeReference param = this.paramTypeParameters[i];
96
				if (param.sourceStart==start) {
97
					return param;
98
				}
99
			}
100
		}
101
		// thrown exception array
102
		if (this.exceptionReferences != null) {
103
			length = this.exceptionReferences.length;
104
			for (int i=0; i<length; i++) {
105
				TypeReference typeRef = this.exceptionReferences[i];
106
				if (typeRef.sourceStart==start) {
107
					return typeRef;
108
				}
109
			}
110
		}
111
		// references array
112
		if (this.seeReferences != null) {
113
			length = this.seeReferences.length;
114
			for (int i=0; i<length; i++) {
115
				org.eclipse.jdt.internal.compiler.ast.Expression expression = this.seeReferences[i];
116
				if (expression.sourceStart==start) {
117
					return expression;
118
				} else if (expression instanceof JavadocAllocationExpression) {
119
					JavadocAllocationExpression allocationExpr = (JavadocAllocationExpression) this.seeReferences[i];
120
					// if binding is valid then look at arguments
121
					if (allocationExpr.binding != null && allocationExpr.binding.isValidBinding()) {
122
						if (allocationExpr.arguments != null) {
123
							for (int j=0, l=allocationExpr.arguments.length; j<l; j++) {
124
								if (allocationExpr.arguments[j].sourceStart == start) {
125
									return allocationExpr.arguments[j];
126
								}
127
							}
128
						}
129
					}
130
				} else if (expression instanceof JavadocMessageSend) {
131
					JavadocMessageSend messageSend = (JavadocMessageSend) this.seeReferences[i];
132
					// if binding is valid then look at arguments
133
					if (messageSend.binding != null && messageSend.binding.isValidBinding()) {
134
						if (messageSend.arguments != null) {
135
							for (int j=0, l=messageSend.arguments.length; j<l; j++) {
136
								if (messageSend.arguments[j].sourceStart == start) {
137
									return messageSend.arguments[j];
138
								}
139
							}
140
						}
141
					}
142
				}
143
			}
144
		}
145
		return null;
146
	}
147
148
	/*
67
	 * @see org.eclipse.jdt.internal.compiler.ast.ASTNode#print(int, java.lang.StringBuffer)
149
	 * @see org.eclipse.jdt.internal.compiler.ast.ASTNode#print(int, java.lang.StringBuffer)
68
	 */
150
	 */
69
	public StringBuffer print(int indent, StringBuffer output) {
151
	public StringBuffer print(int indent, StringBuffer output) {
Lines 288-293 Link Here
288
				}
370
				}
289
			}
371
			}
290
372
373
			// Verify type references
374
			// TODO (frederic) fix for bug 119857
375
			/*
376
			if (fieldRef.binding != null && fieldRef.binding.isValidBinding() && fieldRef.receiverType instanceof ReferenceBinding) {
377
				ReferenceBinding resolvedType = (ReferenceBinding) fieldRef.receiverType;
378
				verifyTypeReference(fieldRef.receiver, scope, source15, resolvedType);
379
			}
380
			*/
381
291
			// That's it for field references
382
			// That's it for field references
292
			return;
383
			return;
293
		}
384
		}
Lines 295-337 Link Here
295
		// Verify type references
386
		// Verify type references
296
		if ((reference instanceof JavadocSingleTypeReference || reference instanceof JavadocQualifiedTypeReference) && reference.resolvedType instanceof ReferenceBinding) {
387
		if ((reference instanceof JavadocSingleTypeReference || reference instanceof JavadocQualifiedTypeReference) && reference.resolvedType instanceof ReferenceBinding) {
297
			ReferenceBinding resolvedType = (ReferenceBinding) reference.resolvedType;
388
			ReferenceBinding resolvedType = (ReferenceBinding) reference.resolvedType;
298
			if (reference.resolvedType.isValidBinding()) {
389
			verifyTypeReference(reference, scope, source15, resolvedType);
299
300
				// member types
301
				if (resolvedType.isMemberType()) {
302
					ReferenceBinding topLevelType = resolvedType;
303
					int depth = 0;
304
					while (topLevelType.enclosingType() != null) {
305
						topLevelType = topLevelType.enclosingType();
306
						depth++;
307
					}
308
					ClassScope topLevelScope = scope.classScope();
309
					// when scope is not on compilation unit type, then inner class may not be visible...
310
					if (topLevelScope.parent.kind != Scope.COMPILATION_UNIT_SCOPE ||
311
						!CharOperation.equals(topLevelType.sourceName, topLevelScope.referenceContext.name)) {
312
						topLevelScope = topLevelScope.outerMostClassScope();
313
						if (reference instanceof JavadocSingleTypeReference) {
314
							// inner class single reference can only be done in same unit
315
							if ((!source15 && depth == 1) || topLevelType != topLevelScope.referenceContext.binding) {
316
								if (scopeModifiers == -1) scopeModifiers = scope.getDeclarationModifiers();
317
								scope.problemReporter().javadocNotVisibleReference(reference.sourceStart, reference.sourceEnd, scopeModifiers);
318
							}
319
						} else {
320
							// inner class qualified reference can only be done in same package
321
							if (topLevelType.getPackage() != topLevelScope.referenceContext.binding.getPackage()) {
322
								if (scopeModifiers == -1) scopeModifiers = scope.getDeclarationModifiers();
323
								scope.problemReporter().javadocNotVisibleReference(reference.sourceStart, reference.sourceEnd, scopeModifiers);
324
							}
325
						}
326
					}
327
				}
328
329
				// reference must have enough visibility to be used
330
				if (!canBeSeen(scope.problemReporter().options.reportInvalidJavadocTagsVisibility, resolvedType)) {
331
					if (scopeModifiers == -1) scopeModifiers = scope.getDeclarationModifiers();
332
					scope.problemReporter().javadocNotVisibleReference(reference.sourceStart, reference.sourceEnd, scopeModifiers);
333
				}
334
			}
335
		}
390
		}
336
391
337
		// Verify that message reference are not used for @value tags
392
		// Verify that message reference are not used for @value tags
Lines 344-349 Link Here
344
				scope.problemReporter().javadocInvalidValueReference(msgSend.sourceStart, msgSend.sourceEnd, scopeModifiers);
399
				scope.problemReporter().javadocInvalidValueReference(msgSend.sourceStart, msgSend.sourceEnd, scopeModifiers);
345
			}
400
			}
346
401
402
			// Verify type references
403
			// TODO (frederic) fix for bug 119857
404
			/*
405
			if (msgSend.binding != null && msgSend.binding.isValidBinding() && msgSend.actualReceiverType instanceof ReferenceBinding) {
406
				ReferenceBinding resolvedType = (ReferenceBinding) msgSend.actualReceiverType;
407
				verifyTypeReference(msgSend.receiver, scope, source15, resolvedType);
408
			}
409
			*/
347
		}
410
		}
348
411
349
		// Verify that constructor reference are not used for @value tags
412
		// Verify that constructor reference are not used for @value tags
Lines 356-361 Link Here
356
				scope.problemReporter().javadocInvalidValueReference(alloc.sourceStart, alloc.sourceEnd, scopeModifiers);
419
				scope.problemReporter().javadocInvalidValueReference(alloc.sourceStart, alloc.sourceEnd, scopeModifiers);
357
			}
420
			}
358
421
422
			// Verify type references
423
			// TODO (frederic) fix for bug 119857
424
			/*
425
			if (alloc.binding != null && alloc.binding.isValidBinding() && alloc.resolvedType instanceof ReferenceBinding) {
426
				ReferenceBinding resolvedType = (ReferenceBinding) alloc.resolvedType;
427
				verifyTypeReference(alloc.type, scope, source15, resolvedType);
428
			}
429
			*/
359
		}
430
		}
360
		
431
		
361
		// Verify that there's no type variable reference
432
		// Verify that there's no type variable reference
Lines 640-725 Link Here
640
			}
711
			}
641
		}
712
		}
642
	}
713
	}
643
	
714
644
	/*
715
	private void verifyTypeReference(Expression reference, Scope scope, boolean source15, ReferenceBinding resolvedType) {
645
	 * Search node with a given staring position in javadoc objects arrays.
716
		if (resolvedType.isValidBinding()) {
646
	 */
717
			int scopeModifiers = -1;
647
	public ASTNode getNodeStartingAt(int start) {
718
648
		int length = 0;
719
			// member types
649
		// parameters array
720
			if (resolvedType.isMemberType()) {
650
		if (this.paramReferences != null) {
721
				ReferenceBinding topLevelType = resolvedType;
651
			length = this.paramReferences.length;
722
				int depth = 0;
652
			for (int i=0; i<length; i++) {
723
				while (topLevelType.enclosingType() != null) {
653
				JavadocSingleNameReference param = this.paramReferences[i];
724
					topLevelType = topLevelType.enclosingType();
654
				if (param.sourceStart==start) {
725
					depth++;
655
					return param;
726
				}
656
				}
727
				ClassScope topLevelScope = scope.classScope();
657
			}
728
				// when scope is not on compilation unit type, then inner class may not be visible...
658
		}
729
				if (topLevelScope.parent.kind != Scope.COMPILATION_UNIT_SCOPE ||
659
		// array of invalid syntax tags parameters
730
					!CharOperation.equals(topLevelType.sourceName, topLevelScope.referenceContext.name)) {
660
		if (this.invalidParameters != null) {
731
					topLevelScope = topLevelScope.outerMostClassScope();
661
			length = this.invalidParameters.length;
732
					if (reference instanceof JavadocSingleTypeReference) {
662
			for (int i=0; i<length; i++) {
733
						// inner class single reference can only be done in same unit
663
				JavadocSingleNameReference param = this.invalidParameters[i];
734
						if ((!source15 && depth == 1) || topLevelType != topLevelScope.referenceContext.binding) {
664
				if (param.sourceStart==start) {
735
							if (scopeModifiers == -1) scopeModifiers = scope.getDeclarationModifiers();
665
					return param;
736
							scope.problemReporter().javadocInvalidMemberTypeQualification(reference.sourceStart, reference.sourceEnd, scopeModifiers);
666
				}
737
						}
667
			}
738
					} else if (reference instanceof JavadocQualifiedTypeReference) {
668
		}
739
						JavadocQualifiedTypeReference qualifiedTypeReference = (JavadocQualifiedTypeReference) reference;
669
		// type parameters array
740
						// inner class qualified reference can only be done in same package
670
		if (this.paramTypeParameters != null) {
741
						if ((qualifiedTypeReference.tokens.length != resolvedType.enclosingType().compoundName.length+1) && topLevelType.getPackage() != topLevelScope.referenceContext.binding.getPackage()) {
671
			length = this.paramTypeParameters.length;
742
							if (scopeModifiers == -1) scopeModifiers = scope.getDeclarationModifiers();
672
			for (int i=0; i<length; i++) {
743
							scope.problemReporter().javadocInvalidMemberTypeQualification(reference.sourceStart, reference.sourceEnd, scopeModifiers);
673
				JavadocSingleTypeReference param = this.paramTypeParameters[i];
674
				if (param.sourceStart==start) {
675
					return param;
676
				}
677
			}
678
		}
679
		// thrown exception array
680
		if (this.exceptionReferences != null) {
681
			length = this.exceptionReferences.length;
682
			for (int i=0; i<length; i++) {
683
				TypeReference typeRef = this.exceptionReferences[i];
684
				if (typeRef.sourceStart==start) {
685
					return typeRef;
686
				}
687
			}
688
		}
689
		// references array
690
		if (this.seeReferences != null) {
691
			length = this.seeReferences.length;
692
			for (int i=0; i<length; i++) {
693
				org.eclipse.jdt.internal.compiler.ast.Expression expression = this.seeReferences[i];
694
				if (expression.sourceStart==start) {
695
					return expression;
696
				} else if (expression instanceof JavadocAllocationExpression) {
697
					JavadocAllocationExpression allocationExpr = (JavadocAllocationExpression) this.seeReferences[i];
698
					// if binding is valid then look at arguments
699
					if (allocationExpr.binding != null && allocationExpr.binding.isValidBinding()) {
700
						if (allocationExpr.arguments != null) {
701
							for (int j=0, l=allocationExpr.arguments.length; j<l; j++) {
702
								if (allocationExpr.arguments[j].sourceStart == start) {
703
									return allocationExpr.arguments[j];
704
								}
705
							}
706
						}
707
					}
708
				} else if (expression instanceof JavadocMessageSend) {
709
					JavadocMessageSend messageSend = (JavadocMessageSend) this.seeReferences[i];
710
					// if binding is valid then look at arguments
711
					if (messageSend.binding != null && messageSend.binding.isValidBinding()) {
712
						if (messageSend.arguments != null) {
713
							for (int j=0, l=messageSend.arguments.length; j<l; j++) {
714
								if (messageSend.arguments[j].sourceStart == start) {
715
									return messageSend.arguments[j];
716
								}
717
							}
718
						}
744
						}
719
					}
745
					}
720
				}
746
				}
721
			}
747
			}
748
749
			// reference must have enough visibility to be used
750
			if (!canBeSeen(scope.problemReporter().options.reportInvalidJavadocTagsVisibility, resolvedType)) {
751
				if (scopeModifiers == -1) scopeModifiers = scope.getDeclarationModifiers();
752
				scope.problemReporter().javadocNotVisibleReference(reference.sourceStart, reference.sourceEnd, scopeModifiers);
753
			}
722
		}
754
		}
723
		return null;
724
	}
755
	}
725
}
756
}
(-)compiler/org/eclipse/jdt/internal/compiler/ast/JavadocAllocationExpression.java (-2 / +2 lines)
Lines 126-139 Link Here
126
			int length = qualification.length;
126
			int length = qualification.length;
127
			ReferenceBinding enclosingTypeBinding = allocationType;
127
			ReferenceBinding enclosingTypeBinding = allocationType;
128
			if (type instanceof JavadocQualifiedTypeReference && (((JavadocQualifiedTypeReference)type).tokens.length != length)) {
128
			if (type instanceof JavadocQualifiedTypeReference && (((JavadocQualifiedTypeReference)type).tokens.length != length)) {
129
				scope.problemReporter().javadocInvalidConstructorQualification(this.memberStart+1, this.sourceEnd); //, scope.getDeclarationModifiers());
129
				scope.problemReporter().javadocInvalidMemberTypeQualification(this.memberStart+1, this.sourceEnd, scope.getDeclarationModifiers());
130
			} else {
130
			} else {
131
				int idx = length;
131
				int idx = length;
132
				while (idx > 0 && CharOperation.equals(qualification[--idx], enclosingTypeBinding.sourceName) && (enclosingTypeBinding = enclosingTypeBinding.enclosingType()) != null) {
132
				while (idx > 0 && CharOperation.equals(qualification[--idx], enclosingTypeBinding.sourceName) && (enclosingTypeBinding = enclosingTypeBinding.enclosingType()) != null) {
133
					// verify that each qualification token matches enclosing types
133
					// verify that each qualification token matches enclosing types
134
				}
134
				}
135
				if (idx > 0 || enclosingTypeBinding != null) {
135
				if (idx > 0 || enclosingTypeBinding != null) {
136
					scope.problemReporter().javadocInvalidConstructorQualification(this.memberStart+1, this.sourceEnd); //, scope.getDeclarationModifiers());
136
					scope.problemReporter().javadocInvalidMemberTypeQualification(this.memberStart+1, this.sourceEnd, scope.getDeclarationModifiers());
137
				}
137
				}
138
			}
138
			}
139
		}
139
		}
(-)compiler/org/eclipse/jdt/core/compiler/IProblem.java (-2 / +2 lines)
Lines 759-768 Link Here
759
	 */
759
	 */
760
	int JavadocNotVisibleReference = Javadoc + Internal + 465;
760
	int JavadocNotVisibleReference = Javadoc + Internal + 465;
761
	/** 
761
	/** 
762
	 * Problem signaled on an unqualified inner class constructor reference.
762
	 * Problem signaled on an invalid qualification for member type reference.
763
	 * @since 3.3
763
	 * @since 3.3
764
	 */
764
	 */
765
	int JavadocInvalidConstructorQualification = Javadoc + Internal + 466;
765
	int JavadocInvalidMemberTypeQualification = Javadoc + Internal + 466;
766
	/** @since 3.2 */
766
	/** @since 3.2 */
767
	int JavadocMissingIdentifier = Javadoc + Internal + 467;
767
	int JavadocMissingIdentifier = Javadoc + Internal + 467;
768
	/** @since 3.2 */
768
	/** @since 3.2 */
(-)compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties (-1 / +1 lines)
Lines 363-369 Link Here
363
363
364
### DOC 
364
### DOC 
365
465 = Not visible reference
365
465 = Not visible reference
366
466 = Invalid qualification for member type constructor
366
466 = Invalid member type qualification
367
467 = Missing identifier
367
467 = Missing identifier
368
468 = Cannot make a static reference to the non-static type variable {0}
368
468 = Cannot make a static reference to the non-static type variable {0}
369
469 = Invalid param tag type parameter name
369
469 = Invalid param tag type parameter name
(-)compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java (-5 / +7 lines)
Lines 215-221 Link Here
215
			case IProblem.JavadocDuplicateParamName:
215
			case IProblem.JavadocDuplicateParamName:
216
			case IProblem.JavadocMissingParamName:
216
			case IProblem.JavadocMissingParamName:
217
			case IProblem.JavadocMissingIdentifier:
217
			case IProblem.JavadocMissingIdentifier:
218
			case IProblem.JavadocInvalidConstructorQualification:
218
			case IProblem.JavadocInvalidMemberTypeQualification:
219
			case IProblem.JavadocInvalidThrowsClassName:
219
			case IProblem.JavadocInvalidThrowsClassName:
220
			case IProblem.JavadocDuplicateThrowsClassName:
220
			case IProblem.JavadocDuplicateThrowsClassName:
221
			case IProblem.JavadocMissingThrowsClassName:
221
			case IProblem.JavadocMissingThrowsClassName:
Lines 990-996 Link Here
990
		case IProblem.JavadocDuplicateParamName:
990
		case IProblem.JavadocDuplicateParamName:
991
		case IProblem.JavadocMissingParamName:
991
		case IProblem.JavadocMissingParamName:
992
		case IProblem.JavadocMissingIdentifier:
992
		case IProblem.JavadocMissingIdentifier:
993
		case IProblem.JavadocInvalidConstructorQualification:
993
		case IProblem.JavadocInvalidMemberTypeQualification:
994
		case IProblem.JavadocInvalidThrowsClassName:
994
		case IProblem.JavadocInvalidThrowsClassName:
995
		case IProblem.JavadocDuplicateThrowsClassName:
995
		case IProblem.JavadocDuplicateThrowsClassName:
996
		case IProblem.JavadocMissingThrowsClassName:
996
		case IProblem.JavadocMissingThrowsClassName:
Lines 3815-3823 Link Here
3815
		statement.sourceStart,
3815
		statement.sourceStart,
3816
		statement.sourceEnd);
3816
		statement.sourceEnd);
3817
}
3817
}
3818
public void javadocInvalidConstructorQualification(int sourceStart, int sourceEnd){
3819
	this.handle(IProblem.JavadocInvalidConstructorQualification, NoArgument, NoArgument, sourceStart, sourceEnd);
3820
}
3821
/*
3818
/*
3822
 * Similar implementation than invalidField(FieldReference...)
3819
 * Similar implementation than invalidField(FieldReference...)
3823
 * Note that following problem id cannot occur for Javadoc:
3820
 * Note that following problem id cannot occur for Javadoc:
Lines 3856-3861 Link Here
3856
			sourceEnd);
3853
			sourceEnd);
3857
	}
3854
	}
3858
}
3855
}
3856
public void javadocInvalidMemberTypeQualification(int sourceStart, int sourceEnd, int modifiers){
3857
	if (javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) {
3858
		this.handle(IProblem.JavadocInvalidMemberTypeQualification, NoArgument, NoArgument, sourceStart, sourceEnd);
3859
	}
3860
}
3859
/*
3861
/*
3860
 * Similar implementation than invalidMethod(MessageSend...)
3862
 * Similar implementation than invalidMethod(MessageSend...)
3861
 * Note that following problem id cannot occur for Javadoc:
3863
 * Note that following problem id cannot occur for Javadoc:
(-)compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java (-2 / +4 lines)
Lines 180-186 Link Here
180
			TypeReference typeRef = (TypeReference) receiver;
180
			TypeReference typeRef = (TypeReference) receiver;
181
			// Decide whether we have a constructor or not
181
			// Decide whether we have a constructor or not
182
			boolean isConstructor = false;
182
			boolean isConstructor = false;
183
			int length = this.identifierLengthStack[0];	// may be > 0 for inner class constructor reference
183
			int length = this.identifierLengthStack[0];	// may be > 0 for member class constructor reference
184
			if (typeRef == null) {
184
			if (typeRef == null) {
185
				char[] name = this.sourceParser.compilationUnit.getMainTypeName();
185
				char[] name = this.sourceParser.compilationUnit.getMainTypeName();
186
				TypeDeclaration typeDecl = getParsedTypeDeclaration();
186
				TypeDeclaration typeDecl = getParsedTypeDeclaration();
Lines 206-212 Link Here
206
						}
206
						}
207
						if (!valid) {
207
						if (!valid) {
208
							if (this.reportProblems) {
208
							if (this.reportProblems) {
209
								this.sourceParser.problemReporter().javadocInvalidConstructorQualification(this.memberStart+1, this.scanner.getCurrentTokenEndPosition());
209
								this.sourceParser.problemReporter().javadocInvalidMemberTypeQualification((int)(this.identifierPositionStack[0]>>>32), (int)this.identifierPositionStack[length-1], -1);
210
							}
210
							}
211
							return null;
211
							return null;
212
						}
212
						}
Lines 226-231 Link Here
226
						allocation.qualification = new char[][] { this.identifierStack[0] };
226
						allocation.qualification = new char[][] { this.identifierStack[0] };
227
					} else {
227
					} else {
228
						System.arraycopy(this.identifierStack, 0, allocation.qualification = new char[length][], 0, length);
228
						System.arraycopy(this.identifierStack, 0, allocation.qualification = new char[length][], 0, length);
229
						allocation.sourceStart = (int) (this.identifierPositionStack[0] >>> 32);
229
					}
230
					}
230
					allocation.memberStart = this.memberStart;
231
					allocation.memberStart = this.memberStart;
231
					return allocation;
232
					return allocation;
Lines 249-254 Link Here
249
						allocation.qualification = new char[][] { this.identifierStack[0] };
250
						allocation.qualification = new char[][] { this.identifierStack[0] };
250
					} else {
251
					} else {
251
						System.arraycopy(this.identifierStack, 0, allocation.qualification = new char[length][], 0, length);
252
						System.arraycopy(this.identifierStack, 0, allocation.qualification = new char[length][], 0, length);
253
						allocation.sourceStart = (int) (this.identifierPositionStack[0] >>> 32);
252
					}
254
					}
253
					allocation.memberStart = this.memberStart;
255
					allocation.memberStart = this.memberStart;
254
					return allocation;
256
					return allocation;
(-)dom/org/eclipse/jdt/core/dom/DocCommentParser.java (-4 / +4 lines)
Lines 167-177 Link Here
167
			// Create method ref
167
			// Create method ref
168
			MethodRef methodRef = this.ast.newMethodRef();
168
			MethodRef methodRef = this.ast.newMethodRef();
169
			SimpleName methodName = new SimpleName(this.ast);
169
			SimpleName methodName = new SimpleName(this.ast);
170
			int memberPtr = this.identifierLengthStack[0] - 1;
170
			int length = this.identifierLengthStack[0] - 1; // may be > 0 for member class constructor reference
171
			methodName.internalSetIdentifier(new String(this.identifierStack[memberPtr]));
171
			methodName.internalSetIdentifier(new String(this.identifierStack[length]));
172
			methodRef.setName(methodName);
172
			methodRef.setName(methodName);
173
			int start = (int) (this.identifierPositionStack[memberPtr] >>> 32);
173
			int start = (int) (this.identifierPositionStack[length] >>> 32);
174
			int end = (int) this.identifierPositionStack[memberPtr];
174
			int end = (int) this.identifierPositionStack[length];
175
			methodName.setSourceRange(start, end - start + 1);
175
			methodName.setSourceRange(start, end - start + 1);
176
			// Set qualifier
176
			// Set qualifier
177
			if (receiver == null) {
177
			if (receiver == null) {
(-)dom/org/eclipse/jdt/core/dom/ASTConverter.java (-2 / +15 lines)
Lines 3688-3695 Link Here
3688
			} else if (node.getNodeType() == ASTNode.METHOD_REF) {
3688
			} else if (node.getNodeType() == ASTNode.METHOD_REF) {
3689
				MethodRef methodRef = (MethodRef) node;
3689
				MethodRef methodRef = (MethodRef) node;
3690
				Name name = methodRef.getName();
3690
				Name name = methodRef.getName();
3691
				// get compiler node and record nodes
3691
				// get method name start position
3692
				int start = name.getStartPosition();
3692
				int start = methodRef.getStartPosition();
3693
				this.scanner.resetTo(start, start + name.getStartPosition()+name.getLength());
3694
				int token;
3695
				try {
3696
					nextToken: while((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF && token != TerminalTokens.TokenNameLPAREN)  {
3697
						if (token == TerminalTokens.TokenNameERROR && this.scanner.currentCharacter == '#') {
3698
							start = this.scanner.getCurrentTokenEndPosition()+1;
3699
							break nextToken;
3700
						}
3701
					}
3702
				}
3703
				catch(InvalidInputException e) {
3704
					// ignore
3705
				}
3693
				// get compiler node and record nodes
3706
				// get compiler node and record nodes
3694
				org.eclipse.jdt.internal.compiler.ast.ASTNode compilerNode = javadoc.getNodeStartingAt(start);
3707
				org.eclipse.jdt.internal.compiler.ast.ASTNode compilerNode = javadoc.getNodeStartingAt(start);
3695
				// record nodes
3708
				// record nodes

Return to bug 96237