This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[gui] Fix BigIntegers in IndexColorModel
- From: Jerry Quinn <jlquinn at optonline dot net>
- To: java-patches at gcc dot gnu dot org
- Date: Fri, 01 Oct 2004 00:19:48 -0400
- Subject: [gui] Fix BigIntegers in IndexColorModel
As discussed previously...
2004-10-01 Jerry Quinn <jlquinn@optonline.net>
* java/awt/image/IndexColorModel.java: Fix use of immutable
BigIntegers.
--- IndexColorModel.java.~1.6.14.3.~ 2004-09-27 22:28:36.000000000 -0400
+++ IndexColorModel.java 2004-09-30 20:56:15.000000000 -0400
@@ -69,7 +69,7 @@
private boolean opaque;
private int trans = -1;
private int[] rgb;
- private BigInteger validBits = new BigInteger("0");
+ private BigInteger validBits = BigInteger.ZERO;
/**
* Each array much contain <code>size</code> elements. For each
@@ -152,8 +152,7 @@
}
// Generate a bigint with 1's for every pixel
- validBits.setBit(size);
- validBits.subtract(new BigInteger("1"));
+ validBits = validBits.setBit(size).subtract(BigInteger.ONE);
}
/**
@@ -195,8 +194,7 @@
opaque = !hasAlpha;
this.trans = trans;
// Generate a bigint with 1's for every pixel
- validBits.setBit(size);
- validBits.subtract(new BigInteger("1"));
+ validBits = validBits.setBit(size).subtract(BigInteger.ONE);
}
/**
@@ -229,8 +227,7 @@
opaque = !hasAlpha;
this.trans = trans;
// Generate a bigint with 1's for every pixel
- validBits.setBit(size);
- validBits.subtract(new BigInteger("1"));
+ validBits = validBits.setBit(size).subtract(BigInteger.ONE);
}
/**