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

Incorrect use of & in {@code}

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • jfx11, 10
    • javafx
    • None

      There are a couple of cases in PixelFormat.java where & is used inside {@code} such that it gets rendered literally in the HTML output as &

      ---------------------
      createByteIndexedPremultipliedInstance
      public static PixelFormat<ByteBuffer> createByteIndexedPremultipliedInstance​(int[] colors)
      Creates a PixelFormat instance describing a pixel layout with the pixels stored as single bytes representing an index into the specified lookup table of premultiplied color values in the INT_ARGB_PRE format.
      Pixels in this format can be decoded using the following sample code:


           int pixel = array[rowstart + x] &amp; 0xff;
           int argb = colors[pixel];

           int alpha = ((argb >> 24) & 0xff);
           int red = ((argb >> 16) & 0xff);
           int green = ((argb >> 8) & 0xff);
           int blue = ((argb ) & 0xff);

      -------------------------------
      createByteIndexedInstance
      public static PixelFormat<ByteBuffer> createByteIndexedInstance​(int[] colors)
      Creates a PixelFormat instance describing a pixel layout with the pixels stored as single bytes representing an index into the specified lookup table of non-premultiplied color values in the INT_ARGB format.
      Pixels in this format can be decoded using the following sample code:


           int pixel = array[rowstart + x] &amp; 0xff;
           int argb = colors[pixel];

           int alpha = ((argb >> 24) & 0xff);
           int red = ((argb >> 16) & 0xff);
           int green = ((argb >> 8) & 0xff);
           int blue = ((argb ) & 0xff);

      --------------------------------------

            nlisker Nir Lisker
            jjg Jonathan Gibbons
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: