aboutsummaryrefslogtreecommitdiff
path: root/src/utils/lombok/javac/java6/CommentCollectingParser.java
diff options
context:
space:
mode:
authorRoel Spilker <r.spilker@gmail.com>2014-06-05 23:45:43 +0200
committerRoel Spilker <r.spilker@gmail.com>2014-06-05 23:45:43 +0200
commit1ce747178b8f24f29f94dd795f09f872aad9272f (patch)
tree76e66d528c56f22ac5782846df4758d75a8b55bd /src/utils/lombok/javac/java6/CommentCollectingParser.java
parentf30485c91fd3f9553fbcbc02d922e6221182c26e (diff)
downloadlombok-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/java6/CommentCollectingParser.java')
-rw-r--r--src/utils/lombok/javac/java6/CommentCollectingParser.java9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/utils/lombok/javac/java6/CommentCollectingParser.java b/src/utils/lombok/javac/java6/CommentCollectingParser.java
index 215bf5b6..d5d3c256 100644
--- a/src/utils/lombok/javac/java6/CommentCollectingParser.java
+++ b/src/utils/lombok/javac/java6/CommentCollectingParser.java
@@ -21,7 +21,7 @@
*/
package lombok.javac.java6;
-import lombok.core.ReferenceFieldAugment;
+import static lombok.javac.CommentCatcher.JCCompilationUnit_comments;
import lombok.javac.CommentInfo;
import com.sun.tools.javac.parser.EndPosParser;
@@ -31,21 +31,18 @@ import com.sun.tools.javac.tree.JCTree.JCCompilationUnit;
import com.sun.tools.javac.util.List;
class CommentCollectingParser extends EndPosParser {
-
- private final ReferenceFieldAugment<JCCompilationUnit, List<CommentInfo>> commentsField;
private final Lexer lexer;
- protected CommentCollectingParser(Parser.Factory fac, Lexer S, boolean keepDocComments, ReferenceFieldAugment<JCCompilationUnit, List<CommentInfo>> commentsField) {
+ protected CommentCollectingParser(Parser.Factory fac, Lexer S, boolean keepDocComments) {
super(fac, S, keepDocComments);
lexer = S;
- this.commentsField = commentsField;
}
@Override public JCCompilationUnit compilationUnit() {
JCCompilationUnit result = super.compilationUnit();
if (lexer instanceof CommentCollectingScanner) {
List<CommentInfo> comments = ((CommentCollectingScanner)lexer).getComments();
- commentsField.set(result, comments);
+ JCCompilationUnit_comments.set(result, comments);
}
return result;
}