From b209e197b3310c4463cb8203098da89edd279773 Mon Sep 17 00:00:00 2001 From: Phil Steitz Date: Sat, 25 Nov 2006 16:43:36 +0000 Subject: [PATCH] Formatting only. Eliminated tabs. git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@479144 13f79535-47bb-0310-9956-ffa450edef68 --- .../mantissa/geometry/Rotation.java | 6 +- .../mantissa/geometry/Vector3D.java | 10 +-- .../math/fraction/FractionFormatTest.java | 78 +++++++++---------- 3 files changed, 47 insertions(+), 47 deletions(-) diff --git a/src/mantissa/src/org/spaceroots/mantissa/geometry/Rotation.java b/src/mantissa/src/org/spaceroots/mantissa/geometry/Rotation.java index 4a4267ea6..e9cdaa0ee 100644 --- a/src/mantissa/src/org/spaceroots/mantissa/geometry/Rotation.java +++ b/src/mantissa/src/org/spaceroots/mantissa/geometry/Rotation.java @@ -494,9 +494,9 @@ public class Rotation implements Serializable { * @param alpha3 angle of the third elementary rotation */ public static Rotation computeRotation(RotationOrder order, - double alpha1, - double alpha2, - double alpha3) { + double alpha1, + double alpha2, + double alpha3) { if (order == RotationOrder.XYZ) { return compose(new Rotation(Vector3D.plusI, alpha1), new Rotation(Vector3D.plusJ, alpha2), diff --git a/src/mantissa/src/org/spaceroots/mantissa/geometry/Vector3D.java b/src/mantissa/src/org/spaceroots/mantissa/geometry/Vector3D.java index 1a985ad4b..a62c08ea7 100644 --- a/src/mantissa/src/org/spaceroots/mantissa/geometry/Vector3D.java +++ b/src/mantissa/src/org/spaceroots/mantissa/geometry/Vector3D.java @@ -202,12 +202,12 @@ public class Vector3D implements Serializable { * @exception ArithmeticException if the norm of the instance is null */ public static Vector3D normalize(Vector3D v) { - double norm = v.getNorm(); - if (norm == 0) { + double norm = v.getNorm(); + if (norm == 0) { throw new ArithmeticException("null norm"); - } - double inv = 1.0 / norm; - return new Vector3D(inv * v.x, inv * v.y, inv * v.z); + } + double inv = 1.0 / norm; + return new Vector3D(inv * v.x, inv * v.y, inv * v.z); } /** Add two vectors. diff --git a/src/test/org/apache/commons/math/fraction/FractionFormatTest.java b/src/test/org/apache/commons/math/fraction/FractionFormatTest.java index edfe945a8..623e98976 100644 --- a/src/test/org/apache/commons/math/fraction/FractionFormatTest.java +++ b/src/test/org/apache/commons/math/fraction/FractionFormatTest.java @@ -108,8 +108,8 @@ public class FractionFormatTest extends TestCase { } public void testParseInteger() { - String source = "10"; - try { + String source = "10"; + try { Fraction c = properFormat.parse(source); assertNotNull(c); assertEquals(10, c.getNumerator()); @@ -117,7 +117,7 @@ public class FractionFormatTest extends TestCase { } catch (ParseException ex) { fail(ex.getMessage()); } - try { + try { Fraction c = improperFormat.parse(source); assertNotNull(c); assertEquals(10, c.getNumerator()); @@ -128,36 +128,36 @@ public class FractionFormatTest extends TestCase { } public void testParseInvalid() { - String source = "a"; + String source = "a"; String msg = "should not be able to parse '10 / a'."; - try { + try { properFormat.parse(source); - fail(msg); + fail(msg); } catch (ParseException ex) { - // success + // success } - try { + try { improperFormat.parse(source); - fail(msg); + fail(msg); } catch (ParseException ex) { - // success + // success } } public void testParseInvalidDenominator() { - String source = "10 / a"; + String source = "10 / a"; String msg = "should not be able to parse '10 / a'."; - try { + try { properFormat.parse(source); - fail(msg); + fail(msg); } catch (ParseException ex) { - // success + // success } - try { + try { improperFormat.parse(source); - fail(msg); + fail(msg); } catch (ParseException ex) { - // success + // success } } @@ -247,45 +247,45 @@ public class FractionFormatTest extends TestCase { } public void testNumeratorFormat() { - NumberFormat old = properFormat.getNumeratorFormat(); + NumberFormat old = properFormat.getNumeratorFormat(); NumberFormat nf = NumberFormat.getInstance(); nf.setParseIntegerOnly(true); - properFormat.setNumeratorFormat(nf); - assertEquals(nf, properFormat.getNumeratorFormat()); - properFormat.setNumeratorFormat(old); + properFormat.setNumeratorFormat(nf); + assertEquals(nf, properFormat.getNumeratorFormat()); + properFormat.setNumeratorFormat(old); - old = improperFormat.getNumeratorFormat(); + old = improperFormat.getNumeratorFormat(); nf = NumberFormat.getInstance(); nf.setParseIntegerOnly(true); - improperFormat.setNumeratorFormat(nf); - assertEquals(nf, improperFormat.getNumeratorFormat()); - improperFormat.setNumeratorFormat(old); + improperFormat.setNumeratorFormat(nf); + assertEquals(nf, improperFormat.getNumeratorFormat()); + improperFormat.setNumeratorFormat(old); } public void testDenominatorFormat() { - NumberFormat old = properFormat.getDenominatorFormat(); + NumberFormat old = properFormat.getDenominatorFormat(); NumberFormat nf = NumberFormat.getInstance(); nf.setParseIntegerOnly(true); - properFormat.setDenominatorFormat(nf); - assertEquals(nf, properFormat.getDenominatorFormat()); - properFormat.setDenominatorFormat(old); + properFormat.setDenominatorFormat(nf); + assertEquals(nf, properFormat.getDenominatorFormat()); + properFormat.setDenominatorFormat(old); - old = improperFormat.getDenominatorFormat(); + old = improperFormat.getDenominatorFormat(); nf = NumberFormat.getInstance(); nf.setParseIntegerOnly(true); - improperFormat.setDenominatorFormat(nf); - assertEquals(nf, improperFormat.getDenominatorFormat()); - improperFormat.setDenominatorFormat(old); + improperFormat.setDenominatorFormat(nf); + assertEquals(nf, improperFormat.getDenominatorFormat()); + improperFormat.setDenominatorFormat(old); } public void testWholeFormat() { - ProperFractionFormat format = (ProperFractionFormat)properFormat; - - NumberFormat old = format.getWholeFormat(); + ProperFractionFormat format = (ProperFractionFormat)properFormat; + + NumberFormat old = format.getWholeFormat(); NumberFormat nf = NumberFormat.getInstance(); nf.setParseIntegerOnly(true); - format.setWholeFormat(nf); - assertEquals(nf, format.getWholeFormat()); - format.setWholeFormat(old); + format.setWholeFormat(nf); + assertEquals(nf, format.getWholeFormat()); + format.setWholeFormat(old); } }