File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -229,9 +229,8 @@ public final class PythonLanguage extends TruffleLanguage<PythonContext> {
229
229
// a dash follows after the opt flag pair
230
230
static final int MIME_KIND_START = MIME_PREFIX .length () + OPT_FLAGS_LEN + 1 ;
231
231
232
- static {
232
+ private static boolean mimeTypesComplete ( ArrayList < String > mimeJavaStrings ) {
233
233
ArrayList <String > mimeTypes = new ArrayList <>();
234
- ArrayList <String > mimeJavaStrings = new ArrayList <>();
235
234
FutureFeature [] all = FutureFeature .values ();
236
235
for (int flagset = 0 ; flagset < (1 << all .length ); ++flagset ) {
237
236
int flags = 0 ;
@@ -248,9 +247,12 @@ public final class PythonLanguage extends TruffleLanguage<PythonContext> {
248
247
}
249
248
}
250
249
HashSet <String > currentMimeTypes = new HashSet <>(List .of (PythonLanguage .class .getAnnotation (Registration .class ).characterMimeTypes ()));
251
- if (!currentMimeTypes .containsAll (mimeTypes )) {
252
- assert false : "Expected all of {" + String .join (", " , mimeJavaStrings ) + "} in the PythonLanguage characterMimeTypes" ;
253
- }
250
+ return currentMimeTypes .containsAll (mimeTypes );
251
+ }
252
+
253
+ static {
254
+ ArrayList <String > mimeJavaStrings = new ArrayList <>();
255
+ assert mimeTypesComplete (mimeJavaStrings ) : "Expected all of {" + String .join (", " , mimeJavaStrings ) + "} in the PythonLanguage characterMimeTypes" ;
254
256
}
255
257
256
258
public static final String MIME_TYPE_BYTECODE = "application/x-python-bytecode" ;
You can’t perform that action at this time.
0 commit comments