8322936: Update blessed-modifier-order.sh for default, sealed, and non-sealed

Reviewed-by: erikj, rriggs, martin
This commit is contained in:
Pavel Rappo 2024-01-09 11:36:36 +00:00
parent 7d42aa1513
commit 37a61720b6

View File

@ -1,5 +1,6 @@
#!/bin/bash
#
# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
# Copyright 2015 Google, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
@ -26,12 +27,17 @@ usage() {
echo "$0 DIR ..."
echo "Modifies in place all the java source files found"
echo "in the given directories so that all java language modifiers"
echo "are in the canonical order given by Modifier#toString()."
echo "are in the canonical order."
echo "Tries to get it right even within javadoc comments,"
echo "and even if the list of modifiers spans 2 lines."
echo
echo "See:"
echo "https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Modifier.html#toString-int-"
echo "https://docs.oracle.com/javase/specs/jls/se21/html/jls-8.html#jls-8.1.1"
echo "https://docs.oracle.com/javase/specs/jls/se21/html/jls-8.html#jls-8.3.1"
echo "https://docs.oracle.com/javase/specs/jls/se21/html/jls-8.html#jls-8.4.3"
echo "https://docs.oracle.com/javase/specs/jls/se21/html/jls-8.html#jls-8.8.3"
echo "https://docs.oracle.com/javase/specs/jls/se21/html/jls-9.html#jls-9.1.1"
echo "https://docs.oracle.com/javase/specs/jls/se21/html/jls-9.html#jls-9.4"
echo
echo "Example:"
echo "$0 jdk/src/java.base jdk/test/java/{util,io,lang}"
@ -46,7 +52,7 @@ for dir in "${dirs[@]}"; do [[ -d "$dir" ]] || usage; done
declare -ar modifiers=(
public protected private
abstract static final transient
abstract default static final sealed non-sealed transient
volatile synchronized native strictfp
)
declare -r SAVE_IFS="$IFS"