You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by ml...@apache.org on 2006/04/05 16:43:09 UTC

svn commit: r391630 - in /incubator/harmony/enhanced/classlib/trunk/modules/crypto/src: main/java/javax/crypto/spec/ test/java/javax/crypto/ test/java/javax/crypto/spec/

Author: mloenko
Date: Wed Apr  5 07:43:05 2006
New Revision: 391630

URL: http://svn.apache.org/viewcvs?rev=391630&view=rev
Log:
crypto part of the HARMONY-76: some clean-up after HARMONY-55 fix is desired

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/PSource.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/BadPaddingExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/CipherInputStreamTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/CipherOutputStreamTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/CipherSpiTests.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/CipherTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/ExemptionMechanismExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/ExemptionMechanismSpiTests.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/ExemptionMechanismTest1.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/IllegalBlockSizeExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/KeyAgreementSpiTests.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/KeyAgreementTest2.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/KeyGeneratorSpiTests.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/KeyGeneratorTest2.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/MacTest2.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/MyExemptionMechanismSpi.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/NoSuchPaddingExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/NullCipherTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/SecretKeyFactorySpiTests.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/SecretKeyFactoryTest1.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/SecretKeyFactoryTest2.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/ShortBufferExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/spec/OAEPParameterSpecTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/spec/PBEKeySpecTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/spec/PBEParameterSpecTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/spec/RC2ParameterSpecTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/spec/RC5ParameterSpecTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/PSource.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/PSource.java?rev=391630&r1=391629&r2=391630&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/PSource.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/PSource.java Wed Apr  5 07:43:05 2006
@@ -28,7 +28,7 @@
 
     private String pSrcName;
 
