1818import android .os .Looper ;
1919import android .text .TextUtils ;
2020import androidx .annotation .Nullable ;
21- import androidx .media3 .common .MediaLibraryInfo ;
2221import org .checkerframework .checker .nullness .qual .EnsuresNonNull ;
2322import org .checkerframework .dataflow .qual .Pure ;
2423
@@ -36,7 +35,7 @@ private Assertions() {}
3635 */
3736 @ Pure
3837 public static void checkArgument (boolean expression ) {
39- if (MediaLibraryInfo . ASSERTIONS_ENABLED && !expression ) {
38+ if (!expression ) {
4039 throw new IllegalArgumentException ();
4140 }
4241 }
@@ -51,7 +50,7 @@ public static void checkArgument(boolean expression) {
5150 */
5251 @ Pure
5352 public static void checkArgument (boolean expression , Object errorMessage ) {
54- if (MediaLibraryInfo . ASSERTIONS_ENABLED && !expression ) {
53+ if (!expression ) {
5554 throw new IllegalArgumentException (String .valueOf (errorMessage ));
5655 }
5756 }
@@ -81,7 +80,7 @@ public static int checkIndex(int index, int start, int limit) {
8180 */
8281 @ Pure
8382 public static void checkState (boolean expression ) {
84- if (MediaLibraryInfo . ASSERTIONS_ENABLED && !expression ) {
83+ if (!expression ) {
8584 throw new IllegalStateException ();
8685 }
8786 }
@@ -96,7 +95,7 @@ public static void checkState(boolean expression) {
9695 */
9796 @ Pure
9897 public static void checkState (boolean expression , Object errorMessage ) {
99- if (MediaLibraryInfo . ASSERTIONS_ENABLED && !expression ) {
98+ if (!expression ) {
10099 throw new IllegalStateException (String .valueOf (errorMessage ));
101100 }
102101 }
@@ -113,7 +112,7 @@ public static void checkState(boolean expression, Object errorMessage) {
113112 @ EnsuresNonNull ({"#1" })
114113 @ Pure
115114 public static <T > T checkStateNotNull (@ Nullable T reference ) {
116- if (MediaLibraryInfo . ASSERTIONS_ENABLED && reference == null ) {
115+ if (reference == null ) {
117116 throw new IllegalStateException ();
118117 }
119118 return reference ;
@@ -133,7 +132,7 @@ public static <T> T checkStateNotNull(@Nullable T reference) {
133132 @ EnsuresNonNull ({"#1" })
134133 @ Pure
135134 public static <T > T checkStateNotNull (@ Nullable T reference , Object errorMessage ) {
136- if (MediaLibraryInfo . ASSERTIONS_ENABLED && reference == null ) {
135+ if (reference == null ) {
137136 throw new IllegalStateException (String .valueOf (errorMessage ));
138137 }
139138 return reference ;
@@ -151,7 +150,7 @@ public static <T> T checkStateNotNull(@Nullable T reference, Object errorMessage
151150 @ EnsuresNonNull ({"#1" })
152151 @ Pure
153152 public static <T > T checkNotNull (@ Nullable T reference ) {
154- if (MediaLibraryInfo . ASSERTIONS_ENABLED && reference == null ) {
153+ if (reference == null ) {
155154 throw new NullPointerException ();
156155 }
157156 return reference ;
@@ -171,7 +170,7 @@ public static <T> T checkNotNull(@Nullable T reference) {
171170 @ EnsuresNonNull ({"#1" })
172171 @ Pure
173172 public static <T > T checkNotNull (@ Nullable T reference , Object errorMessage ) {
174- if (MediaLibraryInfo . ASSERTIONS_ENABLED && reference == null ) {
173+ if (reference == null ) {
175174 throw new NullPointerException (String .valueOf (errorMessage ));
176175 }
177176 return reference ;
@@ -188,7 +187,7 @@ public static <T> T checkNotNull(@Nullable T reference, Object errorMessage) {
188187 @ EnsuresNonNull ({"#1" })
189188 @ Pure
190189 public static String checkNotEmpty (@ Nullable String string ) {
191- if (MediaLibraryInfo . ASSERTIONS_ENABLED && TextUtils .isEmpty (string )) {
190+ if (TextUtils .isEmpty (string )) {
192191 throw new IllegalArgumentException ();
193192 }
194193 return string ;
@@ -207,7 +206,7 @@ public static String checkNotEmpty(@Nullable String string) {
207206 @ EnsuresNonNull ({"#1" })
208207 @ Pure
209208 public static String checkNotEmpty (@ Nullable String string , Object errorMessage ) {
210- if (MediaLibraryInfo . ASSERTIONS_ENABLED && TextUtils .isEmpty (string )) {
209+ if (TextUtils .isEmpty (string )) {
211210 throw new IllegalArgumentException (String .valueOf (errorMessage ));
212211 }
213212 return string ;
@@ -221,7 +220,7 @@ public static String checkNotEmpty(@Nullable String string, Object errorMessage)
221220 */
222221 @ Pure
223222 public static void checkMainThread () {
224- if (MediaLibraryInfo . ASSERTIONS_ENABLED && Looper .myLooper () != Looper .getMainLooper ()) {
223+ if (Looper .myLooper () != Looper .getMainLooper ()) {
225224 throw new IllegalStateException ("Not in applications main thread" );
226225 }
227226 }
0 commit comments