diff --git a/docs/developer/new-contributor-projects.html b/docs/developer/new-contributor-projects.html index a2e41147660..21da5993aea 100644 --- a/docs/developer/new-contributor-projects.html +++ b/docs/developer/new-contributor-projects.html @@ -51,6 +51,7 @@

Projects for new contributors

+

Replace JavaParser by javac

+ +

+The Checker Framework uses JavaParser to parse +a +Java expressions. However, JavaParser is buggy and poorly maintained. +The goal of this project is to replace every use of JavaParser by a use of +javac-parse. +

+ +

Java expression parser

A number of type annotations take, as an argument, a -Java expression. The representation for these -(the JavaExpression -class) is a hack. The goal of this -project is to remove it. +Java expression. The representation for these is as a JavaExpression. The goal of this +project is to remove it.

The JavaExpression class represents an AST. There is no need for the Checker Framework to -define its own AST when the JavaParser AST already exists and is -maintained. In fact, JavaExpressionParseUtil uses JavaParser, -but needlessly converts a -JavaParser Expression into -a JavaExpression. +define its own AST when the javac AST already exists and is +maintained.

@@ -1371,29 +1378,29 @@

Java expression parser

  • Replace every use of JavaExpression - by a use of the JavaParser - class com.github.javaparser.ast.expr.Expression. + by a use of the javac class + class com.sun.tools.javac.tree.JCTree.JCExpression.html.
  • Replace every use of a subclass of JavaExpression (listed in the "Direct Known Subclasses" section of the JavaExpression API documentation) by a use of a - subclass of Expression. For example, replace every use - of MethodCall by MethodCallExpr. + subclass + of JCTree.JCExpression.html. + For example, replace every use + of MethodCall by JCTree.JCMethodInvocation.
  • - The JavaExpressionParseUtil - class already uses JavaParser, but it uses ExpressionToReceiverVisitor to construct - a JavaExpression. Have it return a - JavaParser Expression instead, and delete ExpressionToReceiverVisitor. + Replace the JavaExpressionParseUtil + class and delete ExpressionToReceiverVisitor.
  • Direct replacement of the classes is not possible, or we would have done it already. For example, JavaExpression contains some methods that -JavaParser lacks, such as isUnassignableByOtherCode. As a +javac lacks, such as isUnassignableByOtherCode. As a first step before doing the tasks listed above, you may want to convert these methods from instance methods of JavaExpression into static methods in JavaExpressions, making JavaExpression more @@ -1403,7 +1410,7 @@

    Java expression parser

    An alternate design (or a partial step in the refactoring process) would be to retain the JavaExpression class, but make it a thin wrapper around -JavaParser classes that do most of the real work. +javac classes that do most of the real work.