harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r825528 - /harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/CodecEncoding.java
Date Thu, 15 Oct 2009 15:45:38 GMT
Author: tellison
Date: Thu Oct 15 15:45:38 2009
New Revision: 825528

URL: http://svn.apache.org/viewvc?rev=825528&view=rev
Log:
Ensure the cache is populated before the static is set.

Modified:
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/CodecEncoding.java

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/CodecEncoding.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/CodecEncoding.java?rev=825528&r1=825527&r2=825528&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/CodecEncoding.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/CodecEncoding.java
Thu Oct 15 15:45:38 2009
@@ -226,10 +226,11 @@
     public static int[] getSpecifier(Codec codec, Codec defaultForBand) {
         // lazy initialization
         if(canonicalCodecsToSpecifiers == null) {
-            canonicalCodecsToSpecifiers = new HashMap();
+            HashMap reverseMap = new HashMap(canonicalCodec.length);
             for (int i = 0; i < canonicalCodec.length; i++) {
-                canonicalCodecsToSpecifiers.put(canonicalCodec[i], new Integer(i));
+                reverseMap.put(canonicalCodec[i], new Integer(i));
             }
+            canonicalCodecsToSpecifiers = reverseMap;
         }
 
         if(canonicalCodecsToSpecifiers.containsKey(codec)) {



Mime
View raw message