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

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

*** 42,52 **** /** * A DQT (Define Quantization Table) marker segment. */ class DQTMarkerSegment extends MarkerSegment { ! List tables = new ArrayList(); // Could be 1 to 4 DQTMarkerSegment(float quality, boolean needTwo) { super(JPEG.DQT); tables.add(new Qtable(true, quality)); if (needTwo) { --- 42,52 ---- /** * A DQT (Define Quantization Table) marker segment. */ class DQTMarkerSegment extends MarkerSegment { ! List<Qtable> tables = new ArrayList<>(); // Could be 1 to 4 DQTMarkerSegment(float quality, boolean needTwo) { super(JPEG.DQT); tables.add(new Qtable(true, quality)); if (needTwo) {
*** 84,106 **** } } protected Object clone() { DQTMarkerSegment newGuy = (DQTMarkerSegment) super.clone(); ! newGuy.tables = new ArrayList(tables.size()); ! Iterator iter = tables.iterator(); while (iter.hasNext()) { ! Qtable table = (Qtable) iter.next(); ! newGuy.tables.add(table.clone()); } return newGuy; } IIOMetadataNode getNativeNode() { IIOMetadataNode node = new IIOMetadataNode("dqt"); for (int i= 0; i<tables.size(); i++) { ! Qtable table = (Qtable) tables.get(i); node.appendChild(table.getNativeNode()); } return node; } --- 84,106 ---- } } protected Object clone() { DQTMarkerSegment newGuy = (DQTMarkerSegment) super.clone(); ! newGuy.tables = new ArrayList<>(tables.size()); ! Iterator<Qtable> iter = tables.iterator(); while (iter.hasNext()) { ! Qtable table = iter.next(); ! newGuy.tables.add((Qtable) table.clone()); } return newGuy; } IIOMetadataNode getNativeNode() { IIOMetadataNode node = new IIOMetadataNode("dqt"); for (int i= 0; i<tables.size(); i++) { ! Qtable table = tables.get(i); node.appendChild(table.getNativeNode()); } return node; }
*** 115,125 **** void print() { printTag("DQT"); System.out.println("Num tables: " + Integer.toString(tables.size())); for (int i= 0; i<tables.size(); i++) { ! Qtable table = (Qtable) tables.get(i); table.print(); } System.out.println(); } --- 115,125 ---- void print() { printTag("DQT"); System.out.println("Num tables: " + Integer.toString(tables.size())); for (int i= 0; i<tables.size(); i++) { ! Qtable table = tables.get(i); table.print(); } System.out.println(); }