langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavadocTokenizer.java
equal
deleted
inserted
replaced
28 import com.sun.tools.javac.parser.Tokens.Comment; |
28 import com.sun.tools.javac.parser.Tokens.Comment; |
29 import com.sun.tools.javac.parser.Tokens.Comment.CommentStyle; |
29 import com.sun.tools.javac.parser.Tokens.Comment.CommentStyle; |
30 import com.sun.tools.javac.util.*; |
30 import com.sun.tools.javac.util.*; |
31 |
31 |
32 import java.nio.*; |
32 import java.nio.*; |
|
33 import java.util.regex.Pattern; |
33 |
34 |
34 import static com.sun.tools.javac.util.LayoutCharacters.*; |
35 import static com.sun.tools.javac.util.LayoutCharacters.*; |
35 |
36 |
36 /** An extension to the base lexical analyzer that captures |
37 /** An extension to the base lexical analyzer that captures |
37 * and processes the contents of doc comments. It does so by |
38 * and processes the contents of doc comments. It does so by |
448 } |
449 } |
449 } finally { |
450 } finally { |
450 scanned = true; |
451 scanned = true; |
451 comment_reader = null; |
452 comment_reader = null; |
452 if (docComment != null && |
453 if (docComment != null && |
453 docComment.matches("(?sm).*^\\s*@deprecated( |$).*")) { |
454 DEPRECATED_PATTERN.matcher(docComment).matches()) { |
454 deprecatedFlag = true; |
455 deprecatedFlag = true; |
455 } |
456 } |
456 } |
457 } |
457 } |
458 } |
|
459 //where: |
|
460 private static final Pattern DEPRECATED_PATTERN = |
|
461 Pattern.compile("(?sm).*^\\s*@deprecated( |$).*"); |
|
462 |
458 } |
463 } |
459 |
464 |
460 @Override |
465 @Override |
461 public Position.LineMap getLineMap() { |
466 public Position.LineMap getLineMap() { |
462 char[] buf = reader.getRawCharacters(); |
467 char[] buf = reader.getRawCharacters(); |