diff --git a/.baseline/checkstyle/checkstyle.xml b/.baseline/checkstyle/checkstyle.xml index 1a086c49c..fd1fa3897 100644 --- a/.baseline/checkstyle/checkstyle.xml +++ b/.baseline/checkstyle/checkstyle.xml @@ -43,7 +43,7 @@ - + @@ -402,7 +402,9 @@ - + + + diff --git a/.baseline/idea/intellij-java-palantir-style.xml b/.baseline/idea/intellij-java-palantir-style.xml index f41e2b8aa..6a5f83a61 100644 --- a/.baseline/idea/intellij-java-palantir-style.xml +++ b/.baseline/idea/intellij-java-palantir-style.xml @@ -44,8 +44,10 @@ + + @@ -54,6 +56,7 @@ + diff --git a/build.gradle b/build.gradle index 63b8a6503..27dc27cf8 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ buildscript { dependencies { classpath 'com.palantir.jakartapackagealignment:jakarta-package-alignment:0.5.0' classpath 'com.gradle.publish:plugin-publish-plugin:1.2.0' - classpath 'com.palantir.baseline:gradle-baseline-java:4.145.0' + classpath 'com.palantir.baseline:gradle-baseline-java:5.13.0' classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:2.12.0' classpath 'com.palantir.gradle.externalpublish:gradle-external-publish-plugin:1.12.0' classpath 'com.palantir.gradle.gitversion:gradle-git-version:3.0.0' diff --git a/palantir-java-format/src/main/java/com/palantir/javaformat/OpenOp.java b/palantir-java-format/src/main/java/com/palantir/javaformat/OpenOp.java index 605f474a0..ba25f077c 100644 --- a/palantir-java-format/src/main/java/com/palantir/javaformat/OpenOp.java +++ b/palantir-java-format/src/main/java/com/palantir/javaformat/OpenOp.java @@ -134,7 +134,7 @@ public void add(DocBuilder builder) { builder.open(this); } - /** @see ImmutableOpenOp.Builder#Builder() */ + /** Builder @see ImmutableOpenOp.Builder#Builder(). */ public static Builder builder() { return new Builder(); } diff --git a/palantir-java-format/src/main/java/com/palantir/javaformat/OpsBuilder.java b/palantir-java-format/src/main/java/com/palantir/javaformat/OpsBuilder.java index 242b687cd..0a256d6be 100644 --- a/palantir-java-format/src/main/java/com/palantir/javaformat/OpsBuilder.java +++ b/palantir-java-format/src/main/java/com/palantir/javaformat/OpsBuilder.java @@ -47,7 +47,7 @@ /** An {@code OpsBuilder} creates a list of {@link Op}s, which is turned into a {@link Doc} by {@link DocBuilder}. */ public final class OpsBuilder { - /** @return the actual size of the AST node at position, including comments. */ + /** Return the actual size of the AST node at position, including comments. */ public int actualSize(int position, int length) { Input.Token startToken = input.getPositionTokenMap().get(position); int start = startToken.getTok().getPosition(); @@ -66,7 +66,7 @@ public int actualSize(int position, int length) { return end - start; } - /** @return the start column of the token at {@code position}, including leading comments. */ + /** Return the start column of the token at {@code position}, including leading comments. */ public Integer actualStartColumn(int position) { Input.Token startToken = input.getPositionTokenMap().get(position); int start = startToken.getTok().getPosition(); diff --git a/palantir-java-format/src/main/java/com/palantir/javaformat/Output.java b/palantir-java-format/src/main/java/com/palantir/javaformat/Output.java index 4e39fadd5..f4a7a12d1 100644 --- a/palantir-java-format/src/main/java/com/palantir/javaformat/Output.java +++ b/palantir-java-format/src/main/java/com/palantir/javaformat/Output.java @@ -30,7 +30,7 @@ public abstract class Output extends InputOutput { /** * Output a string. * - * @param state + * @param state the current state * @param text the string * @param range the {@link Range} corresponding to the string */ diff --git a/palantir-java-format/src/main/java/com/palantir/javaformat/doc/Doc.java b/palantir-java-format/src/main/java/com/palantir/javaformat/doc/Doc.java index 748d60a13..57d6cbfd6 100644 --- a/palantir-java-format/src/main/java/com/palantir/javaformat/doc/Doc.java +++ b/palantir-java-format/src/main/java/com/palantir/javaformat/doc/Doc.java @@ -37,8 +37,13 @@ public abstract class Doc extends HasUniqueId { static final Range EMPTY_RANGE = Range.closedOpen(-1, -1); static final DiscreteDomain INTEGERS = DiscreteDomain.integers(); + @SuppressWarnings("Immutable") // Effectively immutable private final ImmutableSupplier memoizedWidth = Suppliers.memoize(this::computeWidth)::get; + + @SuppressWarnings("Immutable") // Effectively immutable private final ImmutableSupplier memoizedFlat = Suppliers.memoize(this::computeFlat)::get; + + @SuppressWarnings("Immutable") // Effectively immutable private final ImmutableSupplier> memoizedRange = Suppliers.memoize(this::computeRange)::get; /** @@ -51,7 +56,7 @@ final float getWidth() { } /** - * Return a {@code Doc}'s flat-string value; not defined (and never called) if the (@code Doc} contains forced + * Return a {@code Doc}'s flat-string value; not defined (and never called) if the {@code Doc} contains forced * breaks. * * @return the flat-string value diff --git a/palantir-java-format/src/main/java/com/palantir/javaformat/doc/Level.java b/palantir-java-format/src/main/java/com/palantir/javaformat/doc/Level.java index 7efab8a90..2b6225a12 100644 --- a/palantir-java-format/src/main/java/com/palantir/javaformat/doc/Level.java +++ b/palantir-java-format/src/main/java/com/palantir/javaformat/doc/Level.java @@ -60,6 +60,8 @@ public final class Level extends Doc { private static final Collector> GET_LAST_COLLECTOR = Collectors.reducing((u, v) -> v); private final List docs = new ArrayList<>(); // The elements of the level. + + @SuppressWarnings("Immutable") // Effectively immutable private final ImmutableSupplier memoizedSplitsBreaks = Suppliers.memoize(() -> splitByBreaks(docs))::get; /** The immutable characteristics of this level determined before the level contents are available. */ @@ -147,7 +149,7 @@ private Optional tryToFitOnOneLine(int maxWidth, State state, Iterable< column = newWidth.get(); continue; } - column += doc.getWidth(); + column = (int) (column + doc.getWidth()); } // Make an additional check that widthBeforeLastBreak fits in the column limit if (getColumnLimitBeforeLastBreak().isPresent() diff --git a/palantir-java-format/src/main/java/com/palantir/javaformat/doc/LevelDelimitedFlatValueDocVisitor.java b/palantir-java-format/src/main/java/com/palantir/javaformat/doc/LevelDelimitedFlatValueDocVisitor.java index eac9665e1..1ec1b64d2 100644 --- a/palantir-java-format/src/main/java/com/palantir/javaformat/doc/LevelDelimitedFlatValueDocVisitor.java +++ b/palantir-java-format/src/main/java/com/palantir/javaformat/doc/LevelDelimitedFlatValueDocVisitor.java @@ -16,7 +16,6 @@ package com.palantir.javaformat.doc; -import com.google.common.base.Strings; import com.palantir.javaformat.BreakBehaviours; import com.palantir.javaformat.Indent; import com.palantir.javaformat.LastLevelBreakability; @@ -94,6 +93,6 @@ public String visitLevel(Level level) { } private void generateIndent(StringBuilder builder) { - builder.append(Strings.repeat(" ", indent)); + builder.append(" ".repeat(indent)); } } diff --git a/palantir-java-format/src/main/java/com/palantir/javaformat/doc/Obs.java b/palantir-java-format/src/main/java/com/palantir/javaformat/doc/Obs.java index ad2e3d8fe..0fcbf7ede 100644 --- a/palantir-java-format/src/main/java/com/palantir/javaformat/doc/Obs.java +++ b/palantir-java-format/src/main/java/com/palantir/javaformat/doc/Obs.java @@ -53,6 +53,7 @@ FinishExplorationNode startExplorationNode( Optional incomingState); /** + * Write the given level node * @param levelNodeId the unique ID of the {@link LevelNode}. There can be multiple LevelNodes per * {@link Level}. * @param parentExplorationId what exploration is this {@link LevelNode} a part of diff --git a/palantir-java-format/src/main/java/com/palantir/javaformat/java/Formatter.java b/palantir-java-format/src/main/java/com/palantir/javaformat/java/Formatter.java index f8f42b645..b8565a408 100644 --- a/palantir-java-format/src/main/java/com/palantir/javaformat/java/Formatter.java +++ b/palantir-java-format/src/main/java/com/palantir/javaformat/java/Formatter.java @@ -44,7 +44,6 @@ import com.sun.tools.javac.util.Context; import com.sun.tools.javac.util.Log; import com.sun.tools.javac.util.Options; -import java.io.IOError; import java.io.IOException; import java.net.URI; import java.util.Collection; @@ -145,7 +144,7 @@ static JavaOutput format( .getConstructor(OpsBuilder.class, int.class) .newInstance(opsBuilder, options.indentationMultiplier()); } catch (ReflectiveOperationException e) { - throw new LinkageError(e.getMessage(), e); + throw new RuntimeException(e.getMessage(), e); } } else { visitor = new JavaInputAstVisitor(opsBuilder, options.indentationMultiplier()); @@ -185,7 +184,7 @@ static JCCompilationUnit parseJcCompilationUnit(Context context, String sourceTe fileManager.setLocation(StandardLocation.PLATFORM_CLASS_PATH, ImmutableList.of()); } catch (IOException e) { // impossible - throw new IOError(e); + throw new RuntimeException(e); } SimpleJavaFileObject source = new SimpleJavaFileObject(URI.create("source"), JavaFileObject.Kind.SOURCE) { @Override diff --git a/palantir-java-format/src/main/java/com/palantir/javaformat/java/JavaCommentsHelper.java b/palantir-java-format/src/main/java/com/palantir/javaformat/java/JavaCommentsHelper.java index 63297a24a..1547c28a1 100644 --- a/palantir-java-format/src/main/java/com/palantir/javaformat/java/JavaCommentsHelper.java +++ b/palantir-java-format/src/main/java/com/palantir/javaformat/java/JavaCommentsHelper.java @@ -15,7 +15,6 @@ package com.palantir.javaformat.java; import com.google.common.base.CharMatcher; -import com.google.common.base.Strings; import com.palantir.javaformat.CommentsHelper; import com.palantir.javaformat.Input.Tok; import com.palantir.javaformat.Newlines; @@ -83,7 +82,7 @@ private String preserveIndentation(List lines, int column0) { // output all trailing lines with plausible indentation for (int i = 1; i < lines.size(); ++i) { - builder.append(lineSeparator).append(Strings.repeat(" ", column0)); + builder.append(lineSeparator).append(" ".repeat(column0)); // check that startCol is valid index, e.g. for blank lines if (lines.get(i).length() >= startCol) { builder.append(lines.get(i).substring(startCol)); @@ -99,7 +98,7 @@ private String indentLineComments(List lines, int column0) { lines = wrapLineComments(lines, column0); StringBuilder builder = new StringBuilder(); builder.append(lines.get(0).trim()); - String indentString = Strings.repeat(" ", column0); + String indentString = " ".repeat(column0); for (int i = 1; i < lines.size(); ++i) { builder.append(lineSeparator) .append(indentString) @@ -120,7 +119,7 @@ private List wrapLineComments(List lines, int column0) { Matcher matcher = LINE_COMMENT_MISSING_SPACE_PREFIX.matcher(line); if (matcher.find()) { int length = matcher.group(1).length(); - line = Strings.repeat("/", length) + " " + line.substring(length); + line = "/".repeat(length) + " " + line.substring(length); } if (line.startsWith("// MOE:")) { // don't wrap comments for https://github.com/google/MOE @@ -150,7 +149,7 @@ private String indentJavadoc(List lines, int column0) { StringBuilder builder = new StringBuilder(); builder.append(lines.get(0).trim()); int indent = column0 + 1; - String indentString = Strings.repeat(" ", indent); + String indentString = " ".repeat(indent); for (int i = 1; i < lines.size(); ++i) { builder.append(lineSeparator).append(indentString); String line = lines.get(i).trim(); diff --git a/palantir-java-format/src/main/java/com/palantir/javaformat/java/JavaInput.java b/palantir-java-format/src/main/java/com/palantir/javaformat/java/JavaInput.java index 7d348a0af..4077bb54a 100644 --- a/palantir-java-format/src/main/java/com/palantir/javaformat/java/JavaInput.java +++ b/palantir-java-format/src/main/java/com/palantir/javaformat/java/JavaInput.java @@ -307,7 +307,7 @@ private static ImmutableMap makePositionToColumnMap(List for (Tok tok : toks) { builder.put(tok.getPosition(), tok.getColumn()); } - return builder.build(); + return builder.buildOrThrow(); } /** @@ -552,7 +552,7 @@ private static boolean isParamComment(Tok tok) { * @param offset the {@code 0}-based offset in characters * @param length the length in characters * @return the {@code 0}-based {@link Range} of tokens - * @throws FormatterException + * @throws FormatterException on formatting errors */ Range characterRangeToTokenRange(int offset, int length) throws FormatterException { int requiredLength = offset + length; diff --git a/palantir-java-format/src/main/java/com/palantir/javaformat/java/JavaInputAstVisitor.java b/palantir-java-format/src/main/java/com/palantir/javaformat/java/JavaInputAstVisitor.java index 5f48f7fc5..a0a2878ed 100644 --- a/palantir-java-format/src/main/java/com/palantir/javaformat/java/JavaInputAstVisitor.java +++ b/palantir-java-format/src/main/java/com/palantir/javaformat/java/JavaInputAstVisitor.java @@ -417,7 +417,7 @@ public Void visitClass(ClassTree tree, Void unused) { visitEnumDeclaration(tree); break; default: - throw new AssertionError(tree.getKind()); + throw new IllegalArgumentException(tree.getKind().name()); } return null; } @@ -941,7 +941,7 @@ public Void visitMemberReference(MemberReferenceTree node, Void unused) { token("new"); break; default: - throw new AssertionError(node.getMode()); + throw new IllegalArgumentException(node.getMode().name()); } builder.close(); builder.close(); @@ -1774,7 +1774,7 @@ public Void visitPrimitiveType(PrimitiveTypeTree node, Void unused) { token("void"); break; default: - throw new AssertionError(node.getPrimitiveTypeKind()); + throw new RuntimeException(node.getPrimitiveTypeKind().name()); } return null; } @@ -3378,6 +3378,7 @@ enum DeclarationKind { } /** Declare one variable or variable-like thing. */ + @SuppressWarnings("TooManyArguments") int declareOne( DeclarationKind kind, Direction annotationsDirection, diff --git a/palantir-java-format/src/main/java/com/palantir/javaformat/java/JavacTokens.java b/palantir-java-format/src/main/java/com/palantir/javaformat/java/JavacTokens.java index 5e331b06b..9cc61d20a 100644 --- a/palantir-java-format/src/main/java/com/palantir/javaformat/java/JavacTokens.java +++ b/palantir-java-format/src/main/java/com/palantir/javaformat/java/JavacTokens.java @@ -141,7 +141,7 @@ private char[] getRawCharactersReflectively(int beginIndex, int endIndex) { .getMethod("getRawCharacters", int.class, int.class) .invoke(instance, beginIndex, endIndex); } catch (ReflectiveOperationException e) { - throw new LinkageError(e.getMessage(), e); + throw new RuntimeException(e.getMessage(), e); } } } diff --git a/palantir-java-format/src/main/java/com/palantir/javaformat/java/Main.java b/palantir-java-format/src/main/java/com/palantir/javaformat/java/Main.java index cec4937b9..c4a9067cf 100644 --- a/palantir-java-format/src/main/java/com/palantir/javaformat/java/Main.java +++ b/palantir-java-format/src/main/java/com/palantir/javaformat/java/Main.java @@ -18,7 +18,6 @@ import com.google.common.io.ByteStreams; import com.palantir.javaformat.java.JavaFormatterOptions.Style; -import java.io.IOError; import java.io.IOException; import java.io.InputStream; import java.io.OutputStreamWriter; @@ -183,7 +182,7 @@ private int formatStdin(CommandLineOptions parameters, JavaFormatterOptions opti try { input = new String(ByteStreams.toByteArray(inStream), UTF_8); } catch (IOException e) { - throw new IOError(e); + throw new RuntimeException(e); } String stdinFilename = parameters.assumeFilename().orElse(STDIN_FILENAME); boolean ok = true; diff --git a/palantir-java-format/src/main/java/com/palantir/javaformat/java/RemoveUnusedImports.java b/palantir-java-format/src/main/java/com/palantir/javaformat/java/RemoveUnusedImports.java index a9ac0f667..c4a0f3445 100644 --- a/palantir-java-format/src/main/java/com/palantir/javaformat/java/RemoveUnusedImports.java +++ b/palantir-java-format/src/main/java/com/palantir/javaformat/java/RemoveUnusedImports.java @@ -109,7 +109,7 @@ public Void visitCase(CaseTree tree, Void unused) { try { scan((List) CASE_TREE_GET_LABELS.invoke(tree), null); } catch (ReflectiveOperationException e) { - throw new LinkageError(e.getMessage(), e); + throw new RuntimeException(e.getMessage(), e); } } return super.visitCase(tree, null); diff --git a/palantir-java-format/src/main/java/com/palantir/javaformat/java/StringWrapper.java b/palantir-java-format/src/main/java/com/palantir/javaformat/java/StringWrapper.java index 7151455bb..39d9f2b73 100644 --- a/palantir-java-format/src/main/java/com/palantir/javaformat/java/StringWrapper.java +++ b/palantir-java-format/src/main/java/com/palantir/javaformat/java/StringWrapper.java @@ -18,7 +18,6 @@ import static java.util.stream.Collectors.joining; import com.google.common.base.CharMatcher; -import com.google.common.base.Strings; import com.google.common.base.Verify; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; @@ -316,10 +315,7 @@ private static String reflow( return lines.stream() .collect(joining( - "\"" - + separator - + Strings.repeat(" ", (first0 ? firstLineStartColumn + 4 : textStartColumn - 2)) - + "+ \"", + "\"" + separator + " ".repeat(first0 ? firstLineStartColumn + 4 : textStartColumn - 2) + "+ \"", "\"", "\"")); } diff --git a/palantir-java-format/src/main/java/com/palantir/javaformat/java/Trees.java b/palantir-java-format/src/main/java/com/palantir/javaformat/java/Trees.java index dff7143be..66c912bc2 100644 --- a/palantir-java-format/src/main/java/com/palantir/javaformat/java/Trees.java +++ b/palantir-java-format/src/main/java/com/palantir/javaformat/java/Trees.java @@ -26,7 +26,6 @@ import com.sun.tools.javac.tree.JCTree; import com.sun.tools.javac.tree.Pretty; import com.sun.tools.javac.tree.TreeInfo; -import java.io.IOError; import java.io.IOException; import javax.lang.model.element.Name; @@ -54,7 +53,7 @@ static String getSourceForNode(Tree node, TreePath path) { try { source = path.getCompilationUnit().getSourceFile().getCharContent(false); } catch (IOException e) { - throw new IOError(e); + throw new RuntimeException(e); } return source.subSequence(getStartPosition(node), getEndPosition(node, path)) .toString(); diff --git a/palantir-java-format/src/main/java/com/palantir/javaformat/java/java14/Java14InputAstVisitor.java b/palantir-java-format/src/main/java/com/palantir/javaformat/java/java14/Java14InputAstVisitor.java index 00b26de9a..db2599b7e 100644 --- a/palantir-java-format/src/main/java/com/palantir/javaformat/java/java14/Java14InputAstVisitor.java +++ b/palantir-java-format/src/main/java/com/palantir/javaformat/java/java14/Java14InputAstVisitor.java @@ -105,7 +105,7 @@ public Void visitBindingPattern(BindingPatternTree node, Void unused) { Name name = (Name) invoke(BINDING_PATTERN_TREE_GET_BINDING, node); visitBindingPattern(/* modifiers= */ null, type, name); } else { - throw new LinkageError( + throw new RuntimeException( "BindingPatternTree must have either getVariable() or both getType() and getBinding()," + " but does not"); } @@ -155,7 +155,7 @@ public Void visitClass(ClassTree tree, Void unused) { visitRecordDeclaration(tree); break; default: - throw new AssertionError(tree.getKind()); + throw new IllegalArgumentException(tree.getKind().name()); } return null; } @@ -305,7 +305,7 @@ public Void visitCase(CaseTree node, Void unused) { builder.guessToken(";"); break; default: - throw new AssertionError(node.getCaseKind()); + throw new IllegalArgumentException(node.getCaseKind().name()); } return null; } @@ -337,7 +337,7 @@ private static Object invoke(Method m, Object target) { try { return m.invoke(target); } catch (ReflectiveOperationException e) { - throw new LinkageError(e.getMessage(), e); + throw new RuntimeException(e.getMessage(), e); } } } diff --git a/palantir-java-format/src/main/java/com/palantir/javaformat/java/javadoc/JavadocFormatter.java b/palantir-java-format/src/main/java/com/palantir/javaformat/java/javadoc/JavadocFormatter.java index ebdae55ff..4c4aefe15 100644 --- a/palantir-java-format/src/main/java/com/palantir/javaformat/java/javadoc/JavadocFormatter.java +++ b/palantir-java-format/src/main/java/com/palantir/javaformat/java/javadoc/JavadocFormatter.java @@ -137,7 +137,7 @@ private String render(List input, int blockIndent) { case OPTIONAL_LINE_BREAK: break; default: - throw new AssertionError(token.getType()); + throw new IllegalArgumentException(token.getType().name()); } } throw new IllegalStateException(); diff --git a/palantir-java-format/src/main/java/com/palantir/javaformat/java/javadoc/JavadocWriter.java b/palantir-java-format/src/main/java/com/palantir/javaformat/java/javadoc/JavadocWriter.java index 4725f4309..548398d20 100644 --- a/palantir-java-format/src/main/java/com/palantir/javaformat/java/javadoc/JavadocWriter.java +++ b/palantir-java-format/src/main/java/com/palantir/javaformat/java/javadoc/JavadocWriter.java @@ -26,7 +26,6 @@ import static com.palantir.javaformat.java.javadoc.Token.Type.LIST_ITEM_OPEN_TAG; import static com.palantir.javaformat.java.javadoc.Token.Type.PARAGRAPH_OPEN_TAG; -import com.google.common.base.Strings; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Ordering; @@ -394,7 +393,7 @@ private int innerIndent() { // If this is a hotspot, keep a String of many spaces around, and call append(string, start, end). private void appendSpaces(int count) { - output.append(Strings.repeat(" ", count)); + output.append(" ".repeat(count)); } /** diff --git a/palantir-java-format/src/main/java/com/palantir/javaformat/java/javadoc/Token.java b/palantir-java-format/src/main/java/com/palantir/javaformat/java/javadoc/Token.java index bdcebbd91..5fa390ca1 100644 --- a/palantir-java-format/src/main/java/com/palantir/javaformat/java/javadoc/Token.java +++ b/palantir-java-format/src/main/java/com/palantir/javaformat/java/javadoc/Token.java @@ -83,9 +83,9 @@ enum Type { * one, start a new line, and write the second. Hence, the token acts as an optional line break. */ OPTIONAL_LINE_BREAK, - /** The start of a {@code {@...}} construct such as {@code {@code foo}}, that is: {@code. */ + /** The start of a {@code {\@...}} construct such as {@code {\@code foo}}, that is: {@code. */ INLINE_TAG_OPEN, - /** The end of a {@code {@...}} construct such as {@code {@code foo}}, i.e. a closing brace {@code }}. */ + /** The end of a {@code {\@...}} construct such as {@code {\@code foo}}, i.e. a closing brace {\@code }}. */ INLINE_TAG_CLOSE, /** * Anything else: {@code foo}, {@code } etc. {@link JavadocLexer} sometimes creates adjacent literal tokens, diff --git a/palantir-java-format/src/test/java/com/palantir/javaformat/java/JavadocFormattingTest.java b/palantir-java-format/src/test/java/com/palantir/javaformat/java/JavadocFormattingTest.java index f9a652697..774746977 100644 --- a/palantir-java-format/src/test/java/com/palantir/javaformat/java/JavadocFormattingTest.java +++ b/palantir-java-format/src/test/java/com/palantir/javaformat/java/JavadocFormattingTest.java @@ -1159,9 +1159,10 @@ public void unicodeEscapesNotReplaced() { } @Test + @SuppressWarnings("UnicodeEscape") public void unicodeEscapesNotInterpretedBug() { /* - * In theory, \u003C should be treated exactly like <, and so too should the escaped versions of + * In theory, "\u003C" should be treated exactly like <, and so too should the escaped versions of * @, *, and other special chars. We don't recognize that, though, so we don't put what is * effectively "

" on a new line. */ @@ -1212,7 +1213,7 @@ public void doesNotBreakLink() { } /** - * Test that a long {@code {@link #foo(many, arguments)}} while keeping {@code @link} and {@code foo(many} on the + * Test that a long {@code "{\@link #foo(many, arguments)}"} while keeping {@code @link} and {@code foo(many} on the * same line. */ @Test