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

Collapse All | Expand All

(-)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
(-)compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java (+2 lines)
Lines 47-52 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 complianceLevel;
50
	protected long sourceLevel;
51
	protected long sourceLevel;
51
	
52
	
52
	// Results
53
	// Results
Lines 100-105 Link Here
100
		if (sourceParser != null) {
101
		if (sourceParser != null) {
101
			this.checkDocComment = this.sourceParser.options.docCommentSupport;
102
			this.checkDocComment = this.sourceParser.options.docCommentSupport;
102
			this.sourceLevel = this.sourceParser.options.sourceLevel;
103
			this.sourceLevel = this.sourceParser.options.sourceLevel;
104
			this.complianceLevel = this.sourceParser.options.complianceLevel;
103
		}
105
		}
104
	}
106
	}
105
107
(-)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;

Return to bug 123096