aboutsummaryrefslogtreecommitdiff
path: root/src/delombok
diff options
context:
space:
mode:
Diffstat (limited to 'src/delombok')
-rw-r--r--src/delombok/lombok/delombok/PrettyCommentsPrinter.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/delombok/lombok/delombok/PrettyCommentsPrinter.java b/src/delombok/lombok/delombok/PrettyCommentsPrinter.java
index cfe8b6c4..506f5a77 100644
--- a/src/delombok/lombok/delombok/PrettyCommentsPrinter.java
+++ b/src/delombok/lombok/delombok/PrettyCommentsPrinter.java
@@ -632,8 +632,7 @@ public class PrettyCommentsPrinter extends JCTree.Visitor {
*/
public void printUnit(JCCompilationUnit tree, JCClassDecl cdef) throws IOException {
Object dc = getDocComments(tree);
- if (dc instanceof Map) this.docComments = (Map) dc;
- else if (dc instanceof DocCommentTable) this.docTable = (DocCommentTable) dc;
+ loadDocCommentsTable(dc);
printDocComment(tree);
if (tree.pid != null) {
consumeComments(tree.pos, tree);
@@ -668,6 +667,12 @@ public class PrettyCommentsPrinter extends JCTree.Visitor {
}
}
// where
+ @SuppressWarnings("unchecked")
+ private void loadDocCommentsTable(Object dc) {
+ if (dc instanceof Map<?, ?>) this.docComments = (Map) dc;
+ else if (dc instanceof DocCommentTable) this.docTable = (DocCommentTable) dc;
+ }
+
boolean isUsed(final Symbol t, JCTree cdef) {
class UsedVisitor extends TreeScanner {
public void scan(JCTree tree) {