From 8dda58a9b22640362e564b753b5f959b3750d6f7 Mon Sep 17 00:00:00 2001 From: Liam Miller-Cushon Date: Thu, 24 May 2018 18:26:45 -0700 Subject: [PATCH] Improve some javadoc --- .../java/com/google/googlejavaformat/InputOutput.java | 9 ++------- .../java/com/google/googlejavaformat/java/Formatter.java | 8 ++++---- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/core/src/main/java/com/google/googlejavaformat/InputOutput.java b/core/src/main/java/com/google/googlejavaformat/InputOutput.java index b072cbe7c..46dc70bbc 100644 --- a/core/src/main/java/com/google/googlejavaformat/InputOutput.java +++ b/core/src/main/java/com/google/googlejavaformat/InputOutput.java @@ -83,7 +83,7 @@ protected final void computeRanges(List toks) { * Given an {@code InputOutput}, compute the map from tok indices to line ranges. * * @param put the {@code InputOutput} - * @return the map from {@link com.google.googlejavaformat.java.JavaInput.Tok} indices to line + * @return the map from {@code com.google.googlejavaformat.java.JavaInput.Tok} indices to line * ranges in this {@code put} */ public static Map> makeKToIJ(InputOutput put) { @@ -114,11 +114,6 @@ public final Range getRanges(int lineI) { @Override public String toString() { - return "InputOutput{" - + "lines=" - + lines - + ", ranges=" - + ranges - + '}'; + return "InputOutput{" + "lines=" + lines + ", ranges=" + ranges + '}'; } } diff --git a/core/src/main/java/com/google/googlejavaformat/java/Formatter.java b/core/src/main/java/com/google/googlejavaformat/java/Formatter.java index 0077bb79a..2b76d8ef8 100644 --- a/core/src/main/java/com/google/googlejavaformat/java/Formatter.java +++ b/core/src/main/java/com/google/googlejavaformat/java/Formatter.java @@ -59,10 +59,10 @@ *

This formatter uses the javac parser to generate an AST. Because the AST loses information * about the non-tokens in the input (including newlines, comments, etc.), and even some tokens * (e.g., optional commas or semicolons), this formatter lexes the input again and follows along in - * the resulting list of tokens. Its lexer splits all multi-character operators (like ">>") into - * multiple single-character operators. Each non-token is assigned to a token---non-tokens following - * a token on the same line go with that token; those following go with the next token--- and there - * is a final EOF token to hold final comments. + * the resulting list of tokens. Its lexer splits all multi-character operators (like ">>") + * into multiple single-character operators. Each non-token is assigned to a token---non-tokens + * following a token on the same line go with that token; those following go with the next token--- + * and there is a final EOF token to hold final comments. * *

The formatter walks the AST to generate a Greg Nelson/Derek Oppen-style list of formatting * {@link Op}s [1--2] that then generates a structured {@link Doc}. Each AST node type has a visitor