diff -r 34e254ffd0e7 -r 5c0b3faeb0b0 src/share/classes/com/sun/tools/javac/parser/Tokens.java --- a/src/share/classes/com/sun/tools/javac/parser/Tokens.java Tue Jun 19 13:25:58 2012 +0100 +++ b/src/share/classes/com/sun/tools/javac/parser/Tokens.java Wed Jun 20 13:23:26 2012 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -371,11 +371,11 @@ * Preserve classic semantics - if multiple javadocs are found on the token * the last one is returned */ - public String comment(Comment.CommentStyle style) { - List readers = getReaders(Comment.CommentStyle.JAVADOC); - return readers.isEmpty() ? + public Comment comment(Comment.CommentStyle style) { + List comments = getComments(Comment.CommentStyle.JAVADOC); + return comments.isEmpty() ? null : - readers.head.getText(); + comments.head; } /** @@ -383,22 +383,22 @@ * javadoc comment attached to this token contains the '@deprecated' string */ public boolean deprecatedFlag() { - for (Comment r : getReaders(Comment.CommentStyle.JAVADOC)) { - if (r.isDeprecated()) { + for (Comment c : getComments(Comment.CommentStyle.JAVADOC)) { + if (c.isDeprecated()) { return true; } } return false; } - private List getReaders(Comment.CommentStyle style) { + private List getComments(Comment.CommentStyle style) { if (comments == null) { return List.nil(); } else { ListBuffer buf = ListBuffer.lb(); - for (Comment r : comments) { - if (r.getStyle() == style) { - buf.add(r); + for (Comment c : comments) { + if (c.getStyle() == style) { + buf.add(c); } } return buf.toList();