From aee04f221f5a9e521f5fb2b77d7d941d0fb1cb06 Mon Sep 17 00:00:00 2001 From: nbransby Date: Sun, 27 Aug 2023 15:38:20 +0300 Subject: [PATCH] add javadoc generation --- build.gradle.kts | 1 + src/main/java/android/os/Parcelable.java | 3 - src/main/java/android/os/RemoteException.java | 6 +- src/main/java/android/text/Spannable.java | 2 +- src/main/java/android/text/TextUtils.java | 108 +++++++++--------- .../java/android/util/AndroidException.java | 2 +- .../java/android/util/Base64OutputStream.java | 2 +- src/main/java/android/util/Log.java | 12 +- src/main/java/android/util/SparseArray.java | 4 +- .../java/android/util/SparseIntArray.java | 4 +- .../internal/util/GrowingArrayUtils.java | 2 +- src/main/java/org/json/JSONObject.java | 6 +- 12 files changed, 75 insertions(+), 77 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 2c918cf..81e6f17 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -27,6 +27,7 @@ version = project.property("version") as String java { withSourcesJar() + withJavadocJar() sourceCompatibility = JavaVersion.VERSION_11 } diff --git a/src/main/java/android/os/Parcelable.java b/src/main/java/android/os/Parcelable.java index 4f7c21a..21a2716 100644 --- a/src/main/java/android/os/Parcelable.java +++ b/src/main/java/android/os/Parcelable.java @@ -58,7 +58,6 @@ * } */ public interface Parcelable { - /** @hide */ @IntDef(flag = true, prefix = { "PARCELABLE_" }, value = { PARCELABLE_WRITE_RETURN_VALUE, PARCELABLE_ELIDE_DUPLICATES, @@ -82,7 +81,6 @@ public interface Parcelable { * across its inner data members. This flag instructs the inner data * types to omit that data during marshaling. Exact behavior may vary * on a case by case basis. - * @hide */ public static final int PARCELABLE_ELIDE_DUPLICATES = 0x0002; @@ -92,7 +90,6 @@ public interface Parcelable { * marshalled. */ - /** @hide */ @IntDef(flag = true, prefix = { "CONTENTS_" }, value = { CONTENTS_FILE_DESCRIPTOR, }) diff --git a/src/main/java/android/os/RemoteException.java b/src/main/java/android/os/RemoteException.java index 1245ef6..8fe4945 100644 --- a/src/main/java/android/os/RemoteException.java +++ b/src/main/java/android/os/RemoteException.java @@ -30,13 +30,13 @@ public RemoteException(String message) { super(message); } - /** @hide */ + /** */ public RemoteException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { super(message, cause, enableSuppression, writableStackTrace); } - /** {@hide} */ + /** {} */ public RuntimeException rethrowAsRuntimeException() { throw new RuntimeException(this); } @@ -52,7 +52,7 @@ public RuntimeException rethrowAsRuntimeException() { * failure of a call, or any default values returned. For this reason, we * want to strongly throw when there was trouble with the transaction. * - * @hide + * */ public RuntimeException rethrowFromSystemServer() { if (this instanceof DeadObjectException) { diff --git a/src/main/java/android/text/Spannable.java b/src/main/java/android/text/Spannable.java index f2e77c8..298d705 100644 --- a/src/main/java/android/text/Spannable.java +++ b/src/main/java/android/text/Spannable.java @@ -52,7 +52,7 @@ public interface Spannable * * See {@link Spanned} for an explanation of what the flags mean. * - * @hide + * */ default void removeSpan(Object what, int flags) { removeSpan(what); diff --git a/src/main/java/android/text/TextUtils.java b/src/main/java/android/text/TextUtils.java index 25958d9..c151d62 100644 --- a/src/main/java/android/text/TextUtils.java +++ b/src/main/java/android/text/TextUtils.java @@ -48,7 +48,7 @@ public class TextUtils { private static final String ELLIPSIS_NORMAL = "\u2026"; // HORIZONTAL ELLIPSIS (…) private static final String ELLIPSIS_TWO_DOTS = "\u2025"; // TWO DOT LEADER (‥) - /** {@hide} */ + /** {} */ @NonNull public static String getEllipsisString(@NonNull TruncateAt method) { return (method == TruncateAt.END_SMALL) ? ELLIPSIS_TWO_DOTS : ELLIPSIS_NORMAL; @@ -373,8 +373,8 @@ public interface StringSplitter extends Iterable { * A simple string splitter. * *

If the final character in the string to split is the delimiter then no empty string will - * be returned for the empty string after that delimeter. That is, splitting "a,b," on - * comma will return "a", "b", not "a", "b", "". + * be returned for the empty string after that delimeter. That is, splitting "a,b," on + * comma will return "a", "b", not "a", "b", "". */ public static class SimpleStringSplitter implements StringSplitter, Iterator { private String mString; @@ -443,29 +443,29 @@ public static boolean isEmpty(@Nullable CharSequence str) { return str == null || str.length() == 0; } - /** {@hide} */ + /** {} */ public static String nullIfEmpty(@Nullable String str) { return isEmpty(str) ? null : str; } - /** {@hide} */ + /** {} */ public static String emptyIfNull(@Nullable String str) { return str == null ? "" : str; } - /** {@hide} */ + /** {} */ public static String firstNotEmpty(@Nullable String a, @NonNull String b) { return !isEmpty(a) ? a : Preconditions.checkStringNotEmpty(b); } - /** {@hide} */ + /** {} */ public static int length(@Nullable String s) { return isEmpty(s) ? 0 : s.length(); } /** * @return interned string if it's null. - * @hide + * */ public static String safeIntern(String s) { return (s != null) ? s.intern() : null; @@ -577,61 +577,61 @@ public void getChars(int start, int end, char[] dest, int destoff) { private int mEnd; } - /** @hide */ + /** */ public static final int ALIGNMENT_SPAN = 1; - /** @hide */ + /** */ public static final int FIRST_SPAN = ALIGNMENT_SPAN; - /** @hide */ + /** */ public static final int FOREGROUND_COLOR_SPAN = 2; - /** @hide */ + /** */ public static final int RELATIVE_SIZE_SPAN = 3; - /** @hide */ + /** */ public static final int SCALE_X_SPAN = 4; - /** @hide */ + /** */ public static final int STRIKETHROUGH_SPAN = 5; - /** @hide */ + /** */ public static final int UNDERLINE_SPAN = 6; - /** @hide */ + /** */ public static final int STYLE_SPAN = 7; - /** @hide */ + /** */ public static final int BULLET_SPAN = 8; - /** @hide */ + /** */ public static final int QUOTE_SPAN = 9; - /** @hide */ + /** */ public static final int LEADING_MARGIN_SPAN = 10; - /** @hide */ + /** */ public static final int URL_SPAN = 11; - /** @hide */ + /** */ public static final int BACKGROUND_COLOR_SPAN = 12; - /** @hide */ + /** */ public static final int TYPEFACE_SPAN = 13; - /** @hide */ + /** */ public static final int SUPERSCRIPT_SPAN = 14; - /** @hide */ + /** */ public static final int SUBSCRIPT_SPAN = 15; - /** @hide */ + /** */ public static final int ABSOLUTE_SIZE_SPAN = 16; - /** @hide */ + /** */ public static final int TEXT_APPEARANCE_SPAN = 17; - /** @hide */ + /** */ public static final int ANNOTATION = 18; - /** @hide */ + /** */ public static final int SUGGESTION_SPAN = 19; - /** @hide */ + /** */ public static final int SPELL_CHECK_SPAN = 20; - /** @hide */ + /** */ public static final int SUGGESTION_RANGE_SPAN = 21; - /** @hide */ + /** */ public static final int EASY_EDIT_SPAN = 22; - /** @hide */ + /** */ public static final int LOCALE_SPAN = 23; - /** @hide */ + /** */ public static final int TTS_SPAN = 24; - /** @hide */ + /** */ public static final int ACCESSIBILITY_CLICKABLE_SPAN = 25; - /** @hide */ + /** */ public static final int ACCESSIBILITY_URL_SPAN = 26; - /** @hide */ + /** */ public static final int LAST_SPAN = ACCESSIBILITY_URL_SPAN; /** @@ -1069,7 +1069,7 @@ public static void copySpansFrom(Spanned source, int start, int end, * * If copySpans is set, source must be an instance of Spanned. * - * {@hide} + * {} */ @NonNull public static CharSequence toUpperCase(@Nullable Locale locale, @NonNull CharSequence source, @@ -1137,7 +1137,7 @@ public enum TruncateAt { END, MARQUEE, /** - * @hide + * */ END_SMALL } @@ -1195,7 +1195,7 @@ public static CharSequence ellipsize(CharSequence text, * If callback is non-null, it will be called to * report the start and end of the ellipsized range. * - * @hide + * */ public static CharSequence ellipsize(CharSequence text, TextPaint paint, @@ -1383,7 +1383,7 @@ public static CharSequence ellipsize(CharSequence text, * @deprecated Do not use. This is not internationalized, and has known issues * with right-to-left text, languages that have more than one plural form, languages * that use a different character as a comma-like separator, etc. - * Use {@link #listEllipsize} instead. + * Use listEllipsize instead. */ @Deprecated public static CharSequence commaEllipsize(CharSequence text, @@ -1395,7 +1395,7 @@ public static CharSequence commaEllipsize(CharSequence text, } /** - * @hide + * */ @Deprecated public static CharSequence commaEllipsize(CharSequence text, TextPaint p, @@ -1667,7 +1667,7 @@ public static boolean isDigitsOnly(CharSequence str) { } /** - * @hide + * */ public static boolean isPrintableAscii(final char c) { final int asciiFirst = 0x20; @@ -1676,7 +1676,7 @@ public static boolean isPrintableAscii(final char c) { } /** - * @hide + * */ public static boolean isPrintableAsciiOnly(final CharSequence str) { final int len = str.length(); @@ -1822,7 +1822,7 @@ public static int getCapsMode(CharSequence cs, int off, int reqModes) { * Does a comma-delimited list 'delimitedString' contain a certain item? * (without allocating memory) * - * @hide + * */ public static boolean delimitedStringContains( String delimitedString, char delimiter, String item) { @@ -1862,7 +1862,7 @@ public static boolean delimitedStringContains( * @param spanned The Spanned from which spans were extracted * @return A subset of spans where empty spans ({@link Spanned#getSpanStart(Object)} == * {@link Spanned#getSpanEnd(Object)} have been removed. The initial order is preserved - * @hide + * */ @SuppressWarnings("unchecked") public static T[] removeEmptySpans(T[] spans, Spanned spanned, Class klass) { @@ -1901,7 +1901,7 @@ public static T[] removeEmptySpans(T[] spans, Spanned spanned, Class klas * Pack 2 int values into a long, useful as a return value for a range * @see #unpackRangeStartFromLong(long) * @see #unpackRangeEndFromLong(long) - * @hide + * */ public static long packRangeInLong(int start, int end) { return (((long) start) << 32) | end; @@ -1911,7 +1911,7 @@ public static long packRangeInLong(int start, int end) { * Get the start value from a range packed in a long by {@link #packRangeInLong(int, int)} * @see #unpackRangeEndFromLong(long) * @see #packRangeInLong(int, int) - * @hide + * */ public static int unpackRangeStartFromLong(long range) { return (int) (range >>> 32); @@ -1921,7 +1921,7 @@ public static int unpackRangeStartFromLong(long range) { * Get the end value from a range packed in a long by {@link #packRangeInLong(int, int)} * @see #unpackRangeStartFromLong(long) * @see #packRangeInLong(int, int) - * @hide + * */ public static int unpackRangeEndFromLong(long range) { return (int) (range & 0x00000000FFFFFFFFL); @@ -1949,7 +1949,7 @@ public static int unpackRangeEndFromLong(long range) { // /** // * Return localized string representing the given number of selected items. // * -// * @hide +// * // */ // public static CharSequence formatSelectedCount(int count) { // return Resources.getSystem().getQuantityString(R.plurals.selected_count, count, count); @@ -1957,7 +1957,7 @@ public static int unpackRangeEndFromLong(long range) { /** * Returns whether or not the specified spanned text has a style span. - * @hide + * */ public static boolean hasStyleSpan(@NonNull Spanned spanned) { Preconditions.checkArgument(spanned != null); @@ -1976,7 +1976,7 @@ public static boolean hasStyleSpan(@NonNull Spanned spanned) { * {@link NoCopySpan}'s are removed from the copy. Otherwise the given {@code charSequence} is * returned as it is. * - * @hide + * */ @Nullable public static CharSequence trimNoCopySpans(@Nullable CharSequence charSequence) { @@ -1990,7 +1990,7 @@ public static CharSequence trimNoCopySpans(@Nullable CharSequence charSequence) /** * Prepends {@code start} and appends {@code end} to a given {@link StringBuilder} * - * @hide + * */ public static void wrap(StringBuilder builder, String start, String end) { builder.insert(0, start); @@ -2008,7 +2008,7 @@ public static void wrap(StringBuilder builder, String start, String end) { * the length() is smaller than {@link #PARCEL_SAFE_TEXT_LENGTH}. Used for text that is parceled * into a {@link Parcelable}. * - * @hide + * */ @Nullable public static T trimToParcelableSize(@Nullable T text) { @@ -2022,7 +2022,7 @@ public static T trimToParcelableSize(@Nullable T text) * * @param size length of the result, should be greater than 0 * - * @hide + * */ @Nullable public static T trimToSize(@Nullable T text, diff --git a/src/main/java/android/util/AndroidException.java b/src/main/java/android/util/AndroidException.java index d9891fc..4a2f642 100644 --- a/src/main/java/android/util/AndroidException.java +++ b/src/main/java/android/util/AndroidException.java @@ -35,7 +35,7 @@ public AndroidException(Exception cause) { super(cause); } - /** @hide */ + /** */ protected AndroidException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { super(message, cause, enableSuppression, writableStackTrace); diff --git a/src/main/java/android/util/Base64OutputStream.java b/src/main/java/android/util/Base64OutputStream.java index f1cff28..874308b 100644 --- a/src/main/java/android/util/Base64OutputStream.java +++ b/src/main/java/android/util/Base64OutputStream.java @@ -55,7 +55,7 @@ public Base64OutputStream(OutputStream out, int flags) { * constants in {@link Base64} * @param encode true to encode, false to decode * - * @hide + * */ public Base64OutputStream(OutputStream out, int flags, boolean encode) { super(out); diff --git a/src/main/java/android/util/Log.java b/src/main/java/android/util/Log.java index a8408e0..fed6c01 100644 --- a/src/main/java/android/util/Log.java +++ b/src/main/java/android/util/Log.java @@ -225,13 +225,13 @@ public static int println(int priority, String tag, String msg) { return println(LOG_ID_MAIN, priority, tag, msg); } - /** @hide */ public static final int LOG_ID_MAIN = 0; - /** @hide */ public static final int LOG_ID_RADIO = 1; - /** @hide */ public static final int LOG_ID_EVENTS = 2; - /** @hide */ public static final int LOG_ID_SYSTEM = 3; - /** @hide */ public static final int LOG_ID_CRASH = 4; + /** */ public static final int LOG_ID_MAIN = 0; + /** */ public static final int LOG_ID_RADIO = 1; + /** */ public static final int LOG_ID_EVENTS = 2; + /** */ public static final int LOG_ID_SYSTEM = 3; + /** */ public static final int LOG_ID_CRASH = 4; - /** @hide */ @SuppressWarnings("unused") + /** */ @SuppressWarnings("unused") public static int println(int bufID, int priority, String tag, String msg) { FirebasePlatform.firebasePlatform.log(tag + " " + msg); diff --git a/src/main/java/android/util/SparseArray.java b/src/main/java/android/util/SparseArray.java index 837d3c3..49799ca 100644 --- a/src/main/java/android/util/SparseArray.java +++ b/src/main/java/android/util/SparseArray.java @@ -133,7 +133,7 @@ public void delete(int key) { } /** - * @hide + * * Removes the mapping from the specified key, if there was any, returning the old value. */ public E removeReturnOld(int key) { @@ -362,7 +362,7 @@ public int indexOfValue(E value) { * and that multiple keys can map to the same value and this will * find only one of them. *

Note also that this method uses {@code equals} unlike {@code indexOfValue}. - * @hide + * */ public int indexOfValueByValue(E value) { if (mGarbage) { diff --git a/src/main/java/android/util/SparseIntArray.java b/src/main/java/android/util/SparseIntArray.java index 187bbcf..00990b9 100644 --- a/src/main/java/android/util/SparseIntArray.java +++ b/src/main/java/android/util/SparseIntArray.java @@ -186,7 +186,7 @@ public int valueAt(int index) { /** * Directly set the value at a particular index. - * @hide + * */ public void setValueAt(int index, int value) { mValues[index] = value; @@ -242,7 +242,7 @@ public void append(int key, int value) { /** * Provides a copy of keys. * - * @hide + * * */ public int[] copyKeys() { if (size() == 0) { diff --git a/src/main/java/com/android/internal/util/GrowingArrayUtils.java b/src/main/java/com/android/internal/util/GrowingArrayUtils.java index 968d920..344fd3e 100644 --- a/src/main/java/com/android/internal/util/GrowingArrayUtils.java +++ b/src/main/java/com/android/internal/util/GrowingArrayUtils.java @@ -24,7 +24,7 @@ * NOT the number of elements in the array. The current size of the array is always passed in as a * parameter. * - * @hide + * */ public final class GrowingArrayUtils { diff --git a/src/main/java/org/json/JSONObject.java b/src/main/java/org/json/JSONObject.java index fa1fc8f..c59c981 100644 --- a/src/main/java/org/json/JSONObject.java +++ b/src/main/java/org/json/JSONObject.java @@ -38,7 +38,7 @@ * be coerced using {@link Number#intValue() intValue}. Strings * that can be coerced using {@link Double#valueOf(String)} will be, * and then cast to int. - *

  • When the requested type is a long, other {@link Number} types will + *
  • When the requested type is a long, other {@link Number} types will * be coerced using {@link Number#longValue() longValue}. Strings * that can be coerced using {@link Double#valueOf(String)} will be, * and then cast to long. This two-step conversion is lossy for very @@ -320,7 +320,7 @@ public JSONObject accumulate(String name, Object value) throws JSONException { * @throws JSONException if {@code name} is {@code null} or if the mapping for * {@code name} is non-null and is not a {@link JSONArray}. * - * @hide + * */ public JSONObject append(String name, Object value) throws JSONException { Object current = nameValuePairs.get(checkName(name)); @@ -660,7 +660,7 @@ public Iterator keys() { * * See {@link #keys()}. * - * @hide. + * . */ public Set keySet() { return nameValuePairs.keySet();