Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 126535 Details for
Bug 260011
[formatter] Formatting of html in javadoc comments doesn't work with style attributes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
v00.txt (text/plain), 7.73 KB, created by
Frederic Fusier
on 2009-02-24 06:15:23 EST
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2009-02-24 06:15:23 EST
Size:
7.73 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: formatter/org/eclipse/jdt/internal/formatter/FormatterCommentParser.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/FormatterCommentParser.java,v >retrieving revision 1.22 >diff -u -r1.22 FormatterCommentParser.java >--- formatter/org/eclipse/jdt/internal/formatter/FormatterCommentParser.java 19 Aug 2008 16:16:39 -0000 1.22 >+++ formatter/org/eclipse/jdt/internal/formatter/FormatterCommentParser.java 24 Feb 2009 11:14:42 -0000 >@@ -142,13 +142,13 @@ > int length = htmlTag == null ? 0 : htmlTag.length; > int tagId = 0; > if (length > 0) { >- for (int i=0, max=JAVADOC_SPECIAL_TAGS.length; i<max; i++) { >- char[] tag = JAVADOC_SPECIAL_TAGS[i]; >- if (length == tag.length && CharOperation.equals(htmlTag, tag, false)) { >- tagId = JAVADOC_SPECIAL_TAGS_ID; >- break; >- } >- } >+// for (int i=0, max=JAVADOC_SPECIAL_TAGS.length; i<max; i++) { >+// char[] tag = JAVADOC_SPECIAL_TAGS[i]; >+// if (length == tag.length && CharOperation.equals(htmlTag, tag, false)) { >+// tagId = JAVADOC_SPECIAL_TAGS_ID; >+// break; >+// } >+// } > for (int i=0, max=JAVADOC_SINGLE_BREAK_TAG.length; i<max; i++) { > char[] tag = JAVADOC_SINGLE_BREAK_TAG[i]; > if (length == tag.length && CharOperation.equals(htmlTag, tag, false)) { >@@ -273,18 +273,18 @@ > return false; > } > if ((token = readTokenAndConsume()) != TerminalTokens.TokenNameGREATER) { >- if ((htmlIndex & JAVADOC_SPECIAL_TAGS_ID) == JAVADOC_SPECIAL_TAGS_ID) { >- // Special tags may have attributes, so consume tokens until the greater token is encountered >+// if ((htmlIndex & JAVADOC_SPECIAL_TAGS_ID) == JAVADOC_SPECIAL_TAGS_ID) { >+ // tags may have attributes, so consume tokens until the greater token is encountered > while (token != TerminalTokens.TokenNameGREATER) { > token = readTokenAndConsume(); > if (token == TerminalTokens.TokenNameEOF) { > return false; > } > } >- } else { >- // invalid syntax >- return false; >- } >+// } else { >+// // invalid syntax >+// return false; >+// } > } > > // Push texts >Index: formatter/org/eclipse/jdt/internal/formatter/comment/IJavaDocTagConstants.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/comment/IJavaDocTagConstants.java,v >retrieving revision 1.12 >diff -u -r1.12 IJavaDocTagConstants.java >--- formatter/org/eclipse/jdt/internal/formatter/comment/IJavaDocTagConstants.java 27 Jun 2008 16:03:57 -0000 1.12 >+++ formatter/org/eclipse/jdt/internal/formatter/comment/IJavaDocTagConstants.java 24 Feb 2009 11:14:42 -0000 >@@ -67,8 +67,8 @@ > }; > > /** Javadoc parameter tags */ >- // TODO (eric) should have another name than 'param' for the following tags >- // TODO (eric) investigate how and why this list was created >+ // TODO (frederic) should have another name than 'param' for the following tags >+ // TODO (frederic) investigate how and why this list was created > public static final char[][] JAVADOC_PARAM_TAGS= new char[][] { > "@exception".toCharArray(), //$NON-NLS-1$ > "@param".toCharArray(), //$NON-NLS-1$ >@@ -89,16 +89,6 @@ > "tr".toCharArray(), //$NON-NLS-1$ > }; > >- /** >- * Following table is used to identify special tags which may have more complex >- * opening than just <name> >- */ >- public static final char[][] JAVADOC_SPECIAL_TAGS= new char[][] { >- "table".toCharArray(), //$NON-NLS-1$ >- "tr".toCharArray(), //$NON-NLS-1$ >- "td".toCharArray(), //$NON-NLS-1$ >- }; >- > /** Javadoc tag prefix */ > public static final char JAVADOC_TAG_PREFIX= '@'; > >@@ -151,5 +141,4 @@ > static final int JAVADOC_SEPARATOR_TAGS_ID = 0x1000; > static final int JAVADOC_SINGLE_TAGS_ID = JAVADOC_SINGLE_BREAK_TAG_ID; // ID max for tags ID with no opening/closing (e.g. <bla>....</bla>) > static final int JAVADOC_CLOSED_TAG = 0x10000; >- static final int JAVADOC_SPECIAL_TAGS_ID = 0x20000; > } >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java,v >retrieving revision 1.34 >diff -u -r1.34 FormatterCommentsBugsTest.java >--- src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java 14 Jan 2009 10:48:43 -0000 1.34 >+++ src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java 24 Feb 2009 11:14:43 -0000 >@@ -3229,6 +3229,102 @@ > } > > /** >+ * @bug 260011: [formatter] Formatting of html in javadoc comments doesn't work with style attributes >+ * @test Ensure that the comment formatter understand <p> html tag with attributes >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=260011" >+ */ >+public void testBug260011() throws JavaModelException { >+ String source = >+ "public class Test {\n" + >+ " /**\n" + >+ " * some comment text here\n" + >+ " * <p style=\"font-variant:small-caps;\">\n" + >+ " * some text to be styled a certain way\n" + >+ " * </p>\n" + >+ " */\n" + >+ " void foo() {}\n" + >+ "\n" + >+ "}\n"; >+ formatSource(source, >+ "public class Test {\n" + >+ " /**\n" + >+ " * some comment text here\n" + >+ " * <p style=\"font-variant:small-caps;\">\n" + >+ " * some text to be styled a certain way\n" + >+ " * </p>\n" + >+ " */\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "\n" + >+ "}\n" >+ ); >+} >+public void testBug260011a() throws JavaModelException { >+ String source = >+ "public class Test {\n" + >+ " /**\n" + >+ " * some comment text here\n" + >+ " * <ul style=\"font-variant:small-caps;\"><li style=\"font-variant:small-caps;\">\n" + >+ " * some text to be styled a certain way</li></ul>\n" + >+ " * end of comment\n" + >+ " */\n" + >+ " void foo() {}\n" + >+ "\n" + >+ "}\n"; >+ formatSource(source, >+ "public class Test {\n" + >+ " /**\n" + >+ " * some comment text here\n" + >+ " * <ul style=\"font-variant:small-caps;\">\n" + >+ " * <li style=\"font-variant:small-caps;\">\n" + >+ " * some text to be styled a certain way</li>\n" + >+ " * </ul>\n" + >+ " * end of comment\n" + >+ " */\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "\n" + >+ "}\n" >+ ); >+} >+public void testBug260011b() throws JavaModelException { >+ String source = >+ "public class Test {\n" + >+ " /**\n" + >+ " * some comment text here\n" + >+ " * <pre style=\"font-variant:small-caps;\">\n" + >+ " * some text\n" + >+ " * to be styled\n" + >+ " * a certain way\n" + >+ " * \n" + >+ " * </pre>\n" + >+ " * end of comment\n" + >+ " */\n" + >+ " void foo() {}\n" + >+ "\n" + >+ "}\n"; >+ formatSource(source, >+ "public class Test {\n" + >+ " /**\n" + >+ " * some comment text here\n" + >+ " * \n" + >+ " * <pre style=\"font-variant:small-caps;\">\n" + >+ " * some text\n" + >+ " * to be styled\n" + >+ " * a certain way\n" + >+ " * \n" + >+ " * </pre>\n" + >+ " * \n" + >+ " * end of comment\n" + >+ " */\n" + >+ " void foo() {\n" + >+ " }\n" + >+ "\n" + >+ "}\n" >+ ); >+} >+ >+/** > * @bug 260274: [formatter] * character is removed while formatting block comments > * @test Ensure that the comment formatter keep '*' characters while formatting block comments > * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=260274"
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 260011
:
126535
|
126874