src/share/classes/java/awt/geom/AffineTransform.java
Print this page
@@ -874,10 +874,11 @@
/**
* This is the utility function to calculate the flag bits when
* they have not been cached.
* @see #getType
*/
+ @SuppressWarnings("fallthrough")
private void calculateType() {
int ret = TYPE_IDENTITY;
boolean sgn0, sgn1;
double M0, M1, M2, M3;
updateState();
@@ -1036,10 +1037,11 @@
* @see #createInverse
* @see #inverseTransform
* @see #TYPE_UNIFORM_SCALE
* @since 1.2
*/
+ @SuppressWarnings("fallthrough")
public double getDeterminant() {
switch (state) {
default:
stateError();
/* NOTREACHED */
@@ -1248,10 +1250,11 @@
public void translate(double tx, double ty) {
switch (state) {
default:
stateError();
/* NOTREACHED */
+ return;
case (APPLY_SHEAR | APPLY_SCALE | APPLY_TRANSLATE):
m02 = tx * m00 + ty * m01 + m02;
m12 = tx * m10 + ty * m11 + m12;
if (m02 == 0.0 && m12 == 0.0) {
state = APPLY_SHEAR | APPLY_SCALE;
@@ -1629,10 +1632,11 @@
* X axis direction
* @param sy the factor by which coordinates are scaled along the
* Y axis direction
* @since 1.2
*/
+ @SuppressWarnings("fallthrough")
public void scale(double sx, double sy) {
int state = this.state;
switch (state) {
default:
stateError();
@@ -1703,10 +1707,11 @@
int state = this.state;
switch (state) {
default:
stateError();
/* NOTREACHED */
+ return;
case (APPLY_SHEAR | APPLY_SCALE | APPLY_TRANSLATE):
case (APPLY_SHEAR | APPLY_SCALE):
double M0, M1;
M0 = m00;
M1 = m01;
@@ -2222,10 +2227,11 @@
* @param Tx the <code>AffineTransform</code> object to be
* concatenated with this <code>AffineTransform</code> object.
* @see #preConcatenate
* @since 1.2
*/
+ @SuppressWarnings("fallthrough")
public void concatenate(AffineTransform Tx) {
double M0, M1;
double T00, T01, T10, T11;
double T02, T12;
int mystate = state;
@@ -2430,10 +2436,11 @@
* @param Tx the <code>AffineTransform</code> object to be
* concatenated with this <code>AffineTransform</code> object.
* @see #concatenate
* @since 1.2
*/
+ @SuppressWarnings("fallthrough")
public void preConcatenate(AffineTransform Tx) {
double M0, M1;
double T00, T01, T10, T11;
double T02, T12;
int mystate = state;
@@ -2653,10 +2660,11 @@
double det;
switch (state) {
default:
stateError();
/* NOTREACHED */
+ return null;
case (APPLY_SHEAR | APPLY_SCALE | APPLY_TRANSLATE):
det = m00 * m11 - m01 * m10;
if (Math.abs(det) <= Double.MIN_VALUE) {
throw new NoninvertibleTransformException("Determinant is "+
det);
@@ -2749,10 +2757,11 @@
double det;
switch (state) {
default:
stateError();
/* NOTREACHED */
+ return;
case (APPLY_SHEAR | APPLY_SCALE | APPLY_TRANSLATE):
M00 = m00; M01 = m01; M02 = m02;
M10 = m10; M11 = m11; M12 = m12;
det = M00 * M11 - M01 * M10;
if (Math.abs(det) <= Double.MIN_VALUE) {
@@ -2883,10 +2892,11 @@
double y = ptSrc.getY();
switch (state) {
default:
stateError();
/* NOTREACHED */
+ return null;
case (APPLY_SHEAR | APPLY_SCALE | APPLY_TRANSLATE):
ptDst.setLocation(x * m00 + y * m01 + m02,
x * m10 + y * m11 + m12);
return ptDst;
case (APPLY_SHEAR | APPLY_SCALE):
@@ -2966,10 +2976,11 @@
}
switch (state) {
default:
stateError();
/* NOTREACHED */
+ return;
case (APPLY_SHEAR | APPLY_SCALE | APPLY_TRANSLATE):
dst.setLocation(x * m00 + y * m01 + m02,
x * m10 + y * m11 + m12);
break;
case (APPLY_SHEAR | APPLY_SCALE):
@@ -3041,10 +3052,11 @@
}
switch (state) {
default:
stateError();
/* NOTREACHED */
+ return;
case (APPLY_SHEAR | APPLY_SCALE | APPLY_TRANSLATE):
M00 = m00; M01 = m01; M02 = m02;
M10 = m10; M11 = m11; M12 = m12;
while (--numPts >= 0) {
double x = srcPts[srcOff++];
@@ -3155,10 +3167,11 @@
}
switch (state) {
default:
stateError();
/* NOTREACHED */
+ return;
case (APPLY_SHEAR | APPLY_SCALE | APPLY_TRANSLATE):
M00 = m00; M01 = m01; M02 = m02;
M10 = m10; M11 = m11; M12 = m12;
while (--numPts >= 0) {
double x = srcPts[srcOff++];
@@ -3250,10 +3263,11 @@
double M00, M01, M02, M10, M11, M12; // For caching
switch (state) {
default:
stateError();
/* NOTREACHED */
+ return;
case (APPLY_SHEAR | APPLY_SCALE | APPLY_TRANSLATE):
M00 = m00; M01 = m01; M02 = m02;
M10 = m10; M11 = m11; M12 = m12;
while (--numPts >= 0) {
double x = srcPts[srcOff++];
@@ -3345,10 +3359,11 @@
double M00, M01, M02, M10, M11, M12; // For caching
switch (state) {
default:
stateError();
/* NOTREACHED */
+ return;
case (APPLY_SHEAR | APPLY_SCALE | APPLY_TRANSLATE):
M00 = m00; M01 = m01; M02 = m02;
M10 = m10; M11 = m11; M12 = m12;
while (--numPts >= 0) {
double x = srcPts[srcOff++];
@@ -3434,10 +3449,11 @@
* inverse transform.
* @exception NoninvertibleTransformException if the matrix cannot be
* inverted.
* @since 1.2
*/
+ @SuppressWarnings("fallthrough")
public Point2D inverseTransform(Point2D ptSrc, Point2D ptDst)
throws NoninvertibleTransformException
{
if (ptDst == null) {
if (ptSrc instanceof Point2D.Double) {
@@ -3545,10 +3561,11 @@
}
switch (state) {
default:
stateError();
/* NOTREACHED */
+ return;
case (APPLY_SHEAR | APPLY_SCALE | APPLY_TRANSLATE):
M00 = m00; M01 = m01; M02 = m02;
M10 = m10; M11 = m11; M12 = m12;
det = M00 * M11 - M01 * M10;
if (Math.abs(det) <= Double.MIN_VALUE) {
@@ -3677,10 +3694,11 @@
double y = ptSrc.getY();
switch (state) {
default:
stateError();
/* NOTREACHED */
+ return null;
case (APPLY_SHEAR | APPLY_SCALE | APPLY_TRANSLATE):
case (APPLY_SHEAR | APPLY_SCALE):
ptDst.setLocation(x * m00 + y * m01, x * m10 + y * m11);
return ptDst;
case (APPLY_SHEAR | APPLY_TRANSLATE):
@@ -3752,10 +3770,11 @@
}
switch (state) {
default:
stateError();
/* NOTREACHED */
+ return;
case (APPLY_SHEAR | APPLY_SCALE | APPLY_TRANSLATE):
case (APPLY_SHEAR | APPLY_SCALE):
M00 = m00; M01 = m01;
M10 = m10; M11 = m11;
while (--numPts >= 0) {