Skip to content

Commit 3086811

Browse files
Ensure TypeSymbols.getRuntimePackage receives a type and not a name
Using `Symbol<Type>` makes this checked at compilation time.
1 parent 6b97134 commit 3086811

File tree

1 file changed

+5
-1
lines changed
  • espresso-shared/src/com.oracle.truffle.espresso.classfile/src/com/oracle/truffle/espresso/classfile/descriptors

1 file changed

+5
-1
lines changed

espresso-shared/src/com.oracle.truffle.espresso.classfile/src/com/oracle/truffle/espresso/classfile/descriptors/TypeSymbols.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,11 @@ public static Symbol<Name> toClassNameEntry(Symbol<Type> type, ParserConstantPoo
454454
return symbolify.apply(className);
455455
}
456456

457-
public static ByteSequence getRuntimePackage(ByteSequence symbol) {
457+
public static ByteSequence getRuntimePackage(Symbol<Type> symbol) {
458+
return TypeSymbols.getRuntimePackage((ByteSequence) symbol);
459+
}
460+
461+
private static ByteSequence getRuntimePackage(ByteSequence symbol) {
458462
if (symbol.byteAt(0) == '[') {
459463
int arrayDimensions = getArrayDimensions(symbol);
460464
return getRuntimePackage(symbol.subSequence(arrayDimensions));

0 commit comments

Comments
 (0)