Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8299772

The ColorModel.getRGBdefault() method is not thread-safe

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 21
    • 17, 21
    • client-libs
    • None
    • 2d
    • b06
    • generic
    • generic

      The next implementation of ColorModel.getRGBdefault() is not thread-safe:

          private static ColorModel RGBdefault;

          public static ColorModel getRGBdefault() {
              if (RGBdefault == null) {
                  RGBdefault = new DirectColorModel(32,
                                                    0x00ff0000, // Red
                                                    0x0000ff00, // Green
                                                    0x000000ff, // Blue
                                                    0xff000000 // Alpha
                                                    );
              }
              return RGBdefault;
          }

            serb Sergey Bylokhov
            serb Sergey Bylokhov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: