changeset 8044:2200f3672dbb

Fix RT-38536: Deadlock initializing Image Conversion utilities from multiple threads Reviewed by: kcr
author flar <James.Graham@oracle.com>
date Thu, 11 Sep 2014 15:13:11 -0700
parents 554c4bdd3c5f
children 522fe51196c8
files modules/graphics/src/main/java/com/sun/javafx/image/PixelUtils.java modules/graphics/src/main/java/com/sun/javafx/image/impl/ByteBgr.java modules/graphics/src/main/java/com/sun/javafx/image/impl/ByteBgra.java modules/graphics/src/main/java/com/sun/javafx/image/impl/ByteBgraPre.java modules/graphics/src/main/java/com/sun/javafx/image/impl/ByteGray.java modules/graphics/src/main/java/com/sun/javafx/image/impl/ByteGrayAlpha.java modules/graphics/src/main/java/com/sun/javafx/image/impl/ByteGrayAlphaPre.java modules/graphics/src/main/java/com/sun/javafx/image/impl/ByteRgb.java modules/graphics/src/main/java/com/sun/javafx/image/impl/ByteRgba.java modules/graphics/src/main/java/com/sun/javafx/image/impl/IntArgb.java modules/graphics/src/main/java/com/sun/javafx/image/impl/IntArgbPre.java modules/graphics/src/main/java/com/sun/javafx/tk/quantum/PixelUtils.java modules/graphics/src/main/java/com/sun/prism/Image.java tests/system/src/test/java/com/sun/javafx/image/impl/ImageRaceTest.java
diffstat 14 files changed, 519 insertions(+), 187 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/com/sun/javafx/image/PixelUtils.java	Thu Sep 11 11:04:27 2014 -0600
+++ b/modules/graphics/src/main/java/com/sun/javafx/image/PixelUtils.java	Thu Sep 11 15:13:11 2014 -0700
@@ -209,41 +209,41 @@
     {
         if (src ==        ByteBgra.getter) {
             if (dst ==               ByteBgra.setter) {
-                return    ByteBgra.ToByteBgraConverter;
+                return    ByteBgra.ToByteBgraConverter();
             } else if (dst ==        ByteBgraPre.setter) {
-                return    ByteBgra.ToByteBgraPreConverter;
+                return    ByteBgra.ToByteBgraPreConverter();
             }
         } else if (src == ByteBgraPre.getter) {
             if (dst ==                  ByteBgra.setter) {
-                return    ByteBgraPre.ToByteBgraConverter;
+                return    ByteBgraPre.ToByteBgraConverter();
             } else if (dst ==           ByteBgraPre.setter) {
-                return    ByteBgraPre.ToByteBgraPreConverter;
+                return    ByteBgraPre.ToByteBgraPreConverter();
             }
         } else if (src == ByteRgb.getter) {
             if (dst ==              ByteBgra.setter) {
-                return    ByteRgb.ToByteBgraConverter;
+                return    ByteRgb.ToByteBgraConverter();
             } else if (dst ==       ByteBgraPre.setter) {
-                return    ByteRgb.ToByteBgraPreConverter;
+                return    ByteRgb.ToByteBgraPreConverter();
             } else if (dst ==       ByteBgr.setter) {
-                return    ByteRgb.ToByteBgrConverter;
+                return    ByteRgb.ToByteBgrConverter();
             }
         } else if (src == ByteBgr.getter) {
             if (dst ==              ByteBgr.setter) {
-                return    ByteBgr.ToByteBgrConverter;
+                return    ByteBgr.ToByteBgrConverter();
             } else if (dst ==       ByteBgra.setter) {
-                return    ByteBgr.ToByteBgraConverter;
+                return    ByteBgr.ToByteBgraConverter();
             } else if (dst ==       ByteBgraPre.setter) {
-                return    ByteBgr.ToByteBgraPreConverter;
+                return    ByteBgr.ToByteBgraPreConverter();
             }
         } else if (src == ByteGray.getter) {
             if (dst ==               ByteGray.setter) {
-                return    ByteGray.ToByteGrayConverter;
+                return    ByteGray.ToByteGrayConverter();
             } else if (dst ==        ByteBgr.setter) {
-                return    ByteGray.ToByteBgrConverter;
+                return    ByteGray.ToByteBgrConverter();
             } else if (dst ==        ByteBgra.setter) {
-                return    ByteGray.ToByteBgraConverter;
+                return    ByteGray.ToByteBgraConverter();
             } else if (dst ==        ByteBgraPre.setter) {
-                return    ByteGray.ToByteBgraPreConverter;
+                return    ByteGray.ToByteBgraPreConverter();
             }
         } else if (src instanceof ByteIndexed.Getter) {
             if (dst == ByteBgra.setter || dst == ByteBgraPre.setter) {
@@ -267,33 +267,33 @@
     {
         if (src ==        ByteBgra.getter) {
             if (dst ==               IntArgb.setter) {
-                return    ByteBgra.ToIntArgbConverter;
+                return    ByteBgra.ToIntArgbConverter();
             } else if (dst ==        IntArgbPre.setter) {
-                return    ByteBgra.ToIntArgbPreConverter;
+                return    ByteBgra.ToIntArgbPreConverter();
             }
         } else if (src == ByteBgraPre.getter) {
             if (dst ==                  IntArgb.setter) {
-                return    ByteBgraPre.ToIntArgbConverter;
+                return    ByteBgraPre.ToIntArgbConverter();
             } else if (dst ==           IntArgbPre.setter) {
-                return    ByteBgraPre.ToIntArgbPreConverter;
+                return    ByteBgraPre.ToIntArgbPreConverter();
             }
         } else if (src == ByteRgb.getter) {
             if (dst ==              IntArgb.setter) {
-                return    ByteRgb.ToIntArgbConverter;
+                return    ByteRgb.ToIntArgbConverter();
             } else if (dst ==       IntArgbPre.setter) {
-                return    ByteRgb.ToIntArgbPreConverter;
+                return    ByteRgb.ToIntArgbPreConverter();
             }
         } else if (src == ByteBgr.getter) {
             if (dst ==              IntArgb.setter) {
-                return    ByteBgr.ToIntArgbConverter;
+                return    ByteBgr.ToIntArgbConverter();
             } else if (dst ==       IntArgbPre.setter) {
-                return    ByteBgr.ToIntArgbPreConverter;
+                return    ByteBgr.ToIntArgbPreConverter();
             }
         } else if (src == ByteGray.getter) {
             if (dst ==              IntArgbPre.setter) {
-                return    ByteGray.ToIntArgbPreConverter;
+                return    ByteGray.ToIntArgbPreConverter();
             } else if (dst ==       IntArgb.setter) {
-                return    ByteGray.ToIntArgbConverter;
+                return    ByteGray.ToIntArgbConverter();
             }
         } else if (src instanceof ByteIndexed.Getter) {
             if (dst == IntArgb.setter || dst == IntArgbPre.setter) {
@@ -314,15 +314,15 @@
     {
         if (src ==        IntArgb.getter) {
             if (dst ==              ByteBgra.setter) {
-                return    IntArgb.ToByteBgraConverter;
+                return    IntArgb.ToByteBgraConverter();
             } else if (dst ==       ByteBgraPre.setter) {
-                return    IntArgb.ToByteBgraPreConverter;
+                return    IntArgb.ToByteBgraPreConverter();
             }
         } else if (src == IntArgbPre.getter) {
             if (dst ==                 ByteBgra.setter) {
-                return    IntArgbPre.ToByteBgraConverter;
+                return    IntArgbPre.ToByteBgraConverter();
             } else if (dst ==          ByteBgraPre.setter) {
-                return    IntArgbPre.ToByteBgraPreConverter;
+                return    IntArgbPre.ToByteBgraPreConverter();
             }
         }
         if (dst == ByteGray.setter) {
@@ -341,15 +341,15 @@
     {
         if (src ==        IntArgb.getter) {
             if (dst ==              IntArgb.setter) {
-                return    IntArgb.ToIntArgbConverter;
+                return    IntArgb.ToIntArgbConverter();
             } else if (dst ==       IntArgbPre.setter) {
-                return    IntArgb.ToIntArgbPreConverter;
+                return    IntArgb.ToIntArgbPreConverter();
             }
         } else if (src == IntArgbPre.getter) {
             if (dst ==                 IntArgb.setter) {
-                return    IntArgbPre.ToIntArgbConverter;
+                return    IntArgbPre.ToIntArgbConverter();
             } else if (dst ==          IntArgbPre.setter) {
-                return    IntArgbPre.ToIntArgbPreConverter;
+                return    IntArgbPre.ToIntArgbPreConverter();
             }
         }
         if (src.getAlphaType() != AlphaType.OPAQUE &&
--- a/modules/graphics/src/main/java/com/sun/javafx/image/impl/ByteBgr.java	Thu Sep 11 11:04:27 2014 -0600
+++ b/modules/graphics/src/main/java/com/sun/javafx/image/impl/ByteBgr.java	Thu Sep 11 15:13:11 2014 -0700
@@ -41,18 +41,33 @@
     public static final BytePixelSetter     setter = Accessor.instance;
     public static final BytePixelAccessor accessor = Accessor.instance;
 
-    public static final ByteToBytePixelConverter ToByteBgrConverter =
-        BaseByteToByteConverter.create(accessor);
-    public static final ByteToBytePixelConverter ToByteBgraConverter =
-        ByteBgr.ToByteBgrfConv.nonpremult;
-    public static final ByteToBytePixelConverter ToByteBgraPreConverter =
-        ByteBgr.ToByteBgrfConv.premult;
-    public static final ByteToIntPixelConverter ToIntArgbConverter =
-        ByteBgr.ToIntFrgbConv.nonpremult;
-    public static final ByteToIntPixelConverter ToIntArgbPreConverter =
-        ByteBgr.ToIntFrgbConv.premult;
-    public static final ByteToBytePixelConverter ToByteArgbConverter =
-        ByteBgr.ToByteFrgbConv.nonpremult;
+    private static ByteToBytePixelConverter ToByteBgrObj;
+    public  static ByteToBytePixelConverter ToByteBgrConverter() {
+        if (ToByteBgrObj == null) {
+            ToByteBgrObj = BaseByteToByteConverter.create(accessor);
+        }
+        return ToByteBgrObj;
+    }
+
+    public static ByteToBytePixelConverter ToByteBgraConverter() {
+        return ByteBgr.ToByteBgrfConv.nonpremult;
+    }
+
+    public static ByteToBytePixelConverter ToByteBgraPreConverter() {
+        return ByteBgr.ToByteBgrfConv.premult;
+    }
+
+    public static ByteToIntPixelConverter ToIntArgbConverter() {
+        return ByteBgr.ToIntFrgbConv.nonpremult;
+    }
+
+    public static ByteToIntPixelConverter ToIntArgbPreConverter() {
+        return ByteBgr.ToIntFrgbConv.premult;
+    }
+
+    public static ByteToBytePixelConverter ToByteArgbConverter() {
+        return ByteBgr.ToByteFrgbConv.nonpremult;
+    }
 
     static class Accessor implements BytePixelAccessor {
         static final BytePixelAccessor instance = new Accessor();
@@ -132,11 +147,7 @@
             new ToByteBgrfConv(ByteBgraPre.setter);
 
         private ToByteBgrfConv(BytePixelSetter setter) {
-            // Note that using ByteBgr.getter here causes a circular reference
-            // between the classes that prevents the above *premult fields
-            // from being initialized before the ByteBgr class copies their
-            // (not yet inited = null) values into its owns static fields.
-            super(Accessor.instance, setter);
+            super(ByteBgr.getter, setter);
         }
 
         @Override
@@ -185,11 +196,7 @@
             new ToIntFrgbConv(IntArgbPre.setter);
 
         private ToIntFrgbConv(IntPixelSetter setter) {
-            // Note that using ByteBgr.getter here causes a circular reference
-            // between the classes that prevents the above *premult fields
-            // from being initialized before the ByteBgr class copies their
-            // (not yet inited = null) values into its owns static fields.
-            super(Accessor.instance, setter);
+            super(ByteBgr.getter, setter);
         }
 
         @Override
@@ -234,11 +241,7 @@
             new ToByteFrgbConv(ByteArgb.setter);
 
         private ToByteFrgbConv(BytePixelSetter setter) {
-            // Note that using ByteBgr.getter here causes a circular reference
-            // between the classes that prevents the above *premult fields
-            // from being initialized before the ByteBgr class copies their
-            // (not yet inited = null) values into its owns static fields.
-            super(Accessor.instance, setter);
+            super(ByteBgr.getter, setter);
         }
 
         @Override
--- a/modules/graphics/src/main/java/com/sun/javafx/image/impl/ByteBgra.java	Thu Sep 11 11:04:27 2014 -0600
+++ b/modules/graphics/src/main/java/com/sun/javafx/image/impl/ByteBgra.java	Thu Sep 11 15:13:11 2014 -0700
@@ -40,14 +40,25 @@
     public static final BytePixelSetter     setter = Accessor.instance;
     public static final BytePixelAccessor accessor = Accessor.instance;
 
-    public static final ByteToBytePixelConverter ToByteBgraConverter =
-        BaseByteToByteConverter.create(accessor);
-    public static final ByteToBytePixelConverter ToByteBgraPreConverter =
-        ByteBgra.ToByteBgraPreConv.instance;
-    public static final ByteToIntPixelConverter ToIntArgbConverter =
-        ByteBgra.ToIntArgbSameConv.nonpremul;
-    public static final ByteToIntPixelConverter ToIntArgbPreConverter =
-        ByteBgra.ToIntArgbPreConv.instance;
+    private static ByteToBytePixelConverter ToByteBgraConv;
+    public  static ByteToBytePixelConverter ToByteBgraConverter() {
+        if (ToByteBgraConv == null) {
+            ToByteBgraConv = BaseByteToByteConverter.create(accessor);
+        }
+        return ToByteBgraConv;
+    }
+
+    public static ByteToBytePixelConverter ToByteBgraPreConverter() {
+        return ByteBgra.ToByteBgraPreConv.instance;
+    }
+
+    public static ByteToIntPixelConverter ToIntArgbConverter() {
+        return ByteBgra.ToIntArgbSameConv.nonpremul;
+    }
+
+    public static ByteToIntPixelConverter ToIntArgbPreConverter() {
+        return ByteBgra.ToIntArgbPreConv.instance;
+    }
 
     static class Accessor implements BytePixelAccessor {
         static final BytePixelAccessor instance = new Accessor();
--- a/modules/graphics/src/main/java/com/sun/javafx/image/impl/ByteBgraPre.java	Thu Sep 11 11:04:27 2014 -0600
+++ b/modules/graphics/src/main/java/com/sun/javafx/image/impl/ByteBgraPre.java	Thu Sep 11 15:13:11 2014 -0700
@@ -40,14 +40,25 @@
     public static final BytePixelSetter     setter = Accessor.instance;
     public static final BytePixelAccessor accessor = Accessor.instance;
 
-    public static final ByteToBytePixelConverter ToByteBgraConverter =
-        ByteBgraPre.ToByteBgraConv.instance;
-    public static final ByteToBytePixelConverter ToByteBgraPreConverter =
-        BaseByteToByteConverter.create(accessor);
-    public static final ByteToIntPixelConverter ToIntArgbConverter =
-        ByteBgraPre.ToIntArgbConv.instance;
-    public static final ByteToIntPixelConverter ToIntArgbPreConverter =
-        ByteBgra.ToIntArgbSameConv.premul;
+    public static ByteToBytePixelConverter ToByteBgraConverter() {
+        return ByteBgraPre.ToByteBgraConv.instance;
+    }
+
+    private static ByteToBytePixelConverter ToByteBgraPreObj;
+    public  static ByteToBytePixelConverter ToByteBgraPreConverter() {
+        if (ToByteBgraPreObj == null) {
+            ToByteBgraPreObj = BaseByteToByteConverter.create(accessor);
+        }
+        return ToByteBgraPreObj;
+    }
+
+    public static ByteToIntPixelConverter ToIntArgbConverter() {
+        return ByteBgraPre.ToIntArgbConv.instance;
+    }
+
+    public static ByteToIntPixelConverter ToIntArgbPreConverter() {
+        return ByteBgra.ToIntArgbSameConv.premul;
+    }
 
     static class Accessor implements BytePixelAccessor {
         static final BytePixelAccessor instance = new Accessor();
--- a/modules/graphics/src/main/java/com/sun/javafx/image/impl/ByteGray.java	Thu Sep 11 11:04:27 2014 -0600
+++ b/modules/graphics/src/main/java/com/sun/javafx/image/impl/ByteGray.java	Thu Sep 11 15:13:11 2014 -0700
@@ -41,18 +41,33 @@
     public static final BytePixelSetter     setter = Accessor.instance;
     public static final BytePixelAccessor accessor = Accessor.instance;
 
-    public static final ByteToBytePixelConverter ToByteGrayConverter =
-        BaseByteToByteConverter.create(accessor);
-    public static final ByteToBytePixelConverter ToByteBgraConverter =
-        ByteGray.ToByteBgrfConv.nonpremult;
-    public static final ByteToBytePixelConverter ToByteBgraPreConverter =
-        ByteGray.ToByteBgrfConv.premult;
-    public static final ByteToIntPixelConverter ToIntArgbConverter =
-        ByteGray.ToIntFrgbConv.nonpremult;
-    public static final ByteToIntPixelConverter ToIntArgbPreConverter =
-        ByteGray.ToIntFrgbConv.premult;
-    public static final ByteToBytePixelConverter ToByteBgrConverter =
-        ByteGray.ToByteRgbAnyConv.bgr;
+    private static ByteToBytePixelConverter ToByteGrayObj;
+    public  static ByteToBytePixelConverter ToByteGrayConverter() {
+        if (ToByteGrayObj == null) {
+            ToByteGrayObj = BaseByteToByteConverter.create(accessor);
+        }
+        return ToByteGrayObj;
+    }
+
+    public static ByteToBytePixelConverter ToByteBgraConverter() {
+        return ByteGray.ToByteBgrfConv.nonpremult;
+    }
+
+    public static ByteToBytePixelConverter ToByteBgraPreConverter() {
+        return ByteGray.ToByteBgrfConv.premult;
+    }
+
+    public static ByteToIntPixelConverter ToIntArgbConverter() {
+        return ByteGray.ToIntFrgbConv.nonpremult;
+    }
+
+    public static ByteToIntPixelConverter ToIntArgbPreConverter() {
+        return ByteGray.ToIntFrgbConv.premult;
+    }
+
+    public static ByteToBytePixelConverter ToByteBgrConverter() {
+        return ByteGray.ToByteRgbAnyConv.bgr;
+    }
 
     static class Accessor implements BytePixelAccessor {
         static final BytePixelAccessor instance = new Accessor();
@@ -208,7 +223,7 @@
         static ToByteRgbAnyConv bgr = new ToByteRgbAnyConv(ByteBgr.setter);
 
         private ToByteRgbAnyConv(BytePixelSetter setter) {
-            super(Accessor.instance, setter);
+            super(ByteGray.getter, setter);
         }
 
         @Override
--- a/modules/graphics/src/main/java/com/sun/javafx/image/impl/ByteGrayAlpha.java	Thu Sep 11 11:04:27 2014 -0600
+++ b/modules/graphics/src/main/java/com/sun/javafx/image/impl/ByteGrayAlpha.java	Thu Sep 11 15:13:11 2014 -0700
@@ -38,10 +38,13 @@
     public static final BytePixelSetter     setter = Accessor.nonpremul;
     public static final BytePixelAccessor accessor = Accessor.nonpremul;
 
-    public static final ByteToBytePixelConverter ToByteGrayAlphaPre =
-        ToByteGrayAlphaPreConv.instance;
-    public static final ByteToBytePixelConverter ToByteBgra =
-        ToByteBgraSameConv.nonpremul;
+    public static ByteToBytePixelConverter ToByteGrayAlphaPreConverter() {
+        return ToByteGrayAlphaPreConv.instance;
+    }
+
+    public static ByteToBytePixelConverter ToByteBgraConverter() {
+        return ToByteBgraSameConv.nonpremul;
+    }
 
     static class Accessor implements BytePixelAccessor {
         static final BytePixelAccessor nonpremul = new Accessor(false);
--- a/modules/graphics/src/main/java/com/sun/javafx/image/impl/ByteGrayAlphaPre.java	Thu Sep 11 11:04:27 2014 -0600
+++ b/modules/graphics/src/main/java/com/sun/javafx/image/impl/ByteGrayAlphaPre.java	Thu Sep 11 15:13:11 2014 -0700
@@ -35,6 +35,7 @@
     public static final BytePixelSetter     setter = ByteGrayAlpha.Accessor.premul;
     public static final BytePixelAccessor accessor = ByteGrayAlpha.Accessor.premul;
 
-    public static final ByteToBytePixelConverter ToByteBgraPre =
-        ByteGrayAlpha.ToByteBgraSameConv.premul;
+    public static ByteToBytePixelConverter ToByteBgraPreConverter() {
+        return ByteGrayAlpha.ToByteBgraSameConv.premul;
+    }
 }
--- a/modules/graphics/src/main/java/com/sun/javafx/image/impl/ByteRgb.java	Thu Sep 11 11:04:27 2014 -0600
+++ b/modules/graphics/src/main/java/com/sun/javafx/image/impl/ByteRgb.java	Thu Sep 11 15:13:11 2014 -0700
@@ -37,18 +37,29 @@
 public class ByteRgb {
     public static final BytePixelGetter getter = Getter.instance;
 
-    public static final ByteToBytePixelConverter ToByteBgraConverter =
-        ByteRgb.ToByteBgrfConv.nonpremult;
-    public static final ByteToBytePixelConverter ToByteBgraPreConverter =
-        ByteRgb.ToByteBgrfConv.premult;
-    public static final ByteToIntPixelConverter ToIntArgbConverter =
-        ByteRgb.ToIntFrgbConv.nonpremult;
-    public static final ByteToIntPixelConverter ToIntArgbPreConverter =
-        ByteRgb.ToIntFrgbConv.premult;
-    public static final ByteToBytePixelConverter ToByteArgbConverter =
-        ByteRgb.ToByteFrgbConv.nonpremult;
-    public static final ByteToBytePixelConverter ToByteBgrConverter =
-        ByteRgb.SwapThreeByteConverter.rgbToBgrInstance;
+    public static ByteToBytePixelConverter ToByteBgraConverter() {
+        return ByteRgb.ToByteBgrfConv.nonpremult;
+    }
+
+    public static ByteToBytePixelConverter ToByteBgraPreConverter() {
+        return ByteRgb.ToByteBgrfConv.premult;
+    }
+
+    public static ByteToIntPixelConverter ToIntArgbConverter() {
+        return ByteRgb.ToIntFrgbConv.nonpremult;
+    }
+
+    public static ByteToIntPixelConverter ToIntArgbPreConverter() {
+        return ByteRgb.ToIntFrgbConv.premult;
+    }
+
+    public static ByteToBytePixelConverter ToByteArgbConverter() {
+        return ByteRgb.ToByteFrgbConv.nonpremult;
+    }
+
+    public static final ByteToBytePixelConverter ToByteBgrConverter() {
+        return ByteRgb.SwapThreeByteConverter.rgbToBgrInstance;
+    }
 
     static class Getter implements BytePixelGetter {
         static final BytePixelGetter instance = new Getter();
@@ -104,11 +115,7 @@
             new ToByteBgrfConv(ByteBgraPre.setter);
 
         private ToByteBgrfConv(BytePixelSetter setter) {
-            // Note that using ByteRgb.getter here causes a circular reference
-            // between the classes that prevents the above *premult fields
-            // from being initialized before the ByteRgb class copies their
-            // (not yet inited = null) values into its owns static fields.
-            super(ByteRgb.Getter.instance, setter);
+            super(ByteRgb.getter, setter);
         }
 
         @Override
@@ -160,11 +167,7 @@
             new ToIntFrgbConv(IntArgbPre.setter);
 
         private ToIntFrgbConv(IntPixelSetter setter) {
-            // Note that using ByteRgb.getter here causes a circular reference
-            // between the classes that prevents the above *premult fields
-            // from being initialized before the ByteRgb class copies their
-            // (not yet inited = null) values into its owns static fields.
-            super(ByteRgb.Getter.instance, setter);
+            super(ByteRgb.getter, setter);
         }
 
         @Override
@@ -210,11 +213,7 @@
             new ToByteFrgbConv(ByteArgb.setter);
 
         private ToByteFrgbConv(BytePixelSetter setter) {
-            // Note that using ByteRgb.getter here causes a circular reference
-            // between the classes that prevents the above *premult fields
-            // from being initialized before the ByteRgb class copies their
-            // (not yet inited = null) values into its owns static fields.
-            super(ByteRgb.Getter.instance, setter);
+            super(ByteRgb.getter, setter);
         }
 
         @Override
@@ -258,8 +257,7 @@
 
     static class SwapThreeByteConverter extends BaseByteToByteConverter {
         static final ByteToBytePixelConverter rgbToBgrInstance =
-            new SwapThreeByteConverter(ByteRgb.Getter.instance,
-                                       ByteBgr.Accessor.instance);
+            new SwapThreeByteConverter(ByteRgb.getter, ByteBgr.accessor);
 
         public SwapThreeByteConverter(BytePixelGetter getter, BytePixelSetter setter) {
             super(getter, setter);
--- a/modules/graphics/src/main/java/com/sun/javafx/image/impl/ByteRgba.java	Thu Sep 11 11:04:27 2014 -0600
+++ b/modules/graphics/src/main/java/com/sun/javafx/image/impl/ByteRgba.java	Thu Sep 11 15:13:11 2014 -0700
@@ -40,13 +40,27 @@
     public static final BytePixelSetter     setter = Accessor.instance;
     public static final BytePixelAccessor accessor = Accessor.instance;
 
-    public static final ByteToBytePixelConverter ToByteRgbaConverter =
-        BaseByteToByteConverter.create(accessor);
-    public static final ByteToBytePixelConverter ToByteBgraConverter =
-        BaseByteToByteConverter.createReorderer(getter, ByteBgra.setter,
-                                                2, 1, 0, 3);
-//    public static final ByteToBytePixelConverter ToByteBgraPreConverter =
-//        ByteRgba.ToByteBgraPreConv.instance;
+    private static ByteToBytePixelConverter ToByteRgbaObj;
+    public  static ByteToBytePixelConverter ToByteRgbaConverter() {
+        if (ToByteRgbaObj == null) {
+            ToByteRgbaObj = BaseByteToByteConverter.create(accessor);
+        }
+        return ToByteRgbaObj;
+    }
+
+    private static ByteToBytePixelConverter ToByteBgraObj;
+    public  static ByteToBytePixelConverter ToByteBgraConverter() {
+        if (ToByteBgraObj == null) {
+            ToByteBgraObj =
+                    BaseByteToByteConverter.createReorderer(getter, ByteBgra.setter,
+                                                            2, 1, 0, 3);
+        }
+        return ToByteBgraObj;
+    }
+
+//    public static ByteToBytePixelConverter ToByteBgraPreConverter() {
+//        return ByteRgba.ToByteBgraPreConv.instance;
+//    }
 
     static class Accessor implements BytePixelAccessor {
         static final BytePixelAccessor instance = new Accessor();
--- a/modules/graphics/src/main/java/com/sun/javafx/image/impl/IntArgb.java	Thu Sep 11 11:04:27 2014 -0600
+++ b/modules/graphics/src/main/java/com/sun/javafx/image/impl/IntArgb.java	Thu Sep 11 15:13:11 2014 -0700
@@ -40,14 +40,29 @@
     public static final IntPixelSetter     setter = Accessor.instance;
     public static final IntPixelAccessor accessor = Accessor.instance;
 
-    public static final IntToBytePixelConverter ToByteBgraConverter =
-        new IntTo4ByteSameConverter(IntArgb.getter, ByteBgra.setter);
-    public static final IntToBytePixelConverter ToByteBgraPreConverter =
-        IntArgb.ToByteBgraPreConv.instance;
-    public static final IntToIntPixelConverter ToIntArgbConverter =
-        BaseIntToIntConverter.create(accessor);
-    public static final IntToIntPixelConverter ToIntArgbPreConverter =
-        IntArgb.ToIntArgbPreConv.instance;
+    private static IntToBytePixelConverter ToByteBgraObj;
+    public  static IntToBytePixelConverter ToByteBgraConverter() {
+        if (ToByteBgraObj == null) {
+            ToByteBgraObj = new IntTo4ByteSameConverter(IntArgb.getter, ByteBgra.setter);
+        }
+        return ToByteBgraObj;
+    }
+
+    public static IntToBytePixelConverter ToByteBgraPreConverter() {
+        return IntArgb.ToByteBgraPreConv.instance;
+    }
+
+    private static IntToIntPixelConverter ToIntArgbObj;
+    public  static IntToIntPixelConverter ToIntArgbConverter() {
+        if (ToIntArgbObj == null) {
+            ToIntArgbObj = BaseIntToIntConverter.create(accessor);
+        }
+        return ToIntArgbObj;
+    }
+
+    public static IntToIntPixelConverter ToIntArgbPreConverter() {
+        return IntArgb.ToIntArgbPreConv.instance;
+    }
 
     static class Accessor implements IntPixelAccessor {
         static final IntPixelAccessor instance = new Accessor();
--- a/modules/graphics/src/main/java/com/sun/javafx/image/impl/IntArgbPre.java	Thu Sep 11 11:04:27 2014 -0600
+++ b/modules/graphics/src/main/java/com/sun/javafx/image/impl/IntArgbPre.java	Thu Sep 11 15:13:11 2014 -0700
@@ -40,14 +40,30 @@
     public static final IntPixelSetter     setter = Accessor.instance;
     public static final IntPixelAccessor accessor = Accessor.instance;
 
-    public static final IntToBytePixelConverter ToByteBgraConverter =
-        IntArgbPre.ToByteBgraConv.instance;
-    public static final IntToBytePixelConverter ToByteBgraPreConverter =
-        new IntTo4ByteSameConverter(IntArgbPre.getter, ByteBgraPre.setter);
-    public static final IntToIntPixelConverter ToIntArgbConverter =
-        IntArgbPre.ToIntArgbConv.instance;
-    public static final IntToIntPixelConverter ToIntArgbPreConverter =
-        BaseIntToIntConverter.create(accessor);
+    public static IntToBytePixelConverter ToByteBgraConverter() {
+        return IntArgbPre.ToByteBgraConv.instance;
+    }
+
+    private static IntToBytePixelConverter ToByteBgraPreObj;
+    public  static IntToBytePixelConverter ToByteBgraPreConverter() {
+        if (ToByteBgraPreObj == null) {
+            ToByteBgraPreObj =
+                    new IntTo4ByteSameConverter(IntArgbPre.getter, ByteBgraPre.setter);
+        }
+        return ToByteBgraPreObj;
+    }
+
+    public static IntToIntPixelConverter ToIntArgbConverter() {
+        return IntArgbPre.ToIntArgbConv.instance;
+    }
+
+    private static IntToIntPixelConverter ToIntArgbPreObj;
+    public  static IntToIntPixelConverter ToIntArgbPreConverter() {
+        if (ToIntArgbPreObj == null) {
+            ToIntArgbPreObj = BaseIntToIntConverter.create(accessor);
+        }
+        return ToIntArgbPreObj;
+    }
 
     static class Accessor implements IntPixelAccessor {
         static final IntPixelAccessor instance = new Accessor();
--- a/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/PixelUtils.java	Thu Sep 11 11:04:27 2014 -0600
+++ b/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/PixelUtils.java	Thu Sep 11 15:13:11 2014 -0700
@@ -74,18 +74,18 @@
                     case Pixels.Format.BYTE_ARGB:
                     {
                         byte newbytes[] = new byte[w * h * 4];
-                        ByteRgb.ToByteArgbConverter.convert(bytes, 0, scanBytes,
-                                                            newbytes, 0, w * 4,
-                                                            w, h);
+                        ByteRgb.ToByteArgbConverter().convert(bytes, 0, scanBytes,
+                                                              newbytes, 0, w * 4,
+                                                              w, h);
                         bytes = ByteBuffer.wrap(newbytes);
                         break;
                     }
                     case Pixels.Format.BYTE_BGRA_PRE:
                     {
                         byte newbytes[] = new byte[w * h * 4];
-                        ByteRgb.ToByteBgraPreConverter.convert(bytes, 0, scanBytes,
-                                                               newbytes, 0, w * 4,
-                                                               w, h);
+                        ByteRgb.ToByteBgraPreConverter().convert(bytes, 0, scanBytes,
+                                                                 newbytes, 0, w * 4,
+                                                                 w, h);
                         bytes = ByteBuffer.wrap(newbytes);
                         break;
                     }
@@ -95,8 +95,8 @@
             } else if (image.getPixelFormat() != PixelFormat.BYTE_BGRA_PRE) {
                 throw new IllegalArgumentException("non-RGB image format");
             }
-            pixels = app.createPixels((int)image.getWidth(),
-                                      (int)image.getHeight(), bytes);
+            pixels = app.createPixels(image.getWidth(),
+                                      image.getHeight(), bytes);
             return pixels;
         } else if (pixelType == PixelFormat.DataType.INT) {
             if (ByteOrder.nativeOrder() != ByteOrder.LITTLE_ENDIAN) {
@@ -108,8 +108,8 @@
              * is INT_ARGB_PRE == BYTE_BGRA_PRE.  No conversion necessary.
              */
             IntBuffer ints = (IntBuffer)image.getPixelBuffer();
-            pixels = app.createPixels((int)image.getWidth(),
-                                      (int)image.getHeight(), ints);
+            pixels = app.createPixels(image.getWidth(),
+                                      image.getHeight(), ints);
             return pixels;
         } else {
             throw new IllegalArgumentException("unhandled image type: " + pixelType);
--- a/modules/graphics/src/main/java/com/sun/prism/Image.java	Thu Sep 11 11:04:27 2014 -0600
+++ b/modules/graphics/src/main/java/com/sun/prism/Image.java	Thu Sep 11 15:13:11 2014 -0700
@@ -56,11 +56,11 @@
 import com.sun.prism.impl.BufferUtil;
 
 public class Image implements PlatformImage {
-    static final javafx.scene.image.WritablePixelFormat FX_ByteBgraPre_FORMAT =
+    static final javafx.scene.image.WritablePixelFormat<ByteBuffer> FX_ByteBgraPre_FORMAT =
         javafx.scene.image.PixelFormat.getByteBgraPreInstance();
-    static final javafx.scene.image.WritablePixelFormat FX_IntArgbPre_FORMAT =
+    static final javafx.scene.image.WritablePixelFormat<IntBuffer> FX_IntArgbPre_FORMAT =
         javafx.scene.image.PixelFormat.getIntArgbPreInstance();
-    static final javafx.scene.image.PixelFormat FX_ByteRgb_FORMAT =
+    static final javafx.scene.image.PixelFormat<ByteBuffer> FX_ByteRgb_FORMAT =
         javafx.scene.image.PixelFormat.getByteRgbInstance();
 
     private final Buffer pixelBuffer;
@@ -220,30 +220,30 @@
             case RGBA:
                 // Bgra => BgrePre is same operation as Rgba => RgbaPre
                 // TODO: 3D - need a way to handle pre versus non-Pre
-                ByteBgra.ToByteBgraPreConverter.convert(buffer, 0, scanBytes,
-                                                        buffer, 0, scanBytes,
-                                                        w, h);
+                ByteBgra.ToByteBgraPreConverter().convert(buffer, 0, scanBytes,
+                                                          buffer, 0, scanBytes,
+                                                          w, h);
                 /* NOBREAK */
             case RGBA_PRE:
-                ByteRgba.ToByteBgraConverter.convert(buffer, 0, scanBytes,
-                                                     buffer, 0, scanBytes,
-                                                     w, h);
+                ByteRgba.ToByteBgraConverter().convert(buffer, 0, scanBytes,
+                                                       buffer, 0, scanBytes,
+                                                       w, h);
                 return Image.fromByteBgraPreData(buffer, w, h, scanBytes, ps);
 
             case GRAY_ALPHA:
                 // TODO: 3D - need a way to handle pre versus non-Pre
-                ByteGrayAlpha.ToByteGrayAlphaPre.convert(buffer, 0, scanBytes,
-                                                         buffer, 0, scanBytes,
-                                                         w, h);
+                ByteGrayAlpha.ToByteGrayAlphaPreConverter().convert(buffer, 0, scanBytes,
+                                                                    buffer, 0, scanBytes,
+                                                                    w, h);
                 /* NOBREAK */
             case GRAY_ALPHA_PRE:
                 if (scanBytes != w * 2) {
                     throw new AssertionError("Bad stride for GRAY_ALPHA");
                 };
                 byte newbuf[] = new byte[w * h * 4];
-                ByteGrayAlphaPre.ToByteBgraPre.convert(buffer, 0, scanBytes,
-                                                       newbuf, 0, w*4,
-                                                       w, h);
+                ByteGrayAlphaPre.ToByteBgraPreConverter().convert(buffer, 0, scanBytes,
+                                                                  newbuf, 0, w*4,
+                                                                  w, h);
                 return Image.fromByteBgraPreData(newbuf, w, h, ps);
             default:
                 throw new RuntimeException("Unknown image type: " + type);
@@ -442,7 +442,7 @@
      * @param pixels the buffer containing the pixels to copy
      * @param format the format of the given buffer
      * @param minX the x offset of the upper-left corner of the pixel region
-     * @param minX the y offset of the upper-left corner of the pixel region
+     * @param minY the y offset of the upper-left corner of the pixel region
      * @param width the width of the pixel region to be copied, in pixels
      * @param height the height of the pixel region to be copied, in pixels
      * @param scanlineStride the scanline stride of the given buffer, in bytes
@@ -545,11 +545,11 @@
 
         ByteToIntPixelConverter converter;
         if (tnumBands == 1) {
-            converter = ByteGray.ToIntArgbPreConverter;
+            converter = ByteGray.ToIntArgbPreConverter();
         } else if (pixelFormat == PixelFormat.BYTE_BGRA_PRE) {
-            converter = ByteBgraPre.ToIntArgbPreConverter;
+            converter = ByteBgraPre.ToIntArgbPreConverter();
         } else { // BYTE_RGB
-            converter = ByteRgb.ToIntArgbPreConverter;
+            converter = ByteRgb.ToIntArgbPreConverter();
         }
 
         //new int array for holding new int formatted image data
@@ -580,15 +580,15 @@
         ByteBuffer oldbuf = (ByteBuffer) pixelBuffer;
         ByteBuffer newbuf = ByteBuffer.allocate(width * height * 4);
         int oldpos = minY * scanlineStride + minX * 3;
-        ByteRgb.ToByteBgraPreConverter.convert(oldbuf, oldpos, scanlineStride,
-                                               newbuf, 0, width * 4,
-                                               width, height);
+        ByteRgb.ToByteBgraPreConverter().convert(oldbuf, oldpos, scanlineStride,
+                                                 newbuf, 0, width * 4,
+                                                 width, height);
         return new Image(PixelFormat.BYTE_BGRA_PRE, newbuf,
                          width, height, 0, 0, width * 4, getPixelScale());
     }
 
-    private Accessor pixelaccessor;
-    private Accessor getPixelAccessor() {
+    private Accessor<?> pixelaccessor;
+    private Accessor<?> getPixelAccessor() {
         if (pixelaccessor == null) {
             switch (getPixelFormat()) {
                 case BYTE_ALPHA:
@@ -617,13 +617,13 @@
             }
         }
         if (pixelaccessor != null && pixelScale != 1.0f) {
-            pixelaccessor = new ScaledAccessor(pixelaccessor, pixelScale);
+            pixelaccessor = new ScaledAccessor<>(pixelaccessor, pixelScale);
         }
         return pixelaccessor;
     }
 
     @Override
-    public javafx.scene.image.PixelFormat getPlatformPixelFormat() {
+    public javafx.scene.image.PixelFormat<?> getPlatformPixelFormat() {
         return getPixelAccessor().getPlatformPixelFormat();
     }
 
@@ -724,7 +724,7 @@
 
         public abstract void setArgb(int x, int y, int argb);
 
-        public abstract javafx.scene.image.PixelFormat getPlatformPixelFormat();
+        public abstract javafx.scene.image.PixelFormat<I> getPlatformPixelFormat();
 
         public abstract boolean isWritable();
 
@@ -790,7 +790,7 @@
         }
 
         @Override
-        public javafx.scene.image.PixelFormat getPlatformPixelFormat() {
+        public javafx.scene.image.PixelFormat<I> getPlatformPixelFormat() {
             return theDelegate.getPlatformPixelFormat();
         }
 
@@ -954,7 +954,7 @@
         }
 
         @Override
-        public javafx.scene.image.PixelFormat getPlatformPixelFormat() {
+        public javafx.scene.image.PixelFormat<I> getPlatformPixelFormat() {
             return theFormat;
         }
 
@@ -1154,8 +1154,8 @@
         }
     }
 
-    static javafx.scene.image.PixelFormat FX_ByteGray_FORMAT;
-    static javafx.scene.image.PixelFormat getGrayFXPixelFormat() {
+    static javafx.scene.image.PixelFormat<ByteBuffer> FX_ByteGray_FORMAT;
+    static javafx.scene.image.PixelFormat<ByteBuffer> getGrayFXPixelFormat() {
         if (FX_ByteGray_FORMAT == null) {
             int grays[] = new int[256];
             int gray = 0xff000000;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/system/src/test/java/com/sun/javafx/image/impl/ImageRaceTest.java	Thu Sep 11 15:13:11 2014 -0700
@@ -0,0 +1,245 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.javafx.image.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+import javafx.application.Application;
+import javafx.application.Platform;
+import javafx.stage.Stage;
+import org.junit.Test;
+
+public class ImageRaceTest extends Application {
+    static boolean verbose;
+    static List<Initializer> initalizers = new ArrayList<>();
+    static volatile boolean ready = false;
+
+    static interface InitProc {
+        public Object get();
+    }
+
+    static class Initializer extends Thread {
+        private final InitProc init;
+        private volatile boolean running;
+
+        public Initializer(String classname, InitProc r) {
+            super(classname+" Initializer");
+            this.init = r;
+        }
+
+        public boolean isRunning() { return running; }
+
+        @Override
+        public void run() {
+            if (verbose) System.err.println(getName()+" started");
+            running = true;
+            while (!ready) { yield(); }
+            init.get();
+            if (verbose) System.err.println(getName()+" done");
+        }
+    }
+
+    @Override
+    public void start(Stage stage) {
+        forkAndJoinInitializers();
+
+        Platform.exit();
+    }
+
+    void forkAndJoinInitializers() {
+        long limit = System.currentTimeMillis() + 1000;
+        for (Initializer i : initalizers) {
+            i.start();
+            while (!i.isRunning() && System.currentTimeMillis() < limit) {
+                Thread.yield();
+            }
+            if (!i.isRunning()) {
+                throw new RuntimeException("Initializer "+i+" never started");
+            }
+        }
+
+        if (verbose) System.err.println("\n[main] signal the threads to proceed\n");
+        try {
+            Thread.sleep(100);
+        } catch (InterruptedException ex) {}
+        ready = true;
+
+        limit = System.currentTimeMillis() + 3000;
+        try {
+            for (Initializer i : initalizers) {
+                long now = System.currentTimeMillis();
+                if (now < limit) {
+                    i.join(limit - now);
+                }
+                if (i.isAlive()) {
+                    throw new RuntimeException("Initializer "+i+" never finished");
+                }
+            }
+        } catch (InterruptedException ex) {}
+    }
+
+    public static void main(String[] args) {
+        init(args);
+        Application.launch(args);
+    }
+
+    static void init(String[] args) {
+        boolean getters, setters, converters;
+        if (args.length == 0) {
+            getters = setters = converters = true;
+        } else {
+            getters = setters = converters = false;
+            for (String arg : args) {
+                if (arg.equalsIgnoreCase("getters")) {
+                    getters = true;
+                } else if (arg.equalsIgnoreCase("setters")) {
+                    setters = true;
+                } else if (arg.equalsIgnoreCase("converters")) {
+                    converters = true;
+                } else if (arg.equalsIgnoreCase("-verbose")) {
+                    verbose = true;
+                } else {
+                    System.err.println("Unrecognized argument: "+arg);
+                    System.exit(-1);
+                }
+            }
+        }
+        if (getters) {
+            initalizers.add(new Initializer("ByteArgb.getter",         () -> { return ByteArgb.getter; } ));
+            initalizers.add(new Initializer("ByteBgr.getter",          () -> { return ByteBgr.getter; } ));
+            initalizers.add(new Initializer("ByteBgra.getter",         () -> { return ByteBgra.getter; } ));
+            initalizers.add(new Initializer("ByteBgraPre.getter",      () -> { return ByteBgraPre.getter; } ));
+            initalizers.add(new Initializer("ByteGray.getter",         () -> { return ByteGray.getter; } ));
+            initalizers.add(new Initializer("ByteGrayAlpha.getter",    () -> { return ByteGrayAlpha.getter; } ));
+            initalizers.add(new Initializer("ByteGrayAlphaPre.getter", () -> { return ByteGrayAlphaPre.getter; } ));
+//            initalizers.add(new Initializer("ByteIndexed.getter",    /* Has no .getter */ ));
+            initalizers.add(new Initializer("ByteRgb.getter",          () -> { return ByteRgb.getter; } ));
+            initalizers.add(new Initializer("ByteRgba.getter",         () -> { return ByteRgba.getter; } ));
+            initalizers.add(new Initializer("IntArgb.getter",          () -> { return IntArgb.getter; } ));
+            initalizers.add(new Initializer("IntArgbPre.getter",       () -> { return IntArgbPre.getter; } ));
+        }
+        if (setters) {
+            initalizers.add(new Initializer("ByteArgb.setter",         () -> { return ByteArgb.setter; } ));
+            initalizers.add(new Initializer("ByteBgr.setter",          () -> { return ByteBgr.setter; } ));
+            initalizers.add(new Initializer("ByteBgra.setter",         () -> { return ByteBgra.setter; } ));
+            initalizers.add(new Initializer("ByteBgraPre.setter",      () -> { return ByteBgraPre.setter; } ));
+            initalizers.add(new Initializer("ByteGray.setter",         () -> { return ByteGray.setter; } ));
+            initalizers.add(new Initializer("ByteGrayAlpha.setter",    () -> { return ByteGrayAlpha.setter; } ));
+            initalizers.add(new Initializer("ByteGrayAlphaPre.setter", () -> { return ByteGrayAlphaPre.setter; } ));
+//            initalizers.add(new Initializer("ByteIndexed.setter",    /* Has no .setter */ ));
+//            initalizers.add(new Initializer("ByteRgb.setter",          /* Has no .setter */ ));
+            initalizers.add(new Initializer("ByteRgba.setter",         () -> { return ByteRgba.setter; } ));
+            initalizers.add(new Initializer("IntArgb.setter",          () -> { return IntArgb.setter; } ));
+            initalizers.add(new Initializer("IntArgbPre.setter",       () -> { return IntArgbPre.setter; } ));
+        }
+        if (converters) {
+            initalizers.add(new Initializer("ByteBgr.ToByteArgb", () ->
+                                    { return ByteBgr.ToByteArgbConverter(); } ));
+            initalizers.add(new Initializer("ByteBgr.ToByteBgr", () ->
+                                    { return ByteBgr.ToByteBgrConverter(); } ));
+            initalizers.add(new Initializer("ByteBgr.ToByteBgra", () ->
+                                    { return ByteBgr.ToByteBgraConverter(); } ));
+            initalizers.add(new Initializer("ByteBgr.ToByteBgraPre", () ->
+                                    { return ByteBgr.ToByteBgraPreConverter(); } ));
+            initalizers.add(new Initializer("ByteBgr.ToIntArgb", () ->
+                                    { return ByteBgr.ToIntArgbConverter(); } ));
+            initalizers.add(new Initializer("ByteBgr.ToIntArgbPre", () ->
+                                    { return ByteBgr.ToIntArgbPreConverter(); } ));
+            initalizers.add(new Initializer("ByteBgra.ToByteBgra", () ->
+                                    { return ByteBgra.ToByteBgraConverter(); } ));
+            initalizers.add(new Initializer("ByteBgra.ToByteBgraPre", () ->
+                                    { return ByteBgra.ToByteBgraPreConverter(); } ));
+            initalizers.add(new Initializer("ByteBgra.ToIntArgb",  () ->
+                                    { return ByteBgra.ToIntArgbConverter(); } ));
+            initalizers.add(new Initializer("ByteBgra.ToIntArgbPre",  () ->
+                                    { return ByteBgra.ToIntArgbPreConverter(); } ));
+            initalizers.add(new Initializer("ByteBgraPre.ToByteBgra", () ->
+                                    { return ByteBgraPre.ToByteBgraConverter(); } ));
+            initalizers.add(new Initializer("ByteBgraPre.ToByteBgraPre", () ->
+                                    { return ByteBgraPre.ToByteBgraPreConverter(); } ));
+            initalizers.add(new Initializer("ByteBgraPre.ToIntArgb", () ->
+                                    { return ByteBgraPre.ToIntArgbConverter(); } ));
+            initalizers.add(new Initializer("ByteBgraPre.ToIntArgbPre", () ->
+                                    { return ByteBgraPre.ToIntArgbPreConverter(); } ));
+            initalizers.add(new Initializer("ByteGray.ToByteBgr", () ->
+                                    { return ByteGray.ToByteBgrConverter(); } ));
+            initalizers.add(new Initializer("ByteGray.ToByteBgra", () ->
+                                    { return ByteGray.ToByteBgraConverter(); } ));
+            initalizers.add(new Initializer("ByteGray.ToByteBgraPre", () ->
+                                    { return ByteGray.ToByteBgraPreConverter(); } ));
+            initalizers.add(new Initializer("ByteGray.ToByteGray", () ->
+                                    { return ByteGray.ToByteGrayConverter(); } ));
+            initalizers.add(new Initializer("ByteGray.ToIntArgb", () ->
+                                    { return ByteGray.ToIntArgbConverter(); } ));
+            initalizers.add(new Initializer("ByteGray.ToIntArgbPre", () ->
+                                    { return ByteGray.ToIntArgbPreConverter(); } ));
+            initalizers.add(new Initializer("ByteGrayAlpha.ToByteBgra", () ->
+                                    { return ByteGrayAlpha.ToByteBgraConverter(); } ));
+            initalizers.add(new Initializer("ByteGrayAlpha.ToByteGrayAlphaPre", () ->
+                                    { return ByteGrayAlpha.ToByteGrayAlphaPreConverter(); } ));
+            initalizers.add(new Initializer("ByteGrayAlphaPre.ToByteBgraPre", () ->
+                                    { return ByteGrayAlphaPre.ToByteBgraPreConverter(); } ));
+            initalizers.add(new Initializer("ByteRgb.ToByteArgb", () ->
+                                    { return ByteRgb.ToByteArgbConverter(); } ));
+            initalizers.add(new Initializer("ByteRgb.ToByteBgr", () ->
+                                    { return ByteRgb.ToByteBgrConverter(); } ));
+            initalizers.add(new Initializer("ByteRgb.ToByteBgra", () ->
+                                    { return ByteRgb.ToByteBgraConverter(); } ));
+            initalizers.add(new Initializer("ByteRgb.ToByteBgraPre", () ->
+                                    { return ByteRgb.ToByteBgraPreConverter(); } ));
+            initalizers.add(new Initializer("ByteRgb.ToIntArgb", () ->
+                                    { return ByteRgb.ToIntArgbConverter(); } ));
+            initalizers.add(new Initializer("ByteRgb.ToIntArgbPre", () ->
+                                    { return ByteRgb.ToIntArgbPreConverter(); } ));
+            initalizers.add(new Initializer("ByteRgba.ToByteBgra", () ->
+                                    { return ByteRgba.ToByteBgraConverter(); } ));
+            initalizers.add(new Initializer("ByteRgba.ToByteRgba", () ->
+                                    { return ByteRgba.ToByteRgbaConverter(); } ));
+            initalizers.add(new Initializer("IntArgb.ToByteBgra", () ->
+                                    { return IntArgb.ToByteBgraConverter(); } ));
+            initalizers.add(new Initializer("IntArgb.ToByteBgraPre", () ->
+                                    { return IntArgb.ToByteBgraPreConverter(); } ));
+            initalizers.add(new Initializer("IntArgb.ToIntArgb", () ->
+                                    { return IntArgb.ToIntArgbConverter(); } ));
+            initalizers.add(new Initializer("IntArgb.ToIntArgbPre", () ->
+                                    { return IntArgb.ToIntArgbPreConverter(); } ));
+            initalizers.add(new Initializer("IntArgbPre.ToByteBgra", () ->
+                                    { return IntArgbPre.ToByteBgraConverter(); } ));
+            initalizers.add(new Initializer("IntArgbPre.ToByteBgraPre", () ->
+                                    { return IntArgbPre.ToByteBgraPreConverter(); } ));
+            initalizers.add(new Initializer("IntArgbPre.ToIntArgb", () ->
+                                    { return IntArgbPre.ToIntArgbConverter(); } ));
+            initalizers.add(new Initializer("IntArgbPre.ToIntArgbPre", () ->
+                                    { return IntArgbPre.ToIntArgbPreConverter(); } ));
+        }
+    }
+
+    @Test
+    public void testImageInitializationRaceCondition() {
+        init(new String[0]);
+        forkAndJoinInitializers();
+    }
+}