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

Collapse All | Expand All

(-)codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionJavadocParser.java (-2 / +3 lines)
Lines 101-108 Link Here
101
	 * Otherwise return null as we do not need this reference.
101
	 * Otherwise return null as we do not need this reference.
102
	 */
102
	 */
103
	protected Object createMethodReference(Object receiver, List arguments) throws InvalidInputException {
103
	protected Object createMethodReference(Object receiver, List arguments) throws InvalidInputException {
104
		int start = (int) (this.identifierPositionStack[0] >>> 32);
104
		int memberPtr = this.identifierLengthStack[0] - 1;
105
		int end = (int) this.identifierPositionStack[0];
105
		int start = (int) (this.identifierPositionStack[memberPtr] >>> 32);
106
		int end = (int) this.identifierPositionStack[memberPtr];
106
		if (start <= this.selectionStart && this.selectionEnd <= end) {
107
		if (start <= this.selectionStart && this.selectionEnd <= end) {
107
			selectedNode = (ASTNode) super.createMethodReference(receiver, arguments);
108
			selectedNode = (ASTNode) super.createMethodReference(receiver, arguments);
108
			this.abort = true;
109
			this.abort = true;
(-)compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java (-20 / +74 lines)
Lines 180-215 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];
183
			if (typeRef == null) {
184
			if (typeRef == null) {
184
				char[] name = this.sourceParser.compilationUnit.getMainTypeName();
185
				char[] name = this.sourceParser.compilationUnit.getMainTypeName();
185
				TypeDeclaration typeDecl = getParsedTypeDeclaration();
186
				TypeDeclaration typeDecl = getParsedTypeDeclaration();
186
				if (typeDecl != null) {
187
				if (typeDecl != null) {
187
					name = typeDecl.name;
188
					name = typeDecl.name;
188
				}
189
				}
189
				isConstructor = CharOperation.equals(this.identifierStack[0], name);
190
				isConstructor = CharOperation.equals(this.identifierStack[length-1], name);
190
				typeRef = new JavadocImplicitTypeReference(name, this.memberStart);
191
				typeRef = new JavadocImplicitTypeReference(name, this.memberStart);
191
			} else {
192
			} else {
192
				char[] name = null;
193
				if (typeRef instanceof JavadocSingleTypeReference) {
193
				if (typeRef instanceof JavadocSingleTypeReference) {
194
					name = ((JavadocSingleTypeReference)typeRef).token;
194
					char[] name = ((JavadocSingleTypeReference)typeRef).token;
195
					isConstructor = CharOperation.equals(this.identifierStack[length-1], name);
195
				} else if (typeRef instanceof JavadocQualifiedTypeReference) {
196
				} else if (typeRef instanceof JavadocQualifiedTypeReference) {
196
					char[][] tokens = ((JavadocQualifiedTypeReference)typeRef).tokens;
197
					char[][] tokens = ((JavadocQualifiedTypeReference)typeRef).tokens;
197
					name = tokens[tokens.length-1];
198
					int last = tokens.length-1;
199
					isConstructor = CharOperation.equals(this.identifierStack[length-1], tokens[last]);
200
					if (isConstructor) {
201
						boolean valid = true;
202
						if (valid) {
203
							for (int i=0; i<length-1 && valid; i++) {
204
								valid = CharOperation.equals(this.identifierStack[i], tokens[i]);
205
							}
206
						}
207
						if (!valid) {
208
							// TODO (frederic) need a specific message after 3.2 ship delivery
209
							if (this.reportProblems) this.sourceParser.problemReporter().javadocInvalidReference(this.memberStart+1, this.scanner.getCurrentTokenEndPosition());
210
							return null;
211
						}
212
					}
198
				} else {
213
				} else {
199
					throw new InvalidInputException();
214
					throw new InvalidInputException();
200
				}
215
				}
201
				isConstructor = CharOperation.equals(this.identifierStack[0], name);
202
			}
216
			}
203
			// Create node
217
			// Create node
204
			if (arguments == null) {
218
			if (arguments == null) {
205
				if (isConstructor) {
219
				if (isConstructor) {
206
					JavadocAllocationExpression alloc = new JavadocAllocationExpression(this.identifierPositionStack[0]);
220
					JavadocAllocationExpression allocation = new JavadocAllocationExpression(this.identifierPositionStack[length-1]);
207
					alloc.type = typeRef;
221
					allocation.type = typeRef;
208
					alloc.tagValue = this.tagValue;
222
					allocation.tagValue = this.tagValue;
209
					alloc.sourceEnd = this.scanner.getCurrentTokenEndPosition();
223
					allocation.sourceEnd = this.scanner.getCurrentTokenEndPosition();
210
					return alloc;
224
					if (length == 1) {
225
						allocation.qualification = new char[][] { this.identifierStack[0] };
226
					} else {
227
						System.arraycopy(this.identifierStack, 0, allocation.qualification = new char[length][], 0, length);
228
					}
229
					allocation.memberStart = this.memberStart;
230
					return allocation;
211
				} else {
231
				} else {
212
					JavadocMessageSend msg = new JavadocMessageSend(this.identifierStack[0], this.identifierPositionStack[0]);
232
					JavadocMessageSend msg = new JavadocMessageSend(this.identifierStack[length-1], this.identifierPositionStack[length-1]);
213
					msg.receiver = typeRef;
233
					msg.receiver = typeRef;
214
					msg.tagValue = this.tagValue;
234
					msg.tagValue = this.tagValue;
215
					msg.sourceEnd = this.scanner.getCurrentTokenEndPosition();
235
					msg.sourceEnd = this.scanner.getCurrentTokenEndPosition();
Lines 219-232 Link Here
219
				JavadocArgumentExpression[] expressions = new JavadocArgumentExpression[arguments.size()];
239
				JavadocArgumentExpression[] expressions = new JavadocArgumentExpression[arguments.size()];
220
				arguments.toArray(expressions);
240
				arguments.toArray(expressions);
221
				if (isConstructor) {
241
				if (isConstructor) {
222
					JavadocAllocationExpression alloc = new JavadocAllocationExpression(this.identifierPositionStack[0]);
242
					JavadocAllocationExpression allocation = new JavadocAllocationExpression(this.identifierPositionStack[length-1]);
223
					alloc.arguments = expressions;
243
					allocation.arguments = expressions;
224
					alloc.type = typeRef;
244
					allocation.type = typeRef;
225
					alloc.tagValue = this.tagValue;
245
					allocation.tagValue = this.tagValue;
226
					alloc.sourceEnd = this.scanner.getCurrentTokenEndPosition();
246
					allocation.sourceEnd = this.scanner.getCurrentTokenEndPosition();
227
					return alloc;
247
					if (length == 1) {
248
						allocation.qualification = new char[][] { this.identifierStack[0] };
249
					} else {
250
						System.arraycopy(this.identifierStack, 0, allocation.qualification = new char[length][], 0, length);
251
					}
252
					allocation.memberStart = this.memberStart;
253
					return allocation;
228
				} else {
254
				} else {
229
					JavadocMessageSend msg = new JavadocMessageSend(this.identifierStack[0], this.identifierPositionStack[0], expressions);
255
					JavadocMessageSend msg = new JavadocMessageSend(this.identifierStack[length-1], this.identifierPositionStack[length-1], expressions);
230
					msg.receiver = typeRef;
256
					msg.receiver = typeRef;
231
					msg.tagValue = this.tagValue;
257
					msg.tagValue = this.tagValue;
232
					msg.sourceEnd = this.scanner.getCurrentTokenEndPosition();
258
					msg.sourceEnd = this.scanner.getCurrentTokenEndPosition();
Lines 258-264 Link Here
258
	 */
284
	 */
259
	protected Object createTypeReference(int primitiveToken) {
285
	protected Object createTypeReference(int primitiveToken) {
260
		TypeReference typeRef = null;
286
		TypeReference typeRef = null;
261
		int size = this.identifierLengthStack[this.identifierLengthPtr--];
287
		int size = this.identifierLengthStack[this.identifierLengthPtr];
262
		if (size == 1) { // Single Type ref
288
		if (size == 1) { // Single Type ref
263
			typeRef = new JavadocSingleTypeReference(
289
			typeRef = new JavadocSingleTypeReference(
264
						this.identifierStack[this.identifierPtr],
290
						this.identifierStack[this.identifierPtr],
Lines 272-278 Link Here
272
			System.arraycopy(this.identifierPositionStack, this.identifierPtr - size + 1, positions, 0, size);
298
			System.arraycopy(this.identifierPositionStack, this.identifierPtr - size + 1, positions, 0, size);
273
			typeRef = new JavadocQualifiedTypeReference(tokens, positions, this.tagSourceStart, this.tagSourceEnd);
299
			typeRef = new JavadocQualifiedTypeReference(tokens, positions, this.tagSourceStart, this.tagSourceEnd);
274
		}
300
		}
275
		this.identifierPtr -= size;
301
//		this.identifierPtr -= size;
276
		return typeRef;
302
		return typeRef;
277
	}
303
	}
278
304
Lines 294-299 Link Here
294
		return null;
320
		return null;
295
	}
321
	}
296
322
323
	/**
324
	 * @param receiver
325
	 * @param start
326
	 * @throws InvalidInputException
327
	 */
328
	protected boolean parseQualifiedMember(Object receiver, int start) throws InvalidInputException {
329
		parseQualifiedName(true);
330
		boolean valid = true;
331
		if (receiver instanceof SingleTypeReference) {
332
			SingleTypeReference singleTypeRef = (SingleTypeReference) receiver;
333
			valid = CharOperation.equals(singleTypeRef.token, this.identifierStack[this.identifierPtr]);
334
		}
335
		else if (receiver instanceof QualifiedTypeReference) {
336
			QualifiedTypeReference qualifiedTypeRef = (QualifiedTypeReference) receiver;
337
			for (int i=0; i<this.identifierPtr && valid; i++) {
338
				valid = CharOperation.equals(qualifiedTypeRef.tokens[i], this.identifierStack[i]);
339
			}
340
		}
341
		if (valid) return true;
342
		int end = this.scanner.getCurrentTokenEndPosition() < this.lineEnd ?
343
				this.scanner.getCurrentTokenEndPosition() :
344
				this.scanner.getCurrentTokenStartPosition();
345
		end = end < this.lineEnd ? end : this.lineEnd;
346
		// TODO (frederic) need a specific message after 3.2 ship delivery
347
		if (this.reportProblems) this.sourceParser.problemReporter().javadocInvalidReference(start, end);
348
		return false;
349
	}
350
297
	/*
351
	/*
298
	 * Parse @return tag declaration
352
	 * Parse @return tag declaration
299
	 */
353
	 */
(-)compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java (-2 / +17 lines)
Lines 641-648 Link Here
641
	
641
	
642
		// Get member identifier
642
		// Get member identifier
643
		if (readToken() == TerminalTokens.TokenNameIdentifier) {
643
		if (readToken() == TerminalTokens.TokenNameIdentifier) {
644
			consumeToken();
644
			if (this.scanner.currentCharacter == '.') {
645
			pushIdentifier(true, false);
645
				if (!parseQualifiedMember(receiver, start)) {
646
					return null;
647
				}
648
			} else {
649
				consumeToken();
650
				pushIdentifier(true, false);
651
			}
646
			// Look for next token to know whether it's a field or method reference
652
			// Look for next token to know whether it's a field or method reference
647
			int previousPosition = this.index;
653
			int previousPosition = this.index;
648
			if (readToken() == TerminalTokens.TokenNameLPAREN) {
654
			if (readToken() == TerminalTokens.TokenNameLPAREN) {
Lines 895-900 Link Here
895
		return false;
901
		return false;
896
	}
902
	}
897
903
904
	/**
905
	 * Parse qualified member
906
	 *
907
	 * @param receiver
908
	 * @param start
909
	 * @throws InvalidInputException
910
	 */
911
	protected abstract boolean parseQualifiedMember(Object receiver, int start) throws InvalidInputException;
912
898
	/*
913
	/*
899
	 * Parse a qualified name and built a type reference if the syntax is valid.
914
	 * Parse a qualified name and built a type reference if the syntax is valid.
900
	 */
915
	 */
(-)dom/org/eclipse/jdt/core/dom/DocCommentParser.java (-13 / +19 lines)
Lines 86-92 Link Here
86
		buffer.append(super.toString());
86
		buffer.append(super.toString());
87
		return buffer.toString();
87
		return buffer.toString();
88
	}
88
	}
89
	
89
90
	/* (non-Javadoc)
90
	/* (non-Javadoc)
91
	 * @see org.eclipse.jdt.internal.compiler.parser.AbstractCommentParser#createArgumentReference(char[], java.lang.Object, int)
91
	 * @see org.eclipse.jdt.internal.compiler.parser.AbstractCommentParser#createArgumentReference(char[], java.lang.Object, int)
92
	 */
92
	 */
Lines 167-179 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
			methodName.internalSetIdentifier(new String(this.identifierStack[0]));
170
			int memberPtr = this.identifierLengthStack[0] - 1;
171
			methodName.internalSetIdentifier(new String(this.identifierStack[memberPtr]));
171
			methodRef.setName(methodName);
172
			methodRef.setName(methodName);
172
			int start = (int) (this.identifierPositionStack[0] >>> 32);
173
			int start = (int) (this.identifierPositionStack[memberPtr] >>> 32);
173
			int end = (int) this.identifierPositionStack[0];
174
			int end = (int) this.identifierPositionStack[memberPtr];
174
			methodName.setSourceRange(start, end - start + 1);
175
			methodName.setSourceRange(start, end - start + 1);
175
			// Set qualifier
176
			// Set qualifier
176
//			int end = methodName.getStartPosition()+methodName.getLength()-1;
177
			if (receiver == null) {
177
			if (receiver == null) {
178
				start = this.memberStart;
178
				start = this.memberStart;
179
				methodRef.setSourceRange(start, end - start + 1);
179
				methodRef.setSourceRange(start, end - start + 1);
Lines 188-197 Link Here
188
				while (parameters.hasNext()) {
188
				while (parameters.hasNext()) {
189
					MethodRefParameter param = (MethodRefParameter) parameters.next();
189
					MethodRefParameter param = (MethodRefParameter) parameters.next();
190
					methodRef.parameters().add(param);
190
					methodRef.parameters().add(param);
191
//					end = param.getStartPosition()+param.getLength()-1;
192
				}
191
				}
193
			}
192
			}
194
//			methodRef.setSourceRange(start, end-start+1);
195
			methodRef.setSourceRange(start, this.scanner.getCurrentTokenEndPosition()-start+1);
193
			methodRef.setSourceRange(start, this.scanner.getCurrentTokenEndPosition()-start+1);
196
			return methodRef;
194
			return methodRef;
197
		}
195
		}
Lines 239-245 Link Here
239
	 * @see org.eclipse.jdt.internal.compiler.parser.AbstractCommentParser#createTypeReference()
237
	 * @see org.eclipse.jdt.internal.compiler.parser.AbstractCommentParser#createTypeReference()
240
	 */
238
	 */
241
	protected Object createTypeReference(int primitiveToken) {
239
	protected Object createTypeReference(int primitiveToken) {
242
		int size = this.identifierLengthStack[this.identifierLengthPtr--];
240
		int size = this.identifierLengthStack[this.identifierLengthPtr];
243
		String[] identifiers = new String[size];
241
		String[] identifiers = new String[size];
244
		int pos = this.identifierPtr - size + 1;
242
		int pos = this.identifierPtr - size + 1;
245
		for (int i = 0; i < size; i++) {
243
		for (int i = 0; i < size; i++) {
Lines 307-321 Link Here
307
			int end = (int) this.identifierPositionStack[pos];
305
			int end = (int) this.identifierPositionStack[pos];
308
			typeRef.setSourceRange(start, end-start+1);
306
			typeRef.setSourceRange(start, end-start+1);
309
		}
307
		}
310
		this.identifierPtr -= size;
311
		return typeRef;
308
		return typeRef;
312
	}
309
	}
313
310
314
	/*
311
	/**
315
	 * Parse @return tag declaration
312
	 * @param receiver
313
	 * @param start
314
	 * @throws InvalidInputException
316
	 */
315
	 */
317
	protected boolean parseReturn() {
316
	protected boolean parseQualifiedMember(Object receiver, int start) throws InvalidInputException {
318
		createTag();
319
		return true;
317
		return true;
320
	}
318
	}
321
319
Lines 332-337 Link Here
332
		return false;
330
		return false;
333
	}
331
	}
334
332
333
	/*
334
	 * Parse @return tag declaration
335
	 */
336
	protected boolean parseReturn() {
337
		createTag();
338
		return true;
339
	}
340
335
	/* (non-Javadoc)
341
	/* (non-Javadoc)
336
	 * @see org.eclipse.jdt.internal.compiler.parser.AbstractCommentParser#parseTag(int)
342
	 * @see org.eclipse.jdt.internal.compiler.parser.AbstractCommentParser#parseTag(int)
337
	 */
343
	 */
(-)compiler/org/eclipse/jdt/internal/compiler/ast/JavadocAllocationExpression.java (-3 / +21 lines)
Lines 10-24 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.jdt.internal.compiler.ast;
11
package org.eclipse.jdt.internal.compiler.ast;
12
12
13
import org.eclipse.jdt.core.compiler.CharOperation;
13
import org.eclipse.jdt.internal.compiler.impl.Constant;
14
import org.eclipse.jdt.internal.compiler.impl.Constant;
14
import org.eclipse.jdt.internal.compiler.lookup.*;
15
import org.eclipse.jdt.internal.compiler.lookup.*;
15
16
16
public class JavadocAllocationExpression extends AllocationExpression {
17
public class JavadocAllocationExpression extends AllocationExpression {
17
18
18
	public int tagSourceStart, tagSourceEnd;
19
	public int tagSourceStart, tagSourceEnd;
19
	public int tagValue;
20
	public int tagValue, memberStart;
20
	public boolean superAccess = false;
21
	public boolean superAccess = false;
21
	
22
	public char[][] qualification;
23
22
	public JavadocAllocationExpression(int start, int end) {
24
	public JavadocAllocationExpression(int start, int end) {
23
		this.sourceStart = start;
25
		this.sourceStart = start;
24
		this.sourceEnd = end;
26
		this.sourceEnd = end;
Lines 28-34 Link Here
28
		this((int) (pos >>> 32), (int) pos);
30
		this((int) (pos >>> 32), (int) pos);
29
	}
31
	}
30
32
31
	private TypeBinding internalResolveType(Scope scope) {
33
	TypeBinding internalResolveType(Scope scope) {
32
	
34
	
33
		// Propagate the type checking to the arguments, and check if the constructor is defined.
35
		// Propagate the type checking to the arguments, and check if the constructor is defined.
34
		this.constant = Constant.NotAConstant;
36
		this.constant = Constant.NotAConstant;
Lines 120-125 Link Here
120
					}
122
					}
121
				}
123
				}
122
			}
124
			}
125
		} else if (this.resolvedType.isMemberType()) {
126
			boolean valid = qualification != null;
127
			int length = qualification.length;
128
			int idx = length;
129
			ReferenceBinding enclosingTypeBinding = allocationType;
130
			if (valid) {
131
				while (idx>0 && enclosingTypeBinding != null) {
132
					valid = CharOperation.equals(qualification[--idx], enclosingTypeBinding.sourceName);
133
					if (!valid) break;
134
					enclosingTypeBinding = enclosingTypeBinding.enclosingType();
135
				}
136
			}
137
			if (!valid || idx > 0 || enclosingTypeBinding != null) {
138
				// TODO (frederic) need a specific message after 3.2 ship delivery
139
				scope.problemReporter().javadocInvalidReference(this.memberStart+1, this.sourceEnd);
140
			}
123
		}
141
		}
124
		if (isMethodUseDeprecated(this.binding, scope, true)) {
142
		if (isMethodUseDeprecated(this.binding, scope, true)) {
125
			scope.problemReporter().javadocDeprecatedMethod(this.binding, this, scope.getDeclarationModifiers());
143
			scope.problemReporter().javadocDeprecatedMethod(this.binding, this, scope.getDeclarationModifiers());
(-)codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionJavadocParser.java (-3 / +3 lines)
Lines 149-156 Link Here
149
	 * Otherwise return null as we do not need this reference.
149
	 * Otherwise return null as we do not need this reference.
150
	 */
150
	 */
151
	protected Object createMethodReference(Object receiver, List arguments) throws InvalidInputException {
151
	protected Object createMethodReference(Object receiver, List arguments) throws InvalidInputException {
152
		int refStart = (int) (this.identifierPositionStack[0] >>> 32);
152
		int memberPtr = this.identifierLengthStack[0] - 1;
153
		int refEnd = (int) this.identifierPositionStack[0];
153
		int refStart = (int) (this.identifierPositionStack[memberPtr] >>> 32);
154
		int refEnd = (int) this.identifierPositionStack[memberPtr];
154
		boolean inCompletion = (refStart <= (this.cursorLocation+1) && this.cursorLocation <= refEnd) // completion cursor is between first and last stacked identifiers
155
		boolean inCompletion = (refStart <= (this.cursorLocation+1) && this.cursorLocation <= refEnd) // completion cursor is between first and last stacked identifiers
155
			|| ((refStart == (refEnd+1) && refEnd == this.cursorLocation)) // or it's a completion on empty token
156
			|| ((refStart == (refEnd+1) && refEnd == this.cursorLocation)) // or it's a completion on empty token
156
			|| (this.memberStart == this.cursorLocation); // or it's a completion just after the member separator with an identifier after the cursor
157
			|| (this.memberStart == this.cursorLocation); // or it's a completion just after the member separator with an identifier after the cursor
Lines 226-232 Link Here
226
				this.completionNode = new CompletionOnJavadocQualifiedTypeReference(tokens, this.identifierStack[this.identifierPtr], positions, this.tagSourceStart, this.tagSourceEnd);
227
				this.completionNode = new CompletionOnJavadocQualifiedTypeReference(tokens, this.identifierStack[this.identifierPtr], positions, this.tagSourceStart, this.tagSourceEnd);
227
			}
228
			}
228
		}
229
		}
229
		this.identifierPtr -= nbIdentifiers;
230
230
231
		if (CompletionEngine.DEBUG) {
231
		if (CompletionEngine.DEBUG) {
232
			System.out.println("	completion partial qualified type="+completionNode); //$NON-NLS-1$
232
			System.out.println("	completion partial qualified type="+completionNode); //$NON-NLS-1$
(-)compiler/org/eclipse/jdt/internal/compiler/ast/JavadocQualifiedAllocationExpression.java (+50 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2006 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.jdt.internal.compiler.ast;
12
13
import org.eclipse.jdt.core.compiler.CharOperation;
14
import org.eclipse.jdt.internal.compiler.lookup.*;
15
16
public class JavadocQualifiedAllocationExpression extends JavadocAllocationExpression {
17
18
public char[][] qualification;
19
20
public JavadocQualifiedAllocationExpression(int start, int end) {
21
	super(start, end);
22
}
23
public JavadocQualifiedAllocationExpression(long pos) {
24
	super(pos);
25
}
26
27
TypeBinding internalResolveType(Scope scope) {
28
	ReferenceBinding allocationType = (ReferenceBinding) super.internalResolveType(scope);
29
	if (this.binding.isValidBinding() &&  allocationType.isMemberType()) {
30
		boolean valid = qualification != null;
31
		if (valid) {
32
			ReferenceBinding enclosingTypeBinding = allocationType;
33
			int idx = qualification.length;
34
			while (idx>0 && enclosingTypeBinding.isMemberType()) {
35
				valid = CharOperation.equals(qualification[--idx], enclosingTypeBinding.sourceName);
36
				if (!valid) break;
37
				enclosingTypeBinding = enclosingTypeBinding.enclosingType();
38
			}
39
		}
40
		if (!valid) {
41
			// TODO (frederic) need a specific message after 3.2 ship delivery
42
			scope.problemReporter().javadocInvalidReference(this.memberStart+1, this.sourceEnd);
43
		}
44
	}
45
	if (isMethodUseDeprecated(this.binding, scope, true)) {
46
		scope.problemReporter().javadocDeprecatedMethod(this.binding, this, scope.getDeclarationModifiers());
47
	}
48
	return allocationType;
49
}
50
}
(-)src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java (-198 / +493 lines)
Lines 36-42 Link Here
36
	// Use this static initializer to specify subset for tests
36
	// Use this static initializer to specify subset for tests
37
	// All specified tests which does not belong to the class are skipped...
37
	// All specified tests which does not belong to the class are skipped...
38
	static {
38
	static {
39
//		TESTS_PREFIX = "testBug83127";
39
//		TESTS_PREFIX = "testBug96237";
40
//		TESTS_NAMES = new String[] { "testBug68017javadocWarning2" };
40
//		TESTS_NAMES = new String[] { "testBug68017javadocWarning2" };
41
//		TESTS_NUMBERS = new int[] { 129241 };
41
//		TESTS_NUMBERS = new int[] { 129241 };
42
//		TESTS_RANGE = new int[] { 21, 50 };
42
//		TESTS_RANGE = new int[] { 21, 50 };
Lines 690-701 Link Here
690
				"}\n"
690
				"}\n"
691
			},
691
			},
692
			"----------\n" + 
692
			"----------\n" + 
693
			"1. WARNING in X.java (at line 2)\n" + 
693
			"1. ERROR in X.java (at line 5)\n" + 
694
			"	public class X extends RuntimeException {\n" + 
695
			"	             ^\n" + 
696
			"The serializable class X does not declare a static final serialVersionUID field of type long\n" + 
697
			"----------\n" + 
698
			"2. ERROR in X.java (at line 5)\n" + 
699
			"	public X(String message) {\n" + 
694
			"	public X(String message) {\n" + 
700
			"	                ^^^^^^^\n" + 
695
			"	                ^^^^^^^\n" + 
701
			"Javadoc: Missing tag for parameter message\n" + 
696
			"Javadoc: Missing tag for parameter message\n" + 
Lines 2420-2425 Link Here
2420
	}
2415
	}
2421
2416
2422
	/**
2417
	/**
2418
	 * Bug 68726: [Javadoc] Target attribute in @see link triggers warning
2419
	 * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=68726">68726</a>
2420
	 */
2421
	public void testBug68726conform1() {
2422
		runConformTest(
2423
			new String[] {
2424
				"X.java",
2425
				"public class X {\n" + 
2426
					"	/**\n" + 
2427
					"	 *	@see Object <a href=\"http://www.eclipse.org\" target=\"_top\">Eclipse</a>\n" + 
2428
					"	 */\n" + 
2429
					"	void foo1() {}\n" + 
2430
					"	/**@see Object <a href=\"http://www.eclipse.org\" target=\"_top\" target1=\"_top1\" target2=\"_top2\">Eclipse</a>*/\n" + 
2431
					"	void foo2() {}\n" + 
2432
					"}\n"	
2433
			}
2434
		);
2435
	}
2436
	public void testBug68726conform2() {
2437
		runConformTest(
2438
			new String[] {
2439
				"X.java",
2440
				"/**\n" + 
2441
					"	* @see <a href=\"http:/www.ibm.com\" target=\"_top\">IBM Home Page</a>\n" + 
2442
					"	* @see <a href=\"http:/www.ibm.com\" target=\"_top\">\n" + 
2443
					"	*          IBM Home Page</a>\n" + 
2444
					"	* @see <a href=\"http:/www.ibm.com\" target=\"_top\">\n" + 
2445
					"	*          IBM Home Page\n" + 
2446
					"	* 			</a>\n" + 
2447
					"	* @see <a href=\"http:/www.ibm.com\" target=\"_top\">\n" + 
2448
					"	*\n" + 
2449
					"	*          IBM\n" + 
2450
					"	*\n" + 
2451
					"	*          Home Page\n" + 
2452
					"	*\n" + 
2453
					"	*\n" + 
2454
					"	* 			</a>\n" + 
2455
					"	* @see Object\n" + 
2456
					"	*/\n" + 
2457
					"public class X {\n" + 
2458
					"}\n"	
2459
			}
2460
		);
2461
	}
2462
	public void testBug68726negative1() {
2463
		runNegativeTest(
2464
			new String[] {
2465
				"X.java",
2466
				"public class X {\n" + 
2467
					"	/**\n" + 
2468
					"	 * Invalid URL link references\n" + 
2469
					"	 *\n" + 
2470
					"	 * @see <a href=\"invalid\" target\n" + 
2471
					"	 * @see <a href=\"invalid\" target=\n" + 
2472
					"	 * @see <a href=\"invalid\" target=\"\n" + 
2473
					"	 * @see <a href=\"invalid\" target=\"_top\n" + 
2474
					"	 * @see <a href=\"invalid\" target=\"_top\"\n" + 
2475
					"	 * @see <a href=\"invalid\" target=\"_top\">\n" + 
2476
					"	 * @see <a href=\"invalid\" target=\"_top\">\n" + 
2477
					"	 * @see <a href=\"invalid\" target=\"_top\">invalid\n" + 
2478
					"	 * @see <a href=\"invalid\" target=\"_top\">invalid<\n" + 
2479
					"	 * @see <a href=\"invalid\" target=\"_top\">invalid</\n" + 
2480
					"	 * @see <a href=\"invalid\" target=\"_top\">invalid</a\n" + 
2481
					"	 * @see <a href=\"invalid\" target=\"_top\">invalid</a> no text allowed after the href\n" + 
2482
					"	 */\n" + 
2483
					"	void foo() {}\n" + 
2484
					"}\n"	
2485
			},
2486
			"----------\n" + 
2487
				"1. ERROR in X.java (at line 5)\n" + 
2488
				"	* @see <a href=\"invalid\" target\n" + 
2489
				"	       ^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
2490
				"Javadoc: Malformed link reference\n" + 
2491
				"----------\n" + 
2492
				"2. ERROR in X.java (at line 6)\n" + 
2493
				"	* @see <a href=\"invalid\" target=\n" + 
2494
				"	       ^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
2495
				"Javadoc: Malformed link reference\n" + 
2496
				"----------\n" + 
2497
				"3. ERROR in X.java (at line 7)\n" + 
2498
				"	* @see <a href=\"invalid\" target=\"\n" + 
2499
				"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
2500
				"Javadoc: Malformed link reference\n" + 
2501
				"----------\n" + 
2502
				"4. ERROR in X.java (at line 8)\n" + 
2503
				"	* @see <a href=\"invalid\" target=\"_top\n" + 
2504
				"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
2505
				"Javadoc: Malformed link reference\n" + 
2506
				"----------\n" + 
2507
				"5. ERROR in X.java (at line 9)\n" + 
2508
				"	* @see <a href=\"invalid\" target=\"_top\"\n" + 
2509
				"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
2510
				"Javadoc: Malformed link reference\n" + 
2511
				"----------\n" + 
2512
				"6. ERROR in X.java (at line 10)\n" + 
2513
				"	* @see <a href=\"invalid\" target=\"_top\">\n" + 
2514
				"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
2515
				"Javadoc: Malformed link reference\n" + 
2516
				"----------\n" + 
2517
				"7. ERROR in X.java (at line 11)\n" + 
2518
				"	* @see <a href=\"invalid\" target=\"_top\">\n" + 
2519
				"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
2520
				"Javadoc: Malformed link reference\n" + 
2521
				"----------\n" + 
2522
				"8. ERROR in X.java (at line 12)\n" + 
2523
				"	* @see <a href=\"invalid\" target=\"_top\">invalid\n" + 
2524
				"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
2525
				"Javadoc: Malformed link reference\n" + 
2526
				"----------\n" + 
2527
				"9. ERROR in X.java (at line 13)\n" + 
2528
				"	* @see <a href=\"invalid\" target=\"_top\">invalid<\n" + 
2529
				"	                                              ^\n" + 
2530
				"Javadoc: Malformed link reference\n" + 
2531
				"----------\n" + 
2532
				"10. ERROR in X.java (at line 14)\n" + 
2533
				"	* @see <a href=\"invalid\" target=\"_top\">invalid</\n" + 
2534
				"	                                              ^^\n" + 
2535
				"Javadoc: Malformed link reference\n" + 
2536
				"----------\n" + 
2537
				"11. ERROR in X.java (at line 15)\n" + 
2538
				"	* @see <a href=\"invalid\" target=\"_top\">invalid</a\n" + 
2539
				"	                                              ^^^\n" + 
2540
				"Javadoc: Malformed link reference\n" + 
2541
				"----------\n" + 
2542
				"12. ERROR in X.java (at line 16)\n" + 
2543
				"	* @see <a href=\"invalid\" target=\"_top\">invalid</a> no text allowed after the href\n" + 
2544
				"	                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
2545
				"Javadoc: Unexpected text\n" + 
2546
				"----------\n"
2547
		);
2548
	}
2549
	public void testBug68726negative2() {
2550
		runNegativeTest(
2551
			new String[] {
2552
				"X.java",
2553
				"/**\n" + 
2554
					"	* @see <a href=\"http:/www.ibm.com\" target=\"_top\">IBM Home Page\n" + 
2555
					"	* @see <a href=\"http:/www.ibm.com\" target=\"_top\">\n" + 
2556
					"	*          IBM Home Page\n" + 
2557
					"	* @see <a href=\"http:/www.ibm.com\" target=\"_top\">\n" + 
2558
					"	*          IBM Home Page<\n" + 
2559
					"	* 			/a>\n" + 
2560
					"	* @see <a href=\"http:/www.ibm.com\" target=\"_top\">\n" + 
2561
					"	*\n" + 
2562
					"	*          IBM\n" + 
2563
					"	*\n" + 
2564
					"	*          Home Page\n" + 
2565
					"	*\n" + 
2566
					"	*\n" + 
2567
					"	* 			\n" + 
2568
					"	* @see Unknown\n" + 
2569
					"	*/\n" + 
2570
					"public class X {\n" + 
2571
					"}\n"	
2572
			},
2573
			"----------\n" + 
2574
				"1. ERROR in X.java (at line 2)\n" + 
2575
				"	* @see <a href=\"http:/www.ibm.com\" target=\"_top\">IBM Home Page\n" + 
2576
				"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
2577
				"Javadoc: Malformed link reference\n" + 
2578
				"----------\n" + 
2579
				"2. ERROR in X.java (at line 3)\n" + 
2580
				"	* @see <a href=\"http:/www.ibm.com\" target=\"_top\">\n" + 
2581
				"	*          IBM Home Page\n" + 
2582
				"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
2583
				"Javadoc: Malformed link reference\n" + 
2584
				"----------\n" + 
2585
				"3. ERROR in X.java (at line 6)\n" + 
2586
				"	*          IBM Home Page<\n" + 
2587
				"	                        ^\n" + 
2588
				"Javadoc: Malformed link reference\n" + 
2589
				"----------\n" + 
2590
				"4. ERROR in X.java (at line 8)\n" + 
2591
				"	* @see <a href=\"http:/www.ibm.com\" target=\"_top\">\n" + 
2592
				"	*\n" + 
2593
				"	*          IBM\n" + 
2594
				"	*\n" + 
2595
				"	*          Home Page\n" + 
2596
				"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
2597
				"Javadoc: Malformed link reference\n" + 
2598
				"----------\n" + 
2599
				"5. ERROR in X.java (at line 16)\n" + 
2600
				"	* @see Unknown\n" + 
2601
				"	       ^^^^^^^\n" + 
2602
				"Javadoc: Unknown cannot be resolved to a type\n" + 
2603
				"----------\n"
2604
		);
2605
	}
2606
2607
	/**
2423
	 * Bug 69272: [Javadoc] Invalid malformed reference (missing separator)
2608
	 * Bug 69272: [Javadoc] Invalid malformed reference (missing separator)
2424
	 * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=69272">69272</a>
2609
	 * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=69272">69272</a>
2425
	 */
2610
	 */
Lines 2709-2904 Link Here
2709
	}
2894
	}
