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 164260 Details for
Bug 307295
Task tags and task priorities
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
patch_307295.txt (text/plain), 10.18 KB, created by
Olivier Thomann
on 2010-04-08 13:54:54 EDT
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2010-04-08 13:54:54 EDT
Size:
10.18 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.202 >diff -u -r1.202 Scanner.java >--- compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java 4 Mar 2010 16:43:55 -0000 1.202 >+++ compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java 8 Apr 2010 17:51:56 -0000 >@@ -211,20 +211,30 @@ > this.complianceLevel = complianceLevel; > this.checkNonExternalizedStringLiterals = checkNonExternalizedStringLiterals; > if (taskTags != null) { >- int length = taskTags.length; >+ int taskTagsLength = taskTags.length; >+ int length = taskTagsLength; > if (taskPriorities != null) { >+ int taskPrioritiesLength = taskPriorities.length; >+ if (taskPrioritiesLength != taskTagsLength) { >+ if (taskPrioritiesLength > taskTagsLength) { >+ System.arraycopy(taskPriorities, 0, (taskPriorities = new char[taskTagsLength][]), 0, taskTagsLength); >+ } else { >+ System.arraycopy(taskTags, 0, (taskTags = new char[taskPrioritiesLength][]), 0, taskPrioritiesLength); >+ length = taskPrioritiesLength; >+ } >+ } > int[] initialIndexes = new int[length]; > for (int i = 0; i < length; i++) { > initialIndexes[i] = i; > } >- Util.reverseQuickSort(taskTags, 0, taskTags.length - 1, initialIndexes); >+ Util.reverseQuickSort(taskTags, 0, length - 1, initialIndexes); > char[][] temp = new char[length][]; > for (int i = 0; i < length; i++) { > temp[i] = taskPriorities[initialIndexes[i]]; > } > this.taskPriorities = temp; > } else { >- Util.reverseQuickSort(taskTags, 0, taskTags.length - 1); >+ Util.reverseQuickSort(taskTags, 0, length - 1); > } > this.taskTags = taskTags; > this.isTaskCaseSensitive = isTaskCaseSensitive; >Index: model/org/eclipse/jdt/core/JavaCore.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java,v >retrieving revision 1.649 >diff -u -r1.649 JavaCore.java >--- model/org/eclipse/jdt/core/JavaCore.java 2 Mar 2010 06:46:01 -0000 1.649 >+++ model/org/eclipse/jdt/core/JavaCore.java 8 Apr 2010 17:51:57 -0000 >@@ -1336,7 +1336,9 @@ > * Compiler option ID: Defining the Automatic Task Priorities. > * <p>In parallel with the Automatic Task Tags, this list defines the priorities (high, normal or low) > * of the task markers issued by the compiler. >- * If the default is specified, the priority of each task marker is <code>"NORMAL"</code>. >+ * If the default is specified, the priority of each task marker is <code>"NORMAL"</code>.</p> >+ * <p>Task Priorities and task tags must have the same length. If task priorities are set, then task tags should also >+ * be set.</p> > * <dl> > * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.taskPriorities"</code></dd> > * <dt>Possible values:</dt><dd><code>{ "<priority>[,<priority>]*" }</code> where <code><priority></code> is one of <code>"HIGH"</code>, <code>"NORMAL"</code> or <code>"LOW"</code></dd> >@@ -1344,6 +1346,7 @@ > * </dl> > * @since 2.1 > * @category CompilerOptionID >+ * @see #COMPILER_TASK_TAGS > */ > public static final String COMPILER_TASK_PRIORITIES = PLUGIN_ID + ".compiler.taskPriorities"; //$NON-NLS-1$ > /** >@@ -1351,15 +1354,17 @@ > * <p>When the tag list is not empty, the compiler will issue a task marker whenever it encounters > * one of the corresponding tags inside any comment in Java source code. > * <p>Generated task messages will start with the tag, and range until the next line separator, >- * comment ending, or tag. >+ * comment ending, or tag.</p> > * <p>When a given line of code bears multiple tags, each tag will be reported separately. > * Moreover, a tag immediately followed by another tag will be reported using the contents of the >- * next non-empty tag of the line, if any. >+ * next non-empty tag of the line, if any.</p> > * <p>Note that tasks messages are trimmed. If a tag is starting with a letter or digit, then it cannot be leaded by > * another letter or digit to be recognized (<code>"fooToDo"</code> will not be recognized as a task for tag <code>"ToDo"</code>, but <code>"foo#ToDo"</code> > * will be detected for either tag <code>"ToDo"</code> or <code>"#ToDo"</code>). Respectively, a tag ending with a letter or digit cannot be followed > * by a letter or digit to be recognized (<code>"ToDofoo"</code> will not be recognized as a task for tag <code>"ToDo"</code>, but <code>"ToDo:foo"</code> will >- * be detected either for tag <code>"ToDo"</code> or <code>"ToDo:"</code>). >+ * be detected either for tag <code>"ToDo"</code> or <code>"ToDo:"</code>).</p> >+ * <p>Task Priorities and task tags must have the same length. If task tags are set, then task priorities should also >+ * be set.</p> > * <dl> > * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.taskTags"</code></dd> > * <dt>Possible values:</dt><dd><code>{ "<tag>[,<tag>]*" }</code> where <code><tag></code> is a String without any wild-card or leading/trailing spaces</dd> >@@ -1367,6 +1372,7 @@ > * </dl> > * @since 2.1 > * @category CompilerOptionID >+ * @see #COMPILER_TASK_PRIORITIES > */ > public static final String COMPILER_TASK_TAGS = PLUGIN_ID + ".compiler.taskTags"; //$NON-NLS-1$ > /** >Index: model/org/eclipse/jdt/internal/core/JavaModelManager.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java,v >retrieving revision 1.446 >diff -u -r1.446 JavaModelManager.java >--- model/org/eclipse/jdt/internal/core/JavaModelManager.java 29 Mar 2010 05:33:50 -0000 1.446 >+++ model/org/eclipse/jdt/internal/core/JavaModelManager.java 8 Apr 2010 17:51:57 -0000 >@@ -2061,6 +2061,7 @@ > // backward compatibility > addDeprecatedOptions(options); > >+ Util.fixTaskTags(options); > // store built map in cache > this.optionsCache = new Hashtable(options); > >Index: model/org/eclipse/jdt/internal/core/JavaProject.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProject.java,v >retrieving revision 1.430 >diff -u -r1.430 JavaProject.java >--- model/org/eclipse/jdt/internal/core/JavaProject.java 4 Mar 2010 10:11:50 -0000 1.430 >+++ model/org/eclipse/jdt/internal/core/JavaProject.java 8 Apr 2010 17:51:57 -0000 >@@ -1674,8 +1674,10 @@ > options.put(propertyName, propertyValue.trim()); > } > } >+ Util.fixTaskTags(options); > return options; > } >+ Util.fixTaskTags(projectOptions); > return projectOptions; > } > >Index: model/org/eclipse/jdt/internal/core/util/Util.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Util.java,v >retrieving revision 1.141 >diff -u -r1.141 Util.java >--- model/org/eclipse/jdt/internal/core/util/Util.java 12 Feb 2010 18:23:23 -0000 1.141 >+++ model/org/eclipse/jdt/internal/core/util/Util.java 8 Apr 2010 17:51:58 -0000 >@@ -112,6 +112,7 @@ > private static final char[] VOID = "void".toCharArray(); //$NON-NLS-1$ > private static final char[] INIT = "<init>".toCharArray(); //$NON-NLS-1$ > >+ private static final String TASK_PRIORITIES_PROBLEM = "TASK_PRIORITIES_PB"; //$NON-NLS-1$ > private static List fgRepeatedMessages= new ArrayList(5); > > private Util() { >@@ -1825,6 +1826,17 @@ > log(e); > } > >+ public static void logRepeatedMessage(String key, int statusErrorID, String message) { >+ if (key == null) { >+ throw new IllegalArgumentException("key cannot be null"); //$NON-NLS-1$ >+ } >+ if (fgRepeatedMessages.contains(key)) { >+ return; >+ } >+ fgRepeatedMessages.add(key); >+ log(statusErrorID, message); >+ } >+ > /* > * Add a log entry > */ >@@ -3571,4 +3583,42 @@ > return start; > } > >+ /* >+ * This method adjusts the task tags and task priorities so that they have the same size >+ */ >+ public static void fixTaskTags(Map defaultOptionsMap) { >+ Object taskTagsValue = defaultOptionsMap.get(JavaCore.COMPILER_TASK_TAGS); >+ char[][] taskTags = null; >+ if (taskTagsValue instanceof String) { >+ taskTags = CharOperation.splitAndTrimOn(',', ((String) taskTagsValue).toCharArray()); >+ } >+ Object taskPrioritiesValue = defaultOptionsMap.get(JavaCore.COMPILER_TASK_PRIORITIES); >+ char[][] taskPriorities = null; >+ if (taskPrioritiesValue instanceof String) { >+ taskPriorities = CharOperation.splitAndTrimOn(',', ((String) taskPrioritiesValue).toCharArray()); >+ } >+ if (taskPriorities == null) { >+ if (taskTags != null) { >+ Util.logRepeatedMessage(TASK_PRIORITIES_PROBLEM, IStatus.ERROR, "Inconsistent values for taskTags (not null) and task priorities (null)"); //$NON-NLS-1$ >+ defaultOptionsMap.remove(JavaCore.COMPILER_TASK_TAGS); >+ return; >+ } >+ } else if (taskTags == null) { >+ Util.logRepeatedMessage(TASK_PRIORITIES_PROBLEM, IStatus.ERROR, "Inconsistent values for taskTags (null) and task priorities (not null)"); //$NON-NLS-1$ >+ defaultOptionsMap.remove(JavaCore.COMPILER_TASK_PRIORITIES); >+ return; >+ } >+ int taskTagsLength = taskTags.length; >+ int taskPrioritiesLength = taskPriorities.length; >+ if (taskTagsLength != taskPrioritiesLength) { >+ Util.logRepeatedMessage(TASK_PRIORITIES_PROBLEM, IStatus.ERROR, "Inconsistent values for taskTags and task priorities : length is different"); //$NON-NLS-1$ >+ if (taskTagsLength > taskPrioritiesLength) { >+ System.arraycopy(taskTags, 0, (taskTags = new char[taskPrioritiesLength][]), 0, taskPrioritiesLength); >+ defaultOptionsMap.put(JavaCore.COMPILER_TASK_TAGS, new String(CharOperation.concatWith(taskTags,','))); >+ } else { >+ System.arraycopy(taskPriorities, 0, (taskPriorities = new char[taskTagsLength][]), 0, taskTagsLength); >+ defaultOptionsMap.put(JavaCore.COMPILER_TASK_PRIORITIES, new String(CharOperation.concatWith(taskPriorities,','))); >+ } >+ } >+ } > }
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 307295
:
164157
| 164260