Skip to content

Commit

Permalink
Change ReflectionException superclass to RuntimeException.
Browse files Browse the repository at this point in the history
For tests scenarios, making ReflectionException a checked exception is cumbersome
and provides limited value.

Most users of the axt.internal.platform.reflect APIs just
catch and rethrow ReflectionException in a RuntimeException.

PiperOrigin-RevId: 707236659
  • Loading branch information
brettchabot authored and copybara-androidxtest committed Dec 17, 2024
1 parent 2174b69 commit eb37e0e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions runner/monitor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
**API Changes**

* Update to minSdkVersion 21
* Make ReflectionException a RuntimeException

**Breaking API Changes**

Expand Down
2 changes: 1 addition & 1 deletion runner/monitor/java/androidx/test/api/current_internal.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ package androidx.test.internal.platform.os {

package androidx.test.internal.platform.reflect {

@RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public class ReflectionException extends java.lang.Exception {
@RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public class ReflectionException extends java.lang.RuntimeException {
}

@RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public class ReflectiveField<T> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* @hide
*/
@RestrictTo(Scope.LIBRARY_GROUP)
public class ReflectionException extends Exception {
public class ReflectionException extends RuntimeException {

ReflectionException(Exception cause) {
super("Reflection access failed", cause);
Expand Down

0 comments on commit eb37e0e

Please sign in to comment.