2710
2895
2711
	/**
2896
	/**
2712
	 * Bug 68726: [Javadoc] Target attribute in @see link triggers warning
2713
	 * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=68726">68726</a>
2714
	 */
2715
	public void testBug68726conform1() {
2716
		runConformTest(
2717
			new String[] {
2718
				"X.java",
2719
				"public class X {\n" + 
2720
					"	/**\n" + 
2721
					"	 *	@see Object <a href=\"http://www.eclipse.org\" target=\"_top\">Eclipse</a>\n" + 
2722
					"	 */\n" + 
2723
					"	void foo1() {}\n" + 
2724
					"	/**@see Object <a href=\"http://www.eclipse.org\" target=\"_top\" target1=\"_top1\" target2=\"_top2\">Eclipse</a>*/\n" + 
2725
					"	void foo2() {}\n" + 
2726
					"}\n"	
2727
			}
2728
		);
2729
	}
2730
	public void testBug68726conform2() {
2731
		runConformTest(
2732
			new String[] {
2733
				"X.java",
2734
				"/**\n" + 
2735
					"	* @see <a href=\"http:/www.ibm.com\" target=\"_top\">IBM Home Page</a>\n" + 
2736
					"	* @see <a href=\"http:/www.ibm.com\" target=\"_top\">\n" + 
2737
					"	*          IBM Home Page</a>\n" + 
2738
					"	* @see <a href=\"http:/www.ibm.com\" target=\"_top\">\n" + 
2739
					"	*          IBM Home Page\n" + 
2740
					"	* 			</a>\n" + 
2741
					"	* @see <a href=\"http:/www.ibm.com\" target=\"_top\">\n" + 
2742
					"	*\n" + 
2743
					"	*          IBM\n" + 
2744
					"	*\n" + 
2745
					"	*          Home Page\n" + 
2746
					"	*\n" + 
2747
					"	*\n" + 
2748
					"	* 			</a>\n" + 
2749
					"	* @see Object\n" + 
2750
					"	*/\n" + 
2751
					"public class X {\n" + 
2752
					"}\n"	
2753
			}
2754
		);
2755
	}
