File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 2727import java .io .File ;
2828import java .net .URL ;
2929import java .security .ProtectionDomain ;
30+ import java .util .ArrayList ;
3031import java .util .Collections ;
3132import java .util .Enumeration ;
3233import java .util .Set ;
33- import java .util .Vector ;
3434import java .util .WeakHashMap ;
3535import java .util .concurrent .ConcurrentHashMap ;
3636import java .util .stream .Stream ;
@@ -67,7 +67,7 @@ public final class Target_java_lang_ClassLoader {
6767 * invoked by the VM to record every loaded class with this loader".
6868 */
6969 @ Alias @ RecomputeFieldValue (kind = Kind .Reset )//
70- private Vector <Class <?>> classes ;
70+ private ArrayList <Class <?>> classes ;
7171
7272 @ Alias @ RecomputeFieldValue (kind = Kind .NewInstanceWhenNotNull , declClass = ConcurrentHashMap .class )//
7373 private ConcurrentHashMap <String , Object > parallelLockMap ;
Original file line number Diff line number Diff line change @@ -136,6 +136,9 @@ public static String makeFilename(Recording recording) {
136136
137137 @ Alias
138138 public static native String formatTimespan (Duration dValue , String separation );
139+
140+ @ Alias
141+ public static native String formatDateTime (LocalDateTime time );
139142}
140143
141144@ TargetClass (className = "jdk.jfr.internal.JVMSupport" , onlyWith = {JDKLatest .class , HasJfrSupport .class })
@@ -169,9 +172,17 @@ final class Target_jdk_jfr_internal_PlatformRecording {
169172final class JfrFilenameUtil {
170173 public static String makeFilename (Recording recording ) {
171174 long pid = ProcessProperties .getProcessID ();
172- String date = Target_jdk_jfr_internal_util_ValueFormatter . formatDateTime ( LocalDateTime . now () );
175+ String date = getFormatDateTime ( );
173176 String idText = recording == null ? "" : "-id-" + recording .getId ();
174177 String imageName = SubstrateOptions .Name .getValue ();
175178 return imageName + "-pid-" + pid + idText + "-" + date + ".jfr" ;
176179 }
180+
181+ private static String getFormatDateTime () {
182+ LocalDateTime now = LocalDateTime .now ();
183+ if (JavaVersionUtil .JAVA_SPEC >= 24 ) {
184+ return Target_jdk_jfr_internal_util_ValueFormatter .formatDateTime (now );
185+ }
186+ return Target_jdk_jfr_internal_Utils .formatDateTime (now );
187+ }
177188}
You can’t perform that action at this time.
0 commit comments