Consider this header:
```
int global;
```
Which is extracted with the option: -Djextract.decls.per.header=0
(this forces each new declaration to be put in a different header class).
Now consider this Java program using the generated output:
```
import java.lang.foreign.ValueLayout;
class TestGensrc {
public static void main(String[] args) {
ValueLayout layout = foo_h.C_INT;
}
}
```
This program fails:
```
Exception in thread "main" java.lang.ExceptionInInitializerError
at TestGensrc.main(TestGensrc.java:5)
Caused by: java.lang.NullPointerException: Cannot invoke "java.lang.foreign.MemoryLayout.varHandle(java.lang.foreign.MemoryLayout$PathElement[])" because "foo_h_1.global$LAYOUT" is null
at foo_h_1.<clinit>(foo_h_1.java:16)
... 1 more
```
```
int global;
```
Which is extracted with the option: -Djextract.decls.per.header=0
(this forces each new declaration to be put in a different header class).
Now consider this Java program using the generated output:
```
import java.lang.foreign.ValueLayout;
class TestGensrc {
public static void main(String[] args) {
ValueLayout layout = foo_h.C_INT;
}
}
```
This program fails:
```
Exception in thread "main" java.lang.ExceptionInInitializerError
at TestGensrc.main(TestGensrc.java:5)
Caused by: java.lang.NullPointerException: Cannot invoke "java.lang.foreign.MemoryLayout.varHandle(java.lang.foreign.MemoryLayout$PathElement[])" because "foo_h_1.global$LAYOUT" is null
at foo_h_1.<clinit>(foo_h_1.java:16)
... 1 more
```