2756
	public void testBug68726negative1() {
2757
		runNegativeTest(
2758
			new String[] {
2759
				"X.java",
2760
				"public class X {\n" + 
2761
					"	/**\n" + 
2762
					"	 * Invalid URL link references\n" + 
2763
					"	 *\n" + 
2764
					"	 * @see <a href=\"invalid\" target\n" + 
2765
					"	 * @see <a href=\"invalid\" target=\n" + 
2766
					"	 * @see <a href=\"invalid\" target=\"\n" + 
2767
					"	 * @see <a href=\"invalid\" target=\"_top\n" + 
2768
					"	 * @see <a href=\"invalid\" target=\"_top\"\n" + 
2769
					"	 * @see <a href=\"invalid\" target=\"_top\">\n" + 
2770
					"	 * @see <a href=\"invalid\" target=\"_top\">\n" + 
2771
					"	 * @see <a href=\"invalid\" target=\"_top\">invalid\n" + 
2772
					"	 * @see <a href=\"invalid\" target=\"_top\">invalid<\n" + 
2773
					"	 * @see <a href=\"invalid\" target=\"_top\">invalid</\n" + 
2774
					"	 * @see <a href=\"invalid\" target=\"_top\">invalid</a\n" + 
2775
					"	 * @see <a href=\"invalid\" target=\"_top\">invalid</a> no text allowed after the href\n" + 
2776
					"	 */\n" + 
2777
					"	void foo() {}\n" + 
2778
					"}\n"	
2779
			},
2780
			"----------\n" + 
2781
				"1. ERROR in X.java (at line 5)\n" + 
2782
				"	* @see <a href=\"invalid\" target\n" + 
2783
				"	       ^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
2784
				"Javadoc: Malformed link reference\n" + 
2785
				"----------\n" + 
2786
				"2. ERROR in X.java (at line 6)\n" + 
2787
				"	* @see <a href=\"invalid\" target=\n" + 
2788
				"	       ^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
2789
				"Javadoc: Malformed link reference\n" + 
2790
				"----------\n" + 
2791
				"3. ERROR in X.java (at line 7)\n" + 
2792
				"	* @see <a href=\"invalid\" target=\"\n" + 
2793
				"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
2794
				"Javadoc: Malformed link reference\n" + 
2795
				"----------\n" + 
2796
				"4. ERROR in X.java (at line 8)\n" + 
2797
				"	* @see <a href=\"invalid\" target=\"_top\n" + 
2798
				"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
2799
				"Javadoc: Malformed link reference\n" + 
2800
				"----------\n" + 
2801
				"5. ERROR in X.java (at line 9)\n" + 
2802
				"	* @see <a href=\"invalid\" target=\"_top\"\n" + 
2803
				"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
2804
				"Javadoc: Malformed link reference\n" + 
2805
				"----------\n" + 
2806
				"6. ERROR in X.java (at line 10)\n" + 
2807
				"	* @see <a href=\"invalid\" target=\"_top\">\n" + 
2808
				"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
2809
				"Javadoc: Malformed link reference\n" + 
2810
				"----------\n" + 
2811
				"7. ERROR in X.java (at line 11)\n" + 
2812
				"	* @see <a href=\"invalid\" target=\"_top\">\n" + 
2813
				"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
2814
				"Javadoc: Malformed link reference\n" + 
2815
				"----------\n" + 
2816
				"8. ERROR in X.java (at line 12)\n" + 
2817
				"	* @see <a href=\"invalid\" target=\"_top\">invalid\n" + 
2818
				"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
2819
				"Javadoc: Malformed link reference\n" + 
2820
				"----------\n" + 
2821
				"9. ERROR in X.java (at line 13)\n" + 
2822
				"	* @see <a href=\"invalid\" target=\"_top\">invalid<\n" + 
2823
				"	                                              ^\n" + 
2824
				"Javadoc: Malformed link reference\n" + 
2825
				"----------\n" + 
2826
				"10. ERROR in X.java (at line 14)\n" + 
2827
				"	* @see <a href=\"invalid\" target=\"_top\">invalid</\n" + 
2828
				"	                                              ^^\n" + 
2829
				"Javadoc: Malformed link reference\n" + 
2830
				"----------\n" + 
2831
				"11. ERROR in X.java (at line 15)\n" + 
2832
				"	* @see <a href=\"invalid\" target=\"_top\">invalid</a\n" + 
2833
				"	                                              ^^^\n" + 
2834
				"Javadoc: Malformed link reference\n" + 
2835
				"----------\n" + 
2836
				"12. ERROR in X.java (at line 16)\n" + 
2837
				"	* @see <a href=\"invalid\" target=\"_top\">invalid</a> no text allowed after the href\n" + 
2838
				"	                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
2839
				"Javadoc: Unexpected text\n" + 
2840
				"----------\n"
2841
		);
2842
	}
