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

The java.awt.image.LookupTable c-tor does not work

XMLWordPrintable

    • 2d
    • 1.2beta3
    • sparc
    • solaris_2.6
    • Verified



      Name: akC57697 Date: 02/04/98



      The java.awt.image.LookupTable c-tor does not work
      because of "this" omitted in LookupTable source code.

      -----
          protected LookupTable(int offset, int numComponents) {
              numComponents = numComponents; <-- "this." absent
      offset = offset; <-- "this." absent
          }
      -----

      ------------------ Example -------------
      import java.awt.image.LookupTable;
      public class testBLT extends LookupTable {

          // Create public c-tor
          public testBLT (int offset, int numComponents) {
           super(offset, numComponents);
          }
          
          public int[] lookupPixel(int a[], int b[]) { return null;}

          public static void main(String s[]) {
            byte b[]={1};
            int magic=13;
            
          testBLT table = new testBLT(magic, magic); // Try to set
         
          if (table.getOffset()!=magic || table.getNumComponents()!=magic) {
          System.out.println("Offset:"+table.getOffset()+" ws "+magic);
          System.out.println("Components:"+table.getNumComponents()+" ws "+magic);
          System.exit(0);
          }

            System.out.println("The test passed");
            System.exit(0);
         }
      }
      -----------------------------------------
      Output:
      java testBLT
      Offset:0 ws 13
      Components:0 ws 13

      ======================================================================

            jehung Jeannette Hung
            akuzminorcl Alexander Kuzmin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: