Skip to content

Commit 878c113

Browse files
committed
Scrub some out of date references to ECJ
google-java-format now uses javac's front end. MOE_MIGRATED_REVID=171897200
1 parent 112179c commit 878c113

File tree

3 files changed

+11
-14
lines changed

3 files changed

+11
-14
lines changed

core/src/main/java/com/google/googlejavaformat/java/Formatter.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@
5757
* This is google-java-format, a new Java formatter that follows the Google Java Style Guide quite
5858
* precisely---to the letter and to the spirit.
5959
*
60-
* <p>This formatter uses the Eclipse parser to generate an AST. Because the Eclipse AST loses
61-
* information about the non-tokens in the input (including newlines, comments, etc.), and even some
62-
* tokens (e.g., optional commas or semicolons), this formatter lexes the input again and follows
63-
* along in the resulting list of tokens. Its lexer splits all multi-character operators (like ">>")
64-
* into multiple single-character operators. Each non-token is assigned to a token---non-tokens
65-
* following a token on the same line go with that token; those following go with the next token---
66-
* and there is a final EOF token to hold final comments.
60+
* <p>This formatter uses the javac parser to generate an AST. Because the AST loses information
61+
* about the non-tokens in the input (including newlines, comments, etc.), and even some tokens
62+
* (e.g., optional commas or semicolons), this formatter lexes the input again and follows along in
63+
* the resulting list of tokens. Its lexer splits all multi-character operators (like ">>") into
64+
* multiple single-character operators. Each non-token is assigned to a token---non-tokens following
65+
* a token on the same line go with that token; those following go with the next token--- and there
66+
* is a final EOF token to hold final comments.
6767
*
6868
* <p>The formatter walks the AST to generate a Greg Nelson/Derek Oppen-style list of formatting
6969
* {@link Op}s [1--2] that then generates a structured {@link Doc}. Each AST node type has a visitor

core/src/main/java/com/google/googlejavaformat/java/JavaInput.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,9 @@ public final class JavaInput extends Input {
5959
* either a token (if {@code isToken()}), or a non-token, which is a comment (if {@code
6060
* isComment()}) or a newline (if {@code isNewline()}) or a maximal sequence of other whitespace
6161
* characters (if {@code isSpaces()}). Each {@link Tok} contains a sequence of characters, an
62-
* index (sequential starting at {@code 0} for tokens and comments, else {@code -1}), and an
63-
* Eclipse-compatible ({@code 0}-origin) position in the input. The concatenation of the texts of
64-
* all the {@link Tok}s equals the input. Each Input ends with a token EOF {@link Tok}, with empty
65-
* text.
62+
* index (sequential starting at {@code 0} for tokens and comments, else {@code -1}), and a
63+
* ({@code 0}-origin) position in the input. The concatenation of the texts of all the {@link
64+
* Tok}s equals the input. Each Input ends with a token EOF {@link Tok}, with empty text.
6665
*
6766
* <p>A {@code /*} comment possibly contains newlines; a {@code //} comment does not contain the
6867
* terminating newline character, but is followed by a newline {@link Tok}.

core/src/main/java/com/google/googlejavaformat/java/JavaInputAstVisitor.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,9 +1100,7 @@ public Void visitImport(ImportTree node, Void unused) {
11001100
public Void visitBinary(BinaryTree node, Void unused) {
11011101
sync(node);
11021102
/*
1103-
* Collect together all operators with same precedence to clean up indentation. Eclipse's
1104-
* extended operands help a little (to collect together the same operator), but they're applied
1105-
* inconsistently, and don't apply to other operators of the same precedence.
1103+
* Collect together all operators with same precedence to clean up indentation.
11061104
*/
11071105
List<ExpressionTree> operands = new ArrayList<>();
11081106
List<String> operators = new ArrayList<>();

0 commit comments

Comments
 (0)