diff --git a/src/hotspot/share/cds/filemap.cpp b/src/hotspot/share/cds/filemap.cpp index cf11877981dd9..08b73365f3dfd 100644 --- a/src/hotspot/share/cds/filemap.cpp +++ b/src/hotspot/share/cds/filemap.cpp @@ -2701,7 +2701,7 @@ ClassFileStream* FileMapInfo::get_stream_from_class_loader(Handle class_loader, TempNewSymbol class_name_sym = SymbolTable::new_symbol(file_name); Handle ext_class_name = java_lang_String::externalize_classname(class_name_sym, CHECK_NULL); - // InputStream ClassLoader.getResourceAsStream(String name) + // byte[] ClassLoader.getResourceAsByteArray(String name) JavaCalls::call_virtual(&result, class_loader, vmClasses::ClassLoader_klass(), @@ -2711,7 +2711,7 @@ ClassFileStream* FileMapInfo::get_stream_from_class_loader(Handle class_loader, CHECK_NULL); assert(result.get_type() == T_OBJECT, "just checking"); oop obj = result.get_oop(); - assert(obj != nullptr, "ClassLoader.getResourceAsStream should not return null"); + assert(obj != nullptr, "ClassLoader.getResourceAsByteArray should not return null"); // The result should be a [B assert(obj->is_typeArray(), "just checking"); diff --git a/src/hotspot/share/classfile/vmSymbols.hpp b/src/hotspot/share/classfile/vmSymbols.hpp index 386d7f24105d9..6a6f7754c509e 100644 --- a/src/hotspot/share/classfile/vmSymbols.hpp +++ b/src/hotspot/share/classfile/vmSymbols.hpp @@ -724,7 +724,7 @@ class SerializeClosure; template(generateLambdaFormHolderClasses, "generateLambdaFormHolderClasses") \ template(generateLambdaFormHolderClasses_signature, "([Ljava/lang/String;)[Ljava/lang/Object;") \ template(getResourceAsByteArray_name, "getResourceAsByteArray") \ - template(getResourceAsByteArray_signature, "(Ljava/lang/String;)[B") \ + template(getResourceAsByteArray_signature, "(Ljava/lang/String;)[B") \ template(java_lang_Enum, "java/lang/Enum") \ template(java_lang_invoke_Invokers_Holder, "java/lang/invoke/Invokers$Holder") \ template(java_lang_invoke_DirectMethodHandle_Holder, "java/lang/invoke/DirectMethodHandle$Holder") \ diff --git a/src/java.base/share/classes/java/lang/ClassLoader.java b/src/java.base/share/classes/java/lang/ClassLoader.java index a4aa01b067060..471c3b6bba812 100644 --- a/src/java.base/share/classes/java/lang/ClassLoader.java +++ b/src/java.base/share/classes/java/lang/ClassLoader.java @@ -1686,7 +1686,7 @@ public InputStream getResourceAsStream(String name) { } /** - * Called by VM for constructing a ClassFileStream. + * Called by VM for reading class bytes. */ private byte[] getResourceAsByteArray(String name) { Objects.requireNonNull(name);