commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1055885 - in /commons/proper/math/trunk/src/test/java/org/apache/commons/math: complex/ComplexFormatAbstractTest.java geometry/Vector3DFormatAbstractTest.java
Date Thu, 06 Jan 2011 14:11:32 GMT
Author: sebb
Date: Thu Jan  6 14:11:32 2011
New Revision: 1055885

URL: http://svn.apache.org/viewvc?rev=1055885&view=rev
Log:
Unnecessary casts

Modified:
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/complex/ComplexFormatAbstractTest.java
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/geometry/Vector3DFormatAbstractTest.java

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/complex/ComplexFormatAbstractTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/complex/ComplexFormatAbstractTest.java?rev=1055885&r1=1055884&r2=1055885&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/complex/ComplexFormatAbstractTest.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/complex/ComplexFormatAbstractTest.java
Thu Jan  6 14:11:32 2011
@@ -159,7 +159,7 @@ public abstract class ComplexFormatAbstr
         String source = "1 + 1i";
         Complex expected = new Complex(1, 1);
         try {
-            Complex actual = (Complex)complexFormat.parse(source);
+            Complex actual = complexFormat.parse(source);
             Assert.assertEquals(expected, actual);
         } catch (MathParseException ex) {
             Assert.fail(ex.getMessage());
@@ -171,7 +171,7 @@ public abstract class ComplexFormatAbstr
         String source = "1" + getDecimalCharacter() + "23 + 1" + getDecimalCharacter() +
"43i";
         Complex expected = new Complex(1.23, 1.43);
         try {
-            Complex actual = (Complex)complexFormat.parse(source);
+            Complex actual = complexFormat.parse(source);
             Assert.assertEquals(expected, actual);
         } catch (MathParseException ex) {
             Assert.fail(ex.getMessage());
@@ -183,7 +183,7 @@ public abstract class ComplexFormatAbstr
         String source = "1" + getDecimalCharacter() + "2323 + 1" + getDecimalCharacter()
+ "4343i";
         Complex expected = new Complex(1.2323, 1.4343);
         try {
-            Complex actual = (Complex)complexFormat.parse(source);
+            Complex actual = complexFormat.parse(source);
             Assert.assertEquals(expected, actual);
         } catch (MathParseException ex) {
             Assert.fail(ex.getMessage());
@@ -195,7 +195,7 @@ public abstract class ComplexFormatAbstr
         String source = "-1" + getDecimalCharacter() + "2323 + 1" + getDecimalCharacter()
+ "4343i";
         Complex expected = new Complex(-1.2323, 1.4343);
         try {
-            Complex actual = (Complex)complexFormat.parse(source);
+            Complex actual = complexFormat.parse(source);
             Assert.assertEquals(expected, actual);
         } catch (MathParseException ex) {
             Assert.fail(ex.getMessage());
@@ -207,7 +207,7 @@ public abstract class ComplexFormatAbstr
         String source = "1" + getDecimalCharacter() + "2323 - 1" + getDecimalCharacter()
+ "4343i";
         Complex expected = new Complex(1.2323, -1.4343);
         try {
-            Complex actual = (Complex)complexFormat.parse(source);
+            Complex actual = complexFormat.parse(source);
             Assert.assertEquals(expected, actual);
         } catch (MathParseException ex) {
             Assert.fail(ex.getMessage());
@@ -219,7 +219,7 @@ public abstract class ComplexFormatAbstr
         String source = "-1" + getDecimalCharacter() + "2323 - 1" + getDecimalCharacter()
+ "4343i";
         Complex expected = new Complex(-1.2323, -1.4343);
         try {
-            Complex actual = (Complex)complexFormat.parse(source);
+            Complex actual = complexFormat.parse(source);
             Assert.assertEquals(expected, actual);
         } catch (MathParseException ex) {
             Assert.fail(ex.getMessage());
@@ -231,7 +231,7 @@ public abstract class ComplexFormatAbstr
         String source = "0" + getDecimalCharacter() + "0 - 1" + getDecimalCharacter() + "4343i";
         Complex expected = new Complex(0.0, -1.4343);
         try {
-            Complex actual = (Complex)complexFormat.parse(source);
+            Complex actual = complexFormat.parse(source);
             Assert.assertEquals(expected, actual);
         } catch (MathParseException ex) {
             Assert.fail(ex.getMessage());
@@ -243,7 +243,7 @@ public abstract class ComplexFormatAbstr
         String source = "-1" + getDecimalCharacter() + "2323";
         Complex expected = new Complex(-1.2323, 0);
         try {
-            Complex actual = (Complex)complexFormat.parse(source);
+            Complex actual = complexFormat.parse(source);
             Assert.assertEquals(expected, actual);
         } catch (MathParseException ex) {
             Assert.fail(ex.getMessage());
@@ -255,7 +255,7 @@ public abstract class ComplexFormatAbstr
         String source = "-1" + getDecimalCharacter() + "2323 - 1" + getDecimalCharacter()
+ "4343j";
         Complex expected = new Complex(-1.2323, -1.4343);
         try {
-            Complex actual = (Complex)complexFormatJ.parse(source);
+            Complex actual = complexFormatJ.parse(source);
             Assert.assertEquals(expected, actual);
         } catch (MathParseException ex) {
             Assert.fail(ex.getMessage());
@@ -267,7 +267,7 @@ public abstract class ComplexFormatAbstr
         String source = "(NaN) + (NaN)i";
         Complex expected = new Complex(Double.NaN, Double.NaN);
         try {
-            Complex actual = (Complex)complexFormat.parse(source);
+            Complex actual = complexFormat.parse(source);
             Assert.assertEquals(expected, actual);
         } catch (MathParseException ex) {
             Assert.fail(ex.getMessage());
@@ -279,7 +279,7 @@ public abstract class ComplexFormatAbstr
         String source = "(Infinity) + (Infinity)i";
         Complex expected = new Complex(Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY);
         try {
-            Complex actual = (Complex)complexFormat.parse(source);
+            Complex actual = complexFormat.parse(source);
             Assert.assertEquals(expected, actual);
         } catch (MathParseException ex) {
             Assert.fail(ex.getMessage());
@@ -291,7 +291,7 @@ public abstract class ComplexFormatAbstr
         String source = "(-Infinity) - (Infinity)i";
         Complex expected = new Complex(Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY);
         try {
-            Complex actual = (Complex)complexFormat.parse(source);
+            Complex actual = complexFormat.parse(source);
             Assert.assertEquals(expected, actual);
         } catch (MathParseException ex) {
             Assert.fail(ex.getMessage());

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/geometry/Vector3DFormatAbstractTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/geometry/Vector3DFormatAbstractTest.java?rev=1055885&r1=1055884&r2=1055885&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/geometry/Vector3DFormatAbstractTest.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/geometry/Vector3DFormatAbstractTest.java
Thu Jan  6 14:11:32 2011
@@ -164,7 +164,7 @@ public abstract class Vector3DFormatAbst
         String source = "{1; 1; 1}";
         Vector3D expected = new Vector3D(1, 1, 1);
         try {
-            Vector3D actual = (Vector3D) vector3DFormat.parse(source);
+            Vector3D actual = vector3DFormat.parse(source);
             Assert.assertEquals(expected, actual);
         } catch (MathParseException ex) {
             Assert.fail(ex.getMessage());
@@ -193,7 +193,7 @@ public abstract class Vector3DFormatAbst
             "63}";
         Vector3D expected = new Vector3D(1.23, 1.43, 1.63);
         try {
-            Vector3D actual = (Vector3D) vector3DFormat.parse(source);
+            Vector3D actual = vector3DFormat.parse(source);
             Assert.assertEquals(expected, actual);
         } catch (MathParseException ex) {
             Assert.fail(ex.getMessage());
@@ -209,7 +209,7 @@ public abstract class Vector3DFormatAbst
             "6333}";
         Vector3D expected = new Vector3D(1.2323, 1.4343, 1.6333);
         try {
-            Vector3D actual = (Vector3D) vector3DFormat.parse(source);
+            Vector3D actual = vector3DFormat.parse(source);
             Assert.assertEquals(expected, actual);
         } catch (MathParseException ex) {
             Assert.fail(ex.getMessage());
@@ -225,7 +225,7 @@ public abstract class Vector3DFormatAbst
             "6333}";
         Vector3D expected = new Vector3D(-1.2323, 1.4343, 1.6333);
         try {
-            Vector3D actual = (Vector3D) vector3DFormat.parse(source);
+            Vector3D actual = vector3DFormat.parse(source);
             Assert.assertEquals(expected, actual);
         } catch (MathParseException ex) {
             Assert.fail(ex.getMessage());
@@ -241,7 +241,7 @@ public abstract class Vector3DFormatAbst
             "6333}";
         Vector3D expected = new Vector3D(1.2323, -1.4343, 1.6333);
         try {
-            Vector3D actual = (Vector3D) vector3DFormat.parse(source);
+            Vector3D actual = vector3DFormat.parse(source);
             Assert.assertEquals(expected, actual);
         } catch (MathParseException ex) {
             Assert.fail(ex.getMessage());
@@ -257,7 +257,7 @@ public abstract class Vector3DFormatAbst
             "6333}";
         Vector3D expected = new Vector3D(1.2323, 1.4343, -1.6333);
         try {
-            Vector3D actual = (Vector3D) vector3DFormat.parse(source);
+            Vector3D actual = vector3DFormat.parse(source);
             Assert.assertEquals(expected, actual);
         } catch (MathParseException ex) {
             Assert.fail(ex.getMessage());
@@ -273,7 +273,7 @@ public abstract class Vector3DFormatAbst
             "6333}";
         Vector3D expected = new Vector3D(-1.2323, -1.4343, -1.6333);
         try {
-            Vector3D actual = (Vector3D) vector3DFormat.parse(source);
+            Vector3D actual = vector3DFormat.parse(source);
             Assert.assertEquals(expected, actual);
         } catch (MathParseException ex) {
             Assert.fail(ex.getMessage());
@@ -289,7 +289,7 @@ public abstract class Vector3DFormatAbst
             "6333}";
         Vector3D expected = new Vector3D(0.0, -1.4343, 1.6333);
         try {
-            Vector3D actual = (Vector3D) vector3DFormat.parse(source);
+            Vector3D actual = vector3DFormat.parse(source);
             Assert.assertEquals(expected, actual);
         } catch (MathParseException ex) {
             Assert.fail(ex.getMessage());
@@ -305,7 +305,7 @@ public abstract class Vector3DFormatAbst
             "6333]";
         Vector3D expected = new Vector3D(1.2323, 1.4343, 1.6333);
         try {
-            Vector3D actual = (Vector3D) vector3DFormatSquare.parse(source);
+            Vector3D actual = vector3DFormatSquare.parse(source);
             Assert.assertEquals(expected, actual);
         } catch (MathParseException ex) {
             Assert.fail(ex.getMessage());
@@ -316,7 +316,7 @@ public abstract class Vector3DFormatAbst
     public void testParseNan() {
         String source = "{(NaN); (NaN); (NaN)}";
         try {
-            Vector3D actual = (Vector3D) vector3DFormat.parse(source);
+            Vector3D actual = vector3DFormat.parse(source);
             Assert.assertEquals(Vector3D.NaN, actual);
         } catch (MathParseException ex) {
             Assert.fail(ex.getMessage());
@@ -327,7 +327,7 @@ public abstract class Vector3DFormatAbst
     public void testParsePositiveInfinity() {
         String source = "{(Infinity); (Infinity); (Infinity)}";
         try {
-            Vector3D actual = (Vector3D)vector3DFormat.parse(source);
+            Vector3D actual = vector3DFormat.parse(source);
             Assert.assertEquals(Vector3D.POSITIVE_INFINITY, actual);
         } catch (MathParseException ex) {
             Assert.fail(ex.getMessage());
@@ -338,7 +338,7 @@ public abstract class Vector3DFormatAbst
     public void testParseNegativeInfinity() {
         String source = "{(-Infinity); (-Infinity); (-Infinity)}";
         try {
-            Vector3D actual = (Vector3D)vector3DFormat.parse(source);
+            Vector3D actual = vector3DFormat.parse(source);
             Assert.assertEquals(Vector3D.NEGATIVE_INFINITY, actual);
         } catch (MathParseException ex) {
             Assert.fail(ex.getMessage());



Mime
View raw message