Community
Participate
Working Groups
Using 200401210900, the method fragments() from org.eclipse.jdt.core.dom.TagElement is reported as deprecated inside org.eclipse.jdt.core.dom.NaiveASTFlattener.visit(TagElement node). It seems that the javadoc parser doesn't ensure that the @deprecated is located at the beginning of a line. The rule is: @deprecated can only be preceeded by white spaces or one asterisk.
Olivier, I can't reproduce the problem with build I200401210900. I can't see any deprecation in NaiveASTFlattener.visit(TagElement)... Do I missed something?
It happens when compiler Javadoc option is not set...
Bug is in Javadoc parser check for deprecation which no longer skip line if line is starting with anything else than whitespaces or '*'. Fixed
Offending loop should read: // scan line per line, since tags must be at beginning of lines only nextLine : for (int line = firstLineNumber; line <= lastLineNumber; line++) { int lineStart = line == firstLineNumber ? javadocStart + 3 // skip leading /** : this.sourceParser.scanner.getLineStart(line); this.index = lineStart; this.lineEnd = line == lastLineNumber ? javadocEnd - 2 // remove trailing * / : this.sourceParser.scanner.getLineEnd(line); nextCharacter : while (this.index < this.lineEnd) { char c = readChar(); // consider unicodes switch (c) { default : if (Character.isWhitespace(c)) { continue nextCharacter; } break; case '*' : continue nextCharacter; case '@' : if ((readChar() == 'd') && (readChar() == 'e') && (readChar() == 'p') && (readChar() == 'r') && (readChar() == 'e') && (readChar() == 'c') && (readChar() == 'a') && (readChar() == 't') && (readChar() == 'e') && (readChar() == 'd')) { // ensure the tag is properly ended: either followed by a space, a tab, line end or asterisk. c = readChar(); if (Character.isWhitespace(c) || c == '*') { return true; } } } continue nextLine; } }
Fixed. This was a regression introduced while splitting Javadoc parsers between compiler and dom... Test case added in jdt.core.tests.compiler.regression.JavadocTestMixed
Verified for 3.0M7