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

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java (-2 / +2 lines)
Lines 500-506 Link Here
500
						}
500
						}
501
						break;
501
						break;
502
					case 'v':
502
					case 'v':
503
						if (this.sourceLevel >= ClassFileConstants.JDK1_5 && length == TAG_VALUE_LENGTH && CharOperation.equals(TAG_VALUE, tagName)) {
503
						if (this.complianceLevel >= ClassFileConstants.JDK1_5 && length == TAG_VALUE_LENGTH && CharOperation.equals(TAG_VALUE, tagName)) {
504
							this.tagValue = TAG_VALUE_VALUE;
504
							this.tagValue = TAG_VALUE_VALUE;
505
							if (this.inlineTagStarted) {
505
							if (this.inlineTagStarted) {
506
								valid = parseReference();
506
								valid = parseReference();
Lines 576-582 Link Here
576
						if (++this.invalidParamReferencesPtr >= stackLength) {
576
						if (++this.invalidParamReferencesPtr >= stackLength) {
577
							System.arraycopy(
577
							System.arraycopy(
578
								this.invalidParamReferencesStack, 0,
578
								this.invalidParamReferencesStack, 0,
579
								this.invalidParamReferencesStack = new JavadocSingleNameReference[stackLength + AstStackIncrement], 0,
579
								this.invalidParamReferencesStack = new JavadocSingleNameReference[stackLength + AST_STACK_INCREMENT], 0,
580
								stackLength);
580
								stackLength);
581
						}
581
						}
582
						this.invalidParamReferencesStack[this.invalidParamReferencesPtr] = nameRef;
582
						this.invalidParamReferencesStack[this.invalidParamReferencesPtr] = nameRef;
(-)compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java (-6 / +6 lines)
Lines 47-53 Link Here
47
	// Options
47
	// Options
48
	public boolean checkDocComment = false;
48
	public boolean checkDocComment = false;
49
	public boolean reportProblems;
49
	public boolean reportProblems;
50
	protected long sourceLevel;
50
	protected long complianceLevel;
51
	
51
	
52
	// Results
52
	// Results
53
	protected long inheritedPositions;
53
	protected long inheritedPositions;
Lines 82-88 Link Here
82
	protected long[] identifierPositionStack;
82
	protected long[] identifierPositionStack;
83
83
84
	// Ast stack
84
	// Ast stack
85
	protected static int AstStackIncrement = 10;
85
	protected final static int AST_STACK_INCREMENT = 10;
86
	protected int astPtr;
86
	protected int astPtr;
87
	protected Object[] astStack;
87
	protected Object[] astStack;
88
	protected int astLengthPtr;
88
	protected int astLengthPtr;
Lines 99-105 Link Here
99
		this.reportProblems = sourceParser != null;
99
		this.reportProblems = sourceParser != null;
100
		if (sourceParser != null) {
100
		if (sourceParser != null) {
101
			this.checkDocComment = this.sourceParser.options.docCommentSupport;
101
			this.checkDocComment = this.sourceParser.options.docCommentSupport;
102
			this.sourceLevel = this.sourceParser.options.sourceLevel;
102
			this.complianceLevel = this.sourceParser.options.complianceLevel;
103
		}
103
		}
104
	}
104
	}
105
105
Lines 710-716 Link Here
710
		boolean hasMultiLines = this.scanner.currentPosition > (this.lineEnd+1);
710
		boolean hasMultiLines = this.scanner.currentPosition > (this.lineEnd+1);
711
		boolean isTypeParam = false;
711
		boolean isTypeParam = false;
712
		boolean valid = true, empty = true;
712
		boolean valid = true, empty = true;
713
		boolean mayBeGeneric = this.sourceLevel >= ClassFileConstants.JDK1_5;
713
		boolean mayBeGeneric = this.complianceLevel >= ClassFileConstants.JDK1_5;
714
		int token = -1;
714
		int token = -1;
715
		nextToken: while (true) {
715
		nextToken: while (true) {
716
			this.currentTokenType = -1;
716
			this.currentTokenType = -1;
Lines 1225-1231 Link Here
1225
		if (++this.astPtr >= stackLength) {
1225
		if (++this.astPtr >= stackLength) {
1226
			System.arraycopy(
1226
			System.arraycopy(
1227
				this.astStack, 0,
1227
				this.astStack, 0,
1228
				this.astStack = new Object[stackLength + AstStackIncrement], 0,
1228
				this.astStack = new Object[stackLength + AST_STACK_INCREMENT], 0,
1229
				stackLength);
1229
				stackLength);
1230
			this.astPtr = stackLength;
1230
			this.astPtr = stackLength;
1231
		}
1231
		}
Lines 1236-1242 Link Here
1236
			if (++this.astLengthPtr >= stackLength) {
1236
			if (++this.astLengthPtr >= stackLength) {
1237
				System.arraycopy(
1237
				System.arraycopy(
1238
					this.astLengthStack, 0,
1238
					this.astLengthStack, 0,
1239
					this.astLengthStack = new int[stackLength + AstStackIncrement], 0,
1239
					this.astLengthStack = new int[stackLength + AST_STACK_INCREMENT], 0,
1240
					stackLength);
1240
					stackLength);
1241
			}
1241
			}
1242
			this.astLengthStack[this.astLengthPtr] = 1;
1242
			this.astLengthStack[this.astLengthPtr] = 1;
(-)dom/org/eclipse/jdt/core/dom/DocCommentParser.java (-2 / +2 lines)
Lines 34-40 Link Here
34
		super(null);
34
		super(null);
35
		this.ast = ast;
35
		this.ast = ast;
36
		this.scanner = scanner;
36
		this.scanner = scanner;
37
		this.sourceLevel = this.ast.apiLevel() >= AST.JLS3 ? ClassFileConstants.JDK1_5 : ClassFileConstants.JDK1_3;
37
		this.complianceLevel = this.ast.apiLevel() >= AST.JLS3 ? ClassFileConstants.JDK1_5 : ClassFileConstants.JDK1_3;
38
		this.checkDocComment = check;
38
		this.checkDocComment = check;
39
		this.kind = DOM_PARSER | TEXT_PARSE;
39
		this.kind = DOM_PARSER | TEXT_PARSE;
40
	}
40
	}
Lines 489-495 Link Here
489
						}
489
						}
