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 160957 Details for
Bug 304506
Task descriptions always have a space after the tag
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix + updated regression tests
patch_304506.txt (text/plain), 18.28 KB, created by
Olivier Thomann
on 2010-03-04 11:47:11 EST
(
hide
)
Description:
Proposed fix + updated regression tests
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2010-03-04 11:47:11 EST
Size:
18.28 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java,v >retrieving revision 1.201 >diff -u -r1.201 Scanner.java >--- compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java 21 Jan 2010 16:14:10 -0000 1.201 >+++ compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java 4 Mar 2010 16:43:47 -0000 >@@ -368,10 +368,9 @@ > continue; > } > // trim the message >+ // we don't trim the beginning of the message to be able to show it after the task tag > while (CharOperation.isWhitespace(src[end]) && msgStart <= end) > end--; >- while (CharOperation.isWhitespace(src[msgStart]) && msgStart <= end) >- msgStart++; > // update the end position of the task > this.foundTaskPositions[i][1] = end; > // get the message source >Index: compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties,v >retrieving revision 1.256 >diff -u -r1.256 messages.properties >--- compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties 13 Jan 2010 15:13:47 -0000 1.256 >+++ compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties 4 Mar 2010 16:43:47 -0000 >@@ -374,7 +374,7 @@ > 441 = 'enum' should not be used as an identifier, since it is a reserved keyword from source level 1.5 on > 442 = Enum constants cannot be surrounded by parenthesis > >-450 = {0} {1} >+450 = {0}{1} > > 451 = Null pointer access: The variable {0} can only be null at this location > 452 = Potential null pointer access: The variable {0} may be null at this location >Index: model/org/eclipse/jdt/internal/core/util/PublicScanner.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/PublicScanner.java,v >retrieving revision 1.112 >diff -u -r1.112 PublicScanner.java >--- model/org/eclipse/jdt/internal/core/util/PublicScanner.java 12 Nov 2009 20:24:54 -0000 1.112 >+++ model/org/eclipse/jdt/internal/core/util/PublicScanner.java 4 Mar 2010 16:43:47 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2009 IBM Corporation and others. >+ * Copyright (c) 2000, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -365,10 +365,9 @@ > continue; > } > // trim the message >+ // we don't trim the beginning of the message to be able to show it after the task tag > while (CharOperation.isWhitespace(src[end]) && msgStart <= end) > end--; >- while (CharOperation.isWhitespace(src[msgStart]) && msgStart <= end) >- msgStart++; > // update the end position of the task > this.foundTaskPositions[i][1] = end; > // get the message source >@@ -1487,7 +1486,8 @@ > boolean isUnicode = false; > while (this.currentCharacter != '\r' && this.currentCharacter != '\n') { > if (this.currentPosition >= this.eofPosition) { >- this.currentPosition++; >+ this.lastCommentLinePosition = this.currentPosition; >+ this.currentPosition ++; > // this avoids duplicating the code in the catch(IndexOutOfBoundsException e) > throw new IndexOutOfBoundsException(); > } >@@ -1947,7 +1947,8 @@ > boolean isUnicode = false; > while (this.currentCharacter != '\r' && this.currentCharacter != '\n') { > if (this.currentPosition >= this.eofPosition) { >- this.currentPosition++; >+ this.lastCommentLinePosition = this.currentPosition; >+ this.currentPosition ++; > // this avoids duplicating the code inside the catch(IndexOutOfBoundsException e) below > throw new IndexOutOfBoundsException(); > } >@@ -3659,36 +3660,26 @@ > if (this.currentPosition <= 0) > return "NOT started!\n\n"+ new String(this.source); //$NON-NLS-1$ > >- char front[] = new char[this.startPosition]; >- System.arraycopy(this.source, 0, front, 0, this.startPosition); >+ StringBuffer buffer = new StringBuffer(); >+ if (this.startPosition < 1000) { >+ buffer.append(this.source, 0, this.startPosition); >+ } else { >+ buffer.append("<source beginning>\n...\n"); //$NON-NLS-1$ >+ int line = Util.getLineNumber(this.startPosition-1000, this.lineEnds, 0, this.linePtr); >+ int lineStart = getLineStart(line); >+ buffer.append(this.source, lineStart, this.startPosition-lineStart); >+ } > >+ buffer.append("\n===============================\nStarts here -->"); //$NON-NLS-1$ > int middleLength = (this.currentPosition - 1) - this.startPosition + 1; >- char middle[]; > if (middleLength > -1) { >- middle = new char[middleLength]; >- System.arraycopy( >- this.source, >- this.startPosition, >- middle, >- 0, >- middleLength); >- } else { >- middle = CharOperation.NO_CHAR; >+ buffer.append(this.source, this.startPosition, middleLength); > } >+ buffer.append("<-- Ends here\n===============================\n"); //$NON-NLS-1$ > >- char end[] = new char[this.eofPosition - (this.currentPosition - 1)]; >- System.arraycopy( >- this.source, >- (this.currentPosition - 1) + 1, >- end, >- 0, >- this.eofPosition - (this.currentPosition - 1) - 1); >- >- return new String(front) >- + "\n===============================\nStarts here -->" //$NON-NLS-1$ >- + new String(middle) >- + "<-- Ends here\n===============================\n" //$NON-NLS-1$ >- + new String(end); >+ buffer.append(this.source, (this.currentPosition - 1) + 1, this.eofPosition - (this.currentPosition - 1) - 1); >+ >+ return buffer.toString(); > } > public String toStringAction(int act) { > switch (act) { >#P org.eclipse.jdt.core.tests >Index: Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/NegativeTest.java >=================================================================== >RCS file: /home/cvs/numbat/org.eclipse.jdt.core.tests/Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/NegativeTest.java,v >retrieving revision 1.333 >diff -u -r1.333 NegativeTest.java >--- Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/NegativeTest.java 3 Mar 2010 18:18:40 -0000 1.333 >+++ Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/NegativeTest.java 4 Mar 2010 16:43:48 -0000 >@@ -10879,42 +10879,42 @@ > "1. WARNING in p\\X.java (at line 3)\n" + > " * TODO:todo1 \n" + > " ^^^^^^^^^^\n" + >- "TODO: todo1\n" + >+ "TODO:todo1\n" + > "----------\n" + > "2. WARNING in p\\X.java (at line 7)\n" + > " * TODO: todo2 \n" + > " ^^^^^^^^^^^^^\n" + >- "TODO: todo2\n" + >+ "TODO: todo2\n" + > "----------\n" + > "3. WARNING in p\\X.java (at line 12)\n" + > " * TODO:todo3 \n" + > " ^^^^^^^^^^\n" + >- "TODO: todo3\n" + >+ "TODO:todo3\n" + > "----------\n" + > "4. WARNING in p\\X.java (at line 14)\n" + > " // TODO:todo4a \n" + > " ^^^^^^^^^^^\n" + >- "TODO: todo4a\n" + >+ "TODO:todo4a\n" + > "----------\n" + > "5. WARNING in p\\X.java (at line 15)\n" + > " //#todo# todo4b \n" + > " ^^^^^^^^^^^^^^^\n" + >- "#todo# todo4b\n" + >+ "#todo# todo4b\n" + > "----------\n" + > "6. WARNING in p\\X.java (at line 19)\n" + > " * TODO:todo5 \n" + > " ^^^^^^^^^^\n" + >- "TODO: todo5\n" + >+ "TODO:todo5\n" + > "----------\n" + > "7. WARNING in p\\X.java (at line 23)\n" + > " * TODO:todo6a \n" + > " ^^^^^^^^^^^\n" + >- "TODO: todo6a\n" + >+ "TODO:todo6a\n" + > "----------\n" + > "8. WARNING in p\\X.java (at line 24)\n" + > " * TODO:todo6b \n" + > " ^^^^^^^^^^^\n" + >- "TODO: todo6b\n" + >+ "TODO:todo6b\n" + > "----------\n" + > "9. WARNING in p\\X.java (at line 26)\n" + > " System.out.println(\"My char: \" + String.valueOf((char)self.MY_CHAR)); \n" + >@@ -10924,17 +10924,17 @@ > "10. WARNING in p\\X.java (at line 28)\n" + > " * TODO:todo7 \n" + > " ^^^^^^^^^^\n" + >- "TODO: todo7\n" + >+ "TODO:todo7\n" + > "----------\n" + > "11. WARNING in p\\X.java (at line 32)\n" + > " * TODO:todo8 */ \n" + > " ^^^^^^^^^^\n" + >- "TODO: todo8\n" + >+ "TODO:todo8\n" + > "----------\n" + > "12. WARNING in p\\X.java (at line 36)\n" + > " * TODO:todo9 \n" + > " ^^^^^^^^^^\n" + >- "TODO: todo9\n" + >+ "TODO:todo9\n" + > "----------\n", > null, null, JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings); > } >@@ -11935,7 +11935,7 @@ > "1. WARNING in p\\X.java (at line 4)\n" + > " //TODO:hkjhkhkj\n" + > " ^^^^^^^^^^^^^\n" + >- "TODO: hkjhkhkj\n" + >+ "TODO:hkjhkhkj\n" + > "----------\n", > null, null, JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings); > } >@@ -11961,7 +11961,7 @@ > "1. WARNING in p\\X.java (at line 5)\n" + > " //TODO:hkjhkhkj\n" + > " ^^^^^^^^^^^^^\n" + >- "TODO: hkjhkhkj\n" + >+ "TODO:hkjhkhkj\n" + > "----------\n" + > "2. ERROR in p\\X.java (at line 8)\n" + > " }\n" + >@@ -12191,52 +12191,52 @@ > "1. WARNING in p\\X.java (at line 3)\n" + > " * TODO:commentTODO:comment 2#todo#\n" + > " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + >- "TODO: commentTODO:comment 2\n" + >+ "TODO:commentTODO:comment 2\n" + > "----------\n" + > "2. WARNING in p\\X.java (at line 3)\n" + > " * TODO:commentTODO:comment 2#todo#\n" + > " ^^^^^^\n" + >- "#todo# \n" + >+ "#todo#\n" + > "----------\n" + > "3. WARNING in p\\X.java (at line 5)\n" + > " // TODO:comment 3#todo#comment 4TODO:\n" + > " ^^^^^^^^^^^^^^\n" + >- "TODO: comment 3\n" + >+ "TODO:comment 3\n" + > "----------\n" + > "4. WARNING in p\\X.java (at line 5)\n" + > " // TODO:comment 3#todo#comment 4TODO:\n" + > " ^^^^^^^^^^^^^^^^^^^^\n" + >- "#todo# comment 4TODO:\n" + >+ "#todo#comment 4TODO:\n" + > "----------\n" + > "5. WARNING in p\\X.java (at line 7)\n" + > " * TODO:comment 5 TODO:comment 6 #todo# \n" + > " ^^^^^^^^^^^^^^\n" + >- "TODO: comment 5\n" + >+ "TODO:comment 5\n" + > "----------\n" + > "6. WARNING in p\\X.java (at line 7)\n" + > " * TODO:comment 5 TODO:comment 6 #todo# \n" + > " ^^^^^^^^^^^^^^\n" + >- "TODO: comment 6\n" + >+ "TODO:comment 6\n" + > "----------\n" + > "7. WARNING in p\\X.java (at line 7)\n" + > " * TODO:comment 5 TODO:comment 6 #todo# \n" + > " ^^^^^^\n" + >- "#todo# \n" + >+ "#todo#\n" + > "----------\n" + > "8. WARNING in p\\X.java (at line 9)\n" + > " // #todo#comment 7 TODO:comment 8 TODO: \n" + > " ^^^^^^^^^^^^^^^\n" + >- "#todo# comment 7\n" + >+ "#todo#comment 7\n" + > "----------\n" + > "9. WARNING in p\\X.java (at line 9)\n" + > " // #todo#comment 7 TODO:comment 8 TODO: \n" + > " ^^^^^^^^^^^^^^\n" + >- "TODO: comment 8\n" + >+ "TODO:comment 8\n" + > "----------\n" + > "10. WARNING in p\\X.java (at line 9)\n" + > " // #todo#comment 7 TODO:comment 8 TODO: \n" + > " ^^^^^\n" + >- "TODO: \n" + >+ "TODO:\n" + > "----------\n", > null, null, JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings); > } >@@ -12678,7 +12678,7 @@ > "1. WARNING in p\\X.java (at line 3)\n" + > " * TODO:todo1 \n" + > " ^^^^^^^^^^\n" + >- "TODO: todo1\n" + >+ "TODO:todo1\n" + > "----------\n" + > "2. WARNING in p\\X.java (at line 8)\n" + > " * #todo# second todo TODO: third todo\n" + >@@ -13154,7 +13154,7 @@ > "1. WARNING in p\\X.java (at line 4)\n" + > " }//TODO\n" + > " ^^^^\n" + >- "TODO \n" + >+ "TODO\n" + > "----------\n", > null, null, JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings); > } >@@ -13586,7 +13586,7 @@ > "1. WARNING in p\\X.java (at line 4)\n" + > " }//TODO\n" + > " ^^^^\n" + >- "TODO \n" + >+ "TODO\n" + > "----------\n", > null, null, JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings); > } >@@ -13616,7 +13616,7 @@ > "1. WARNING in p\\X.java (at line 5)\n" + > " /*TODO*/ \n" + > " ^^^^^^\n" + >- "TODO */\n" + >+ "TODO*/\n" + > "----------\n" + > "2. WARNING in p\\X.java (at line 7)\n" + > " //TODO REMPLACER aa \n" + >@@ -13626,7 +13626,7 @@ > "3. WARNING in p\\X.java (at line 9)\n" + > " }//TODO \n" + > " ^^^^\n" + >- "TODO \n" + >+ "TODO\n" + > "----------\n", > null, null, JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings); > } >@@ -13658,22 +13658,22 @@ > "1. WARNING in p\\X.java (at line 5)\n" + > " /*TODO*/ \n" + > " ^^^^^^\n" + >- "TODO */\n" + >+ "TODO*/\n" + > "----------\n" + > "2. WARNING in p\\X.java (at line 7)\n" + > " //TODO REM:PLACER aa \n" + > " ^^^^^^^^^^^^^^^^^^\n" + >- "TODO PLACER aa\n" + >+ "TODOPLACER aa\n" + > "----------\n" + > "3. WARNING in p\\X.java (at line 7)\n" + > " //TODO REM:PLACER aa \n" + > " ^^^^^^^^^^^^^\n" + >- "REM: PLACER aa\n" + >+ "REM:PLACER aa\n" + > "----------\n" + > "4. WARNING in p\\X.java (at line 9)\n" + > " }//TODO \n" + > " ^^^^\n" + >- "TODO \n" + >+ "TODO\n" + > "----------\n", > null, null, JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings); > } >@@ -13704,22 +13704,22 @@ > "1. WARNING in p\\X.java (at line 5)\n" + > " /*TODO:*/ \n" + > " ^^^^^^^\n" + >- "TODO: */\n" + >+ "TODO:*/\n" + > "----------\n" + > "2. WARNING in p\\X.java (at line 7)\n" + > " //TODO:REM:PLACER aa \n" + > " ^^^^^^^^^^^^^^^^^^\n" + >- "TODO: PLACER aa\n" + >+ "TODO:PLACER aa\n" + > "----------\n" + > "3. WARNING in p\\X.java (at line 7)\n" + > " //TODO:REM:PLACER aa \n" + > " ^^^^^^^^^^^^^\n" + >- "REM: PLACER aa\n" + >+ "REM:PLACER aa\n" + > "----------\n" + > "4. WARNING in p\\X.java (at line 9)\n" + > " }//TODO: \n" + > " ^^^^^\n" + >- "TODO: \n" + >+ "TODO:\n" + > "----------\n", > null, null, JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings); > } >@@ -13749,12 +13749,12 @@ > "1. WARNING in p\\X.java (at line 6)\n" + > " //consider#TODO#\n" + > " ^^^^^^\n" + >- "#TODO# \n" + >+ "#TODO#\n" + > "----------\n" + > "2. WARNING in p\\X.java (at line 8)\n" + > " }//#TODO#\n" + > " ^^^^^^\n" + >- "#TODO# \n" + >+ "#TODO#\n" + > "----------\n", > null, null, JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings); > } >@@ -15410,7 +15410,7 @@ > "1. WARNING in p\\X.java (at line 8)\n" + > " }//#TODO#\n" + > " ^^^^^\n" + >- "TODO #\n" + >+ "TODO#\n" + > "----------\n", > null, null, JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings); > } >@@ -15470,7 +15470,7 @@ > "1. WARNING in p\\X.java (at line 8)\n" + > " }//#todO#\n" + > " ^^^^^\n" + >- "TODO #\n" + >+ "TODO#\n" + > "----------\n", > null, null, JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings); > } >#P org.eclipse.jdt.core.tests.builder >Index: src/org/eclipse/jdt/core/tests/builder/ErrorsTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/ErrorsTests.java,v >retrieving revision 1.29 >diff -u -r1.29 ErrorsTests.java >--- src/org/eclipse/jdt/core/tests/builder/ErrorsTests.java 27 Jun 2008 16:02:02 -0000 1.29 >+++ src/org/eclipse/jdt/core/tests/builder/ErrorsTests.java 4 Mar 2010 16:43:47 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2008 IBM Corporation and others. >+ * Copyright (c) 2000, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -208,7 +208,7 @@ > ); > fullBuild(); > Problem[] prob1 = env.getProblemsFor(classTest1); >- expectingSpecificProblemFor(classTest1, new Problem("p1", "TODO : marker only", classTest1, 38, 55, -1, IMarker.SEVERITY_ERROR)); >+ expectingSpecificProblemFor(classTest1, new Problem("p1", "TODO: marker only", classTest1, 38, 55, -1, IMarker.SEVERITY_ERROR)); > assertEquals(JavaBuilder.SOURCE_ID, prob1[0].getSourceId()); > } > >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java,v >retrieving revision 1.35 >diff -u -r1.35 CompilerInvocationTests.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java 13 Jan 2010 18:58:46 -0000 1.35 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java 4 Mar 2010 16:43:48 -0000 >@@ -188,9 +188,9 @@ > " }\n" + > "}\n"}, > null, >- "[FIXME,message contents,HIGH]\n" + >- "[TODO,message contents,NORMAL]\n" + >- "[XXX,message contents,NORMAL]\n"); >+ "[FIXME, message contents,HIGH]\n" + >+ "[TODO, message contents,NORMAL]\n" + >+ "[XXX, message contents,NORMAL]\n"); > } > // effect of cancelling priorities > // reactivate when bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=143402 is fixed >@@ -206,9 +206,9 @@ > " }\n" + > "}\n"}, > customOptions, >- "[FIXME,message contents,NORMAL]\n" + >- "[TODO,message contents,NORMAL]\n" + >- "[XXX,message contents,NORMAL]\n"); >+ "[FIXME, message contents,NORMAL]\n" + >+ "[TODO, message contents,NORMAL]\n" + >+ "[XXX, message contents,NORMAL]\n"); > } > // effect of cancelling priorities > // reactivate when bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=143402 is fixed >@@ -261,9 +261,9 @@ > " }\n" + > "}\n"}, > customOptions, >- "[FIXME,message contents,NORMAL]\n" + >- "[TODO,message contents,NORMAL]\n" + >- "[XXX,message contents,NORMAL]\n"); >+ "[FIXME, message contents,NORMAL]\n" + >+ "[TODO, message contents,NORMAL]\n" + >+ "[XXX, message contents,NORMAL]\n"); > } > // effect of changing priorities > // reactivate when bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=143402 is fixed
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 304506
:
160832
| 160957