2843
	public void testBug68726negative2() {
2844
		runNegativeTest(
2845
			new String[] {
2846
				"X.java",
2847
				"/**\n" + 
2848
					"	* @see <a href=\"http:/www.ibm.com\" target=\"_top\">IBM Home Page\n" + 
2849
					"	* @see <a href=\"http:/www.ibm.com\" target=\"_top\">\n" + 
2850
					"	*          IBM Home Page\n" + 
2851
					"	* @see <a href=\"http:/www.ibm.com\" target=\"_top\">\n" + 
2852
					"	*          IBM Home Page<\n" + 
2853
					"	* 			/a>\n" + 
2854
					"	* @see <a href=\"http:/www.ibm.com\" target=\"_top\">\n" + 
2855
					"	*\n" + 
2856
					"	*          IBM\n" + 
2857
					"	*\n" + 
2858
					"	*          Home Page\n" + 
2859
					"	*\n" + 
2860
					"	*\n" + 
2861
					"	* 			\n" + 
2862
					"	* @see Unknown\n" + 
2863
					"	*/\n" + 
2864
					"public class X {\n" + 
2865
					"}\n"	
2866
			},
2867
			"----------\n" + 
2868
				"1. ERROR in X.java (at line 2)\n" + 
2869
				"	* @see <a href=\"http:/www.ibm.com\" target=\"_top\">IBM Home Page\n" + 
2870
				"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
2871
				"Javadoc: Malformed link reference\n" + 
2872
				"----------\n" + 
2873
				"2. ERROR in X.java (at line 3)\n" + 
2874
				"	* @see <a href=\"http:/www.ibm.com\" target=\"_top\">\n" + 
2875
				"	*          IBM Home Page\n" + 
2876
				"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
2877
				"Javadoc: Malformed link reference\n" + 
2878
				"----------\n" + 
2879
				"3. ERROR in X.java (at line 6)\n" + 
2880
				"	*          IBM Home Page<\n" + 
2881
				"	                        ^\n" + 
2882
				"Javadoc: Malformed link reference\n" + 
2883
				"----------\n" + 
2884
				"4. ERROR in X.java (at line 8)\n" + 
2885
				"	* @see <a href=\"http:/www.ibm.com\" target=\"_top\">\n" + 
2886
				"	*\n" + 
2887
				"	*          IBM\n" + 
2888
				"	*\n" + 
2889
				"	*          Home Page\n" + 
2890
				"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
2891
				"Javadoc: Malformed link reference\n" + 
2892
				"----------\n" + 
2893
				"5. ERROR in X.java (at line 16)\n" + 
2894
				"	* @see Unknown\n" + 
2895
				"	       ^^^^^^^\n" + 
2896
				"Javadoc: Unknown cannot be resolved to a type\n" + 
2897
				"----------\n"
2898
		);
2899
	}
