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 23090 Details for
Bug 100041
[javadoc][dom] Wrong positions when javadoc comment inside method declaration
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
patch_100041.txt (text/plain), 4.50 KB, created by
Olivier Thomann
on 2005-06-14 14:52:12 EDT
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2005-06-14 14:52:12 EDT
Size:
4.50 KB
patch
obsolete
>Index: compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java,v >retrieving revision 1.309 >diff -u -r1.309 Parser.java >--- compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java 9 Jun 2005 14:03:38 -0000 1.309 >+++ compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java 14 Jun 2005 18:45:59 -0000 >@@ -863,11 +863,15 @@ > > if (this.modifiersSourceStart < 0) this.modifiersSourceStart = this.scanner.startPosition; > } >+public void flushComments() { >+ this.scanner.commentPtr = -1; >+} > public void checkComment() { > > // discard obsolete comments while inside methods or fields initializer (see bug 74369) >- if (!(this.diet && this.dietInt==0) && this.scanner.commentPtr >= 0) { >- flushCommentsDefinedPriorTo(this.endStatementPosition); >+ if (this.nestedMethod[this.nestedType] != 0 && this.scanner.commentPtr >= 0) { >+ flushComments(); >+ return; > } > > int lastComment = this.scanner.commentPtr; >Index: model/org/eclipse/jdt/internal/compiler/DocumentElementParser.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/DocumentElementParser.java,v >retrieving revision 1.15 >diff -u -r1.15 DocumentElementParser.java >--- model/org/eclipse/jdt/internal/compiler/DocumentElementParser.java 31 May 2005 11:47:48 -0000 1.15 >+++ model/org/eclipse/jdt/internal/compiler/DocumentElementParser.java 14 Jun 2005 18:45:59 -0000 >@@ -73,6 +73,11 @@ > */ > public void checkComment() { > >+ // discard obsolete comments while inside methods or fields initializer (see bug 74369) >+ if (this.nestedMethod[this.nestedType] != 0 && this.scanner.commentPtr >= 0) { >+ flushComments(); >+ return; >+ } > /* persisting javadoc positions */ > pushOnIntArrayStack(this.getJavaDocPositions()); > boolean deprecated = false; >Index: model/org/eclipse/jdt/internal/compiler/SourceElementParser.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementParser.java,v >retrieving revision 1.48 >diff -u -r1.48 SourceElementParser.java >--- model/org/eclipse/jdt/internal/compiler/SourceElementParser.java 11 May 2005 21:08:50 -0000 1.48 >+++ model/org/eclipse/jdt/internal/compiler/SourceElementParser.java 14 Jun 2005 18:45:59 -0000 >@@ -112,11 +112,11 @@ > this.localDeclarationVisitor = new LocalDeclarationVisitor(); > } > } >- > public void checkComment() { > // discard obsolete comments while inside methods or fields initializer (see bug 74369) >- if (!(this.diet && this.dietInt==0) && this.scanner.commentPtr >= 0) { >- flushCommentsDefinedPriorTo(this.endStatementPosition); >+ if (this.nestedMethod[this.nestedType] != 0 && this.scanner.commentPtr >= 0) { >+ flushComments(); >+ return; > } > > int lastComment = this.scanner.commentPtr; >Index: model/org/eclipse/jdt/internal/core/util/CommentRecorderParser.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/CommentRecorderParser.java,v >retrieving revision 1.15 >diff -u -r1.15 CommentRecorderParser.java >--- model/org/eclipse/jdt/internal/core/util/CommentRecorderParser.java 18 May 2005 15:28:34 -0000 1.15 >+++ model/org/eclipse/jdt/internal/core/util/CommentRecorderParser.java 14 Jun 2005 18:45:59 -0000 >@@ -42,8 +42,9 @@ > public void checkComment() { > > // discard obsolete comments while inside methods or fields initializer (see bug 74369) >- if (!(this.diet && this.dietInt==0) && this.scanner.commentPtr >= 0) { >- flushCommentsDefinedPriorTo(this.endStatementPosition); >+ if (this.nestedMethod[this.nestedType] != 0 && this.scanner.commentPtr >= 0) { >+ flushComments(); >+ return; > } > boolean deprecated = false; > boolean checkDeprecated = false; >@@ -141,7 +142,12 @@ > } > return unit; > } >- >+ public void flushComments() { >+ final int lastCommentIndex = this.scanner.commentPtr; >+ if (lastCommentIndex < 0) return; // no comment >+ pushOnCommentsStack(0, lastCommentIndex); // store comment before flushing them >+ this.scanner.commentPtr = -1; >+ } > /* (non-Javadoc) > * Save all source comments currently stored before flushing them. > * @see org.eclipse.jdt.internal.compiler.parser.Parser#flushCommentsDefinedPriorTo(int)
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 100041
:
23090
|
23091
|
25611
|
25612
|
25613