-    private PSource() {};
+    private PSource() {}
 
     /**
      * @com.intel.drl.spec_ref

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/BadPaddingExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/BadPaddingExceptionTest.java?rev=391630&r1=391629&r2=391630&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/BadPaddingExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/BadPaddingExceptionTest.java Wed Apr  5 07:43:05 2006
@@ -65,8 +65,6 @@
 
     static Throwable tCause = new Throwable("Throwable for exception");
 
-    private static String errNotExc = "Exception is not BadPaddingException";
-
     static String createErr(Exception tE, Exception eE) {
         return "BadPaddingException: ".concat(tE.toString()).concat(
                 " is not equal to caught exception: ").concat(eE.toString());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/CipherInputStreamTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/CipherInputStreamTest.java?rev=391630&r1=391629&r2=391630&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/CipherInputStreamTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/CipherInputStreamTest.java Wed Apr  5 07:43:05 2006
@@ -48,7 +48,7 @@
         public boolean wasClosed() {
             return closed;
         }
-    };
+    }
 
     /**
      * CipherInputStream(InputStream is) method testing. Tests that

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/CipherOutputStreamTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/CipherOutputStreamTest.java?rev=391630&r1=391629&r2=391630&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/CipherOutputStreamTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/CipherOutputStreamTest.java Wed Apr  5 07:43:05 2006
@@ -45,7 +45,7 @@
         public boolean wasClosed() {
             return closed;
         }
-    };
+    }
 
     /**
      * CipherOutputStream(OutputStream os) method testing. Tests that

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/CipherSpiTests.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/CipherSpiTests.java?rev=391630&r1=391629&r2=391630&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/CipherSpiTests.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/CipherSpiTests.java Wed Apr  5 07:43:05 2006
@@ -56,8 +56,7 @@
     public void testCipherSpiTests01() throws IllegalBlockSizeException,
             BadPaddingException, ShortBufferException {
         
-        CipherSpi cSpi = (CipherSpi) new myCipherSpi();
-        assertTrue("Not cipherSpi object", cSpi instanceof CipherSpi);
+        CipherSpi cSpi = new myCipherSpi();
         assertEquals("BlockSize is not 0", cSpi.engineGetBlockSize(), 0);
         assertEquals("OutputSize is not 0", cSpi.engineGetOutputSize(1), 0);
         byte[] bb = cSpi.engineGetIV();
@@ -84,8 +83,7 @@
      * Assertion: It throws UnsupportedOperationException if it is not overriden
      */
     public void testCipherSpi02() {
-        CipherSpi cSpi = (CipherSpi) new myCipherSpi();
-        assertTrue(cSpi instanceof CipherSpi);
+        CipherSpi cSpi = new myCipherSpi();
         try {
             cSpi.engineGetKeySize(null);
             assertTrue("UnsupportedOperationException must be thrown", false);
@@ -102,8 +100,7 @@
      * Assertion: It throws UnsupportedOperationException if it is not overriden
      */
     public void testCipherSpi03() {
-        CipherSpi cSpi = (CipherSpi) new myCipherSpi();
-        assertTrue(cSpi instanceof CipherSpi);
+        CipherSpi cSpi = new myCipherSpi();
         try {
             cSpi.engineWrap(null);
             assertTrue("UnsupportedOperationException must be thrown", false);
@@ -120,8 +117,7 @@
      * Assertion: It throws UnsupportedOperationException if it is not overriden
      */
     public void testCipherSpi04() {
-        CipherSpi cSpi = (CipherSpi) new myCipherSpi();
-        assertTrue(cSpi instanceof CipherSpi);
+        CipherSpi cSpi = new myCipherSpi();
         try {
             cSpi.engineUnwrap(new byte[0], "", 0);
             assertTrue("UnsupportedOperationException must be thrown", false);
@@ -140,8 +136,7 @@
      * throws ShortBufferException is there is no space in output to hold result
      */
     public void testCipherSpi05() throws ShortBufferException {
-        CipherSpi cSpi = (CipherSpi) new myCipherSpi();
-        assertTrue(cSpi instanceof CipherSpi);
+        CipherSpi cSpi = new myCipherSpi();
         byte[] bb = { (byte) 0, (byte) 1, (byte) 2, (byte) 3, (byte) 4,
                 (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9, (byte) 10 };
         int pos = 5;
@@ -194,8 +189,7 @@
      */
     public void testCipherSpi06() throws BadPaddingException,
             ShortBufferException, IllegalBlockSizeException {
-        CipherSpi cSpi = (CipherSpi) new myCipherSpi();
-        assertTrue(cSpi instanceof CipherSpi);
+        CipherSpi cSpi = new myCipherSpi();
         int len = 10;
         byte[] bbuf = new byte[len];
         for (int i = 0; i < bbuf.length; i++) {
@@ -241,8 +235,6 @@
  */
 
 class myCipherSpi extends CipherSpi {
-    private String cipherMode;
-
     private byte[] initV;
 
     private static byte[] resV = { (byte) 7, (byte) 6, (byte) 5, (byte) 4,
@@ -253,7 +245,6 @@
     }
 
     protected void engineSetMode(String mode) throws NoSuchAlgorithmException {
-        this.cipherMode = mode;
     }
 
     protected void engineSetPadding(String padding)

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/CipherTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/CipherTest.java?rev=391630&r1=391629&r2=391630&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/CipherTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/CipherTest.java Wed Apr  5 07:43:05 2006
@@ -24,11 +24,8 @@
 import java.security.NoSuchAlgorithmException;
 import java.security.NoSuchProviderException;
 import java.security.Provider;
-import java.security.SecureRandom;
 import java.security.Security;
 import java.security.spec.InvalidKeySpecException;
-import java.util.Date;
-import java.util.Enumeration;
 
 import org.apache.harmony.security.TestKeyPair;
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/ExemptionMechanismExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/ExemptionMechanismExceptionTest.java?rev=391630&r1=391629&r2=391630&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/ExemptionMechanismExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/ExemptionMechanismExceptionTest.java Wed Apr  5 07:43:05 2006
@@ -66,8 +66,6 @@
 
     static Throwable tCause = new Throwable("Throwable for exception");
 
-    private static String errNotExc = "Exception is not ExemptionMechanismException";
-
     static String createErr(Exception tE, Exception eE) {
         return "ExemptionMechanismException: ".concat(tE.toString()).concat(
                 " is not equal to caught exception: ").concat(eE.toString());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/ExemptionMechanismSpiTests.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/ExemptionMechanismSpiTests.java?rev=391630&r1=391629&r2=391630&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/ExemptionMechanismSpiTests.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/ExemptionMechanismSpiTests.java Wed Apr  5 07:43:05 2006
@@ -54,9 +54,8 @@
             throws  ExemptionMechanismException,
             ShortBufferException, InvalidKeyException,
             InvalidAlgorithmParameterException {
-        ExemptionMechanismSpi emSpi = (ExemptionMechanismSpi) new MyExemptionMechanismSpi();
+        ExemptionMechanismSpi emSpi = new MyExemptionMechanismSpi();
         int len = MyExemptionMechanismSpi.getLength();
-        assertTrue("Not ExemptionMechanismSpi object", emSpi instanceof ExemptionMechanismSpi);
         byte [] bbRes = emSpi.engineGenExemptionBlob();
         assertEquals("Incorrect length", bbRes.length, len);
         assertEquals("Incorrect result", 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/ExemptionMechanismTest1.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/ExemptionMechanismTest1.java?rev=391630&r1=391629&r2=391630&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/ExemptionMechanismTest1.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/ExemptionMechanismTest1.java Wed Apr  5 07:43:05 2006
@@ -30,7 +30,6 @@
 import java.security.Provider;
 import java.security.Security;
 import java.security.spec.AlgorithmParameterSpec;
-import java.security.spec.KeySpec;
 
 import javax.crypto.spec.SecretKeySpec;
 
@@ -191,8 +190,6 @@
         ExemptionMechanism exMech;
         for (int i = 0; i < validValues.length; i++) {
             exMech = ExemptionMechanism.getInstance(validValues[i]);
-            assertTrue("Not instanceof ExemptionMechanism object",
-                    exMech instanceof ExemptionMechanism);
             assertEquals("Incorrect algorithm", exMech.getName(),
                     validValues[i]);
             assertEquals("Incorrect provider", exMech.getProvider(), mProv);
@@ -254,8 +251,6 @@
         for (int i = 0; i < validValues.length; i++) {
             exMech = ExemptionMechanism.getInstance(validValues[i], mProv
                     .getName());
-            assertTrue("Not instanceof ExemptionMechanism object",
-                    exMech instanceof ExemptionMechanism);
             assertEquals("Incorrect algorithm", exMech.getName(),
                     validValues[i]);
             assertEquals("Incorrect provider", exMech.getProvider().getName(),
@@ -301,12 +296,8 @@
             }
         }
         ExemptionMechanism exMech;
-        SecretKey sk;
-        KeySpec keySpec;
         for (int i = 0; i < validValues.length; i++) {
             exMech = ExemptionMechanism.getInstance(validValues[i], mProv);
-            assertTrue("Not instanceof ExemptionMechanism object",
-                    exMech instanceof ExemptionMechanism);
             assertEquals("Incorrect algorithm", exMech.getName(),
                     validValues[i]);
             assertEquals("Incorrect provider", exMech.getProvider(), mProv);
@@ -323,7 +314,6 @@
         ExemptionMechanismSpi spi = new MyExemptionMechanismSpi();
         ExemptionMechanism em = new myEM(spi, mProv, defaultAlg);
         
-        assertTrue("Not ExemptionMechanism object", em instanceof ExemptionMechanism);
         assertEquals("Incorrect provider", em.getProvider(), mProv);
         assertEquals("Incorrect algorithm", em.getName(), defaultAlg);
         try {
@@ -337,7 +327,6 @@
         } catch (IllegalStateException e) {
         }        
         em = new myEM(null, null, null);
-        assertTrue("Not ExemptionMechanism object", em instanceof ExemptionMechanism);
         assertNull("Incorrect mechanism", em.getName());
         assertNull("Incorrect provider", em.getProvider());
         try {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/IllegalBlockSizeExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/IllegalBlockSizeExceptionTest.java?rev=391630&r1=391629&r2=391630&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/IllegalBlockSizeExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/IllegalBlockSizeExceptionTest.java Wed Apr  5 07:43:05 2006
@@ -66,8 +66,6 @@
 
     static Throwable tCause = new Throwable("Throwable for exception");
 
-    private static String errNotExc = "Exception is not IllegalBlockSizeException";
-
     static String createErr(Exception tE, Exception eE) {
         return "IllegalBlockSizeException: ".concat(tE.toString()).concat(
                 " is not equal to caught exception: ").concat(eE.toString());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/KeyAgreementSpiTests.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/KeyAgreementSpiTests.java?rev=391630&r1=391629&r2=391630&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/KeyAgreementSpiTests.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/KeyAgreementSpiTests.java Wed Apr  5 07:43:05 2006
@@ -52,9 +52,7 @@
     public void testKeyAgreementSpi01() throws InvalidKeyException,
             ShortBufferException, NoSuchAlgorithmException, 
             InvalidAlgorithmParameterException {
-        KeyAgreementSpi kaSpi = (KeyAgreementSpi) new MyKeyAgreementSpi();
-        assertTrue("Not KeyAgreementSpi object",
-                kaSpi instanceof KeyAgreementSpi);
+        KeyAgreementSpi kaSpi = new MyKeyAgreementSpi();
 
         assertNull("Not null result", kaSpi.engineDoPhase(null, true));
         try {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/KeyAgreementTest2.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/KeyAgreementTest2.java?rev=391630&r1=391629&r2=391630&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/KeyAgreementTest2.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/KeyAgreementTest2.java Wed Apr  5 07:43:05 2006
@@ -31,7 +31,6 @@
 import java.security.Security;
 import java.security.spec.AlgorithmParameterSpec;
 import java.security.spec.InvalidKeySpecException;
-import java.security.spec.KeySpec;
 
 import org.apache.harmony.security.SpiEngUtils;
 import junit.framework.TestCase;
@@ -259,8 +258,6 @@
             }
         }
         KeyAgreement keyAgr;
-        SecretKey sk;
-        KeySpec keySpec;
         for (int i = 0; i < validValues.length; i++) {
             keyAgr = KeyAgreement.getInstance(validValues[i], mProv);
             assertEquals("Incorrect algorithm", keyAgr.getAlgorithm(),

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/KeyGeneratorSpiTests.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/KeyGeneratorSpiTests.java?rev=391630&r1=391629&r2=391630&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/KeyGeneratorSpiTests.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/KeyGeneratorSpiTests.java Wed Apr  5 07:43:05 2006
@@ -51,9 +51,7 @@
      * KeyGeneratorSpi
      */
     public void testKeyGeneratorSpi01() throws InvalidAlgorithmParameterException {
-        KeyGeneratorSpi kgSpi = (KeyGeneratorSpi) new MyKeyGeneratorSpi();
-        assertTrue("Not KeyGeneratorSpi object",
-                kgSpi instanceof KeyGeneratorSpi);
+        KeyGeneratorSpi kgSpi = new MyKeyGeneratorSpi();
         assertNull("Not null result", kgSpi.engineGenerateKey());
         try {
             kgSpi.engineInit(77, new SecureRandom());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/KeyGeneratorTest2.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/KeyGeneratorTest2.java?rev=391630&r1=391629&r2=391630&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/KeyGeneratorTest2.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/KeyGeneratorTest2.java Wed Apr  5 07:43:05 2006
@@ -30,7 +30,6 @@
 import java.security.Security;
 import java.security.spec.AlgorithmParameterSpec;
 import java.security.spec.InvalidKeySpecException;
-import java.security.spec.KeySpec;
 
 import org.apache.harmony.security.SpiEngUtils;
 import junit.framework.TestCase;
@@ -262,8 +261,6 @@
             }
         }
         KeyGenerator keyGen;
-        SecretKey sk;
-        KeySpec keySpec;
         for (int i = 0; i < validValues.length; i++) {
             keyGen = KeyGenerator.getInstance(validValues[i], mProv);
             assertEquals("Incorrect algorithm", keyGen.getAlgorithm(),

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/MacTest2.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/MacTest2.java?rev=391630&r1=391629&r2=391630&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/MacTest2.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/MacTest2.java Wed Apr  5 07:43:05 2006
@@ -29,7 +29,6 @@
 import java.security.Provider;
 import java.security.Security;
 import java.security.spec.AlgorithmParameterSpec;
-import java.security.spec.KeySpec;
 
 import javax.crypto.spec.SecretKeySpec;
 
@@ -154,8 +153,6 @@
         Mac keyAgr;
         for (int i = 0; i < validValues.length; i++) {
             keyAgr = Mac.getInstance(validValues[i]);
-            assertTrue("Not instanceof Mac object",
-                    keyAgr instanceof Mac);
             assertEquals("Incorrect algorithm", keyAgr.getAlgorithm(),
                     validValues[i]);
             assertEquals("Incorrect provider", keyAgr.getProvider(), mProv);
@@ -216,8 +213,6 @@
         for (int i = 0; i < validValues.length; i++) {
             keyAgr = Mac.getInstance(validValues[i], mProv
                     .getName());
-            assertTrue("Not instanceof Mac object",
-                    keyAgr instanceof Mac);
             assertEquals("Incorrect algorithm", keyAgr.getAlgorithm(),
                     validValues[i]);
             assertEquals("Incorrect provider", keyAgr.getProvider().getName(),
@@ -263,12 +258,8 @@
             }
         }
         Mac keyAgr;
-        SecretKey sk;
-        KeySpec keySpec;
         for (int i = 0; i < validValues.length; i++) {
             keyAgr = Mac.getInstance(validValues[i], mProv);
-            assertTrue("Not instanceof Mac object",
-                    keyAgr instanceof Mac);
             assertEquals("Incorrect algorithm", keyAgr.getAlgorithm(),
                     validValues[i]);
             assertEquals("Incorrect provider", keyAgr.getProvider(), mProv);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/MyExemptionMechanismSpi.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/MyExemptionMechanismSpi.java?rev=391630&r1=391629&r2=391630&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/MyExemptionMechanismSpi.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/MyExemptionMechanismSpi.java Wed Apr  5 07:43:05 2006
@@ -104,10 +104,8 @@
         }
     }
     public class tmp1Key implements Key {
-        private String alg;
         private byte[] enc;
         public tmp1Key(String alg, byte[] enc) {
-            this.alg = alg;
             this.enc = enc;
         }
         public String getAlgorithm() {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/NoSuchPaddingExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/NoSuchPaddingExceptionTest.java?rev=391630&r1=391629&r2=391630&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/NoSuchPaddingExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/NoSuchPaddingExceptionTest.java Wed Apr  5 07:43:05 2006
@@ -66,8 +66,6 @@
 
     static Throwable tCause = new Throwable("Throwable for exception");
 
-    private static String errNotExc = "Exception is not NoSuchPaddingException";
-
     static String createErr(Exception tE, Exception eE) {
         return "NoSuchPaddingException: ".concat(tE.toString()).concat(
                 " is not equal to caught exception: ").concat(eE.toString());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/NullCipherTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/NullCipherTest.java?rev=391630&r1=391629&r2=391630&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/NullCipherTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/NullCipherTest.java Wed Apr  5 07:43:05 2006
@@ -100,7 +100,7 @@
 	 * Class under test for void init(int, Key, AlgorithmParameterSpec)
 	 */
 	public void testInitintKeyAlgorithmParameterSpec() {
-		class myAlgorithmParameterSpec implements java.security.spec.AlgorithmParameterSpec {};
+		class myAlgorithmParameterSpec implements java.security.spec.AlgorithmParameterSpec {}
 		try {
 			c.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(new byte[1], "algorithm"), new myAlgorithmParameterSpec());
 		} catch (InvalidKeyException e) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/SecretKeyFactorySpiTests.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/SecretKeyFactorySpiTests.java?rev=391630&r1=391629&r2=391630&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/SecretKeyFactorySpiTests.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/SecretKeyFactorySpiTests.java Wed Apr  5 07:43:05 2006
@@ -51,8 +51,7 @@
      */
     public void testSecretKeyFactorySpi01() throws InvalidKeyException,
             InvalidKeySpecException {
-        SecretKeyFactorySpi skfSpi = (SecretKeyFactorySpi) new MySecretKeyFactorySpi();
-        assertTrue(skfSpi instanceof SecretKeyFactorySpi);
+        SecretKeyFactorySpi skfSpi = new MySecretKeyFactorySpi();
         SecretKey sk = null;
         assertNull("Not null result", skfSpi.engineTranslateKey(sk));
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/SecretKeyFactoryTest1.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/SecretKeyFactoryTest1.java?rev=391630&r1=391629&r2=391630&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/SecretKeyFactoryTest1.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/SecretKeyFactoryTest1.java Wed Apr  5 07:43:05 2006
@@ -128,7 +128,6 @@
         SecretKeyFactorySpi spi = new MySecretKeyFactorySpi();
         SecretKeyFactory secKF = new mySecretKeyFactory(spi, defaultProvider,
                 defaultAlgorithm);
-        assertTrue("Not SecretKeyFactory object", secKF instanceof SecretKeyFactory);
         assertEquals("Incorrect algorithm", secKF.getAlgorithm(),
                 defaultAlgorithm);
         assertEquals("Incorrect provider", secKF.getProvider(), defaultProvider);
@@ -136,7 +135,6 @@
         assertNull("Incorrect result", secKF.getKeySpec(null, null));
         assertNull("Incorrect result", secKF.translateKey(null));
         secKF = new mySecretKeyFactory(null, null, null);
-        assertTrue("Not SecretKeyFactory object", secKF instanceof SecretKeyFactory);
         assertNull("Algorithm must be null", secKF.getAlgorithm());
         assertNull("Provider must be null", secKF.getProvider());
         try {
@@ -180,8 +178,6 @@
         for (int i = 0; i < validValues.length; i++) {
             SecretKeyFactory secKF = SecretKeyFactory
                     .getInstance(validValues[i]);
-            assertTrue("Not SecretKeyFactory object",
-                    secKF instanceof SecretKeyFactory);
             assertEquals("Incorrect algorithm", secKF.getAlgorithm(),
                     validValues[i]);
         }
@@ -271,8 +267,6 @@
         for (int i = 0; i < validValues.length; i++) {
             SecretKeyFactory secKF = SecretKeyFactory.getInstance(
                     validValues[i], defaultProviderName);
-            assertTrue("Not SecretKeyFactory object",
-                    secKF instanceof SecretKeyFactory);
             assertEquals("Incorrect algorithm", secKF.getAlgorithm(),
                     validValues[i]);
             assertEquals("Incorrect provider", secKF.getProvider().getName(),
@@ -341,8 +335,6 @@
         for (int i = 0; i < validValues.length; i++) {
             SecretKeyFactory secKF = SecretKeyFactory.getInstance(
                     validValues[i], defaultProvider);
-            assertTrue("Not SecretKeyFactory object",
-                    secKF instanceof SecretKeyFactory);
             assertEquals("Incorrect algorithm", secKF.getAlgorithm(),
                     validValues[i]);
             assertEquals("Incorrect provider", secKF.getProvider(),
@@ -445,8 +437,8 @@
             } catch (InvalidKeyException e) {
             }
             try { 
-                SecretKey sk = skF[i].translateKey(secKeySpec);
-                assertTrue(sk instanceof SecretKey);
+                skF[i].translateKey(secKeySpec);
+                fail("InvalidKeyException must be thrown");
             } catch (InvalidKeyException e) {
             }            
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/SecretKeyFactoryTest2.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/SecretKeyFactoryTest2.java?rev=391630&r1=391629&r2=391630&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/SecretKeyFactoryTest2.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/SecretKeyFactoryTest2.java Wed Apr  5 07:43:05 2006
@@ -119,8 +119,6 @@
         SecretKeyFactory skf;
         for (int i = 0; i < validValues.length; i++) {
             skf = SecretKeyFactory.getInstance(validValues[i]);
-            assertTrue("Not instanceof SecretKeyFactory object",
-                    skf instanceof SecretKeyFactory);
             assertEquals("Incorrect algorithm", skf.getAlgorithm(),
                     validValues[i]);
             assertEquals("Incorrect provider", skf.getProvider(), mProv);
@@ -185,8 +183,6 @@
         for (int i = 0; i < validValues.length; i++) {
             skf = SecretKeyFactory.getInstance(validValues[i], mProv
                     .getName());
-            assertTrue("Not instanceof SecretKeyFactory object",
-                    skf instanceof SecretKeyFactory);
             assertEquals("Incorrect algorithm", skf.getAlgorithm(),
                     validValues[i]);
             assertEquals("Incorrect provider", skf.getProvider().getName(),
@@ -233,8 +229,6 @@
         SecretKeyFactory skf;
         for (int i = 0; i < validValues.length; i++) {
             skf = SecretKeyFactory.getInstance(validValues[i], mProv);
-            assertTrue("Not instanceof SecretKeyFactory object",
-                    skf instanceof SecretKeyFactory);
             assertEquals("Incorrect algorithm", skf.getAlgorithm(),
                     validValues[i]);
             assertEquals("Incorrect provider", skf.getProvider(), mProv);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/ShortBufferExceptionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/ShortBufferExceptionTest.java?rev=391630&r1=391629&r2=391630&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/ShortBufferExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/ShortBufferExceptionTest.java Wed Apr  5 07:43:05 2006
@@ -65,8 +65,6 @@
 
     static Throwable tCause = new Throwable("Throwable for exception");
 
-    private static String errNotExc = "Exception is not ShortBufferException";
-
     static String createErr(Exception tE, Exception eE) {
         return "ShortBufferException: ".concat(tE.toString()).concat(
                 " is not equal to caught exception: ").concat(eE.toString());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/spec/OAEPParameterSpecTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/spec/OAEPParameterSpecTest.java?rev=391630&r1=391629&r2=391630&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/spec/OAEPParameterSpecTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/spec/OAEPParameterSpecTest.java Wed Apr  5 07:43:05 2006
@@ -48,24 +48,21 @@
         PSource pSrc = PSource.PSpecified.DEFAULT;
 
         try {
-            OAEPParameterSpec ps = new OAEPParameterSpec(null, mgfName,
-                                                                mgfSpec, pSrc);
+            new OAEPParameterSpec(null, mgfName, mgfSpec, pSrc);
             fail("NullPointerException should be thrown in the case of "
                     + "null mdName.");
         } catch (NullPointerException e) {
         }
 
         try {
-            OAEPParameterSpec ps = new OAEPParameterSpec(mdName, null,
-                                                                mgfSpec, pSrc);
+            new OAEPParameterSpec(mdName, null, mgfSpec, pSrc);
             fail("NullPointerException should be thrown in the case of "
                     + "null mgfName.");
         } catch (NullPointerException e) {
         }
 
         try {
-            OAEPParameterSpec ps = new OAEPParameterSpec(mdName, mgfName,
-                                                                mgfSpec, null);
+            new OAEPParameterSpec(mdName, mgfName, mgfSpec, null);
             fail("NullPointerException should be thrown in the case of "
                     + "null pSrc.");
         } catch (NullPointerException e) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/spec/PBEKeySpecTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/spec/PBEKeySpecTest.java?rev=391630&r1=391629&r2=391630&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/spec/PBEKeySpecTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/spec/PBEKeySpecTest.java Wed Apr  5 07:43:05 2006
@@ -78,8 +78,7 @@
         }
 
         try {
-            PBEKeySpec pbeks = new PBEKeySpec(password, null,
-                                                iterationCount, keyLength);
+            new PBEKeySpec(password, null, iterationCount, keyLength);
             fail("A NullPointerException should be was thrown "
                     + "in the case of null salt.");
         } catch (IllegalArgumentException e) {
@@ -88,40 +87,35 @@
         }
 
         try {
-            PBEKeySpec pbeks = new PBEKeySpec(password, new byte [0],
-                                                iterationCount, keyLength);
+            new PBEKeySpec(password, new byte [0], iterationCount, keyLength);
             fail("An IllegalArgumentException should be thrown "
                     + "in the case of empty salt.");
         } catch (IllegalArgumentException e) {
         }
 
         try {
-            PBEKeySpec pbeks = new PBEKeySpec(password, salt,
-                                                -1, keyLength);
+            new PBEKeySpec(password, salt, -1, keyLength);
             fail("An IllegalArgumentException should be thrown "
                     + "in the case of negative iterationCount.");
         } catch (IllegalArgumentException e) {
         }
 
         try {
-            PBEKeySpec pbeks = new PBEKeySpec(password, salt,
-                                                iterationCount, -1);
+            new PBEKeySpec(password, salt, iterationCount, -1);
             fail("An IllegalArgumentException should be thrown "
                     + "in the case of negative keyLength.");
         } catch (IllegalArgumentException e) {
         }
 
         try {
-            PBEKeySpec pbeks = new PBEKeySpec(password, salt,
-                                              0, keyLength);
+            new PBEKeySpec(password, salt, 0, keyLength);
             fail("An IllegalArgumentException should be thrown "
                     + "in the case of zero iterationCount.");
         } catch (IllegalArgumentException e) {
         }
 
         try {
-            PBEKeySpec pbeks = new PBEKeySpec(password, salt,
-                                              iterationCount, 0);
+            new PBEKeySpec(password, salt, iterationCount, 0);
             fail("An IllegalArgumentException should be thrown "
                     + "in the case of zero keyLength.");
         } catch (IllegalArgumentException e) {
@@ -161,7 +155,7 @@
         }
 
         try {
-            PBEKeySpec pbeks = new PBEKeySpec(password, null, iterationCount);
+            new PBEKeySpec(password, null, iterationCount);
             fail("A NullPointerException should be was thrown "
                     + "in the case of null salt.");
         } catch (IllegalArgumentException e) {
@@ -170,7 +164,7 @@
         }
 
         try {
-            PBEKeySpec pbeks = new PBEKeySpec(password, new byte [0],
+            new PBEKeySpec(password, new byte [0],
                                                 iterationCount);
             fail("An IllegalArgumentException should be thrown "
                     + "in the case of empty salt.");
@@ -178,14 +172,14 @@
         }
 
         try {
-            PBEKeySpec pbeks = new PBEKeySpec(password, salt, -1);
+            new PBEKeySpec(password, salt, -1);
             fail("An IllegalArgumentException should be thrown "
                     + "in the case of negative iterationCount.");
         } catch (IllegalArgumentException e) {
         }
 
         try {
-            PBEKeySpec pbeks = new PBEKeySpec(password, salt, 0);
+            new PBEKeySpec(password, salt, 0);
             fail("An IllegalArgumentException should be thrown "
                     + "in the case of zero iterationCount.");
         } catch (IllegalArgumentException e) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/spec/PBEParameterSpecTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/spec/PBEParameterSpecTest.java?rev=391630&r1=391629&r2=391630&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/spec/PBEParameterSpecTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/spec/PBEParameterSpecTest.java Wed Apr  5 07:43:05 2006
@@ -42,7 +42,7 @@
         int iterationCount = 10;
 
         try {
-            PBEParameterSpec pbeps = new PBEParameterSpec(null, iterationCount);
+            new PBEParameterSpec(null, iterationCount);
             fail("A NullPointerException should be was thrown "
                     + "in the case of null salt.");
         } catch (NullPointerException e) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/spec/RC2ParameterSpecTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/spec/RC2ParameterSpecTest.java?rev=391630&r1=391629&r2=391630&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/spec/RC2ParameterSpecTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/spec/RC2ParameterSpecTest.java Wed Apr  5 07:43:05 2006
@@ -44,15 +44,14 @@
         byte[] iv = {1, 2, 3, 4, 5, 6, 7, 8};
 
         try {
-            RC2ParameterSpec ps = new RC2ParameterSpec(effectiveKeyBits, null);
+            new RC2ParameterSpec(effectiveKeyBits, null);
             fail("An IllegalArgumentException should be thrown "
                     + "in the case of null iv.");
         } catch (IllegalArgumentException e) {
         }
 
         try {
-            RC2ParameterSpec ps = new RC2ParameterSpec(effectiveKeyBits,
-                                                new byte[] {1, 2, 3, 4, 5});
+            new RC2ParameterSpec(effectiveKeyBits, new byte[] {1, 2, 3, 4, 5});
             fail("An IllegalArgumentException should be thrown "
                     + "in the case of short iv.");
         } catch (IllegalArgumentException e) {
@@ -77,16 +76,14 @@
         int offset = 2;
 
         try {
-            RC2ParameterSpec ps = new RC2ParameterSpec(effectiveKeyBits,
-                                                                null, offset);
+            new RC2ParameterSpec(effectiveKeyBits, null, offset);
             fail("An IllegalArgumentException should be thrown "
                     + "in the case of null iv.");
         } catch (IllegalArgumentException e) {
         }
 
         try {
-            RC2ParameterSpec ps = new RC2ParameterSpec(effectiveKeyBits,
-                                                                        iv, 4);
+            new RC2ParameterSpec(effectiveKeyBits, iv, 4);
             fail("An IllegalArgumentException should be thrown "
                     + "in the case of short iv.");
         } catch (IllegalArgumentException e) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/spec/RC5ParameterSpecTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/spec/RC5ParameterSpecTest.java?rev=391630&r1=391629&r2=391630&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/spec/RC5ParameterSpecTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/java/javax/crypto/spec/RC5ParameterSpecTest.java Wed Apr  5 07:43:05 2006
@@ -45,24 +45,21 @@
         byte[] iv = {1, 2, 3, 4};
 
         try {
-            RC5ParameterSpec ps = new RC5ParameterSpec(version, rounds,
-                                                            wordSize, null);
+            new RC5ParameterSpec(version, rounds, wordSize, null);
             fail("An IllegalArgumentException should be thrown "
                     + "in the case of null iv.");
         } catch (IllegalArgumentException e) {
         }
 
         try {
-            RC5ParameterSpec ps = new RC5ParameterSpec(version, rounds,
-                                                            wordSize+8, iv);
+            new RC5ParameterSpec(version, rounds, wordSize+8, iv);
             fail("An IllegalArgumentException should be thrown "
                     + "in the case of short iv.");
         } catch (IllegalArgumentException e) {
         }
 
         try {
-            RC5ParameterSpec ps = new RC5ParameterSpec(version, rounds,
-                                                wordSize, new byte[] {1, 2, 3});
+            new RC5ParameterSpec(version, rounds, wordSize, new byte[] {1, 2, 3});
             fail("An IllegalArgumentException should be thrown "
                     + "in the case of short iv.");
         } catch (IllegalArgumentException e) {
@@ -90,32 +87,29 @@
         int offset = 2;
 
         try {
-            RC5ParameterSpec ps = new RC5ParameterSpec(version, rounds,
-                                                        wordSize, null, offset);
+            new RC5ParameterSpec(version, rounds, wordSize, null, offset);
             fail("An IllegalArgumentException should be thrown "
                     + "in the case of null iv.");
         } catch (IllegalArgumentException e) {
         }
 
         try {
-            RC5ParameterSpec ps = new RC5ParameterSpec(version, rounds,
-                                                        wordSize+8, iv, offset);
+            new RC5ParameterSpec(version, rounds, wordSize+8, iv, offset);
             fail("An IllegalArgumentException should be thrown "
                     + "in the case of short iv.");
         } catch (IllegalArgumentException e) {
         }
 
         try {
-            RC5ParameterSpec ps = new RC5ParameterSpec(version, rounds,
-                                                        wordSize, iv, offset+1);
+            new RC5ParameterSpec(version, rounds, wordSize, iv, offset+1);
             fail("An IllegalArgumentException should be thrown "
                     + "in the case of short iv.");
         } catch (IllegalArgumentException e) {
         }
 
         try {
-            RC5ParameterSpec ps = new RC5ParameterSpec(version, rounds,
-                                    wordSize, new byte[] {1, 2, 3, 4}, offset);
+            new RC5ParameterSpec(version, rounds, wordSize, new byte[] { 1, 2,
+                    3, 4 }, offset);
             fail("An IllegalArgumentException should be thrown "
                     + "in the case of short iv.");
         } catch (IllegalArgumentException e) {