diff --git a/sentry-android-core/src/main/java/io/sentry/android/core/InternalSentrySdk.java b/sentry-android-core/src/main/java/io/sentry/android/core/InternalSentrySdk.java index 4ad11399d02..58552c8bcd6 100644 --- a/sentry-android-core/src/main/java/io/sentry/android/core/InternalSentrySdk.java +++ b/sentry-android-core/src/main/java/io/sentry/android/core/InternalSentrySdk.java @@ -51,7 +51,7 @@ public final class InternalSentrySdk { /** - * @return a copy of the current scopes's topmost scope, or null in case the scopes is disabled + * Returns a copy of the current scopes's topmost scope, or null in case the scopes is disabled. */ @Nullable public static IScope getCurrentScope() { diff --git a/sentry-android-core/src/main/java/io/sentry/android/core/SentryAndroidOptions.java b/sentry-android-core/src/main/java/io/sentry/android/core/SentryAndroidOptions.java index 46dc16e0410..959b956578c 100644 --- a/sentry-android-core/src/main/java/io/sentry/android/core/SentryAndroidOptions.java +++ b/sentry-android-core/src/main/java/io/sentry/android/core/SentryAndroidOptions.java @@ -867,8 +867,8 @@ public void setReportHistoricalMemoryLimiterExits( } /** - * @return true if standalone app start tracing is enabled. See {@link - * #setEnableStandaloneAppStartTracing(boolean)} for more details. + * Returns true if standalone app start tracing is enabled. See {@link + * #setEnableStandaloneAppStartTracing(boolean)} for more details. */ @ApiStatus.Experimental public boolean isEnableStandaloneAppStartTracing() { diff --git a/sentry-android-core/src/main/java/io/sentry/android/core/SentryFrameMetrics.java b/sentry-android-core/src/main/java/io/sentry/android/core/SentryFrameMetrics.java index cf2241757ca..2989f10c640 100644 --- a/sentry-android-core/src/main/java/io/sentry/android/core/SentryFrameMetrics.java +++ b/sentry-android-core/src/main/java/io/sentry/android/core/SentryFrameMetrics.java @@ -91,8 +91,9 @@ public SentryFrameMetrics duplicate() { } /** + * Returns the difference between two frame metrics (this minus other). + * * @param other the other frame metrics to compare to, usually the older one - * @return the difference between two frame metrics (this minus other) */ @NotNull public SentryFrameMetrics diffTo(final @NotNull SentryFrameMetrics other) { @@ -105,8 +106,8 @@ public SentryFrameMetrics diffTo(final @NotNull SentryFrameMetrics other) { } /** - * @return true if the frame metrics contain valid data, meaning all values are greater or equal - * to 0 + * Returns true if the frame metrics contain valid data, meaning all values are greater or equal + * to 0. */ public boolean containsValidData() { return slowFrameCount >= 0 diff --git a/sentry-android-core/src/main/java/io/sentry/android/core/SentryFramesDelayResult.java b/sentry-android-core/src/main/java/io/sentry/android/core/SentryFramesDelayResult.java index 724d8446ea8..65e7ab8456c 100644 --- a/sentry-android-core/src/main/java/io/sentry/android/core/SentryFramesDelayResult.java +++ b/sentry-android-core/src/main/java/io/sentry/android/core/SentryFramesDelayResult.java @@ -16,15 +16,13 @@ public SentryFramesDelayResult( } /** - * @return the total frame delay in seconds, or -1 if incalculable (e.g. no frame data available) + * Returns the total frame delay in seconds, or -1 if incalculable (e.g. no frame data available). */ public double getDelaySeconds() { return delaySeconds; } - /** - * @return the number of frames that contributed to the delay (slow + frozen frames) - */ + /** Returns the number of frames that contributed to the delay (slow + frozen frames). */ public int getFramesContributingToDelayCount() { return framesContributingToDelayCount; } diff --git a/sentry-android-core/src/main/java/io/sentry/android/core/anr/AnrCulpritIdentifier.java b/sentry-android-core/src/main/java/io/sentry/android/core/anr/AnrCulpritIdentifier.java index 447cb106ce1..33eb71c9b5f 100644 --- a/sentry-android-core/src/main/java/io/sentry/android/core/anr/AnrCulpritIdentifier.java +++ b/sentry-android-core/src/main/java/io/sentry/android/core/anr/AnrCulpritIdentifier.java @@ -89,8 +89,9 @@ public boolean equals(final Object obj) { } /** + * Returns the most common occurring stacktrace identified as the culprit. + * * @param stacks a list of stack traces to analyze - * @return the most common occurring stacktrace identified as the culprit */ @Nullable public static AggregatedStackTrace identify(final @NotNull List stacks) { diff --git a/sentry-android-core/src/main/java/io/sentry/android/core/internal/util/AndroidConnectionStatusProvider.java b/sentry-android-core/src/main/java/io/sentry/android/core/internal/util/AndroidConnectionStatusProvider.java index 62a212e6dcc..3a694c96566 100644 --- a/sentry-android-core/src/main/java/io/sentry/android/core/internal/util/AndroidConnectionStatusProvider.java +++ b/sentry-android-core/src/main/java/io/sentry/android/core/internal/util/AndroidConnectionStatusProvider.java @@ -304,7 +304,7 @@ private void updateCacheAndNotifyObservers( } } - /** + /* * Check if NetworkCapabilities change is significant for our observers. Only notify for * changes that affect connectivity status or connection type. */ @@ -334,7 +334,7 @@ private boolean isSignificantChange(@Nullable NetworkCapabilities newCapabilitie return false; } - /** Check if capabilities that affect connectivity status changed. */ + /* Check if capabilities that affect connectivity status changed. */ private boolean hasSignificantCapabilityChanges( @NotNull NetworkCapabilities old, @NotNull NetworkCapabilities new_) { // Check capabilities we care about for connectivity determination @@ -348,7 +348,7 @@ private boolean hasSignificantCapabilityChanges( return false; } - /** Check if transport types that affect connection type changed. */ + /* Check if transport types that affect connection type changed. */ private boolean hasSignificantTransportChanges( @NotNull NetworkCapabilities old, @NotNull NetworkCapabilities new_) { // Check transports we care about for connection type determination diff --git a/sentry-android-core/src/main/java/io/sentry/android/core/internal/util/Debouncer.java b/sentry-android-core/src/main/java/io/sentry/android/core/internal/util/Debouncer.java index 8808947c0cc..30ce25cfc8c 100644 --- a/sentry-android-core/src/main/java/io/sentry/android/core/internal/util/Debouncer.java +++ b/sentry-android-core/src/main/java/io/sentry/android/core/internal/util/Debouncer.java @@ -27,8 +27,8 @@ public Debouncer( } /** - * @return true if the execution should be debounced due to maxExecutions executions being made - * within waitTimeMs, otherwise false. + * Returns true if the execution should be debounced due to maxExecutions executions being made + * within waitTimeMs, otherwise false. */ public boolean checkForDebounce() { final long now = timeProvider.getCurrentTimeMillis(); diff --git a/sentry-android-core/src/main/java/io/sentry/android/core/internal/util/ScreenshotUtils.java b/sentry-android-core/src/main/java/io/sentry/android/core/internal/util/ScreenshotUtils.java index 657ba54cbd2..26638222c0e 100644 --- a/sentry-android-core/src/main/java/io/sentry/android/core/internal/util/ScreenshotUtils.java +++ b/sentry-android-core/src/main/java/io/sentry/android/core/internal/util/ScreenshotUtils.java @@ -29,9 +29,7 @@ public class ScreenshotUtils { private static final long CAPTURE_TIMEOUT_MS = 1000; // Used by Hybrid SDKs - /** - * @noinspection unused - */ + @SuppressWarnings("unused") public static @Nullable byte[] takeScreenshot( final @NotNull Activity activity, final @NotNull ILogger logger, @@ -58,8 +56,8 @@ public class ScreenshotUtils { * same way {@link io.sentry.android.core.ScreenshotEventProcessor} does for native errors. * * @see #captureMaskedScreenshot(Activity, SentryAndroidOptions, BuildInfoProvider, boolean) - * @noinspection unused */ + @SuppressWarnings("unused") public static @Nullable byte[] takeMaskedScreenshot( final @NotNull Activity activity, final @NotNull SentryAndroidOptions options, diff --git a/sentry-android-core/src/main/java/io/sentry/android/core/internal/util/SentryFrameMetricsCollector.java b/sentry-android-core/src/main/java/io/sentry/android/core/internal/util/SentryFrameMetricsCollector.java index 2c0ae246558..e20d359d120 100644 --- a/sentry-android-core/src/main/java/io/sentry/android/core/internal/util/SentryFrameMetricsCollector.java +++ b/sentry-android-core/src/main/java/io/sentry/android/core/internal/util/SentryFrameMetricsCollector.java @@ -381,9 +381,7 @@ private void trackCurrentWindow() { } } - /** - * @return the last known time a frame was started, according to the Choreographer - */ + /** Returns the last known time a frame was started, according to the Choreographer. */ public long getLastKnownFrameStartTimeNanos() { // Let's read the choreographer private field to get start timestamp of the frame, which // uses System.nanoTime() under the hood diff --git a/sentry-android-core/src/main/java/io/sentry/android/core/performance/AppStartMetrics.java b/sentry-android-core/src/main/java/io/sentry/android/core/performance/AppStartMetrics.java index a23b9a8720b..f36b3aa5879 100644 --- a/sentry-android-core/src/main/java/io/sentry/android/core/performance/AppStartMetrics.java +++ b/sentry-android-core/src/main/java/io/sentry/android/core/performance/AppStartMetrics.java @@ -120,16 +120,16 @@ public AppStartMetrics() { } /** - * @return the app start span Uses Process.getStartUptimeMillis() as start timestamp, which - * requires API level 24+ + * Returns the app start span. It uses Process.getStartUptimeMillis() as start timestamp, which + * requires API level 24+. */ public @NotNull TimeSpan getAppStartTimeSpan() { return appStartSpan; } /** - * @return the app start span Uses Process.getStartUptimeMillis() as start timestamp, which - * requires API level 24+ + * Returns the app start span. It uses Process.getStartUptimeMillis() as start timestamp, which + * requires API level 24+. */ public @NotNull TimeSpan createProcessInitSpan() { // AppStartSpan and CLASS_LOADED_UPTIME_MS can be modified at any time. @@ -144,11 +144,12 @@ public AppStartMetrics() { } /** - * @return the SDK init time span. Uses ContentProvider/Sdk init time as start timestamp. It's the - * app start fallback below API 24, where the process start time isn't available. - *

Data is filled by either {@link io.sentry.android.core.SentryPerformanceProvider} with a - * fallback to {@link io.sentry.android.core.SentryAndroid}. At least the start timestamp - * should always be set. + * Returns the SDK init time span. Uses ContentProvider/Sdk init time as start timestamp. It's the + * app start fallback below API 24, where the process start time isn't available. + * + *

Data is filled by either {@link io.sentry.android.core.SentryPerformanceProvider} with a + * fallback to {@link io.sentry.android.core.SentryAndroid}. At least the start timestamp should + * always be set. */ public @NotNull TimeSpan getSdkInitTimeSpan() { return sdkInitTimeSpan; @@ -338,8 +339,8 @@ public long getClassLoadedUptimeMs() { } /** - * @return the app start time span if it was started, falls back to the sdk init time span - * otherwise + * Returns the app start time span if it was started, falls back to the sdk init time span + * otherwise. */ public @NotNull TimeSpan getAppStartTimeSpanWithFallback() { // If the app start type was never determined or app wasn't launched in foreground, @@ -464,8 +465,8 @@ public void setCachedStartInfo(final @Nullable ApplicationStartInfo cachedStartI * Called by instrumentation * * @param application The application object where onCreate was called on - * @noinspection unused */ + @SuppressWarnings("unused") public static void onApplicationCreate(final @NotNull Application application) { final long now = SystemClock.uptimeMillis(); @@ -480,8 +481,8 @@ public static void onApplicationCreate(final @NotNull Application application) { * Called by instrumentation * * @param application The application object where onCreate was called on - * @noinspection unused */ + @SuppressWarnings("unused") public static void onApplicationPostCreate(final @NotNull Application application) { final long now = SystemClock.uptimeMillis(); @@ -751,8 +752,8 @@ public void onActivityDestroyed(@NonNull Activity activity) { * Called by instrumentation * * @param contentProvider The content provider where onCreate was called on - * @noinspection unused */ + @SuppressWarnings("unused") public static void onContentProviderCreate(final @NotNull ContentProvider contentProvider) { final long now = SystemClock.uptimeMillis(); @@ -765,8 +766,8 @@ public static void onContentProviderCreate(final @NotNull ContentProvider conten * Called by instrumentation * * @param contentProvider The content provider where onCreate was called on - * @noinspection unused */ + @SuppressWarnings("unused") public static void onContentProviderPostCreate(final @NotNull ContentProvider contentProvider) { final long now = SystemClock.uptimeMillis(); diff --git a/sentry-android-core/src/main/java/io/sentry/android/core/performance/TimeSpan.java b/sentry-android-core/src/main/java/io/sentry/android/core/performance/TimeSpan.java index 5ea785165dc..113ffccd93d 100644 --- a/sentry-android-core/src/main/java/io/sentry/android/core/performance/TimeSpan.java +++ b/sentry-android-core/src/main/java/io/sentry/android/core/performance/TimeSpan.java @@ -36,6 +36,8 @@ public void setup( } /** + * Starts the time span at the given uptime. + * * @param uptimeMs the uptime in ms, provided by {@link SystemClock#uptimeMillis()} */ public void setStartedAt(final long uptimeMs) { @@ -52,6 +54,8 @@ public void stop() { } /** + * Stops the time span at the given uptime. + * * @param uptimeMs the uptime in ms, provided by {@link SystemClock#uptimeMillis()} */ public void setStoppedAt(final long uptimeMs) { @@ -75,23 +79,17 @@ public boolean hasNotStopped() { return stopUptimeMs == 0; } - /** - * @return the start timestamp of this measurement, as uptime, in ms - */ + /** Returns the start timestamp of this measurement, as uptime, in ms. */ public long getStartUptimeMs() { return startUptimeMs; } - /** - * @return the start timestamp of this measurement, unix time, in ms - */ + /** Returns the start timestamp of this measurement, unix time, in ms. */ public long getStartTimestampMs() { return startUnixTimeMs; } - /** - * @return the start timestamp of this measurement, unix time - */ + /** Returns the start timestamp of this measurement, unix time. */ public @Nullable SentryDate getStartTimestamp() { if (hasStarted()) { return new SentryLongDate(DateUtils.millisToNanos(getStartTimestampMs())); @@ -99,17 +97,15 @@ public long getStartTimestampMs() { return null; } - /** - * @return the start timestamp of this measurement, unix time, in seconds - */ + /** Returns the start timestamp of this measurement, unix time, in seconds. */ public double getStartTimestampSecs() { return DateUtils.millisToSeconds(startUnixTimeMs); } /** - * @return the projected stop timestamp of this measurement, based on the start timestamp and the - * duration. If the time span was not started 0 is returned, if the time span was not stopped - * the start timestamp is returned. + * Returns the projected stop timestamp of this measurement, based on the start timestamp and the + * duration. If the time span was not started 0 is returned, if the time span was not stopped the + * start timestamp is returned. */ public long getProjectedStopTimestampMs() { if (hasStarted()) { @@ -119,7 +115,8 @@ public long getProjectedStopTimestampMs() { } /** - * @return the projected stop timestamp + * Returns the projected stop timestamp of this measurement, unix time, in seconds. + * * @see #getProjectedStopTimestampMs() */ public double getProjectedStopTimestampSecs() { @@ -127,7 +124,8 @@ public double getProjectedStopTimestampSecs() { } /** - * @return the projected stop timestamp + * Returns the projected stop timestamp of this measurement, or null if it was not stopped. + * * @see #getProjectedStopTimestampMs() */ public @Nullable SentryDate getProjectedStopTimestamp() { @@ -137,9 +135,7 @@ public double getProjectedStopTimestampSecs() { return null; } - /** - * @return the duration of this measurement, in ms, or 0 if no end time is set - */ + /** Returns the duration of this measurement, in ms, or 0 if no end time is set. */ public long getDurationMs() { if (hasStopped()) { return stopUptimeMs - startUptimeMs;