8331879: Clean up non-standard use of /// comments in java.base

Reviewed-by: naoto, iris, darcy
This commit is contained in:
Jonathan Gibbons 2024-05-31 22:16:35 +00:00
parent 2cae9a0397
commit 10eb1cb639
25 changed files with 117 additions and 117 deletions

View File

@ -27,7 +27,7 @@
# new warning is added to javac, it can be temporarily added to the
# disabled warnings list.
#
DISABLED_WARNINGS_java += dangling-doc-comments
# DISABLED_WARNINGS_java +=
DOCLINT += -Xdoclint:all/protected \
'-Xdoclint/package:java.*,javax.*'

View File

@ -181,9 +181,9 @@ public abstract class ClassValue<T> {
map.changeEntry(this, value);
}
/// --------
/// Implementation...
/// --------
//| --------
//| Implementation...
//| --------
/** Return the cache, if it exists, else a dummy empty cache. */
private static Entry<?>[] getCacheCarefully(Class<?> type) {
@ -535,9 +535,9 @@ public abstract class ClassValue<T> {
addToCache(classValue, e);
}
/// --------
/// Cache management.
/// --------
//| --------
//| Cache management.
//| --------
// Statics do not need synchronization.

View File

@ -1068,7 +1068,7 @@ public final class String
return Arrays.copyOf(dst, dp);
}
//////////////////////////////// utf8 ////////////////////////////////////
//------------------------------ utf8 ------------------------------------
/**
* Decodes ASCII from the source byte array into the destination
@ -4806,7 +4806,7 @@ public final class String
System.arraycopy(buffer, offset, buffer, offset + copied, limit - copied);
}
////////////////////////////////////////////////////////////////
//--------------------------------------------------------------
/**
* Copy character bytes from this string into dst starting at dstBegin.

View File

@ -94,7 +94,7 @@ import java.util.function.IntFunction;
*/
// public
interface ConstantGroup {
/// Access
//--- Access
/**
* Returns the number of constants in this group.
@ -148,7 +148,7 @@ interface ConstantGroup {
*/
boolean isPresent(int index);
/// Views
//--- Views
/**
* Create a view on this group as a {@link List} view.
@ -182,7 +182,7 @@ interface ConstantGroup {
return new AbstractConstantGroup.SubGroup(this, start, end);
}
/// Bulk operations
//--- Bulk operations
/**
* Copy a sequence of constant values into a given buffer.

View File

@ -46,20 +46,20 @@ class MethodHandleNatives {
private MethodHandleNatives() { } // static only
/// MemberName support
//--- MemberName support
static native void init(MemberName self, Object ref);
static native void expand(MemberName self);
static native MemberName resolve(MemberName self, Class<?> caller, int lookupMode,
boolean speculativeResolve) throws LinkageError, ClassNotFoundException;
/// Field layout queries parallel to jdk.internal.misc.Unsafe:
//--- Field layout queries parallel to jdk.internal.misc.Unsafe:
static native long objectFieldOffset(MemberName self); // e.g., returns vmindex
static native long staticFieldOffset(MemberName self); // e.g., returns vmindex
static native Object staticFieldBase(MemberName self); // e.g., returns clazz
static native Object getMemberVMInfo(MemberName self); // returns {vmindex,vmtarget}
/// CallSite support
//--- CallSite support
/** Tell the JVM that we need to change the target of a CallSite. */
static native void setCallSiteTargetNormal(CallSite site, MethodHandle target);

View File

@ -93,7 +93,7 @@ public class MethodHandles {
// See IMPL_LOOKUP below.
//// Method handle creation from ordinary methods.
//--- Method handle creation from ordinary methods.
/**
* Returns a {@link Lookup lookup object} with
@ -3745,7 +3745,7 @@ return mh1;
return new InfoFromMemberName(this, member, refKind);
}
/// Helper methods, all package-private.
//--- Helper methods, all package-private.
MemberName resolveOrFail(byte refKind, Class<?> refc, String name, Class<?> type) throws NoSuchFieldException, IllegalAccessException {
checkSymbolicClass(refc); // do this before attempting to resolve
@ -4639,7 +4639,7 @@ return mh1;
}
/// method handle invocation (reflective style)
//--- method handle invocation (reflective style)
/**
* Produces a method handle which will invoke any method handle of the
@ -4822,7 +4822,7 @@ return invoker;
return type.invokers().basicInvoker();
}
/// method handle modification (creation from other method handles)
//--- method handle modification (creation from other method handles)
/**
* Produces a method handle which adapts the type of the

View File

@ -1133,7 +1133,7 @@ class MethodType
}
}
/// Queries which have to do with the bytecode architecture
//--- Queries which have to do with the bytecode architecture
/** Reports the number of JVM stack slots required to invoke a method
* of this type. Note that (for historical reasons) the JVM requires
@ -1302,7 +1302,7 @@ class MethodType
}
}
/// Serialization.
//--- Serialization.
/**
* There are no serializable fields for {@code MethodType}.

View File

@ -354,9 +354,9 @@ public class GregorianCalendar extends Calendar {
* accurate.
*/
//////////////////
//----------------
// Class Variables
//////////////////
//----------------
/**
* Value of the {@code ERA} field indicating
@ -513,9 +513,9 @@ public class GregorianCalendar extends Calendar {
// The default value of gregorianCutover.
static final long DEFAULT_GREGORIAN_CUTOVER = -12219292800000L;
/////////////////////
//-------------------
// Instance Variables
/////////////////////
//-------------------
/**
* The point at which the Gregorian calendar rules are used, measured in
@ -579,9 +579,9 @@ public class GregorianCalendar extends Calendar {
*/
private transient int[] originalFields;
///////////////
//-------------
// Constructors
///////////////
//-------------
/**
* Constructs a default {@code GregorianCalendar} using the current time
@ -748,9 +748,9 @@ public class GregorianCalendar extends Calendar {
gdate = gcal.newCalendarDate(getZone());
}
/////////////////
//---------------
// Public methods
/////////////////
//---------------
/**
* Sets the {@code GregorianCalendar} change date. This is the point when the switch
@ -2254,9 +2254,9 @@ public class GregorianCalendar extends Calendar {
return gc.getActualMaximum(WEEK_OF_YEAR);
}
/////////////////////////////
//---------------------------
// Time => Fields computation
/////////////////////////////
//---------------------------
/**
* The fixed date corresponding to gdate. If the value is

View File

@ -166,7 +166,7 @@ class CharPredicates {
JOIN_CONTROL());
}
/////////////////////////////////////////////////////////////////////////////
//---------------------------------------------------------------------------
private static CharPredicate getPosixPredicate(String name, boolean caseIns) {
return switch (name) {
@ -234,7 +234,7 @@ class CharPredicates {
return getPosixPredicate(propName.toUpperCase(Locale.ENGLISH), caseIns);
}
/////////////////////////////////////////////////////////////////////////////
//---------------------------------------------------------------------------
/**
* Returns a predicate matching all characters belong to a named
@ -411,7 +411,7 @@ class CharPredicates {
return (BmpCharPredicate)ch -> ch < 128 && ASCII.isType(ch, ctype);
}
/////////////////////////////////////////////////////////////////////////////
//---------------------------------------------------------------------------
/**
* Posix ASCII variants, not in the lookup map
@ -426,7 +426,7 @@ class CharPredicates {
return ch -> ch < 128 && ASCII.isSpace(ch);
}
/////////////////////////////////////////////////////////////////////////////
//---------------------------------------------------------------------------
/**
* Emoji related binary properties

View File

@ -119,7 +119,7 @@ public final class StringPrepDataReader implements ICUBinary.Authenticate {
* No guarantees are made if a older version is used
* see store.c of gennorm for more information and values
*/
///* dataFormat="SPRP" 0x53, 0x50, 0x52, 0x50 */
// /* dataFormat="SPRP" 0x53, 0x50, 0x52, 0x50 */
private static final byte DATA_FORMAT_ID[] = {(byte)0x53, (byte)0x50,
(byte)0x52, (byte)0x50};
private static final byte DATA_FORMAT_VERSION[] = {(byte)0x3, (byte)0x2,

View File

@ -51,14 +51,14 @@ package jdk.internal.icu.lang;
public final class UCharacterDirection implements UCharacterEnums.ECharacterDirection {
// private constructor =========================================
///CLOVER:OFF
// CLOVER:OFF
/**
* Private constructor to prevent initialization
*/
private UCharacterDirection()
{
}
///CLOVER:ON
// CLOVER:ON
/**
* Gets the name of the argument direction

View File

@ -92,8 +92,8 @@ public final class Unsafe {
return theUnsafe;
}
/// peek and poke operations
/// (compilers should optimize these to memory ops)
//--- peek and poke operations
// (compilers should optimize these to memory ops)
// These work on object fields in the Java heap.
// They will not work on elements of packed arrays.
@ -420,7 +420,7 @@ public final class Unsafe {
/// helper methods for validating various types of objects/values
//--- helper methods for validating various types of objects/values
/**
* Create an exception reflecting that some of the input was invalid
@ -581,7 +581,7 @@ public final class Unsafe {
}
/// wrappers for malloc, realloc, free:
//--- wrappers for malloc, realloc, free:
/**
* Round up allocation size to a multiple of HeapWordSize.
@ -1032,7 +1032,7 @@ public final class Unsafe {
@IntrinsicCandidate
private native void writebackPostSync0();
/// random queries
//--- random queries
/**
* This constant differs from all results that will ever be returned from
@ -1312,7 +1312,7 @@ public final class Unsafe {
*/
public static boolean isWritebackEnabled() { return DATA_CACHE_LINE_FLUSH_SIZE != 0; }
/// random trusted operations from JNI:
//--- random trusted operations from JNI:
/**
* Tells the VM to define a class, without security checks. By default, the

View File

@ -94,9 +94,9 @@ public interface Attributes
{
////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------
// Indexed access.
////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------
/**
@ -191,9 +191,9 @@ public interface Attributes
////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------
// Name-based query.
////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------
/**

View File

@ -348,9 +348,9 @@ public class InputSource {
////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------
// Internal state.
////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------
private String publicId;
private String systemId;

View File

@ -174,9 +174,9 @@ public class SAXException extends Exception {
//////////////////////////////////////////////////////////////////////
//--------------------------------------------------------------------
// Internal state.
//////////////////////////////////////////////////////////////////////
//--------------------------------------------------------------------
@java.io.Serial
private static final ObjectStreamField[] serialPersistentFields = {

View File

@ -62,9 +62,9 @@ package jdk.internal.org.xml.sax;
public class SAXParseException extends SAXException {
//////////////////////////////////////////////////////////////////////
//--------------------------------------------------------------------
// Constructors.
//////////////////////////////////////////////////////////////////////
//--------------------------------------------------------------------
/**
@ -274,9 +274,9 @@ public class SAXParseException extends SAXException {
return buf.toString();
}
//////////////////////////////////////////////////////////////////////
//--------------------------------------------------------------------
// Internal state.
//////////////////////////////////////////////////////////////////////
//--------------------------------------------------------------------
/**

View File

@ -85,9 +85,9 @@ public interface XMLReader
{
////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------
// Configuration.
////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------
/**
@ -236,9 +236,9 @@ public interface XMLReader
////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------
// Event handlers.
////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------
/**
@ -350,9 +350,9 @@ public interface XMLReader
////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------
// Parsing.
////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------
/**
* Parse an XML document.

View File

@ -85,9 +85,9 @@ public class DefaultHandler
{
////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------
// Default implementation of the EntityResolver interface.
////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------
/**
* Resolve an external entity.
@ -118,9 +118,9 @@ public class DefaultHandler
////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------
// Default implementation of DTDHandler interface.
////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------
/**
@ -170,9 +170,9 @@ public class DefaultHandler
////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------
// Default implementation of ContentHandler interface.
////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------
/**
@ -416,9 +416,9 @@ public class DefaultHandler
////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------
// Default implementation of the ErrorHandler interface.
////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------
/**

View File

@ -201,9 +201,9 @@ class ClassFileAssembler implements ClassFileConstants {
}
}
///////////////
//-----------//
// Constants //
///////////////
//-----------//
public void opc_aconst_null() {
emitByte(opc_aconst_null);
@ -222,9 +222,9 @@ class ClassFileAssembler implements ClassFileConstants {
incStack();
}
/////////////////////////////////////
//---------------------------------//
// Local variable loads and stores //
/////////////////////////////////////
//---------------------------------//
public void opc_iload_0() {
emitByte(opc_iload_0);
@ -383,9 +383,9 @@ class ClassFileAssembler implements ClassFileConstants {
decStack();
}
////////////////////////
//--------------------//
// Stack manipulation //
////////////////////////
//--------------------//
public void opc_pop() {
emitByte(opc_pop);
@ -406,9 +406,9 @@ class ClassFileAssembler implements ClassFileConstants {
emitByte(opc_swap);
}
///////////////////////////////
//---------------------------//
// Widening conversions only //
///////////////////////////////
//---------------------------//
public void opc_i2l() {
emitByte(opc_i2l);
@ -434,9 +434,9 @@ class ClassFileAssembler implements ClassFileConstants {
emitByte(opc_f2d);
}
//////////////////
//--------------//
// Control flow //
//////////////////
//--------------//
public void opc_ifeq(short bciOffset) {
emitByte(opc_ifeq);
@ -514,9 +514,9 @@ class ClassFileAssembler implements ClassFileConstants {
decStack();
}
/////////////////////////
//---------------------//
// Return instructions //
/////////////////////////
//---------------------//
public void opc_ireturn() {
emitByte(opc_ireturn);
@ -548,9 +548,9 @@ class ClassFileAssembler implements ClassFileConstants {
setStack(0);
}
//////////////////////
//------------------//
// Field operations //
//////////////////////
//------------------//
public void opc_getstatic(short fieldIndex, int fieldSizeInStackSlots) {
emitByte(opc_getstatic);
@ -576,9 +576,9 @@ class ClassFileAssembler implements ClassFileConstants {
setStack(getStack() - fieldSizeInStackSlots - 1);
}
////////////////////////
//--------------------//
// Method invocations //
////////////////////////
//--------------------//
/** Long and double arguments and return types count as 2 arguments;
other values count as 1. */
@ -627,17 +627,17 @@ class ClassFileAssembler implements ClassFileConstants {
setStack(getStack() - numArgs - 1 + numReturnValues);
}
//////////////////
//--------------//
// Array length //
//////////////////
//--------------//
public void opc_arraylength() {
emitByte(opc_arraylength);
}
/////////
//-----//
// New //
/////////
//-----//
public void opc_new(short classIndex) {
emitByte(opc_new);
@ -645,18 +645,18 @@ class ClassFileAssembler implements ClassFileConstants {
incStack();
}
////////////
//--------//
// Athrow //
////////////
//--------//
public void opc_athrow() {
emitByte(opc_athrow);
setStack(1);
}
//////////////////////////////
//--------------------------//
// Checkcast and instanceof //
//////////////////////////////
//--------------------------//
/** Assumes the checkcast succeeds */
public void opc_checkcast(short classIndex) {

View File

@ -136,14 +136,14 @@ public class PropertiesDefaultHandler extends DefaultHandler {
}
}
////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------
// Validate while parsing
////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------
static final String ALLOWED_ELEMENTS = "comment, entry";
static final String ALLOWED_COMMENT = "comment";
////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------
// Handler methods
////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------
StringBuilder buf = new StringBuilder();
boolean sawRoot = false; // whether a valid root element exists
boolean sawComment = false;

View File

@ -65,7 +65,7 @@ public class ValueConversions {
return caches;
}
/// Converting references to values.
//--- Converting references to values.
// There are several levels of this unboxing conversions:
// no conversions: exactly Integer.valueOf, etc.
@ -222,7 +222,7 @@ public class ValueConversions {
private static final Integer ZERO_INT = 0, ONE_INT = 1;
/// Primitive conversions
//--- Primitive conversions
/**
* Produce a Number which represents the given value {@code x}
* according to the primitive type of the given wrapper {@code wrap}.
@ -274,7 +274,7 @@ public class ValueConversions {
return (int) x;
}
/// Converting primitives to references
//--- Converting primitives to references
static Integer boxInteger(int x) {
return x;
@ -336,7 +336,7 @@ public class ValueConversions {
throw new IllegalArgumentException("cannot find box adapter for " + wrap);
}
/// Constant functions
//--- Constant functions
static void ignore(Object x) {
// no value to return; this is an unbox of null
@ -360,7 +360,7 @@ public class ValueConversions {
}
/// Primitive conversions.
//--- Primitive conversions.
// These are supported directly by the JVM, usually by a single instruction.
// In the case of narrowing to a subword, there may be a pair of instructions.
// In the case of booleans, there may be a helper routine to manage a 1-bit value.

View File

@ -128,7 +128,7 @@ public enum Wrapper {
static int other(int slots) { return slots << SLOT_SHIFT; }
}
/// format queries:
//--- format queries:
/** How many bits are in the wrapped value? Returns 0 for OBJECT or VOID. */
public int bitWidth() { return (format >> Format.SIZE_SHIFT) & Format.SIZE_MASK; }

View File

@ -35,18 +35,18 @@ import sun.util.locale.provider.CalendarDataUtility;
public class BuddhistCalendar extends GregorianCalendar {
//////////////////
//----------------
// Class Variables
//////////////////
//----------------
@java.io.Serial
private static final long serialVersionUID = -8527488697350388578L;
private static final int BUDDHIST_YEAR_OFFSET = 543;
///////////////
//-------------
// Constructors
///////////////
//-------------
/**
* Constructs a default BuddhistCalendar using the current time
@ -84,9 +84,9 @@ public class BuddhistCalendar extends GregorianCalendar {
super(zone, aLocale);
}
/////////////////
//---------------
// Public methods
/////////////////
//---------------
/**
* Returns {@code "buddhist"} as the calendar type of this Calendar.

View File

@ -67,7 +67,7 @@ import java.util.concurrent.ConcurrentMap;
public abstract sealed class CalendarSystem permits AbstractCalendar {
/////////////////////// Calendar Factory Methods /////////////////////////
//--------------------- Calendar Factory Methods -------------------------
private static volatile boolean initialized;
@ -173,7 +173,7 @@ public abstract sealed class CalendarSystem permits AbstractCalendar {
return (cs == null) ? cal : cs;
}
//////////////////////////////// Calendar API //////////////////////////////////
//------------------------------ Calendar API ----------------------------------
/**
* Returns the name of this calendar system.

View File

@ -115,8 +115,8 @@ public final class Unsafe {
return theUnsafe;
}
/// peek and poke operations
/// (compilers should optimize these to memory ops)
//| peek and poke operations
//| (compilers should optimize these to memory ops)
// These work on object fields in the Java heap.
// They will not work on elements of packed arrays.
@ -648,7 +648,7 @@ public final class Unsafe {
}
/// wrappers for malloc, realloc, free:
//| wrappers for malloc, realloc, free:
/**
* Allocates a new block of native memory, of the given size in bytes. The
@ -858,7 +858,7 @@ public final class Unsafe {
theInternalUnsafe.freeMemory(address);
}
/// random queries
//| random queries
/**
* This constant differs from all results that will ever be returned from
@ -1177,7 +1177,7 @@ public final class Unsafe {
}
/// random trusted operations from JNI:
//| random trusted operations from JNI:
/**
* Allocates an instance but does not run any constructor.