2900
2901
	/**
2902
	 * Bug 70892: [1.5][Javadoc] Compiler should parse reference for inline tag @value
2897
	 * Bug 70892: [1.5][Javadoc] Compiler should parse reference for inline tag @value
2903
	 * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=70892">70892</a>
2898
	 * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=70892">70892</a>
2904
	 * These two tests should pass whatever the source level...
2899
	 * These two tests should pass whatever the source level...
Lines 3751-3757 Link Here
3751
				"	class C { \n" + 
3746
				"	class C { \n" + 
3752
				"	    /**\n" + 
3747
				"	    /**\n" + 
3753
				"	     * Link {@link #B(Exception)} OK\n" + 
3748
				"	     * Link {@link #B(Exception)} OK\n" + 
3754
				"	     * Link {@link #C(String)} OK\n" + 
3749
				"	     * Link {@link #B.C(String)} OK\n" + 
3755
				"	     * Link {@link #foo()} OK\n" + 
3750
				"	     * Link {@link #foo()} OK\n" + 
3756
				"	     * Link {@link #bar()} OK\n" + 
3751
				"	     * Link {@link #bar()} OK\n" + 
3757
				"	     */\n" + 
3752
				"	     */\n" + 
Lines 3950-3955 Link Here
3950
	}
3945
	}
