src/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadataFormat.java

Print this page
rev 9343 : 8033716: Fix raw and unchecked lint warnings in com.sun.imageio
Reviewed-by: darcy, prr, bae


  39     private static final int MAX_JPEG_DATA_SIZE = 65533;
  40 
  41     String resourceBaseName = this.getClass().getName() + "Resources";
  42 
  43     JPEGMetadataFormat(String formatName, int childPolicy) {
  44         super(formatName, childPolicy);
  45         setResourceBaseName(resourceBaseName);
  46     }
  47 
  48     // Format shared between image and stream formats
  49     void addStreamElements(String parentName) {
  50         addElement("dqt", parentName, 1, 4);
  51 
  52         addElement("dqtable", "dqt", CHILD_POLICY_EMPTY);
  53 
  54         addAttribute("dqtable",
  55                      "elementPrecision",
  56                      DATATYPE_INTEGER,
  57                      false,
  58                      "0");
  59         List tabids = new ArrayList();
  60         tabids.add("0");
  61         tabids.add("1");
  62         tabids.add("2");
  63         tabids.add("3");
  64         addAttribute("dqtable",
  65                      "qtableId",
  66                      DATATYPE_INTEGER,
  67                      true,
  68                      null,
  69                      tabids);
  70         addObjectValue("dqtable",
  71                        JPEGQTable.class,
  72                        true,
  73                        null);
  74 
  75         addElement("dht", parentName, 1, 4);
  76         addElement("dhtable", "dht", CHILD_POLICY_EMPTY);
  77         List classes = new ArrayList();
  78         classes.add("0");
  79         classes.add("1");
  80         addAttribute("dhtable",
  81                      "class",
  82                      DATATYPE_INTEGER,
  83                      true,
  84                      null,
  85                      classes);
  86         addAttribute("dhtable",
  87                      "htableId",
  88                      DATATYPE_INTEGER,
  89                      true,
  90                      null,
  91                      tabids);
  92         addObjectValue("dhtable",
  93                        JPEGHuffmanTable.class,
  94                        true,
  95                        null);
  96 
  97 




  39     private static final int MAX_JPEG_DATA_SIZE = 65533;
  40 
  41     String resourceBaseName = this.getClass().getName() + "Resources";
  42 
  43     JPEGMetadataFormat(String formatName, int childPolicy) {
  44         super(formatName, childPolicy);
  45         setResourceBaseName(resourceBaseName);
  46     }
  47 
  48     // Format shared between image and stream formats
  49     void addStreamElements(String parentName) {
  50         addElement("dqt", parentName, 1, 4);
  51 
  52         addElement("dqtable", "dqt", CHILD_POLICY_EMPTY);
  53 
  54         addAttribute("dqtable",
  55                      "elementPrecision",
  56                      DATATYPE_INTEGER,
  57                      false,
  58                      "0");
  59         List<String> tabids = new ArrayList<>();
  60         tabids.add("0");
  61         tabids.add("1");
  62         tabids.add("2");
  63         tabids.add("3");
  64         addAttribute("dqtable",
  65                      "qtableId",
  66                      DATATYPE_INTEGER,
  67                      true,
  68                      null,
  69                      tabids);
  70         addObjectValue("dqtable",
  71                        JPEGQTable.class,
  72                        true,
  73                        null);
  74 
  75         addElement("dht", parentName, 1, 4);
  76         addElement("dhtable", "dht", CHILD_POLICY_EMPTY);
  77         List<String> classes = new ArrayList<>();
  78         classes.add("0");
  79         classes.add("1");
  80         addAttribute("dhtable",
  81                      "class",
  82                      DATATYPE_INTEGER,
  83                      true,
  84                      null,
  85                      classes);
  86         addAttribute("dhtable",
  87                      "htableId",
  88                      DATATYPE_INTEGER,
  89                      true,
  90                      null,
  91                      tabids);
  92         addObjectValue("dhtable",
  93                        JPEGHuffmanTable.class,
  94                        true,
  95                        null);
  96 
  97