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 101061 Details for
Bug 232944
IMember#getJavadocRange() should end with "*/"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix and regression test
232944.txt (text/plain), 2.84 KB, created by
Jerome Lanneluc
on 2008-05-20 11:05:20 EDT
(
hide
)
Description:
Proposed fix and regression test
Filename:
MIME Type:
Creator:
Jerome Lanneluc
Created:
2008-05-20 11:05:20 EDT
Size:
2.84 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/Member.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Member.java,v >retrieving revision 1.48 >diff -u -r1.48 Member.java >--- model/org/eclipse/jdt/internal/core/Member.java 24 Oct 2007 13:50:51 -0000 1.48 >+++ model/org/eclipse/jdt/internal/core/Member.java 20 May 2008 15:04:45 -0000 >@@ -301,7 +301,7 @@ > } > } > if (docOffset != -1) { >- return new SourceRange(docOffset + start, docEnd - docOffset + 1); >+ return new SourceRange(docOffset + start, docEnd - docOffset); > } > } catch (InvalidInputException ex) { > // try if there is inherited Javadoc >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/GetSourceTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/GetSourceTests.java,v >retrieving revision 1.22 >diff -u -r1.22 GetSourceTests.java >--- src/org/eclipse/jdt/core/tests/model/GetSourceTests.java 10 Apr 2008 14:38:21 -0000 1.22 >+++ src/org/eclipse/jdt/core/tests/model/GetSourceTests.java 20 May 2008 15:04:46 -0000 >@@ -163,6 +163,54 @@ > assertNull("Should not be a constant", constant); > } > >+ /* >+ * Ensures that the Javadoc range for a method is correct. >+ * (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=232944 ) >+ */ >+ public void testJavadocRange01() throws CoreException { >+ try { >+ String cuSource = >+ "package p;\n" + >+ "class A{\n" + >+ " /**\n" + >+ " * swsw\n" + >+ " */\n" + >+ " void m(){\n" + >+ " }\n" + >+ "}"; >+ createFile("/P/p/A.java", cuSource); >+ IMethod method = getCompilationUnit("/P/p/A.java").getType("A").getMethod("m", new String[0]); >+ assertSourceEquals( >+ "Unexpected Javadoc'", >+ "/**\n" + >+ " * swsw\n" + >+ " */", >+ getSource(cuSource, method.getJavadocRange())); >+ } finally { >+ deleteFile("/P/p/A.java"); >+ } >+ } >+ >+ /* >+ * Ensures that the Javadoc range for a class is correct. >+ * (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=232944 ) >+ */ >+ public void testJavadocRange02() throws CoreException { >+ try { >+ String cuSource = >+ "package p;\n" + >+ "/** X */class A {}"; >+ createFile("/P/p/A.java", cuSource); >+ IType type = getCompilationUnit("/P/p/A.java").getType("A"); >+ assertSourceEquals( >+ "Unexpected Javadoc'", >+ "/** X */", >+ getSource(cuSource, type.getJavadocRange())); >+ } finally { >+ deleteFile("/P/p/A.java"); >+ } >+ } >+ > /** > * Ensure the source for an import contains the 'import' keyword, > * name, and terminator.
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 232944
: 101061