3951
3946
3952
	/**
3947
	/**
3948
	 * Bug 96237: [javadoc] Inner types must be qualified
3949
	 * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=96237"
3950
	 */
3951
	public void testBug96237() {
3952
		runConformTest(
3953
			new String[] {
3954
				"boden/IAFAState.java",
3955
				"package boden;\n" + 
3956
				"public interface IAFAState {\n" + 
3957
				"    public class ValidationException extends Exception {\n" + 
3958
				"        public ValidationException(String variableName, IAFAState subformula) {\n" + 
3959
				"            super(\"Variable \'\"+variableName+\"\' may be unbound in \'\"+subformula+\"\'\");\n" + 
3960
				"        }\n" + 
3961
				"        public void method() {}\n" + 
3962
				"    }\n" + 
3963
				"    /**\n" + 
3964
				"     * Validates a formula for consistent bindings. Bindings are consistent, when at each point in time,\n" + 
3965
				"     * the set of povided variables can be guaranteed to be a superset of the set of required variables.\n" + 
3966
				"     * @throws ValidationException Thrown if a variable is unbound. \n" + 
3967
				"     * @see ValidationException#IAFAState.ValidationException(String, IAFAState)\n" + 
3968
				"     * @see IAFAState.ValidationException#method()\n" + 
3969
				"     * @see ValidationException\n" + 
3970
				"     * {@link ValidationException}\n" + 
3971
				"     */\n" + 
3972
				"    public void validate() throws ValidationException;\n" + 
3973
				"}\n",
3974
				"boden/TestValid.java",
3975
				"package boden;\n" + 
3976
				"import boden.IAFAState.ValidationException;\n" + 
3977
				"/**\n" + 
3978
				" * @see ValidationException\n" + 
3979
				" * @see IAFAState.ValidationException\n" + 
3980
				" */\n" + 
3981
				"public class TestValid {\n" + 
3982
				"	/**  \n" + 
3983
				"	 * @see ValidationException#IAFAState.ValidationException(String, IAFAState)\n" + 
3984
				"	 */\n" + 
3985
				"	IAFAState.ValidationException valid1;\n" + 
3986
				"	/**\n" + 
3987
				"	 * @see IAFAState.ValidationException#IAFAState.ValidationException(String, IAFAState)\n" + 
3988
				"	 */\n" + 
3989
				"	IAFAState.ValidationException valid2;\n" + 
3990
				"}\n"
3991
			}
3992
		);
3993
	}
