JDK-8369993 : Redundant separate 'String' check in 'trust_final_non_static_fields' ciField.cpp
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 26
  • Priority: P5
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2025-10-16
  • Updated: 2025-11-10
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Relates :  
Description
In JDK-8234049 code was updated to trust all classes from 'java/lang' package.

  if (holder->is_in_package("java/lang/invoke") || holder->is_in_package("sun/invoke") ||
      holder->is_in_package("java/lang/reflect") || holder->is_in_package("jdk/internal/reflect") ||
      holder->is_in_package("jdk/internal/foreign/layout") || holder->is_in_package("jdk/internal/foreign") ||
      holder->is_in_package("jdk/internal/vm/vector") || holder->is_in_package("jdk/incubator/vector") ||
      holder->is_in_package("java/lang"))
    return true;

It means separate String check now is not needed.

  if (holder->name() == ciSymbols::java_lang_String())
    return true;
Comments
A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/28191 Date: 2025-11-07 10:57:53 +0000
07-11-2025

ciField is the compiler interface for field, so it belongs to hotspot/compiler instead of core-libs/java.lang.
16-10-2025