View | Details | Raw Unified | Return to bug 232488
Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java (+10 lines)
Lines 165-168 Link Here
165
	formatUnit("bugs.b232138", "X04b.java");
165
	formatUnit("bugs.b232138", "X04b.java");
166
}
166
}
167
167
168
/**
169
 * @bug 232488: [formatter] Code formatter scrambles JavaDoc of Generics
170
 * @test Insure that comment formatter format properly generic param tags
171
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=232488"
172
 */
173
public void testBug232488() throws JavaModelException {
174
	this.preferences.comment_line_length = 40;
175
	formatUnit("bugs.b232488", "X01.java");
176
}
177
168
}
178
}
(-)src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsTests.java (-2 / +2 lines)
Lines 76-82 Link Here
76
 */
76
 */
77
public void setUpSuite() throws Exception {
77
public void setUpSuite() throws Exception {
78
	if (JAVA_PROJECT == null) {
78
	if (JAVA_PROJECT == null) {
79
		JAVA_PROJECT = setUpJavaProject("FormatterJavadoc"); //$NON-NLS-1$
79
		JAVA_PROJECT = setUpJavaProject("FormatterJavadoc", "1.5"); //$NON-NLS-1$
80
	}
80
	}
81
	super.setUpSuite();
81
	super.setUpSuite();
82
}	
82
}	
Lines 96-102 Link Here
96
}
96
}
97
97
98
DefaultCodeFormatter codeFormatter() {
98
DefaultCodeFormatter codeFormatter() {
99
	DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
99
	DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, JAVA_PROJECT.getOptions(true));
100
	return codeFormatter;
100
	return codeFormatter;
101
}
101
}
102
102
(-)workspace/FormatterJavadoc/.classpath (-1 / +1 lines)
Lines 1-6 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
1
<?xml version="1.0" encoding="UTF-8"?>
2
<classpath>
2
<classpath>
3
    <classpathentry kind="src" path=""/>
3
    <classpathentry kind="src" path=""/>
4
    <classpathentry kind="var" path="JCL_LIB" sourcepath="JCL_SRC" rootpath="JCL_SRCROOT"/>
4
    <classpathentry kind="var" path="JCL15_LIB" sourcepath="JCL15_SRC" rootpath="JCL_SRCROOT"/>
5
    <classpathentry kind="output" path="bin"/>
5
    <classpathentry kind="output" path="bin"/>
6
</classpath>
6
</classpath>
(-)workspace/FormatterJavadoc/test/bugs/b232488/X01.java (+12 lines)
Added Link Here
1
public class X01 {
2
3
	/**
4
	 * Test generic param reference
5
	 * 
6
	 * @param <T> type parameter
7
	 * @param str the string argument
8
	 */
9
	<T> void foo(String str) {
10
11
	}
12
}
(-)workspace/FormatterJavadoc/test/bugs/b232488/out/X01.java (+14 lines)
Added Link Here
1
public class X01 {
2
3
	/**
4
	 * Test generic param reference
5
	 * 
6
	 * @param <T>
7
	 *            type parameter
8
	 * @param str
9
	 *            the string argument
10
	 */
11
	<T> void foo(String str) {
12
13
	}
14
}
(-)formatter/org/eclipse/jdt/internal/formatter/Scribe.java (-1 / +1 lines)
Lines 831-837 Link Here
831
	
831
	
832
	private void initFormatterCommentParser() {
832
	private void initFormatterCommentParser() {
833
		if (this.formatterCommentParser == null) {
833
		if (this.formatterCommentParser == null) {
834
			this.formatterCommentParser = new FormatterCommentParser(null);
834
			this.formatterCommentParser = new FormatterCommentParser(this.scanner.sourceLevel);
835
		}
835
		}
836
		this.formatterCommentParser.scanner.setSource(this.scanner.source);
836
		this.formatterCommentParser.scanner.setSource(this.scanner.source);
837
		this.formatterCommentParser.source = this.scanner.source;
837
		this.formatterCommentParser.source = this.scanner.source;
(-)formatter/org/eclipse/jdt/internal/formatter/FormatterCommentParser.java (-3 / +3 lines)
Lines 15-21 Link Here
15
import org.eclipse.jdt.core.compiler.CharOperation;
15
import org.eclipse.jdt.core.compiler.CharOperation;
16
import org.eclipse.jdt.core.compiler.InvalidInputException;
16
import org.eclipse.jdt.core.compiler.InvalidInputException;
17
import org.eclipse.jdt.internal.compiler.parser.JavadocParser;
17
import org.eclipse.jdt.internal.compiler.parser.JavadocParser;
18
import org.eclipse.jdt.internal.compiler.parser.Parser;
19
import org.eclipse.jdt.internal.compiler.parser.ScannerHelper;
18
import org.eclipse.jdt.internal.compiler.parser.ScannerHelper;
20
import org.eclipse.jdt.internal.compiler.parser.TerminalTokens;
19
import org.eclipse.jdt.internal.compiler.parser.TerminalTokens;
21
import org.eclipse.jdt.internal.formatter.comment.IJavaDocTagConstants;
20
import org.eclipse.jdt.internal.formatter.comment.IJavaDocTagConstants;
Lines 28-38 Link Here
28
	int htmlTagsPtr = -1;
27
	int htmlTagsPtr = -1;
29
	private boolean invalidTagName;
28
	private boolean invalidTagName;
30
	
29
	
31
FormatterCommentParser(Parser sourceParser) {
30
public FormatterCommentParser(long sourceLevel) {
32
	super(sourceParser);
31
	super(null);
33
	this.kind = FORMATTER_COMMENT_PARSER | TEXT_PARSE;
32
	this.kind = FORMATTER_COMMENT_PARSER | TEXT_PARSE;
34
	this.reportProblems = false;
33
	this.reportProblems = false;
35
	this.checkDocComment = true;
34
	this.checkDocComment = true;
35
	this.sourceLevel = sourceLevel;
36
}
36
}
37
37
38
public boolean parse(int start, int end) {
38
public boolean parse(int start, int end) {

Return to bug 232488