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 74987 Details for
Bug 109636
Comment formatter doesn't support "*/"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
patch_109636.txt (text/plain), 2.63 KB, created by
Olivier Thomann
on 2007-07-30 22:25:53 EDT
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2007-07-30 22:25:53 EDT
Size:
2.63 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: formatter/org/eclipse/jdt/internal/formatter/comment/Java2HTMLEntityReader.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/comment/Java2HTMLEntityReader.java,v >retrieving revision 1.4 >diff -u -r1.4 Java2HTMLEntityReader.java >--- formatter/org/eclipse/jdt/internal/formatter/comment/Java2HTMLEntityReader.java 30 Jul 2007 20:20:14 -0000 1.4 >+++ formatter/org/eclipse/jdt/internal/formatter/comment/Java2HTMLEntityReader.java 31 Jul 2007 02:26:49 -0000 >@@ -11,6 +11,7 @@ > *******************************************************************************/ > package org.eclipse.jdt.internal.formatter.comment; > >+import java.io.IOException; > import java.io.Reader; > import java.util.HashMap; > import java.util.Map; >@@ -26,6 +27,8 @@ > */ > public class Java2HTMLEntityReader extends SubstitutionTextReader { > >+ private static final int BEGIN_LINE = 0x01; >+ > /** The hardcoded entity map. */ > private static final Map fgEntityLookup; > >@@ -33,8 +36,8 @@ > * True if we have not yet seen a non-whitespace character on the current > * line. > */ >- private boolean beginLine = true; >- >+ private int bits = BEGIN_LINE; >+ > static { > fgEntityLookup= new HashMap(7); > fgEntityLookup.put("<", "<"); //$NON-NLS-1$ //$NON-NLS-2$ >@@ -58,18 +61,30 @@ > /* > * @see org.eclipse.jdt.internal.ui.text.SubstitutionTextReader#computeSubstitution(int) > */ >- protected String computeSubstitution(int c) { >+ protected String computeSubstitution(int c) throws IOException { > /* > * When @ is first on a line, translate it to @ so it isn't > * misinterpreted as a Javadoc tag. > * See https://bugs.eclipse.org/bugs/show_bug.cgi?id=197169 > */ >- if (c == '@') >- return this.beginLine ? "@" : null; //$NON-NLS-1$ >- else if (c == '\n' || c == '\r') >- this.beginLine = true; >- else if (!ScannerHelper.isWhitespace((char) c)) { >- this.beginLine = false; >+ if (c == '@') { >+ return (this.bits & BEGIN_LINE) != 0 ? "@" : null; //$NON-NLS-1$ >+ } >+ if (c == '*') { >+ this.bits &= ~BEGIN_LINE; >+ int next = nextChar(); >+ if (next == '/') { >+ return "*/"; //$NON-NLS-1$ >+ } >+ if (next == -1) { >+ return "*"; //$NON-NLS-1$ >+ } >+ return "*" + (char) next; //$NON-NLS-1$ >+ } >+ if (c == '\n' || c == '\r') { >+ this.bits |= BEGIN_LINE; >+ } else if (!ScannerHelper.isWhitespace((char) c)) { >+ this.bits &= ~BEGIN_LINE; > } > return (String) fgEntityLookup.get(String.valueOf((char) c)); > }
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 109636
: 74987 |
74988
|
75133