/[classpath]/classpath/java/nio/charset/Charset.java
ViewVC logotype

Diff of /classpath/java/nio/charset/Charset.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.11.2.3 by gnu_andrew, Sat Feb 19 10:50:38 2005 UTC revision 1.11.2.4 by gnu_andrew, Mon Apr 18 01:37:38 2005 UTC
# Line 62  import java.util.TreeMap; Line 62  import java.util.TreeMap;
62   */   */
63  public abstract class Charset implements Comparable  public abstract class Charset implements Comparable
64  {  {
65    private static CharsetEncoder cachedEncoder;    private CharsetEncoder cachedEncoder;
66    private static CharsetDecoder cachedDecoder;    private CharsetDecoder cachedDecoder;
67    
68    /**    /**
69     * Charset providers.     * Charset providers.
70     */     */
71    private static CharsetProvider[] providers;    private static CharsetProvider[] providers;
72        
   static  
   {  
     synchronized (Charset.class)  
       {  
         cachedEncoder = null;  
         cachedDecoder = null;  
       }  
   }  
   
73    private final String canonicalName;    private final String canonicalName;
74    private final String[] aliases;    private final String[] aliases;
75        
# Line 92  public abstract class Charset implements Line 83  public abstract class Charset implements
83              checkName (aliases[i]);              checkName (aliases[i]);
84        }        }
85    
86        cachedEncoder = null;
87        cachedDecoder = null;
88      this.canonicalName = canonicalName;      this.canonicalName = canonicalName;
89      this.aliases = aliases;      this.aliases = aliases;
90    }    }
# Line 296  public abstract class Charset implements Line 289  public abstract class Charset implements
289                  cachedEncoder = newEncoder ()                  cachedEncoder = newEncoder ()
290                    .onMalformedInput (CodingErrorAction.REPLACE)                    .onMalformedInput (CodingErrorAction.REPLACE)
291                    .onUnmappableCharacter (CodingErrorAction.REPLACE);                    .onUnmappableCharacter (CodingErrorAction.REPLACE);
292                }                } else
293                    cachedEncoder.reset();
294              return cachedEncoder.encode (cb);              return cachedEncoder.encode (cb);
295            }            }
296        }        }
# Line 327  public abstract class Charset implements Line 320  public abstract class Charset implements
320                  cachedDecoder = newDecoder ()                  cachedDecoder = newDecoder ()
321                    .onMalformedInput (CodingErrorAction.REPLACE)                    .onMalformedInput (CodingErrorAction.REPLACE)
322                    .onUnmappableCharacter (CodingErrorAction.REPLACE);                    .onUnmappableCharacter (CodingErrorAction.REPLACE);
323                }                } else
324                    cachedDecoder.reset();
325    
326              return cachedDecoder.decode (bb);              return cachedDecoder.decode (bb);
327            }            }

Legend:
Removed from v.1.11.2.3  
changed lines
  Added in v.1.11.2.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26