Originally created by @ShiftSad on GitHub (Jun 25, 2025).
I'm on pkl-config-java-all version 0.28.2, Pkl 0.28.2 (Windows 10.0, native) and OpenJDK 24.0.1
Warning:
WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::objectFieldOffset has been called by com.oracle.truffle.api.nodes.NodeClassImpl$NodeFieldData (file:/C:/Users/---/.gradle/caches/modules-2/files-2.1/org.pkl-lang/pkl-config-java-all/0.28.2/1cead8c0419840532c33b53da3295b56853140f1/pkl-config-java-all-0.28.2.jar)
WARNING: Please consider reporting this to the maintainers of class com.oracle.truffle.api.nodes.NodeClassImpl$NodeFieldData
WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release
My configuration loader class has these two methods for acessing data, and they seem related to the warning being thrown.
/**
* Returns the child node with the given unqualified name.
* Allows for nested keys using dot notation (e.g., "parent.child").
*
* @throws NoSuchChildException if a child with the given name does not exist
*/publicConfigget(Stringkey){String[]parts=key.split("\\.");Configcurrent=config;for(Stringpart:parts){current=current.get(part);}returncurrent;}/**
* Returns the child node with the given unqualified name and converts it to the specified type.
*
* @throws NoSuchChildException if a child with the given name does not exist
* @throws ConversionException if the value cannot be converted to the given type
*/public<T>Tget(Stringkey,Class<T>type){returnget(key).as(type);}
I've got it running the test bellow, it passes but throws warnig.
@BeforeEachvoidsetUp()throwsIOException{Files.createDirectories(tempDir);tempConfigFile=tempDir.resolve("my-app-test.pkl");Files.writeString(tempConfigFile,"app { \n"+" name = \"TestApp\" \n"+" version = 1.0 \n"+" enabled = true \n"+"}\n"+"server {\n"+" port = 8080\n"+" timeout = 5000\n"+"}");tempDefaultConfigFile=tempDir.resolve(TEST_RESOURCE_CONFIG);Files.deleteIfExists(tempDefaultConfigFile);}@Test@DisplayName("Should load an existing configuration file successfully")voidtestLoadExistingFile_success()throwsIOException{ConfigurationLoaderloader=newConfigurationLoader(tempConfigFile.toString());assertNotNull(loader);assertEquals("TestApp",loader.get("app.name",String.class));assertEquals(1.0,loader.get("app.version",Double.class));assertTrue(loader.get("app.enabled",Boolean.class));}
Originally created by @ShiftSad on GitHub (Jun 25, 2025).
I'm on pkl-config-java-all version 0.28.2, Pkl 0.28.2 (Windows 10.0, native) and OpenJDK 24.0.1
Warning:
```
WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::objectFieldOffset has been called by com.oracle.truffle.api.nodes.NodeClassImpl$NodeFieldData (file:/C:/Users/---/.gradle/caches/modules-2/files-2.1/org.pkl-lang/pkl-config-java-all/0.28.2/1cead8c0419840532c33b53da3295b56853140f1/pkl-config-java-all-0.28.2.jar)
WARNING: Please consider reporting this to the maintainers of class com.oracle.truffle.api.nodes.NodeClassImpl$NodeFieldData
WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release
```
My configuration loader class has these two methods for acessing data, and they seem related to the warning being thrown.
```java
/**
* Returns the child node with the given unqualified name.
* Allows for nested keys using dot notation (e.g., "parent.child").
*
* @throws NoSuchChildException if a child with the given name does not exist
*/
public Config get(String key) {
String[] parts = key.split("\\.");
Config current = config;
for (String part : parts) {
current = current.get(part);
}
return current;
}
/**
* Returns the child node with the given unqualified name and converts it to the specified type.
*
* @throws NoSuchChildException if a child with the given name does not exist
* @throws ConversionException if the value cannot be converted to the given type
*/
public <T> T get(String key, Class<T> type) {
return get(key).as(type);
}
```
I've got it running the test bellow, it passes but throws warnig.
```java
@BeforeEach
void setUp() throws IOException {
Files.createDirectories(tempDir);
tempConfigFile = tempDir.resolve("my-app-test.pkl");
Files.writeString(tempConfigFile,
"app { \n" +
" name = \"TestApp\" \n" +
" version = 1.0 \n" +
" enabled = true \n" +
"}\n" +
"server {\n" +
" port = 8080\n" +
" timeout = 5000\n" +
"}"
);
tempDefaultConfigFile = tempDir.resolve(TEST_RESOURCE_CONFIG);
Files.deleteIfExists(tempDefaultConfigFile);
}
@Test
@DisplayName("Should load an existing configuration file successfully")
void testLoadExistingFile_success() throws IOException {
ConfigurationLoader loader = new ConfigurationLoader(tempConfigFile.toString());
assertNotNull(loader);
assertEquals("TestApp", loader.get("app.name", String.class));
assertEquals(1.0, loader.get("app.version", Double.class));
assertTrue(loader.get("app.enabled", Boolean.class));
}
```
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @ShiftSad on GitHub (Jun 25, 2025).
I'm on pkl-config-java-all version 0.28.2, Pkl 0.28.2 (Windows 10.0, native) and OpenJDK 24.0.1
Warning:
My configuration loader class has these two methods for acessing data, and they seem related to the warning being thrown.
I've got it running the test bellow, it passes but throws warnig.
@stackoverflow commented on GitHub (Jun 30, 2025):
We'll update graalvm/truffle for the 0.30 release. So, hopefully this will be fixed.