You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by cl...@apache.org on 2014/05/06 20:51:33 UTC

svn commit: r1592838 - in /felix/trunk/ipojo/manipulator/manipulator: pom.xml src/test/java/test/frames/CryptoServiceSingleton.java

Author: clement
Date: Tue May  6 18:51:33 2014
New Revision: 1592838

URL: http://svn.apache.org/r1592838
Log:
Revert to Java 6.

Modified:
    felix/trunk/ipojo/manipulator/manipulator/pom.xml
    felix/trunk/ipojo/manipulator/manipulator/src/test/java/test/frames/CryptoServiceSingleton.java

Modified: felix/trunk/ipojo/manipulator/manipulator/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/pom.xml?rev=1592838&r1=1592837&r2=1592838&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/pom.xml (original)
+++ felix/trunk/ipojo/manipulator/manipulator/pom.xml Tue May  6 18:51:33 2014
@@ -131,8 +131,8 @@
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-compiler-plugin</artifactId>
         <configuration>
-          <source>1.7</source>
-          <target>1.7</target>
+          <source>1.6</source>
+          <target>1.6</target>
         </configuration>
       </plugin>
 

Modified: felix/trunk/ipojo/manipulator/manipulator/src/test/java/test/frames/CryptoServiceSingleton.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/test/java/test/frames/CryptoServiceSingleton.java?rev=1592838&r1=1592837&r2=1592838&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/test/java/test/frames/CryptoServiceSingleton.java (original)
+++ felix/trunk/ipojo/manipulator/manipulator/src/test/java/test/frames/CryptoServiceSingleton.java Tue May  6 18:51:33 2014
@@ -88,7 +88,11 @@ public class CryptoServiceSingleton {
             KeySpec spec = new PBEKeySpec(privateKey.toCharArray(), raw, iterationCount, keySize);
             SecretKeyFactory factory = SecretKeyFactory.getInstance(PBKDF_2_WITH_HMAC_SHA_1);
             return new SecretKeySpec(factory.generateSecret(spec).getEncoded(), AES_ECB_ALGORITHM);
-        } catch (DecoderException | NoSuchAlgorithmException | InvalidKeySpecException e) {
+        } catch (DecoderException e) {
+            throw new IllegalStateException(e);
+        } catch ( NoSuchAlgorithmException e) {
+            throw new IllegalStateException(e);
+        } catch (InvalidKeySpecException e) {
             throw new IllegalStateException(e);
         }
     }
@@ -172,8 +176,7 @@ public class CryptoServiceSingleton {
             Cipher cipher = Cipher.getInstance(AES_CBC_ALGORITHM);
             cipher.init(encryptMode, generatedKey, new IvParameterSpec(raw));
             return cipher.doFinal(message);
-        } catch (NoSuchAlgorithmException | NoSuchPaddingException | DecoderException | InvalidKeyException |
-                InvalidAlgorithmParameterException | IllegalBlockSizeException | BadPaddingException e) {
+        } catch (Exception e) {
             throw new IllegalStateException(e);
         }
     }
@@ -266,8 +269,7 @@ public class CryptoServiceSingleton {
             Cipher cipher = Cipher.getInstance(AES_ECB_ALGORITHM);
             cipher.init(Cipher.ENCRYPT_MODE, skeySpec);
             return Hex.encodeHexString(cipher.doFinal(value.getBytes(UTF_8)));
-        } catch (NoSuchAlgorithmException | NoSuchPaddingException |
-                InvalidKeyException | BadPaddingException | IllegalBlockSizeException e) {
+        } catch (Exception e) {
             throw new IllegalStateException(e);
         }
     }
@@ -298,8 +300,7 @@ public class CryptoServiceSingleton {
             Cipher cipher = Cipher.getInstance(AES_ECB_ALGORITHM);
             cipher.init(Cipher.DECRYPT_MODE, skeySpec);
             return new String(cipher.doFinal(Hex.decodeHex(value.toCharArray())), UTF_8);
-        } catch (NoSuchAlgorithmException | NoSuchPaddingException |
-                InvalidKeyException | BadPaddingException | IllegalBlockSizeException | DecoderException e) {
+        } catch (Exception e) {
             throw new IllegalStateException(e);
         }
     }