3994
	public void testBug96237b() {
3995
		runNegativeTest(
3996
			new String[] {
3997
				"boden/IAFAState.java",
3998
				"package boden;\n" + 
3999
				"public interface IAFAState {\n" + 
4000
				"    public class ValidationException extends Exception {\n" + 
4001
				"        public ValidationException(String variableName, IAFAState subformula) {\n" + 
4002
				"            super(\"Variable \'\"+variableName+\"\' may be unbound in \'\"+subformula+\"\'\");\n" + 
4003
				"        }\n" + 
4004
				"        public void method() {}\n" + 
4005
				"    }\n" + 
4006
				"}\n",
4007
				"boden/TestInvalid.java",
4008
				"package boden;\n" + 
4009
				"import boden.IAFAState.ValidationException;\n" + 
4010
				"public class TestInvalid {\n" + 
4011
				"	/** \n" + 
4012
				"	 * @see ValidationException#ValidationException(String, IAFAState)\n" + 
4013
				"	 */ \n" + 
4014
				"	IAFAState.ValidationException invalid;\n" + 
4015
				"}\n"
4016
			},
4017
			"----------\n" + 
4018
			"1. ERROR in boden\\TestInvalid.java (at line 5)\n" + 
4019
			"	* @see ValidationException#ValidationException(String, IAFAState)\n" + 
4020
			"	                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
4021
			"Javadoc: Invalid reference\n" + 
4022
			"----------\n"
4023
		);
4024
	}
4025
	public void testBug96237c() {
4026
		runNegativeTest(
4027
			new String[] {
4028
				"boden/IAFAState.java",
4029
				"package boden;\n" + 
4030
				"public interface IAFAState {\n" + 
4031
				"    public class ValidationException extends Exception {\n" + 
4032
				"        public ValidationException(String variableName, IAFAState subformula) {\n" + 
4033
				"            super(\"Variable \'\"+variableName+\"\' may be unbound in \'\"+subformula+\"\'\");\n" + 
4034
				"        }\n" + 
4035
				"        public void method() {}\n" + 
4036
				"    }\n" + 
4037
				"}\n",
4038
				"boden/TestInvalid.java",
4039
				"package boden;\n" + 
4040
				"import boden.IAFAState.ValidationException;\n" + 
4041
				"public class TestInvalid {\n" + 
4042
				"	/**\n" + 
4043
				"	 * @see IAFAState.ValidationException#ValidationException(String, IAFAState)\n" + 
4044
				"	 */\n" + 
4045
				"	IAFAState.ValidationException invalid;\n" + 
4046
				"}\n"
4047
			},
4048
			"----------\n" + 
4049
			"1. ERROR in boden\\TestInvalid.java (at line 5)\n" + 
4050
			"	* @see IAFAState.ValidationException#ValidationException(String, IAFAState)\n" + 
4051
			"	                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
4052
			"Javadoc: Invalid reference\n" + 
4053
			"----------\n"
4054
		);
4055
	}
4056
	public void testBug96237d() {
4057
		runNegativeTest(
4058
			new String[] {
4059
				"test/Test.java",
4060
				"package test;\n" + 
4061
				"public interface Test {\n" + 
4062
				"	public class Level0 {\n" + 
4063
				"		public Level0() {}\n" + 
4064
				"	}\n" + 
4065
				"	public interface Member {\n" + 
4066
				"		public class Level1 {\n" + 
4067
				"			public Level1() {}\n" + 
4068
				"		}\n" + 
4069
				"	}\n" + 
4070
				"}\n",
4071
				"test/C.java",
4072
				"package test;\n" + 
4073
				"public class C {\n" + 
4074
				"	/**\n" + 
4075
				"	 * @see Test.Level0#Test.Level0()\n" + 
4076
				"	 */\n" + 
4077
				"	Test.Level0 valid = new Test.Level0();\n" + 
4078
				"	/**\n" + 
4079
				"	 * @see Test.Level0#Level0()\n" + 
4080
				"	 */\n" + 
4081
				"	Test.Level0 invalid = new Test.Level0();\n" + 
4082
				"}\n"
4083
			},
4084
			"----------\n" + 
4085
			"1. ERROR in test\\C.java (at line 8)\n" + 
4086
			"	* @see Test.Level0#Level0()\n" + 
4087
			"	                   ^^^^^^^^\n" + 
4088
			"Javadoc: Invalid reference\n" + 
4089
			"----------\n"
4090
		);
4091
	}