490
					break;
490
					break;
491
					case 'v':
491
					case 'v':
492
						if (this.sourceLevel >= ClassFileConstants.JDK1_5 && length == TAG_VALUE_LENGTH && CharOperation.equals(TAG_VALUE, tagName)) {
492
						if (this.complianceLevel >= ClassFileConstants.JDK1_5 && length == TAG_VALUE_LENGTH && CharOperation.equals(TAG_VALUE, tagName)) {
493
							this.tagValue = TAG_VALUE_VALUE;
493
							this.tagValue = TAG_VALUE_VALUE;
494
							if (this.inlineTagStarted) {
494
							if (this.inlineTagStarted) {
495
								valid = parseReference();
495
								valid = parseReference();
(-)codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionJavadocParser.java (-1 / +1 lines)
Lines 278-284 Link Here
278
	 * Init tags arrays for current source level.
278
	 * Init tags arrays for current source level.
279
	 */
279
	 */
280
	private void initLevelTags() {
280
	private void initLevelTags() {
281
		int level = ((int)(this.sourceLevel >>> 16)) - ClassFileConstants.MAJOR_VERSION_1_1 + 1;
281
		int level = ((int)(this.complianceLevel >>> 16)) - ClassFileConstants.MAJOR_VERSION_1_1 + 1;
282
		// Init block tags
282
		// Init block tags
283
		this.levelTags[BLOCK_IDX] = new char[BLOCK_ALL_TAGS_LENGTH][];
283
		this.levelTags[BLOCK_IDX] = new char[BLOCK_ALL_TAGS_LENGTH][];
284
		this.levelTagsLength[BLOCK_IDX] = 0;
284
		this.levelTagsLength[BLOCK_IDX] = 0;
(-)src/org/eclipse/jdt/core/tests/compiler/parser/JavadocCompletionParserTest.java (-1 / +26 lines)
Lines 11-16 Link Here
11
package org.eclipse.jdt.core.tests.compiler.parser;
11
package org.eclipse.jdt.core.tests.compiler.parser;
12
12
13
import java.util.Locale;
13
import java.util.Locale;
14
import java.util.Map;
14
import java.util.StringTokenizer;
15
import java.util.StringTokenizer;
15
16
16
import junit.framework.Test;
17
import junit.framework.Test;
Lines 41-46 Link Here
41
	}
42
	}
42
43
43
	CompletionJavadoc javadoc;
44
	CompletionJavadoc javadoc;
45
	String sourceLevel;
44
46
45
public JavadocCompletionParserTest(String testName) {
47
public JavadocCompletionParserTest(String testName) {
46
	super(testName);
48
	super(testName);
Lines 61-66 Link Here
61
 */
63
 */
62
protected void setUp() throws Exception {
64
protected void setUp() throws Exception {
63
	super.setUp();
65
	super.setUp();
66
	this.sourceLevel = null;
64
}
67
}
65
68
66
protected void assertCompletionNodeResult(String source, String expected) {
69
protected void assertCompletionNodeResult(String source, String expected) {
Lines 82-88 Link Here
82
		actual
85
		actual
83
	);
86
	);
84
}
87
}
85
88
protected Map getCompilerOptions() {
89
	Map options = super.getCompilerOptions();
90
	if (this.sourceLevel == null) {
91
		return options;
92
	}
93
	options.put(CompilerOptions.OPTION_Source, this.sourceLevel);
94
	return options;
95
}
86
protected void verifyCompletionInJavadoc(String source, String after) {
96
protected void verifyCompletionInJavadoc(String source, String after) {
87
	CompilerOptions options = new CompilerOptions(getCompilerOptions());
97
	CompilerOptions options = new CompilerOptions(getCompilerOptions());
88
	CompletionParser parser = new CompletionParser(new ProblemReporter(DefaultErrorHandlingPolicies.proceedWithAllProblems(),
98
	CompletionParser parser = new CompletionParser(new ProblemReporter(DefaultErrorHandlingPolicies.proceedWithAllProblems(),
Lines 283-288 Link Here
283
	verifyCompletionInJavadoc(source, "@");
293
	verifyCompletionInJavadoc(source, "@");
284
	verifyAllTagsCompletion();
294
	verifyAllTagsCompletion();
285
}
295
}
296
/**
297
 * @bug [javadoc][assist] @linkplain no longer proposed when 1.4 compliance is used
298
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=123096"
299
 */
300
public void test008() {
301
	this.sourceLevel = CompilerOptions.VERSION_1_3;
302
	String source = "package javadoc;\n" +
303
		"/**\n" +
304
		" * Completion on empty tag name:\n" +
305
		" * 	@\n" +
306
		" */\n" +
307
		"public class Test {}\n";
308
	verifyCompletionInJavadoc(source, "@");
309
	verifyAllTagsCompletion();
310
}
286
311
287
/**
312
/**
288
 * @tests Tests to verify completion node flags
313
 * @tests Tests to verify completion node flags

Return to bug 123096