src/java.base/share/classes/java/nio/charset/Charset.java
changeset 49443 e5679a6661d6
parent 47216 71c04702a3d5
child 49556 809b178407cc
equal deleted inserted replaced
49442:d6d1c06becda 49443:e5679a6661d6
    24  */
    24  */
    25 
    25 
    26 package java.nio.charset;
    26 package java.nio.charset;
    27 
    27 
    28 import jdk.internal.misc.VM;
    28 import jdk.internal.misc.VM;
    29 import sun.nio.cs.StandardCharsets;
       
    30 import sun.nio.cs.ThreadLocalCoders;
    29 import sun.nio.cs.ThreadLocalCoders;
    31 import sun.security.action.GetPropertyAction;
    30 import sun.security.action.GetPropertyAction;
    32 
    31 
    33 import java.nio.ByteBuffer;
    32 import java.nio.ByteBuffer;
    34 import java.nio.CharBuffer;
    33 import java.nio.CharBuffer;
   309             throw new IllegalCharsetNameException(s);
   308             throw new IllegalCharsetNameException(s);
   310         }
   309         }
   311     }
   310     }
   312 
   311 
   313     /* The standard set of charsets */
   312     /* The standard set of charsets */
   314     private static final CharsetProvider standardProvider = new StandardCharsets();
   313     private static final CharsetProvider standardProvider
       
   314         = new sun.nio.cs.StandardCharsets();
   315 
   315 
   316     private static final String[] zeroAliases = new String[0];
   316     private static final String[] zeroAliases = new String[0];
   317 
   317 
   318     // Cache of the most-recently-returned charsets,
   318     // Cache of the most-recently-returned charsets,
   319     // along with the names that were used to find them
   319     // along with the names that were used to find them
   607                         .privilegedGetProperty("file.encoding");
   607                         .privilegedGetProperty("file.encoding");
   608                 Charset cs = lookup(csn);
   608                 Charset cs = lookup(csn);
   609                 if (cs != null)
   609                 if (cs != null)
   610                     defaultCharset = cs;
   610                     defaultCharset = cs;
   611                 else
   611                 else
   612                     defaultCharset = sun.nio.cs.UTF_8.INSTANCE;
   612                     defaultCharset = StandardCharsets.UTF_8;
   613             }
   613             }
   614         }
   614         }
   615         return defaultCharset;
   615         return defaultCharset;
   616     }
   616     }
   617 
   617