diff options
author | Roel Spilker <r.spilker@gmail.com> | 2014-06-05 23:45:43 +0200 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2014-06-05 23:45:43 +0200 |
commit | 1ce747178b8f24f29f94dd795f09f872aad9272f (patch) | |
tree | 76e66d528c56f22ac5782846df4758d75a8b55bd /src/utils/lombok/javac/java7/CommentCollectingParser.java | |
parent | f30485c91fd3f9553fbcbc02d922e6221182c26e (diff) | |
download | lombok-1ce747178b8f24f29f94dd795f09f872aad9272f.tar.gz lombok-1ce747178b8f24f29f94dd795f09f872aad9272f.tar.bz2 lombok-1ce747178b8f24f29f94dd795f09f872aad9272f.zip |
Finished refactor of FieldAugment; there's no longer a separate variant for boolean and references, and the code no longer blows up with a bunch of NPEs if you try to use the reference variant (which is now the only variant) with a primitive type.
Should have zero effect on features or bugs, 100% refactor.
Diffstat (limited to 'src/utils/lombok/javac/java7/CommentCollectingParser.java')
-rw-r--r-- | src/utils/lombok/javac/java7/CommentCollectingParser.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/utils/lombok/javac/java7/CommentCollectingParser.java b/src/utils/lombok/javac/java7/CommentCollectingParser.java index 27d731ba..de93e5b4 100644 --- a/src/utils/lombok/javac/java7/CommentCollectingParser.java +++ b/src/utils/lombok/javac/java7/CommentCollectingParser.java @@ -21,9 +21,10 @@ */ package lombok.javac.java7; +import static lombok.javac.CommentCatcher.JCCompilationUnit_comments; + import java.util.List; -import lombok.core.ReferenceFieldAugment; import lombok.javac.CommentInfo; import com.sun.tools.javac.parser.EndPosParser; @@ -32,21 +33,19 @@ import com.sun.tools.javac.parser.ParserFactory; import com.sun.tools.javac.tree.JCTree.JCCompilationUnit; class CommentCollectingParser extends EndPosParser { - private final ReferenceFieldAugment<JCCompilationUnit, List<CommentInfo>> commentsField; private final Lexer lexer; protected CommentCollectingParser(ParserFactory fac, Lexer S, - boolean keepDocComments, boolean keepLineMap, ReferenceFieldAugment<JCCompilationUnit, List<CommentInfo>> commentsField) { + boolean keepDocComments, boolean keepLineMap) { super(fac, S, keepDocComments, keepLineMap); lexer = S; - this.commentsField = commentsField; } public JCCompilationUnit parseCompilationUnit() { JCCompilationUnit result = super.parseCompilationUnit(); if (lexer instanceof CommentCollectingScanner) { List<CommentInfo> comments = ((CommentCollectingScanner)lexer).getComments(); - commentsField.set(result, comments); + JCCompilationUnit_comments.set(result, comments); } return result; } |