Bug 7244 - Problems and suggestions for "Mark my Words" article
Summary: Problems and suggestions for "Mark my Words" article
Status: RESOLVED FIXED
Alias: None
Product: Community
Classification: Eclipse Foundation
Component: Articles (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Eclipse Webmaster CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2002-01-03 16:25 EST by John Arthorne CLA
Modified: 2006-06-19 09:37 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Arthorne CLA 2002-01-03 16:25:46 EST
Paul T. Keyser on the newsgroup noted some problems and possible improvements to 
the "Mark my Words" article by Jeff and Dejan.  The first item is certainly a 
bug which should be fixed.  The other three items fall into the "how to improve 
the article" category.  I will cite the complete post below so it doesn't get 
lost:

a) The code for manipulateMarker() is either wrong or *looks* wrong and
needs a comment:

public void manipulateMarker(IMarker marker) {
          // test to see if the marker really exists.  Perhaps its
stale?
          if (marker.exists())
             return;
          // ...
       }// end manipulateMarker()
shouldn't that be "if (!marker.exists())" ...?


b) this XML is deeply confusing to anyone not an Eclipse guru:
<extension id="coolmarker" point="org.eclipse.core.resources.markers"/>
       <extension id="coolproblem"
point="org.eclipse.core.resources.markers">
          <super type="org.eclipse.core.resources.problemmarker"/>
          <super type="com.example.markers.r.us.coolmarker"/>
          <attribute name="coolFactor"/>
          <persistent value="true"/>
       </extension>
there are TWO new types of markers, the second of which "inherits" both
from the first and from org.eclipse.core.resources.problemmarker; that
should be stated in the accompanying text.


c) the creation code here contains a string whose construction needs to
be explained:
public IMarker createCoolMarker(IResource resource) {
          try {
             IMarker marker =
resource.createMarker("com.example.markers.r.us.coolproblem");
             marker.setAttribute("coolFactor", "ULTRA");
             // ...
       }
the accompanying text should explain that the string is composed of a
"prefix" derived from the *id* of the *plug-in* (in this case, not ever
given in the accompanying text, it is "com.example.markers.r.us") and a
suffix which is identical to the *id* of the *extension* (in this case
"coolproblem").


d) the article should explain, and never does, how programmatically to
set the "completion" status of a marker, as well as how to set/create
one so that a user can mark it as completed.  At the moment, no-one,
using just the article, could ever manage to do either of those things,
and in fact the "obvious" API for doing the second does not work.  (See
the as-yet unanswered thread "(New) Question on deleting (in)complete
tasks..." where I ask about how to do that.)
Comment 1 Nick Edgar CLA 2002-01-10 16:34:41 EST
See also bug 7448 for an example of confusion.
Comment 2 Ed Burnette CLA 2005-03-11 11:20:34 EST
Dejan or Jeff, this article was written in 2001 and could use updating. Would
one or both of you be willing to create an updated version?
Comment 3 Jeff McAffer CLA 2005-03-11 16:25:14 EST
I am way out of touch with anything related to resources.  Perhaps someone like 
John A would be able to do the updates accurately.
Comment 4 Ed Burnette CLA 2005-03-22 12:25:47 EST
John do you want to take it or get somebody else to fix it?

Are the problems serious enough we should have the article removed until it's fixed?
Comment 5 John Arthorne CLA 2005-03-22 12:34:08 EST
I think the only real "bug" in the article is the missing "!" in the code
snippet (problem a)).  The rest are merely suggestions.  I reread the article
and its content is still valid, so I don't think major revisions are necessary.
 I suggest just fixing the "!" in the code snippet.
Comment 6 Ed Burnette CLA 2005-03-22 21:58:42 EST
Ok, let's ask "He who has write permission" to add the "!". 

Denis, please change: 
          if (marker.exists())
to:
          if (!marker.exists())
in:
http://www.eclipse.org/articles/Article-Mark%20My%20Words/Mark%20My%20Words.html .
Thanks.
Comment 7 Eclipse Webmaster CLA 2005-03-22 22:05:36 EST
Done.

This has to be a new speed record for solving a three-year-old bug  =)

D.
Comment 8 John Arthorne CLA 2005-03-23 09:51:10 EST
Thanks Denis