From 48e2df9e2118599e5d6252c00cc91c52e556337d Mon Sep 17 00:00:00 2001 From: jjg Date: Thu, 13 Sep 2012 14:29:36 -0700 Subject: [PATCH] 7177970: fix issues in langtools doc comments Reviewed-by: mcimadamore --- src/share/classes/com/sun/javadoc/Doc.java | 6 ++-- .../com/sun/javadoc/ExecutableMemberDoc.java | 10 +++---- src/share/classes/com/sun/javadoc/Tag.java | 4 +-- .../sun/source/tree/LambdaExpressionTree.java | 6 ++-- .../classes/com/sun/source/tree/LineMap.java | 6 ++-- .../com/sun/source/util/TreeScanner.java | 4 +-- .../formats/html/HtmlDocletWriter.java | 12 ++++---- .../toolkit/builders/ClassBuilder.java | 4 +-- .../com/sun/tools/javac/code/Symtab.java | 3 +- .../com/sun/tools/javac/code/Type.java | 2 +- .../com/sun/tools/javac/comp/Check.java | 5 +++- .../com/sun/tools/javac/comp/Enter.java | 4 +-- .../com/sun/tools/javac/comp/Lower.java | 20 ++++++------- .../com/sun/tools/javac/comp/Resolve.java | 8 ++--- .../com/sun/tools/javac/jvm/ByteCodes.java | 4 +-- .../com/sun/tools/javac/jvm/CRTable.java | 2 +- .../com/sun/tools/javac/jvm/ClassFile.java | 6 ++-- .../classes/com/sun/tools/javac/jvm/Code.java | 15 ++++++---- .../classes/com/sun/tools/javac/jvm/Gen.java | 4 +-- .../sun/tools/javac/parser/JavacParser.java | 29 +++++++++++++++---- .../com/sun/tools/javac/parser/Lexer.java | 5 ++-- .../JavacProcessingEnvironment.java | 3 +- .../com/sun/tools/javac/tree/JCTree.java | 2 +- .../com/sun/tools/javac/tree/Pretty.java | 3 +- .../com/sun/tools/javac/util/Bits.java | 10 +++---- .../com/sun/tools/javac/util/Context.java | 7 +++-- .../com/sun/tools/javac/util/Name.java | 11 +++---- .../com/sun/tools/javac/util/Position.java | 16 +++++----- .../com/sun/tools/javadoc/Comment.java | 4 +-- .../com/sun/tools/javadoc/DocImpl.java | 4 +-- .../com/sun/tools/javadoc/FieldDocImpl.java | 4 +-- .../com/sun/tools/javah/JavahTask.java | 2 +- .../javax/lang/model/util/Elements.java | 6 ++-- .../classes/javax/tools/JavaCompiler.java | 4 +-- 34 files changed, 134 insertions(+), 101 deletions(-) diff --git a/src/share/classes/com/sun/javadoc/Doc.java b/src/share/classes/com/sun/javadoc/Doc.java index ae2e933f..c258eeb6 100644 --- a/src/share/classes/com/sun/javadoc/Doc.java +++ b/src/share/classes/com/sun/javadoc/Doc.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -76,7 +76,7 @@ public interface Doc extends Comparable { /** * Return comment as an array of tags. Includes inline tags - * (i.e. {@link reference} tags) but not + * (i.e. {@link reference} tags) but not * block tags. * Each section of plain text is represented as a {@link Tag} * of {@linkplain Tag#kind() kind} "Text". @@ -90,7 +90,7 @@ public interface Doc extends Comparable { /** * Return the first sentence of the comment as an array of tags. * Includes inline tags - * (i.e. {@link reference} tags) but not + * (i.e. {@link reference} tags) but not * block tags. * Each section of plain text is represented as a {@link Tag} * of {@linkplain Tag#kind() kind} "Text". diff --git a/src/share/classes/com/sun/javadoc/ExecutableMemberDoc.java b/src/share/classes/com/sun/javadoc/ExecutableMemberDoc.java index 55fdeabf..f073a588 100644 --- a/src/share/classes/com/sun/javadoc/ExecutableMemberDoc.java +++ b/src/share/classes/com/sun/javadoc/ExecutableMemberDoc.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -90,8 +90,8 @@ public interface ExecutableMemberDoc extends MemberDoc { /** * Return the throws tags in this method. * - * @return an array of ThrowTag containing all @exception - * and @throws tags. + * @return an array of ThrowTag containing all @exception + * and @throws tags. */ ThrowsTag[] throwsTags(); @@ -99,7 +99,7 @@ public interface ExecutableMemberDoc extends MemberDoc { * Return the param tags in this method, excluding the type * parameter tags. * - * @return an array of ParamTag containing all @param tags + * @return an array of ParamTag containing all @param tags * corresponding to the parameters of this method. */ ParamTag[] paramTags(); @@ -107,7 +107,7 @@ public interface ExecutableMemberDoc extends MemberDoc { /** * Return the type parameter tags in this method. * - * @return an array of ParamTag containing all @param tags + * @return an array of ParamTag containing all @param tags * corresponding to the type parameters of this method. * @since 1.5 */ diff --git a/src/share/classes/com/sun/javadoc/Tag.java b/src/share/classes/com/sun/javadoc/Tag.java index fdc54c4c..96faac5a 100644 --- a/src/share/classes/com/sun/javadoc/Tag.java +++ b/src/share/classes/com/sun/javadoc/Tag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -127,7 +127,7 @@ public interface Tag { /** * Return the first sentence of the comment as an array of tags. * Includes inline tags - * (i.e. {@link reference} tags) but not + * (i.e. {@link reference} tags) but not * block tags. * Each section of plain text is represented as a {@link Tag} * of kind "Text". diff --git a/src/share/classes/com/sun/source/tree/LambdaExpressionTree.java b/src/share/classes/com/sun/source/tree/LambdaExpressionTree.java index 61ae45ae..163f113e 100644 --- a/src/share/classes/com/sun/source/tree/LambdaExpressionTree.java +++ b/src/share/classes/com/sun/source/tree/LambdaExpressionTree.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,11 +31,11 @@ import java.util.List; * A tree node for a lambda expression. * * For example: - *
+ * 
{@code
  *   ()->{}
  *   (List ls)->ls.size()
  *   (x,y)-> { return x + y; }
- * 
+ * }
*/ public interface LambdaExpressionTree extends ExpressionTree { diff --git a/src/share/classes/com/sun/source/tree/LineMap.java b/src/share/classes/com/sun/source/tree/LineMap.java index 058d3bb3..609a3b10 100644 --- a/src/share/classes/com/sun/source/tree/LineMap.java +++ b/src/share/classes/com/sun/source/tree/LineMap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,8 +38,8 @@ public interface LineMap { * @param line line number (beginning at 1) * @return position of first character in line * @throws IndexOutOfBoundsException - * if lineNumber < 1 - * if lineNumber > no. of lines + * if {@code lineNumber < 1} + * if {@code lineNumber > no. of lines} */ long getStartPosition(long line); diff --git a/src/share/classes/com/sun/source/util/TreeScanner.java b/src/share/classes/com/sun/source/util/TreeScanner.java index 3619f313..0fcdf825 100644 --- a/src/share/classes/com/sun/source/util/TreeScanner.java +++ b/src/share/classes/com/sun/source/util/TreeScanner.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -52,7 +52,7 @@ import com.sun.source.tree.*; * *

Here is an example to count the number of identifier nodes in a tree: *

- *   class CountIdentifiers extends TreeScanner {
+ *   class CountIdentifiers extends TreeScanner<Integer,Void> {
  *      {@literal @}Override
  *      public Integer visitIdentifier(IdentifierTree node, Void p) {
  *          return 1;
diff --git a/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java b/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java
index e0b39b93..59d77610 100644
--- a/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1260,7 +1260,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
     /**
      * Print the Html table tag for the index summary tables. The table tag
      * printed is
-     * <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
+     * {@code  }
      */
     public void tableIndexSummary() {
         table(1, "100%", 3, 0);
@@ -1548,7 +1548,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
     }
 
     /**
-     * Print the heading in Html <H2> format.
+     * Print the heading in Html {@literal 

} format. * * @param str The Header string. */ @@ -2416,15 +2416,15 @@ public class HtmlDocletWriter extends HtmlDocWriter { *

* Here is the algorithm used to fix the link: *

- * <relative link> => docRoot + <relative path to file> + <relative link> + * {@literal => docRoot + + } *

* For example, suppose com.sun.javadoc.RootDoc has this link: - * <a href="package-summary.html">The package Page</a> + * {@literal The package Page } *

* If this link appeared in the index, we would redirect * the link like this: * - * <a href="./com/sun/javadoc/package-summary.html">The package Page</a> + * {@literal The package Page} * * @param doc the Doc object whose documentation is being written. * @param text the text being written. diff --git a/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java b/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java index e0c8d7b1..d050cab7 100644 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -125,7 +125,7 @@ public class ClassBuilder extends AbstractBuilder { } /** - * Handles the <ClassDoc> tag. + * Handles the {@literal } tag. * * @param node the XML element that specifies which components to document * @param contentTree the content tree to which the documentation will be added diff --git a/src/share/classes/com/sun/tools/javac/code/Symtab.java b/src/share/classes/com/sun/tools/javac/code/Symtab.java index 7b35ad53..32a9170d 100644 --- a/src/share/classes/com/sun/tools/javac/code/Symtab.java +++ b/src/share/classes/com/sun/tools/javac/code/Symtab.java @@ -251,7 +251,8 @@ public class Symtab { } /** Enter a binary operation, as above but with two opcodes, - * which get encoded as (opcode1 << ByteCodeTags.preShift) + opcode2. + * which get encoded as + * {@code (opcode1 << ByteCodeTags.preShift) + opcode2 }. * @param opcode1 First opcode. * @param opcode2 Second opcode. */ diff --git a/src/share/classes/com/sun/tools/javac/code/Type.java b/src/share/classes/com/sun/tools/javac/code/Type.java index b4094d41..86d2c631 100644 --- a/src/share/classes/com/sun/tools/javac/code/Type.java +++ b/src/share/classes/com/sun/tools/javac/code/Type.java @@ -692,7 +692,7 @@ public class Type implements PrimitiveType { /** A class type is raw if it misses some * of its type parameter sections. * After validation, this is equivalent to: - * allparams.isEmpty() && tsym.type.allparams.nonEmpty(); + * {@code allparams.isEmpty() && tsym.type.allparams.nonEmpty(); } */ public boolean isRaw() { return diff --git a/src/share/classes/com/sun/tools/javac/comp/Check.java b/src/share/classes/com/sun/tools/javac/comp/Check.java index 62725872..d3a9e3bc 100644 --- a/src/share/classes/com/sun/tools/javac/comp/Check.java +++ b/src/share/classes/com/sun/tools/javac/comp/Check.java @@ -2373,9 +2373,12 @@ public class Check { tree.accept(new AnnotationValidator()); } - /** Annotation types are restricted to primitives, String, an + /** + * {@literal + * Annotation types are restricted to primitives, String, an * enum, an annotation, Class, Class, Class, arrays of the preceding. + * } */ void validateAnnotationType(JCTree restype) { // restype may be null if an error occurred, so don't bother validating it diff --git a/src/share/classes/com/sun/tools/javac/comp/Enter.java b/src/share/classes/com/sun/tools/javac/comp/Enter.java index 22e0c923..00534ce9 100644 --- a/src/share/classes/com/sun/tools/javac/comp/Enter.java +++ b/src/share/classes/com/sun/tools/javac/comp/Enter.java @@ -77,12 +77,12 @@ import static com.sun.tools.javac.code.Kinds.*; * *

Classes migrate from one phase to the next via queues: * - *

+ *  
{@literal
  *  class enter -> (Enter.uncompleted)         --> member enter (1)
  *              -> (MemberEnter.halfcompleted) --> member enter (2)
  *              -> (Todo)                      --> attribute
  *                                              (only for toplevel classes)
- *  
+ * }
* *

This is NOT part of any supported API. * If you write code that depends on this, you do so at your own risk. diff --git a/src/share/classes/com/sun/tools/javac/comp/Lower.java b/src/share/classes/com/sun/tools/javac/comp/Lower.java index 1745da37..f7674052 100644 --- a/src/share/classes/com/sun/tools/javac/comp/Lower.java +++ b/src/share/classes/com/sun/tools/javac/comp/Lower.java @@ -1449,7 +1449,7 @@ public class Lower extends TreeTranslator { return access(v, make.at(pos).Ident(v), null, false); } - /** Construct a tree simulating the expression . + /** Construct a tree simulating the expression {@code C.this}. * @param pos The source code position to be used for the tree. * @param c The qualifier class. */ @@ -1623,7 +1623,7 @@ public class Lower extends TreeTranslator { } /** Construct a tree that represents the outer instance - * . Never pick the current `this'. + * {@code C.this}. Never pick the current `this'. * @param pos The source code position to be used for the tree. * @param c The qualifier class. */ @@ -1661,7 +1661,7 @@ public class Lower extends TreeTranslator { } /** Construct a tree that represents the closest outer instance - * such that the given symbol is a member of C. + * {@code C.this} such that the given symbol is a member of C. * @param pos The source code position to be used for the tree. * @param sym The accessed symbol. * @param preciseMatch should we accept a type that is a subtype of @@ -1713,7 +1713,7 @@ public class Lower extends TreeTranslator { return tree; } - /** Return tree simulating the assignment , where + /** Return tree simulating the assignment {@code this.name = name}, where * name is the name of a free variable. */ JCStatement initField(int pos, Name name) { @@ -1730,7 +1730,7 @@ public class Lower extends TreeTranslator { make.Ident(rhs)).setType(lhs.erasure(types))); } - /** Return tree simulating the assignment . + /** Return tree simulating the assignment {@code this.this$n = this$n}. */ JCStatement initOuterThis(int pos) { VarSymbol rhs = outerThisStack.head; @@ -3194,7 +3194,7 @@ public class Lower extends TreeTranslator { * * (where arrayexpr is of an array type) gets translated to * - *

+         * 
{@code
          *     for ( { arraytype #arr = arrayexpr;
          *             int #len = array.length;
          *             int #i = 0; };
@@ -3202,7 +3202,7 @@ public class Lower extends TreeTranslator {
          *         T v = arr$[#i];
          *         stmt;
          *     }
-         * 
+ * }
* * where #arr, #len, and #i are freshly named synthetic local variables. */ @@ -3272,14 +3272,14 @@ public class Lower extends TreeTranslator { * for ( T v : coll ) stmt ; * * - * (where coll implements Iterable) gets translated to + * (where coll implements {@code Iterable}) gets translated to * - *
+         * 
{@code
          *     for ( Iterator #i = coll.iterator(); #i.hasNext(); ) {
          *         T v = (T) #i.next();
          *         stmt;
          *     }
-         * 
+ * }
* * where #i is a freshly named synthetic local variable. */ diff --git a/src/share/classes/com/sun/tools/javac/comp/Resolve.java b/src/share/classes/com/sun/tools/javac/comp/Resolve.java index f2e574f3..b10f4b7d 100644 --- a/src/share/classes/com/sun/tools/javac/comp/Resolve.java +++ b/src/share/classes/com/sun/tools/javac/comp/Resolve.java @@ -1516,7 +1516,7 @@ public class Resolve { /** If `sym' is a bad symbol: report error and return errSymbol * else pass through unchanged, * additional arguments duplicate what has been used in trying to find the - * symbol (--> flyweight pattern). This improves performance since we + * symbol {@literal (--> flyweight pattern)}. This improves performance since we * expect misses to happen frequently. * * @param sym The symbol that was found, or a ResolveError. @@ -1903,9 +1903,9 @@ public class Resolve { /** This method scans all the constructor symbol in a given class scope - * assuming that the original scope contains a constructor of the kind: - * Foo(X x, Y y), where X,Y are class type-variables declared in Foo, + * {@code Foo(X x, Y y)}, where X,Y are class type-variables declared in Foo, * a method check is executed against the modified constructor type: - * Foo(X x, Y y). This is crucial in order to enable diamond + * {@code Foo(X x, Y y)}. This is crucial in order to enable diamond * inference. The inferred return type of the synthetic constructor IS * the inferred type for the diamond operator. */ @@ -2223,7 +2223,7 @@ public class Resolve { /** * A name designates an operator if it consists - * of a non-empty sequence of operator symbols +-~!/*%&|^<>= + * of a non-empty sequence of operator symbols {@literal +-~!/*%&|^<>= } */ boolean isOperator(Name name) { int i = 0; diff --git a/src/share/classes/com/sun/tools/javac/jvm/ByteCodes.java b/src/share/classes/com/sun/tools/javac/jvm/ByteCodes.java index 81085cd1..7cd696e8 100644 --- a/src/share/classes/com/sun/tools/javac/jvm/ByteCodes.java +++ b/src/share/classes/com/sun/tools/javac/jvm/ByteCodes.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -277,7 +277,7 @@ public interface ByteCodes { /** Shift and mask constants for shifting prefix instructions. * a pair of instruction codes such as LCMP ; IFEQ is encoded - * in Symtab as (LCMP << preShift) + IFEQ. + * in Symtab as {@literal (LCMP << preShift) + IFEQ }. */ int preShift = 9; int preMask = (1 << preShift) - 1; diff --git a/src/share/classes/com/sun/tools/javac/jvm/CRTable.java b/src/share/classes/com/sun/tools/javac/jvm/CRTable.java index 2fb1c038..85a4df64 100644 --- a/src/share/classes/com/sun/tools/javac/jvm/CRTable.java +++ b/src/share/classes/com/sun/tools/javac/jvm/CRTable.java @@ -162,7 +162,7 @@ implements CRTFlags { } /** Source file positions in CRT are integers in the format: - * line-number << LINESHIFT + column-number + * {@literal line-number << LINESHIFT + column-number } */ private int encodePosition(int pos, Position.LineMap lineMap, Log log) { int line = lineMap.getLineNumber(pos); diff --git a/src/share/classes/com/sun/tools/javac/jvm/ClassFile.java b/src/share/classes/com/sun/tools/javac/jvm/ClassFile.java index 966a84d5..96ff0557 100644 --- a/src/share/classes/com/sun/tools/javac/jvm/ClassFile.java +++ b/src/share/classes/com/sun/tools/javac/jvm/ClassFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,7 +45,7 @@ import com.sun.tools.javac.util.Name; * classSignature ::= [ typeparams ] supertype { interfacetype } * *

The type syntax in signatures is extended as follows: - *

+ *  
{@literal
  *     type       ::= ... | classtype | methodtype | typevar
  *     classtype  ::= classsig { '.' classsig }
  *     classig    ::= 'L' name [typeargs] ';'
@@ -54,7 +54,7 @@ import com.sun.tools.javac.util.Name;
  *     typeargs   ::= '<' type { type } '>'
  *     typeparams ::= '<' typeparam { typeparam } '>'
  *     typeparam  ::= name ':' type
- *  
+ * }
*

This class defines constants used in class files as well * as routines to convert between internal ``.'' and external ``/'' * separators in class names. diff --git a/src/share/classes/com/sun/tools/javac/jvm/Code.java b/src/share/classes/com/sun/tools/javac/jvm/Code.java index 59f0fc16..ff78df2d 100644 --- a/src/share/classes/com/sun/tools/javac/jvm/Code.java +++ b/src/share/classes/com/sun/tools/javac/jvm/Code.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -122,7 +122,7 @@ public class Code { /*---------- internal fields: --------------- */ - /** Are we generating code with jumps >= 32K? + /** Are we generating code with jumps ≥ 32K? */ public boolean fatcode; @@ -1077,13 +1077,15 @@ public class Code { while (cp % incr != 0) emitop0(nop); } - /** Place a byte into code at address pc. Pre: pc + 1 <= cp. + /** Place a byte into code at address pc. + * Pre: {@literal pc + 1 <= cp }. */ private void put1(int pc, int op) { code[pc] = (byte)op; } - /** Place two bytes into code at address pc. Pre: pc + 2 <= cp. + /** Place two bytes into code at address pc. + * Pre: {@literal pc + 2 <= cp }. */ private void put2(int pc, int od) { // pre: pc + 2 <= cp @@ -1091,7 +1093,8 @@ public class Code { put1(pc+1, od); } - /** Place four bytes into code at address pc. Pre: pc + 4 <= cp. + /** Place four bytes into code at address pc. + * Pre: {@literal pc + 4 <= cp }. */ public void put4(int pc, int od) { // pre: pc + 4 <= cp @@ -1990,7 +1993,7 @@ public class Code { nextreg = max_locals; } - /** End scopes of all variables with registers >= first. + /** End scopes of all variables with registers ≥ first. */ public void endScopes(int first) { int prevNextReg = nextreg; diff --git a/src/share/classes/com/sun/tools/javac/jvm/Gen.java b/src/share/classes/com/sun/tools/javac/jvm/Gen.java index 5759ec60..2919579f 100644 --- a/src/share/classes/com/sun/tools/javac/jvm/Gen.java +++ b/src/share/classes/com/sun/tools/javac/jvm/Gen.java @@ -247,10 +247,10 @@ public class Gen extends JCTree.Visitor { /** Construct a symbol to reflect the qualifying type that should * appear in the byte code as per JLS 13.1. * - * For target >= 1.2: Clone a method with the qualifier as owner (except + * For {@literal target >= 1.2}: Clone a method with the qualifier as owner (except * for those cases where we need to work around VM bugs). * - * For target <= 1.1: If qualified variable or method is defined in a + * For {@literal target <= 1.1}: If qualified variable or method is defined in a * non-accessible class, clone it with the qualifier class as owner. * * @param sym The accessed symbol diff --git a/src/share/classes/com/sun/tools/javac/parser/JavacParser.java b/src/share/classes/com/sun/tools/javac/parser/JavacParser.java index 3fac490b..ec9eecce 100644 --- a/src/share/classes/com/sun/tools/javac/parser/JavacParser.java +++ b/src/share/classes/com/sun/tools/javac/parser/JavacParser.java @@ -670,6 +670,7 @@ public class JavacParser implements Parser { } /** + * {@literal * Expression = Expression1 [ExpressionRest] * ExpressionRest = [AssignmentOperator Expression1] * AssignmentOperator = "=" | "+=" | "-=" | "*=" | "/=" | @@ -679,6 +680,7 @@ public class JavacParser implements Parser { * TypeNoParams = TypeNoParams1 * StatementExpression = Expression * ConstantExpression = Expression + * } */ JCExpression term() { JCExpression t = term1(); @@ -884,9 +886,12 @@ public class JavacParser implements Parser { return opStack; } - /** Expression3 = PrefixOp Expression3 + /** + * Expression3 = PrefixOp Expression3 * | "(" Expr | TypeNoParams ")" Expression3 * | Primary {Selector} {PostfixOp} + * + * {@literal * Primary = "(" Expression ")" * | Literal * | [TypeArguments] THIS [Arguments] @@ -901,6 +906,8 @@ public class JavacParser implements Parser { * | "." ( CLASS | THIS | [TypeArguments] SUPER Arguments | NEW [TypeArguments] InnerCreator ) * ] * | BasicType BracketsOpt "." CLASS + * } + * * PrefixOp = "++" | "--" | "!" | "~" | "+" | "-" * PostfixOp = "++" | "--" * Type3 = Ident { "." Ident } [TypeArguments] {TypeSelector} BracketsOpt @@ -1453,7 +1460,10 @@ public class JavacParser implements Parser { return null; } - /** TypeArguments = "<" TypeArgument {"," TypeArgument} ">" + /** + * {@literal + * TypeArguments = "<" TypeArgument {"," TypeArgument} ">" + * } */ List typeArguments(boolean diamondAllowed) { if (token.kind == LT) { @@ -1490,10 +1500,13 @@ public class JavacParser implements Parser { } } - /** TypeArgument = Type + /** + * {@literal + * TypeArgument = Type * | "?" * | "?" EXTENDS Type {"&" Type} * | "?" SUPER Type + * } */ JCExpression typeArgument() { if (token.kind != QUES) return parseType(); @@ -2991,7 +3004,10 @@ public class JavacParser implements Parser { return ts.toList(); } - /** TypeParametersOpt = ["<" TypeParameter {"," TypeParameter} ">"] + /** + * {@literal + * TypeParametersOpt = ["<" TypeParameter {"," TypeParameter} ">"] + * } */ List typeParametersOpt() { if (token.kind == LT) { @@ -3010,9 +3026,12 @@ public class JavacParser implements Parser { } } - /** TypeParameter = TypeVariable [TypeParameterBound] + /** + * {@literal + * TypeParameter = TypeVariable [TypeParameterBound] * TypeParameterBound = EXTENDS Type {"&" Type} * TypeVariable = Ident + * } */ JCTypeParameter typeParameter() { int pos = token.pos; diff --git a/src/share/classes/com/sun/tools/javac/parser/Lexer.java b/src/share/classes/com/sun/tools/javac/parser/Lexer.java index ed428f83..20248bde 100644 --- a/src/share/classes/com/sun/tools/javac/parser/Lexer.java +++ b/src/share/classes/com/sun/tools/javac/parser/Lexer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -61,7 +61,8 @@ public interface Lexer { /** * Splits the current token in two and return the first (splitted) token. - * For instance '<<<' is splitted into two tokens '<' and '<<' respectively, + * For instance {@literal '<<<'} is split into two tokens + * {@literal '<'} and {@literal '<<'} respectively, * and the latter is returned. */ Token split(); diff --git a/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java b/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java index bee5a985..2e40563f 100644 --- a/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java +++ b/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java @@ -1364,7 +1364,8 @@ public class JavacProcessingEnvironment implements ProcessingEnvironment, Closea * {@inheritdoc} * * Command line options suitable for presenting to annotation - * processors. "-Afoo=bar" should be "-Afoo" => "bar". + * processors. + * {@literal "-Afoo=bar"} should be {@literal "-Afoo" => "bar"}. */ public Map getOptions() { return processorOptions; diff --git a/src/share/classes/com/sun/tools/javac/tree/JCTree.java b/src/share/classes/com/sun/tools/javac/tree/JCTree.java index 6c398a04..fe6c8100 100644 --- a/src/share/classes/com/sun/tools/javac/tree/JCTree.java +++ b/src/share/classes/com/sun/tools/javac/tree/JCTree.java @@ -2010,7 +2010,7 @@ public abstract class JCTree implements Tree, Cloneable, DiagnosticPosition { } /** - * A parameterized type, T<...> + * A parameterized type, {@literal T<...>} */ public static class JCTypeApply extends JCExpression implements ParameterizedTypeTree { public JCExpression clazz; diff --git a/src/share/classes/com/sun/tools/javac/tree/Pretty.java b/src/share/classes/com/sun/tools/javac/tree/Pretty.java index 67b49848..78592156 100644 --- a/src/share/classes/com/sun/tools/javac/tree/Pretty.java +++ b/src/share/classes/com/sun/tools/javac/tree/Pretty.java @@ -256,7 +256,8 @@ public class Pretty extends JCTree.Visitor { return pos; } - /** If type parameter list is non-empty, print it enclosed in "<...>" brackets. + /** If type parameter list is non-empty, print it enclosed in + * {@literal "<...>"} brackets. */ public void printTypeParameters(List trees) throws IOException { if (trees.nonEmpty()) { diff --git a/src/share/classes/com/sun/tools/javac/util/Bits.java b/src/share/classes/com/sun/tools/javac/util/Bits.java index 2fe9ea0b..0c7d2338 100644 --- a/src/share/classes/com/sun/tools/javac/util/Bits.java +++ b/src/share/classes/com/sun/tools/javac/util/Bits.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -127,7 +127,7 @@ public class Bits { (bits[x >>> wordshift] & (1 << (x & wordmask))) != 0; } - /** this set = this set & xs. + /** {@literal this set = this set & xs}. */ public Bits andSet(Bits xs) { sizeTo(xs.bits.length); @@ -179,12 +179,12 @@ public class Bits { return n - (x&1); } - /** Return the index of the least bit position >= x that is set. + /** Return the index of the least bit position ≥ x that is set. * If none are set, returns -1. This provides a nice way to iterate * over the members of a bit set: - *

+     *  
{@code
      *  for (int i = bits.nextBit(0); i>=0; i = bits.nextBit(i+1)) ...
-     *  
+ * }
*/ public int nextBit(int x) { int windex = x >>> wordshift; diff --git a/src/share/classes/com/sun/tools/javac/util/Context.java b/src/share/classes/com/sun/tools/javac/util/Context.java index 8a993d1d..91a4e634 100644 --- a/src/share/classes/com/sun/tools/javac/util/Context.java +++ b/src/share/classes/com/sun/tools/javac/util/Context.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -115,7 +115,10 @@ public class Context { * The underlying map storing the data. * We maintain the invariant that this table contains only * mappings of the form - * Key -> T or Key -> Factory */ + * {@literal Key -> T } + * or + * {@literal Key -> Factory } + */ private Map,Object> ht = new HashMap,Object>(); /** Set the factory for the key in this context. */ diff --git a/src/share/classes/com/sun/tools/javac/util/Name.java b/src/share/classes/com/sun/tools/javac/util/Name.java index ddd9340d..ad1cd7a4 100644 --- a/src/share/classes/com/sun/tools/javac/util/Name.java +++ b/src/share/classes/com/sun/tools/javac/util/Name.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,28 +43,28 @@ public abstract class Name implements javax.lang.model.element.Name { } /** - * @inheritDoc + * {@inheritDoc} */ public boolean contentEquals(CharSequence cs) { return toString().equals(cs.toString()); } /** - * @inheritDoc + * {@inheritDoc} */ public int length() { return toString().length(); } /** - * @inheritDoc + * {@inheritDoc} */ public char charAt(int index) { return toString().charAt(index); } /** - * @inheritDoc + * {@inheritDoc} */ public CharSequence subSequence(int start, int end) { return toString().subSequence(start, end); @@ -142,6 +142,7 @@ public abstract class Name implements javax.lang.model.element.Name { /** Return the string representation of this name. */ + @Override public String toString() { return Convert.utf2string(getByteArray(), getByteOffset(), getByteLength()); } diff --git a/src/share/classes/com/sun/tools/javac/util/Position.java b/src/share/classes/com/sun/tools/javac/util/Position.java index d11afc11..27146718 100644 --- a/src/share/classes/com/sun/tools/javac/util/Position.java +++ b/src/share/classes/com/sun/tools/javac/util/Position.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -79,12 +79,12 @@ public class Position { } /** Encode line and column numbers in an integer as: - * line-number << LINESHIFT + column-number - * {@link Position.NOPOS represents an undefined position. + * {@code line-number << LINESHIFT + column-number }. + * {@link Position.NOPOS} represents an undefined position. * * @param line number of line (first is 1) * @param col number of character on line (first is 1) - * @return an encoded position or {@link Position.NOPOS + * @return an encoded position or {@link Position.NOPOS} * if the line or column number is too big to * represent in the encoded format * @throws IllegalArgumentException if line or col is less than 1 @@ -107,8 +107,8 @@ public class Position { * @param line number of line (first is 1) * @return position of first character in line * @throws ArrayIndexOutOfBoundsException - * if lineNumber < 1 - * if lineNumber > no. of lines + * if {@code lineNumber < 1} + * if {@code lineNumber > no. of lines} */ int getStartPosition(int line); @@ -119,8 +119,8 @@ public class Position { * * @return position of character * @throws ArrayIndexOutOfBoundsException - * if line < 1 - * if line > no. of lines + * if {@code line < 1} + * if {@code line > no. of lines} */ int getPosition(int line, int column); diff --git a/src/share/classes/com/sun/tools/javadoc/Comment.java b/src/share/classes/com/sun/tools/javadoc/Comment.java index 648f55e0..2c27e8b4 100644 --- a/src/share/classes/com/sun/tools/javadoc/Comment.java +++ b/src/share/classes/com/sun/tools/javadoc/Comment.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -386,7 +386,7 @@ class Comment { } /** - * Recursively search for the string "{@" followed by + * Recursively search for the characters '{', '@', followed by * name of inline tag and white space, * if found * return the index of the text following the white space. diff --git a/src/share/classes/com/sun/tools/javadoc/DocImpl.java b/src/share/classes/com/sun/tools/javadoc/DocImpl.java index 25b480a7..0936194d 100644 --- a/src/share/classes/com/sun/tools/javadoc/DocImpl.java +++ b/src/share/classes/com/sun/tools/javadoc/DocImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -138,7 +138,7 @@ public abstract class DocImpl implements Doc, Comparable { /** * Return the see also tags in this Doc item. * - * @return an array of SeeTag containing all @see tags. + * @return an array of SeeTag containing all @see tags. */ public SeeTag[] seeTags() { return comment().seeTags(); diff --git a/src/share/classes/com/sun/tools/javadoc/FieldDocImpl.java b/src/share/classes/com/sun/tools/javadoc/FieldDocImpl.java index 3a865589..c11c84bc 100644 --- a/src/share/classes/com/sun/tools/javadoc/FieldDocImpl.java +++ b/src/share/classes/com/sun/tools/javadoc/FieldDocImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -241,7 +241,7 @@ public class FieldDocImpl extends MemberDocImpl implements FieldDoc { * Return the serialField tags in this FieldDocImpl item. * * @return an array of SerialFieldTagImpl containing all - * @serialField tags. + * @serialField tags. */ public SerialFieldTag[] serialFieldTags() { return comment().serialFieldTags(); diff --git a/src/share/classes/com/sun/tools/javah/JavahTask.java b/src/share/classes/com/sun/tools/javah/JavahTask.java index 4abbc276..16c3be89 100644 --- a/src/share/classes/com/sun/tools/javah/JavahTask.java +++ b/src/share/classes/com/sun/tools/javah/JavahTask.java @@ -79,7 +79,7 @@ import com.sun.tools.javac.main.CommandLine; /** * Javah generates support files for native methods. - * Parse commandline options & Invokes javadoc to execute those commands. + * Parse commandline options and invokes javadoc to execute those commands. * *

This is NOT part of any supported API. * If you write code that depends on this, you do so at your own diff --git a/src/share/classes/javax/lang/model/util/Elements.java b/src/share/classes/javax/lang/model/util/Elements.java index 035fcfb3..2167f5a9 100644 --- a/src/share/classes/javax/lang/model/util/Elements.java +++ b/src/share/classes/javax/lang/model/util/Elements.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -79,12 +79,12 @@ public interface Elements { * *

A documentation comment of an element is a comment that * begins with "{@code /**}" , ends with a separate - * "*/", and immediately precedes the element, + * "*/", and immediately precedes the element, * ignoring white space. Therefore, a documentation comment * contains at least three"{@code *}" characters. The text * returned for the documentation comment is a processed form of * the comment as it appears in source code. The leading "{@code - * /**}" and trailing "*/" are removed. For lines + * /**}" and trailing "*/" are removed. For lines * of the comment starting after the initial "{@code /**}", * leading white space characters are discarded as are any * consecutive "{@code *}" characters appearing after the white diff --git a/src/share/classes/javax/tools/JavaCompiler.java b/src/share/classes/javax/tools/JavaCompiler.java index 126719b5..f5b572d1 100644 --- a/src/share/classes/javax/tools/JavaCompiler.java +++ b/src/share/classes/javax/tools/JavaCompiler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -137,7 +137,7 @@ import javax.annotation.processing.Processor; * StandardJavaFileManager fileManager = compiler.getStandardFileManager(diagnostics, null, null); * compiler.getTask(null, fileManager, diagnostics, null, null, compilationUnits).call(); * - * for (Diagnostic diagnostic : diagnostics.getDiagnostics()) + * for ({@code Diagnostic} diagnostic : diagnostics.getDiagnostics()) * System.out.format("Error on line %d in %s%n", * diagnostic.getLineNumber(), * diagnostic.getSource().toUri()); -- GitLab