Skip to content

Commit bf79e5f

Browse files
committed
Add missing TruffleBoundary.
1 parent 69ffe92 commit bf79e5f

File tree

1 file changed

+12
-2
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/zipimporter

1 file changed

+12
-2
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/zipimporter/PZipImporter.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ public PZipImporter(LazyPythonClass cls, PDict zipDirectoryCache, String separat
125125
private SearchOrderEntry[] defineSearchOrder() {
126126
return new SearchOrderEntry[]{
127127
new SearchOrderEntry(joinStrings(separator, "__init__.py"),
128-
EnumSet.of(EntryType.IS_PACKAGE, EntryType.IS_SOURCE)),
129-
new SearchOrderEntry(".py", EnumSet.of(EntryType.IS_SOURCE))
128+
enumSetOf(EntryType.IS_PACKAGE, EntryType.IS_SOURCE)),
129+
new SearchOrderEntry(".py", enumSetOf(EntryType.IS_SOURCE))
130130
};
131131
}
132132

@@ -135,6 +135,16 @@ private static String joinStrings(String a, String b) {
135135
return a + b;
136136
}
137137

138+
@TruffleBoundary
139+
private static <E extends Enum<E>> EnumSet<E> enumSetOf(E e1) {
140+
return EnumSet.of(e1);
141+
}
142+
143+
@TruffleBoundary
144+
private static <E extends Enum<E>> EnumSet<E> enumSetOf(E e1, E e2) {
145+
return EnumSet.of(e1, e2);
146+
}
147+
138148
public PDict getZipDirectoryCache() {
139149
return moduleZipDirectoryCache;
140150
}

0 commit comments

Comments
 (0)