Bugs item #1435289, was opened at 2006-02-21 02:56
Message generated for change (Comment added) made by oburn
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397078&aid=1435289&group_id=29721
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Core Framework
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Phil Riley (rileypb)
Assigned to: Oliver Burn (oburn)
Summary: HTML Comments in JavaDoc cause incorrect <tag> parsing
Initial Comment:
The following javadoc is incorrectly parsed:
/**
* Create a new Event with the given parameters.
*
* <P>Will accept the parameters:
* <ol>
* <li><strong>latency</strong>: optional, <!-- >=
-->≥ 0, defaults to zero if trigger time is also
omitted.</li>
* <li><strong>trigger time</strong>: optional,
<!-- >= -->≥, defaults to posting time if latency
is also omitted.</li>
* <li><strong>posting time</strong>: required.</li>
* </ol>
* </p>
*
* @param type event type
* @param source event source
* @param target event target(s)
* @param params event parameters
*/
Checkstyle reports the following warning:
"Unclosed HTML tag found: <ol>"
Only removing the "<!--" comments seems to fix the problem.
----------------------------------------------------------------------
Comment By: Oliver Burn (oburn)
Date: 2008-10-30 21:12
Message:
thanks - I will endeavour to have a look this weekend.
----------------------------------------------------------------------
Comment By: Nicolas Dordet (ndox)
Date: 2008-10-30 21:04
Message:
I just made a little (maybe unpretty...) patch for the documentation.
Tell me if its OK, or if you need something else.
I attached the file here :
https://sourceforge.net/tracker/?func=detail&atid=397078&aid=2207732&group_id=29721
----------------------------------------------------------------------
Comment By: Nicolas Dordet (ndox)
Date: 2008-10-30 01:49
Message:
I didn't try the 5.x version but the firm I work with is using the 4.4
version...
I will try to make the documentation, what do you need?
Thanks for the link.
----------------------------------------------------------------------
Comment By: Oliver Burn (oburn)
Date: 2008-10-29 21:24
Message:
Yes, I can also apply the patch for 4.4 release, but do need documentation.
Why do you need the 4.4 release, is something missing/broken in the 5.x
version?
BTW, 4.4 is available, but the new interface to SF does not make it
obvious. In case you have problems, use
http://sourceforge.net/project/showfiles.php?group_id=29721&package_id=21696&release_id=561755
----------------------------------------------------------------------
Comment By: Nicolas Dordet (ndox)
Date: 2008-10-29 20:15
Message:
For the moment, I need to work with the 4.4 version.
Is it possible to apply the patch for this version (tell me what do you
need for the documentation, I will try to fix it)?
Another thing, could you put the package 4.4 back on the download page? (I
think many people still work with this version).
Then, I will make test with the last 5.x version and try to make a second
patch.
Thanks
----------------------------------------------------------------------
Comment By: Oliver Burn (oburn)
Date: 2008-10-29 08:54
Message:
That explains the problem - can you please work against the 5.x version of
the software. Checkout the code using the details at
https://sourceforge.net/svn/?group_id=29721. The URL is
https://checkstyle.svn.sourceforge.net/svnroot/checkstyle/trunk/checkstyle
----------------------------------------------------------------------
Comment By: Nicolas Dordet (ndox)
Date: 2008-10-29 04:33
Message:
Hi,
I tried this patch on a 4.4 release of checkstyle and it works fine, the
test passes without issues. I'll work on upgrading the documentation of the
patch. Please provide me any info.
you'll have on reproducing your issue with the unit test.
(I'll try to fix it)
----------------------------------------------------------------------
Comment By: Oliver Burn (oburn)
Date: 2008-10-27 15:25
Message:
I applied this patch and the unit tests now fail. There is also no
associated documentation. So I cannot apply this patch as requested.
----------------------------------------------------------------------
Comment By: Oliver Burn (oburn)
Date: 2008-10-25 09:51
Message:
Thanks - I will endeavour to apply the patch this week
----------------------------------------------------------------------
Comment By: Rémy-Christophe Schermesser (rschermesser)
Date: 2008-10-25 02:11
Message:
Hi,
I have also made a unit test. Here it is :
http://pastebin.linagora.com/126, and here is again the patch
http://pastebin.linagora.com/127.
The last patch was only retained for a month.
Cheers
----------------------------------------------------------------------
Comment By: Rémy-Christophe Schermesser (rschermesser)
Date: 2008-10-14 02:42
Message:
Hi,
I have made a patch against the trunk.
I have not found how to attach a file to this request...
so here is my patch : http://pastebin.linagora.com/114
Cheers,
----------------------------------------------------------------------
Comment By: Rémy-Christophe Schermesser (rschermesser)
Date: 2008-10-13 20:45
Message:
Hi,
Sorry I was on vacations for 2 weeks.
Ok, I will make the patch to allow only a set on HTML tags in the
javadoc.
Cheers,
----------------------------------------------------------------------
Comment By: Oliver Burn (oburn)
Date: 2008-10-06 15:31
Message:
Ouch - I see what you mean. This is hard problem, and you could also get
/**
* @return Map<String, List<String>> a map indexed on String of Lists of
Strings.
**/
And of course it is legal to use Generics in all sorts of places.
I guess I now like your first suggestion of only checking certain tags.
This could be a parameter that defaults to "p,li,ul,code,tt,b,i". This has
a lot merit as a simple workable solution.
Attempting to fully parse Javadoc comments is a huge job.
----------------------------------------------------------------------
Comment By: Rémy-Christophe Schermesser (rschermesser)
Date: 2008-09-23 22:11
Message:
Yes, that seems a good idea, but what about comments like this one ?
/**
* @return List<String> return a List of Strings
*
**/
----------------------------------------------------------------------
Comment By: Oliver Burn (oburn)
Date: 2008-09-23 22:03
Message:
Tough one. I would suggest to ignore <>'s when inside a set of {@...}'s.
E.g. when getting {@code List<String>} - ignore the <String>. Equally, when
get a <!-- ... --> ignore everything in between.
I'd agree that attempting to determine if what is between <>'s is a class
is not the way to go.
----------------------------------------------------------------------
Comment By: Rémy-Christophe Schermesser (rschermesser)
Date: 2008-09-23 02:44
Message:
Hi,
I am willing to fix this issue, but I am not sure whow to fix it.
I have found 2 possible ways to fix it :
- Allow only some specific HTML tags in the javadoc.
- Check if the value between the < > is a Java class or not.
Which way do you prefer ? Or do you have another idea ?
I much prefer the first solution, because the second one is very very slow
...
Thanks in advance
----------------------------------------------------------------------
Comment By: Tobias Scholl (schollt)
Date: 2008-02-04 22:05
Message:
Logged In: YES
user_id=1464585
Originator: NO
Another example:
/**
* @return a {@code List<String>}.
*/
List<String> someMethod() {
return new java.util.ArrayList<String>();
}
"<String>" considered to be an HTML tag and produces the following error:
Unclosed HTML tag found: <String>}.
Possible workaround:
<code>List<String></code>.
However, that (in my opinion) makes the comment less readable in the
source code.
----------------------------------------------------------------------
Comment By: Hendrik Schreiber (hendriks73)
Date: 2006-05-04 01:46
Message:
Logged In: YES
user_id=252726
A similar problem occurs when linking to a method with parametrized
arguments like this:
/**
* {@link #offer(java.util.Collection<Task>)}
*
*
* @param task task
*/
The resulting message is "Unclosed HTML tag found: <Task>)}"
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397078&aid=1435289&group_id=29721
|