jdk/src/windows/classes/sun/net/dns/ResolverConfigurationImpl.java
changeset 10596 39b3a979e600
parent 6112 b9d1b10c662c
child 12559 9456ceada8b1
equal deleted inserted replaced
10595:c5be3e19fbab 10596:39b3a979e600
    55     // DNS suffix list and name servers populated by native method
    55     // DNS suffix list and name servers populated by native method
    56     private static String os_searchlist;
    56     private static String os_searchlist;
    57     private static String os_nameservers;
    57     private static String os_nameservers;
    58 
    58 
    59     // Cached lists
    59     // Cached lists
    60     private static LinkedList searchlist;
    60     private static LinkedList<String> searchlist;
    61     private static LinkedList nameservers;
    61     private static LinkedList<String> nameservers;
    62 
    62 
    63     // Parse string that consists of token delimited by space or commas
    63     // Parse string that consists of token delimited by space or commas
    64     // and return LinkedHashMap
    64     // and return LinkedHashMap
    65     private LinkedList<String> stringToList(String str) {
    65     private LinkedList<String> stringToList(String str) {
    66         LinkedList<String> ll = new LinkedList<>();
    66         LinkedList<String> ll = new LinkedList<>();
   109 
   109 
   110     ResolverConfigurationImpl() {
   110     ResolverConfigurationImpl() {
   111         opts = new OptionsImpl();
   111         opts = new OptionsImpl();
   112     }
   112     }
   113 
   113 
       
   114     @SuppressWarnings("unchecked") // clone()
   114     public List<String> searchlist() {
   115     public List<String> searchlist() {
   115         synchronized (lock) {
   116         synchronized (lock) {
   116             loadConfig();
   117             loadConfig();
   117 
   118 
   118             // List is mutable so return a shallow copy
   119             // List is mutable so return a shallow copy
   119             return (List)searchlist.clone();
   120             return (List<String>)searchlist.clone();
   120         }
   121         }
   121     }
   122     }
   122 
   123 
       
   124     @SuppressWarnings("unchecked") // clone()
   123     public List<String> nameservers() {
   125     public List<String> nameservers() {
   124         synchronized (lock) {
   126         synchronized (lock) {
   125             loadConfig();
   127             loadConfig();
   126 
   128 
   127             // List is mutable so return a shallow copy
   129             // List is mutable so return a shallow copy
   128             return (List)nameservers.clone();
   130             return (List<String>)nameservers.clone();
   129          }
   131          }
   130     }
   132     }
   131 
   133 
   132     public Options options() {
   134     public Options options() {
   133         return opts;
   135         return opts;