5555 * Each thread uses both a Java and a native {@link JfrBuffer}:
5656 * <ul>
5757 * <li>The Java buffer is accessed by JFR events that are implemented as Java classes and written
58- * using {@linkplain EventWriter} .</li>
58+ * using EventWriter.</li>
5959 * <li>The native buffer is accessed when {@link JfrNativeEventWriter} is used to write an
6060 * event.</li>
6161 * </ul>
6666 * modify the buffers of other threads).
6767 */
6868public class JfrThreadLocal implements ThreadListener {
69- private static final FastThreadLocalObject javaEventWriter ;
69+ @ SuppressWarnings ( "rawtypes" ) private static final FastThreadLocalObject javaEventWriter ;
7070 private static final FastThreadLocalWord <JfrBuffer > javaBuffer = FastThreadLocalFactory .createWord ("JfrThreadLocal.javaBuffer" );
7171 private static final FastThreadLocalWord <JfrBuffer > nativeBuffer = FastThreadLocalFactory .createWord ("JfrThreadLocal.nativeBuffer" );
7272 private static final FastThreadLocalWord <UnsignedWord > dataLost = FastThreadLocalFactory .createWord ("JfrThreadLocal.dataLost" );
@@ -76,10 +76,10 @@ public class JfrThreadLocal implements ThreadListener {
7676 static {
7777 if (JavaVersionUtil .JAVA_SPEC < 19 ) {
7878 javaEventWriter = FastThreadLocalFactory .createObject (Target_jdk_jfr_internal_EventWriter .class ,
79- "JfrThreadLocal.javaEventWriter" );
79+ "JfrThreadLocal.javaEventWriter" );
8080 } else {
8181 javaEventWriter = FastThreadLocalFactory .createObject (Target_jdk_jfr_internal_event_EventWriter .class ,
82- "JfrThreadLocal.javaEventWriter" );
82+ "JfrThreadLocal.javaEventWriter" );
8383 }
8484 }
8585
@@ -114,6 +114,7 @@ public void beforeThreadRun(IsolateThread isolateThread, Thread javaThread) {
114114
115115 @ Uninterruptible (reason = "Accesses a JFR buffer." )
116116 @ Override
117+ @ SuppressWarnings ("rawtypes" )
117118 public void afterThreadExit (IsolateThread isolateThread , Thread javaThread ) {
118119
119120 // Emit ThreadEnd event after thread.run() finishes.
@@ -162,6 +163,7 @@ public Object getEventWriter() {
162163 // If a safepoint happens in this method, the state that another thread can see is always
163164 // sufficiently consistent as the JFR buffer is still empty. So, this method does not need to be
164165 // uninterruptible.
166+ @ SuppressWarnings ("rawtypes" )
165167 public Target_jdk_jfr_internal_EventWriter newEventWriter () {
166168 assert javaEventWriter .get () == null ;
167169 assert javaBuffer .get ().isNull ();
@@ -221,7 +223,7 @@ public static void notifyEventWriter(IsolateThread thread) {
221223 if (javaEventWriter .get (thread ) != null ) {
222224 if (JavaVersionUtil .JAVA_SPEC < 19 ) {
223225 SubstrateUtil .cast (javaEventWriter .get (thread ), Target_jdk_jfr_internal_EventWriter .class ).notified = true ;
224- }else {
226+ } else {
225227 SubstrateUtil .cast (javaEventWriter .get (thread ), Target_jdk_jfr_internal_event_EventWriter .class ).notified = true ;
226228 }
227229 }
0 commit comments