From 25bb698eff9f5aadb54dd37a442e2e1bc555353a Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Wed, 22 Jan 2025 15:27:41 +0000 Subject: [PATCH] 8348195: More u2 conversion warnings after JDK-8347147 Reviewed-by: coleenp, dholmes --- src/hotspot/share/classfile/classFileParser.cpp | 2 +- src/hotspot/share/oops/fieldInfo.inline.hpp | 2 +- src/hotspot/share/oops/method.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hotspot/share/classfile/classFileParser.cpp b/src/hotspot/share/classfile/classFileParser.cpp index 14339dc7204..92d31c48ca8 100644 --- a/src/hotspot/share/classfile/classFileParser.cpp +++ b/src/hotspot/share/classfile/classFileParser.cpp @@ -2126,7 +2126,7 @@ Method* ClassFileParser::parse_method(const ClassFileStream* const cfs, // access_flags, name_index, descriptor_index, attributes_count cfs->guarantee_more(8, CHECK_NULL); - int flags = cfs->get_u2_fast(); + u2 flags = cfs->get_u2_fast(); const u2 name_index = cfs->get_u2_fast(); const int cp_size = cp->length(); guarantee_property( diff --git a/src/hotspot/share/oops/fieldInfo.inline.hpp b/src/hotspot/share/oops/fieldInfo.inline.hpp index bf37d280510..d3d4d765081 100644 --- a/src/hotspot/share/oops/fieldInfo.inline.hpp +++ b/src/hotspot/share/oops/fieldInfo.inline.hpp @@ -102,7 +102,7 @@ inline void FieldInfoReader::read_field_info(FieldInfo& fi) { fi._name_index = checked_cast(next_uint()); fi._signature_index = checked_cast(next_uint()); fi._offset = next_uint(); - fi._access_flags = AccessFlags(next_uint()); + fi._access_flags = AccessFlags(checked_cast(next_uint())); fi._field_flags = FieldInfo::FieldFlags(next_uint()); if (fi._field_flags.is_initialized()) { fi._initializer_index = checked_cast(next_uint()); diff --git a/src/hotspot/share/oops/method.cpp b/src/hotspot/share/oops/method.cpp index de3e9f97253..a0f6a901cf7 100644 --- a/src/hotspot/share/oops/method.cpp +++ b/src/hotspot/share/oops/method.cpp @@ -1434,7 +1434,7 @@ methodHandle Method::make_method_handle_intrinsic(vmIntrinsics::ID iid, cp->set_is_for_method_handle_intrinsic(); // decide on access bits: public or not? - int flags_bits = (JVM_ACC_NATIVE | JVM_ACC_SYNTHETIC | JVM_ACC_FINAL); + u2 flags_bits = (JVM_ACC_NATIVE | JVM_ACC_SYNTHETIC | JVM_ACC_FINAL); bool must_be_static = MethodHandles::is_signature_polymorphic_static(iid); if (must_be_static) flags_bits |= JVM_ACC_STATIC; assert((flags_bits & JVM_ACC_PUBLIC) == 0, "do not expose these methods");