Restrict exception constructors
Our exception type is public, to allow API clients to catch it. The
constructors do not need to be part of the API, and do not need to be
called by anything other than the VM API implementation, so don't mark
them public. This allows us to add or remove constructors in the
future.
Bug: 261037705
Bug: 261089785
Test: Everything still builds
Test: atest MicrodroidTests
Change-Id: I31656353a82e13a9d26ca10b9c35458b47909b90
diff --git a/javalib/api/system-current.txt b/javalib/api/system-current.txt
index d14d83c..592a751 100644
--- a/javalib/api/system-current.txt
+++ b/javalib/api/system-current.txt
@@ -88,9 +88,6 @@
}
public class VirtualMachineException extends java.lang.Exception {
- ctor public VirtualMachineException(@Nullable String);
- ctor public VirtualMachineException(@Nullable String, @Nullable Throwable);
- ctor public VirtualMachineException(@Nullable Throwable);
}
public class VirtualMachineManager {
diff --git a/javalib/src/android/system/virtualmachine/VirtualMachineException.java b/javalib/src/android/system/virtualmachine/VirtualMachineException.java
index 985eb70..9948fda 100644
--- a/javalib/src/android/system/virtualmachine/VirtualMachineException.java
+++ b/javalib/src/android/system/virtualmachine/VirtualMachineException.java
@@ -26,15 +26,15 @@
*/
@SystemApi
public class VirtualMachineException extends Exception {
- public VirtualMachineException(@Nullable String message) {
+ VirtualMachineException(@Nullable String message) {
super(message);
}
- public VirtualMachineException(@Nullable String message, @Nullable Throwable cause) {
+ VirtualMachineException(@Nullable String message, @Nullable Throwable cause) {
super(message, cause);
}
- public VirtualMachineException(@Nullable Throwable cause) {
+ VirtualMachineException(@Nullable Throwable cause) {
super(cause);
}
}