partial fix submitted by Andreas

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@7205 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Brian Remedios committed 2011-07-24 16:27:48 +00:00
1 parent 17caae8a73
commit 46b878abb4
1 file changed
+12 -4
@@ -51,16 +51,24 @@ public final class CommentUtil {
}
public static Map<String, Integer> javadocTagsIn(String comment) {
int atPos = comment.indexOf('@');
if (atPos < 0) return Collections.emptyMap();
Map<String, Integer> tags = new HashMap<String, Integer>();
while (atPos >= 0) {
String tag = wordAfter(comment, atPos);
String content = javadocContentAfter(comment, atPos + tag.length() );
tags.put(tag, atPos);
atPos = comment.indexOf('@', atPos + tag.length());
// String content = javadocContentAfter(comment, atPos + tag.length() );
// tags.put(tag, atPos);
// atPos = comment.indexOf('@', atPos + tag.length());
int offset = 1; // default offset for next tag
if (StringUtil.isNotEmpty(tag)) {
//TODO: this seems to be not complete, the content is not used
//String content = javadocContentAfter(comment, atPos + tag.length() );
tags.put(tag, atPos);
offset = tag.length();
}
atPos = comment.indexOf('@', atPos + offset);
}
return tags;
}