harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r431551 - /incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/org/apache/harmony/crypto/utils/AlgNameMapper.java
Date Tue, 15 Aug 2006 07:37:58 GMT
Author: mloenko
Date: Tue Aug 15 00:37:58 2006
New Revision: 431551

URL: http://svn.apache.org/viewvc?rev=431551&view=rev
Log:
applied patch for HARMONY-1185
org.apache.harmony.crypto.utils.AlgNameMapper discards mappings which should be allowed

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/org/apache/harmony/crypto/utils/AlgNameMapper.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/org/apache/harmony/crypto/utils/AlgNameMapper.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/org/apache/harmony/crypto/utils/AlgNameMapper.java?rev=431551&r1=431550&r2=431551&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/org/apache/harmony/crypto/utils/AlgNameMapper.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/org/apache/harmony/crypto/utils/AlgNameMapper.java
Tue Aug 15 00:37:58 2006
@@ -188,15 +188,19 @@
                             alias = alias.substring(4);
                         }
                         // Do not overwrite already known mappings
-                        if (!oid2AlgMap.containsKey(alias) &&
-                            !alg2OidMap.containsKey(algUC)) {
-                            // Suppose OID always points to the standard name
-                            alg2OidMap.put(algUC, alias);
-                            oid2AlgMap.put(alias, algUC);
+                        boolean oid2AlgContains = oid2AlgMap.containsKey(alias);
+                        boolean alg2OidContains = alg2OidMap.containsKey(algUC);
+                        if (!oid2AlgContains || !alg2OidContains) {
+                            if (!oid2AlgContains) {
+                                oid2AlgMap.put(alias, algUC);
+                            } 
+                            if (!alg2OidContains) {
+                                alg2OidMap.put(algUC, alias);
+                            }
                             // map upper case alg name to its original name
                             algAliasesMap.put(algUC, alg);
                         }
-                           // Do not allow known standard names as alias 
+                           // Do not override known standard names
                     } else if (!algAliasesMap.containsKey(alias.toUpperCase())) {
                         algAliasesMap.put(alias.toUpperCase(), alg);
                     }



Mime
View raw message