cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1583128 - in /cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto: reader/CryptoRowReaderFactoryDecorator.java transformer/DefaultMapTransformer.java transformer/DefaultTransformerFactory.java
Date Sun, 30 Mar 2014 13:18:44 GMT
Author: aadamchik
Date: Sun Mar 30 13:18:44 2014
New Revision: 1583128

URL: http://svn.apache.org/r1583128
Log:
cleanup

Modified:
    cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/reader/CryptoRowReaderFactoryDecorator.java
    cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultMapTransformer.java
    cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultTransformerFactory.java

Modified: cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/reader/CryptoRowReaderFactoryDecorator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/reader/CryptoRowReaderFactoryDecorator.java?rev=1583128&r1=1583127&r2=1583128&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/reader/CryptoRowReaderFactoryDecorator.java
(original)
+++ cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/reader/CryptoRowReaderFactoryDecorator.java
Sun Mar 30 13:18:44 2014
@@ -35,11 +35,12 @@ import org.apache.cayenne.query.QueryMet
 public class CryptoRowReaderFactoryDecorator implements RowReaderFactory {
 
     private RowReaderFactory delegate;
-    private TransformerFactory cryptoFactory;
+    private TransformerFactory transformerFactory;
 
-    public CryptoRowReaderFactoryDecorator(@Inject RowReaderFactory delegate, @Inject TransformerFactory
cryptoFactory) {
+    public CryptoRowReaderFactoryDecorator(@Inject RowReaderFactory delegate,
+            @Inject TransformerFactory transformerFactory) {
         this.delegate = delegate;
-        this.cryptoFactory = cryptoFactory;
+        this.transformerFactory = transformerFactory;
     }
 
     @Override
@@ -55,7 +56,7 @@ public class CryptoRowReaderFactoryDecor
 
             private void ensureDecryptorCompiled(Object row) {
                 if (!decryptorCompiled) {
-                    decryptor = cryptoFactory.decryptor(descriptor.getColumns(), row);
+                    decryptor = transformerFactory.decryptor(descriptor.getColumns(), row);
                     decryptorCompiled = true;
                 }
             }

Modified: cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultMapTransformer.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultMapTransformer.java?rev=1583128&r1=1583127&r2=1583128&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultMapTransformer.java
(original)
+++ cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultMapTransformer.java
Sun Mar 30 13:18:44 2014
@@ -29,12 +29,12 @@ import org.apache.cayenne.crypto.transfo
  */
 public class DefaultMapTransformer implements MapTransformer {
 
-    private String[] keys;
+    private String[] mapKeys;
     private ValueTransformer[] transformers;
     private Cipher cipher;
 
-    public DefaultMapTransformer(String[] keys, ValueTransformer[] transformers, Cipher cipher)
{
-        this.keys = keys;
+    public DefaultMapTransformer(String[] mapKeys, ValueTransformer[] transformers, Cipher
cipher) {
+        this.mapKeys = mapKeys;
         this.transformers = transformers;
         this.cipher = cipher;
     }
@@ -42,14 +42,14 @@ public class DefaultMapTransformer imple
     @Override
     public void transform(Map<String, Object> map) {
 
-        int len = keys.length;
+        int len = mapKeys.length;
 
         for (int i = 0; i < len; i++) {
-            Object value = map.get(keys[i]);
+            Object value = map.get(mapKeys[i]);
 
             if (value != null) {
                 Object transformed = transformers[i].transform(cipher, value);
-                map.put(keys[i], transformed);
+                map.put(mapKeys[i], transformed);
             }
         }
     }

Modified: cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultTransformerFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultTransformerFactory.java?rev=1583128&r1=1583127&r2=1583128&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultTransformerFactory.java
(original)
+++ cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultTransformerFactory.java
Sun Mar 30 13:18:44 2014
@@ -72,17 +72,17 @@ public class DefaultTransformerFactory i
         if (cryptoColumns != null) {
 
             int dlen = cryptoColumns.size();
-            String[] keys = new String[dlen];
+            String[] mapKeys = new String[dlen];
             ValueTransformer[] transformers = new ValueTransformer[dlen];
 
             for (int i = 0; i < dlen; i++) {
 
                 ColumnDescriptor cd = columns[cryptoColumns.get(i)];
-                keys[i] = cd.getDataRowKey();
+                mapKeys[i] = cd.getDataRowKey();
                 transformers[i] = transformerFactory.decryptor(cd.getAttribute());
             }
 
-            return new DefaultMapTransformer(keys, transformers, cipherFactory.cipher());
+            return new DefaultMapTransformer(mapKeys, transformers, cipherFactory.cipher());
         }
 
         return null;



Mime
View raw message