|
63 | 63 | *
|
64 | 64 | * @see <a href="http://svnbook.red-bean.com/en/1.4/svn.advanced.props.special.keywords.html">Keywords substitution in Subversion</a>
|
65 | 65 | * @since 0.3
|
66 |
| - * @todo #743:30min Nested classes should have since tag. Implement check to |
67 |
| - * validate if nested classes javadoc have a valid since tag. After the |
68 |
| - * implementation add JavadocTagsCheck to checks.xml and ChecksTest (removed |
69 |
| - * because now the test fails). |
70 | 66 | */
|
71 | 67 | public final class JavadocTagsCheck extends AbstractCheck {
|
72 | 68 |
|
@@ -111,21 +107,19 @@ public void init() {
|
111 | 107 |
|
112 | 108 | @Override
|
113 | 109 | public void visitToken(final DetailAST ast) {
|
114 |
| - if (ast.getParent() == null) { |
115 |
| - final String[] lines = this.getLines(); |
116 |
| - final int start = ast.getLineNo(); |
117 |
| - final int cstart = JavadocTagsCheck.findCommentStart(lines, start); |
118 |
| - final int cend = JavadocTagsCheck.findCommentEnd(lines, start); |
119 |
| - if (cend > cstart && cstart >= 0) { |
120 |
| - for (final String tag : this.prohibited) { |
121 |
| - this.findProhibited(lines, start, cstart, cend, tag); |
122 |
| - } |
123 |
| - for (final String tag : this.tags.keySet()) { |
124 |
| - this.matchTagFormat(lines, cstart, cend, tag); |
125 |
| - } |
126 |
| - } else { |
127 |
| - this.log(0, "Problem finding class/interface comment"); |
| 110 | + final String[] lines = this.getLines(); |
| 111 | + final int start = ast.getLineNo(); |
| 112 | + final int cstart = JavadocTagsCheck.findCommentStart(lines, start); |
| 113 | + final int cend = JavadocTagsCheck.findCommentEnd(lines, start); |
| 114 | + if (cend > cstart && cstart >= 0) { |
| 115 | + for (final String tag : this.prohibited) { |
| 116 | + this.findProhibited(lines, start, cstart, cend, tag); |
| 117 | + } |
| 118 | + for (final String tag : this.tags.keySet()) { |
| 119 | + this.matchTagFormat(lines, cstart, cend, tag); |
128 | 120 | }
|
| 121 | + } else { |
| 122 | + this.log(0, "Problem finding class/interface comment"); |
129 | 123 | }
|
130 | 124 | }
|
131 | 125 |
|
@@ -252,7 +246,7 @@ private List<Integer> findTagLineNum(final String[] lines, final int start,
|
252 | 246 | for (int pos = start; pos <= end; pos += 1) {
|
253 | 247 | final String line = lines[pos];
|
254 | 248 | if (line.contains(String.format("@%s ", tag))) {
|
255 |
| - if (!line.startsWith(prefix)) { |
| 249 | + if (!line.trim().startsWith(prefix.trim())) { |
256 | 250 | this.log(
|
257 | 251 | start + pos + 1,
|
258 | 252 | "Line with ''@{0}'' does not start with a ''{1}''",
|
|
0 commit comments