Hi Andrew,

With version 6 [1] of the patch applied, tests throw this exception:

Mapped java.lang.InternalError: java.lang.NullPointerException
        at 
java.base/jdk.internal.misc.ExtendedMapMode.newMapMode(ExtendedMapMode.java:58)
        at 
java.base/jdk.internal.misc.ExtendedMapMode.<clinit>(ExtendedMapMode.java:40)
        at java.base/sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:1007)

Looks like a problem in the initialization order of the static final constants: 
MAP_MODE_CONSTRUCTOR needs to be initialized first so I think the *_SYNC 
constants need to be after the static initializer [2].

Sorry for suggesting the change that was the proximate cause of this. :-(

Thanks,

Brian

[1] http://cr.openjdk.java.net/~adinn/8224974/webrev.06/
[2] diff

--- a/src/java.base/share/classes/jdk/internal/misc/ExtendedMapMode.java
+++ b/src/java.base/share/classes/jdk/internal/misc/ExtendedMapMode.java
@@ -37,10 +37,6 @@
 
     static final MethodHandle MAP_MODE_CONSTRUCTOR;
 
-    public static final MapMode READ_ONLY_SYNC = newMapMode("READ_ONLY_SYNC");
-
-    public static final MapMode READ_WRITE_SYNC = 
newMapMode("READ_WRITE_SYNC");
-
     static {
         try {
             var lookup = MethodHandles.privateLookupIn(MapMode.class, 
MethodHandles.lookup());
@@ -51,6 +47,10 @@
         }
     }
 
+    public static final MapMode READ_ONLY_SYNC = newMapMode("READ_ONLY_SYNC");
+
+    public static final MapMode READ_WRITE_SYNC = 
newMapMode("READ_WRITE_SYNC");
+
     private static MapMode newMapMode(String name) {
         try {
             return (MapMode) MAP_MODE_CONSTRUCTOR.invoke(name);

 

> On Jun 5, 2019, at 10:47 AM, Brian Burkhalter <brian.burkhal...@oracle.com> 
> wrote:
> 
> Hi Andrew,
> 
> Please ignore the content below: I see the changes are in version 6 which I 
> had not looked through before posting my previous message.
> 
> Thanks,
> 
> Brian
> 
>> On Jun 5, 2019, at 10:25 AM, Brian Burkhalter <brian.burkhal...@oracle.com 
>> <mailto:brian.burkhal...@oracle.com>> wrote:
>> 
>> I suppose these changes will be in version 7. If it is likely that comments 
>> will be forthcoming from others then it might be worth waiting to 
>> incorporate any further changes in version 7.
> 

Reply via email to