18
18
import android .os .Looper ;
19
19
import android .text .TextUtils ;
20
20
import androidx .annotation .Nullable ;
21
- import androidx .media3 .common .MediaLibraryInfo ;
22
21
import org .checkerframework .checker .nullness .qual .EnsuresNonNull ;
23
22
import org .checkerframework .dataflow .qual .Pure ;
24
23
@@ -36,7 +35,7 @@ private Assertions() {}
36
35
*/
37
36
@ Pure
38
37
public static void checkArgument (boolean expression ) {
39
- if (MediaLibraryInfo . ASSERTIONS_ENABLED && !expression ) {
38
+ if (!expression ) {
40
39
throw new IllegalArgumentException ();
41
40
}
42
41
}
@@ -51,7 +50,7 @@ public static void checkArgument(boolean expression) {
51
50
*/
52
51
@ Pure
53
52
public static void checkArgument (boolean expression , Object errorMessage ) {
54
- if (MediaLibraryInfo . ASSERTIONS_ENABLED && !expression ) {
53
+ if (!expression ) {
55
54
throw new IllegalArgumentException (String .valueOf (errorMessage ));
56
55
}
57
56
}
@@ -81,7 +80,7 @@ public static int checkIndex(int index, int start, int limit) {
81
80
*/
82
81
@ Pure
83
82
public static void checkState (boolean expression ) {
84
- if (MediaLibraryInfo . ASSERTIONS_ENABLED && !expression ) {
83
+ if (!expression ) {
85
84
throw new IllegalStateException ();
86
85
}
87
86
}
@@ -96,7 +95,7 @@ public static void checkState(boolean expression) {
96
95
*/
97
96
@ Pure
98
97
public static void checkState (boolean expression , Object errorMessage ) {
99
- if (MediaLibraryInfo . ASSERTIONS_ENABLED && !expression ) {
98
+ if (!expression ) {
100
99
throw new IllegalStateException (String .valueOf (errorMessage ));
101
100
}
102
101
}
@@ -113,7 +112,7 @@ public static void checkState(boolean expression, Object errorMessage) {
113
112
@ EnsuresNonNull ({"#1" })
114
113
@ Pure
115
114
public static <T > T checkStateNotNull (@ Nullable T reference ) {
116
- if (MediaLibraryInfo . ASSERTIONS_ENABLED && reference == null ) {
115
+ if (reference == null ) {
117
116
throw new IllegalStateException ();
118
117
}
119
118
return reference ;
@@ -133,7 +132,7 @@ public static <T> T checkStateNotNull(@Nullable T reference) {
133
132
@ EnsuresNonNull ({"#1" })
134
133
@ Pure
135
134
public static <T > T checkStateNotNull (@ Nullable T reference , Object errorMessage ) {
136
- if (MediaLibraryInfo . ASSERTIONS_ENABLED && reference == null ) {
135
+ if (reference == null ) {
137
136
throw new IllegalStateException (String .valueOf (errorMessage ));
138
137
}
139
138
return reference ;
@@ -151,7 +150,7 @@ public static <T> T checkStateNotNull(@Nullable T reference, Object errorMessage
151
150
@ EnsuresNonNull ({"#1" })
152
151
@ Pure
153
152
public static <T > T checkNotNull (@ Nullable T reference ) {
154
- if (MediaLibraryInfo . ASSERTIONS_ENABLED && reference == null ) {
153
+ if (reference == null ) {
155
154
throw new NullPointerException ();
156
155
}
157
156
return reference ;
@@ -171,7 +170,7 @@ public static <T> T checkNotNull(@Nullable T reference) {
171
170
@ EnsuresNonNull ({"#1" })
172
171
@ Pure
173
172
public static <T > T checkNotNull (@ Nullable T reference , Object errorMessage ) {
174
- if (MediaLibraryInfo . ASSERTIONS_ENABLED && reference == null ) {
173
+ if (reference == null ) {
175
174
throw new NullPointerException (String .valueOf (errorMessage ));
176
175
}
177
176
return reference ;
@@ -188,7 +187,7 @@ public static <T> T checkNotNull(@Nullable T reference, Object errorMessage) {
188
187
@ EnsuresNonNull ({"#1" })
189
188
@ Pure
190
189
public static String checkNotEmpty (@ Nullable String string ) {
191
- if (MediaLibraryInfo . ASSERTIONS_ENABLED && TextUtils .isEmpty (string )) {
190
+ if (TextUtils .isEmpty (string )) {
192
191
throw new IllegalArgumentException ();
193
192
}
194
193
return string ;
@@ -207,7 +206,7 @@ public static String checkNotEmpty(@Nullable String string) {
207
206
@ EnsuresNonNull ({"#1" })
208
207
@ Pure
209
208
public static String checkNotEmpty (@ Nullable String string , Object errorMessage ) {
210
- if (MediaLibraryInfo . ASSERTIONS_ENABLED && TextUtils .isEmpty (string )) {
209
+ if (TextUtils .isEmpty (string )) {
211
210
throw new IllegalArgumentException (String .valueOf (errorMessage ));
212
211
}
213
212
return string ;
@@ -221,7 +220,7 @@ public static String checkNotEmpty(@Nullable String string, Object errorMessage)
221
220
*/
222
221
@ Pure
223
222
public static void checkMainThread () {
224
- if (MediaLibraryInfo . ASSERTIONS_ENABLED && Looper .myLooper () != Looper .getMainLooper ()) {
223
+ if (Looper .myLooper () != Looper .getMainLooper ()) {
225
224
throw new IllegalStateException ("Not in applications main thread" );
226
225
}
227
226
}
0 commit comments