Skip to content

Commit c27d2b7

Browse files
committed
svm: move CalendarSubstitutions to webimage
1 parent 53696fb commit c27d2b7

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/trace/AccessAdvisor.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ public final class AccessAdvisor {
127127
internalCallerFilter.addOrGetChildren("sun.util.**", ConfigurationFilter.Inclusion.Exclude);
128128
// Bundles calls Bundles.of
129129
internalCallerFilter.addOrGetChildren("sun.util.resources.Bundles", ConfigurationFilter.Inclusion.Include);
130+
// Class.forName calls in CalendarSystem.forName
131+
internalCallerFilter.addOrGetChildren("sun.util.calendar.CalendarSystem", ConfigurationFilter.Inclusion.Include);
130132

131133
excludeInaccessiblePackages(internalCallerFilter);
132134

web-image/mx.web-image/suite.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
"java.base": [
101101
"sun.nio.ch",
102102
"sun.security.provider",
103+
"sun.util.calendar",
103104
"jdk.internal.misc",
104105
"jdk.internal.util",
105106
],

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/CalendarSubstitutions.java renamed to web-image/src/com.oracle.svm.webimage/src/com/oracle/svm/webimage/substitute/WebImageCalendarSubstitutions.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,8 @@
2222
* or visit www.oracle.com if you need additional information or have any
2323
* questions.
2424
*/
25-
package com.oracle.svm.core.jdk;
25+
26+
package com.oracle.svm.webimage.substitute;
2627

2728
import java.util.Calendar;
2829
import java.util.GregorianCalendar;
@@ -43,39 +44,38 @@
4344
*/
4445

4546
@TargetClass(java.util.Calendar.class)
46-
final class Target_java_util_Calendar {
47+
final class Target_java_util_Calendar_Web {
4748

4849
@Substitute
4950
private static Calendar createCalendar(TimeZone zone, Locale aLocale) {
5051
return new GregorianCalendar(zone, aLocale);
5152
}
5253
}
5354

54-
@TargetClass(sun.util.calendar.CalendarSystem.class)
55-
final class Target_sun_util_calendar_CalendarSystem {
55+
@TargetClass(CalendarSystem.class)
56+
final class Target_sun_util_calendar_CalendarSystem_Web {
5657

5758
@Substitute
5859
private static CalendarSystem forName(String calendarName) {
5960
if ("gregorian".equals(calendarName)) {
60-
return Util_sun_util_calendar_CalendarSystem.GREGORIAN;
61+
return Util_sun_util_calendar_CalendarSystem_Web.GREGORIAN;
6162
} else if ("japanese".equals(calendarName)) {
62-
return Util_sun_util_calendar_CalendarSystem.JAPANESE;
63+
return Util_sun_util_calendar_CalendarSystem_Web.JAPANESE;
6364
} else if ("julian".equals(calendarName)) {
64-
return Util_sun_util_calendar_CalendarSystem.JULIAN;
65+
return Util_sun_util_calendar_CalendarSystem_Web.JULIAN;
6566
} else {
6667
throw VMError.unsupportedFeature("CalendarSystem.forName " + calendarName);
6768
}
6869
}
6970
}
7071

71-
final class Util_sun_util_calendar_CalendarSystem {
72-
72+
final class Util_sun_util_calendar_CalendarSystem_Web {
7373
// The static fields are initialized during native image generation.
7474
static final CalendarSystem GREGORIAN = CalendarSystem.forName("gregorian");
7575
static final CalendarSystem JAPANESE = CalendarSystem.forName("japanese");
7676
static final CalendarSystem JULIAN = CalendarSystem.forName("julian");
7777
}
7878

7979
/** Dummy class to have a class with the file's name. */
80-
public final class CalendarSubstitutions {
80+
public final class WebImageCalendarSubstitutions {
8181
}

0 commit comments

Comments
 (0)