4092
	public void testBug96237e() {
4093
		runNegativeTest(
4094
			new String[] {
4095
				"test/Test.java",
4096
				"package test;\n" + 
4097
				"public interface Test {\n" + 
4098
				"	public class Level0 {\n" + 
4099
				"		public Level0() {}\n" + 
4100
				"	}\n" + 
4101
				"	public interface Member {\n" + 
4102
				"		public class Level1 {\n" + 
4103
				"			public Level1() {}\n" + 
4104
				"		}\n" + 
4105
				"	}\n" + 
4106
				"}\n",
4107
				"test/C2.java",
4108
				"package test;\n" + 
4109
				"public class C2 {\n" + 
4110
				"	/**\n" + 
4111
				"	 * @see Test.Member.Level1#Test.Member.Level1()\n" + 
4112
				"	 */\n" + 
4113
				"	Test.Member.Level1 valid = new Test.Member.Level1();\n" + 
4114
				"	/**\n" + 
4115
				"	 * @see Test.Member.Level1#Level1()\n" + 
4116
				"	 */\n" + 
4117
				"	Test.Member.Level1 invalid = new Test.Member.Level1();\n" + 
4118
				"	/**\n" + 
4119
				"	 * @see Test.Member.Level1#Test.Level1()\n" + 
4120
				"	 */\n" + 
4121
				"	Test.Member.Level1 wrong = new Test.Member.Level1();\n" + 
4122
				"}\n"
4123
			},
4124
			"----------\n" + 
4125
			"1. ERROR in test\\C2.java (at line 8)\n" + 
4126
			"	* @see Test.Member.Level1#Level1()\n" + 
4127
			"	                          ^^^^^^^^\n" + 
4128
			"Javadoc: Invalid reference\n" + 
4129
			"----------\n" + 
4130
			"2. ERROR in test\\C2.java (at line 12)\n" + 
4131
			"	* @see Test.Member.Level1#Test.Level1()\n" + 
4132
			"	                          ^^^^^^^^^^^^^\n" + 
4133
			"Javadoc: Invalid reference\n" + 
4134
			"----------\n"
4135
		);
4136
	}
4137
	public void testBug96237f() {
4138
		runConformTest(
4139
			new String[] {
4140
				"implicit/Valid.java",
4141
				"package implicit;\n" + 
4142
				"public interface Valid {\n" + 
4143
				"	public class Level0 {\n" + 
4144
				"		/**\n" + 
4145
				"		 * @see #Valid.Level0() Valid\n" + 
4146
				"		 */\n" + 
4147
				"		public Level0() {}\n" + 
4148
				"		/**\n" + 
4149
				"		 * @see #Valid.Level0(String) Valid\n" + 
4150
				"		 */\n" + 
4151
				"		public Level0(String str) {}\n" + 
4152
				"	}\n" + 
4153
				"	public interface Member {\n" + 
4154
				"		public class Level1 {\n" + 
4155
				"			/**\n" + 
4156
				"			 * @see #Valid.Member.Level1() Valid\n" + 
4157
				"			 */\n" + 
4158
				"			public Level1() {}\n" + 
4159
				"			/**\n" + 
4160
				"			 * @see #Valid.Member.Level1(int) Valid\n" + 
4161
				"			 */\n" + 
4162
				"			public Level1(int x) {}\n" + 
4163
				"		}\n" + 
4164
				"	}\n" + 
4165
				"}\n"
4166
			}
4167
		);
4168
	}
4169
	public void testBug96237g() {
4170
		runNegativeTest(
4171
			new String[] {
4172
				"implicit/Invalid.java",
4173
				"package implicit;\n" + 
4174
				"public interface Invalid {\n" + 
4175
				"	public class Level0 {\n" + 
4176
				"		/**\n" + 
4177
				"		 * @see #Level0() Invalid\n" + 
4178
				"		 */\n" + 
4179
				"		public Level0() {}\n" + 
4180
				"		/**\n" + 
4181
				"		 * @see #Level0(String) Invalid\n" + 
4182
				"		 */\n" + 
4183
				"		public Level0(String str) {}\n" + 
4184
				"	}\n" + 
4185
				"	public interface Member {\n" + 
4186
				"		public class Level1 {\n" + 
4187
				"			/**\n" + 
4188
				"			 * @see #Level1() Invalid\n" + 
4189
				"			 * @see #Member.Level1() Invalid\n" + 
4190
				"			 * @see #Invalid.Level1() Invalid\n" + 
4191
				"			 */\n" + 
4192
				"			public Level1() {}\n" + 
4193
				"			/**\n" + 
4194
				"			 * @see #Level1(int) Invalid\n" + 
4195
				"			 * @see #Invalid.Level1(int) Invalid\n" + 
4196
				"			 * @see #Member.Level1(int) Invalid\n" + 
4197
				"			 */\n" + 
4198
				"			public Level1(int x) {}\n" + 
4199
				"		}\n" + 
4200
				"	}\n" + 
4201
				"}\n"
4202
			},
4203
			"----------\n" + 
4204
			"1. ERROR in implicit\\Invalid.java (at line 5)\n" + 
4205
			"	* @see #Level0() Invalid\n" + 
4206
			"	        ^^^^^^^^\n" + 
4207
			"Javadoc: Invalid reference\n" + 
4208
			"----------\n" + 
4209
			"2. ERROR in implicit\\Invalid.java (at line 9)\n" + 
4210
			"	* @see #Level0(String) Invalid\n" + 
4211
			"	        ^^^^^^^^^^^^^^\n" + 
4212
			"Javadoc: Invalid reference\n" + 
4213
			"----------\n" + 
4214
			"3. ERROR in implicit\\Invalid.java (at line 16)\n" + 
4215
			"	* @see #Level1() Invalid\n" + 
4216
			"	        ^^^^^^^^\n" + 
4217
			"Javadoc: Invalid reference\n" + 
4218
			"----------\n" + 
4219
			"4. ERROR in implicit\\Invalid.java (at line 17)\n" + 
4220
			"	* @see #Member.Level1() Invalid\n" + 
4221
			"	        ^^^^^^^^^^^^^^^\n" + 
4222
			"Javadoc: Invalid reference\n" + 
4223
			"----------\n" + 
4224
			"5. ERROR in implicit\\Invalid.java (at line 18)\n" + 
4225
			"	* @see #Invalid.Level1() Invalid\n" + 
4226
			"	        ^^^^^^^^^^^^^^^^\n" + 
4227
			"Javadoc: Invalid reference\n" + 
4228
			"----------\n" + 
4229
			"6. ERROR in implicit\\Invalid.java (at line 22)\n" + 
4230
			"	* @see #Level1(int) Invalid\n" + 
4231
			"	        ^^^^^^^^^^^\n" + 
4232
			"Javadoc: Invalid reference\n" + 
4233
			"----------\n" + 
4234
			"7. ERROR in implicit\\Invalid.java (at line 23)\n" + 
4235
			"	* @see #Invalid.Level1(int) Invalid\n" + 
4236
			"	        ^^^^^^^^^^^^^^^^^^^\n" + 
4237
			"Javadoc: Invalid reference\n" + 
4238
			"----------\n" + 
4239
			"8. ERROR in implicit\\Invalid.java (at line 24)\n" + 
4240
			"	* @see #Member.Level1(int) Invalid\n" + 
4241
			"	        ^^^^^^^^^^^^^^^^^^\n" + 
4242
			"Javadoc: Invalid reference\n" + 
4243
			"----------\n"
4244
		);
4245
	}
4246
4247
	/**
3953
	 * Bug 116464: [javadoc] Unicode tag name are not correctly parsed
4248
	 * Bug 116464: [javadoc] Unicode tag name are not correctly parsed
3954
	 * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=116464"
4249
	 * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=116464"
3955
	 */
4250
	 */
(-)src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest.java (+1 lines)
Lines 100-105 Link Here
100
		options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsDeprecatedRef, CompilerOptions.ENABLED);
100
		options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsDeprecatedRef, CompilerOptions.ENABLED);
101
		options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsNotVisibleRef, CompilerOptions.ENABLED);
101
		options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsNotVisibleRef, CompilerOptions.ENABLED);
102
		options.put(CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, CompilerOptions.PRIVATE);
102
		options.put(CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, CompilerOptions.PRIVATE);
103
		options.put(CompilerOptions.OPTION_ReportMissingSerialVersion, CompilerOptions.IGNORE);
103
		return options;
104
		return options;
104
	}
105
	}
105
	
106
	

Return to bug 96237