< prev index next >

src/java.base/share/classes/com/sun/java/util/jar/pack/PropMap.java

Print this page
rev 50498 : 8199871: Deprecate pack200 and unpack200 tools
Reviewed-by:


  30 import java.io.PrintStream;
  31 import java.io.PrintWriter;
  32 import java.security.AccessController;
  33 import java.security.PrivilegedAction;
  34 import java.util.ArrayList;
  35 import java.util.Collection;
  36 import java.util.Comparator;
  37 import java.util.HashMap;
  38 import java.util.List;
  39 import java.util.Map;
  40 import java.util.Properties;
  41 import java.util.Set;
  42 import java.util.SortedMap;
  43 import java.util.TreeMap;
  44 import java.util.jar.Pack200;
  45 
  46 /**
  47  * Control block for publishing Pack200 options to the other classes.
  48  */
  49 

  50 final class PropMap implements SortedMap<String, String>  {
  51     private final TreeMap<String, String> theMap = new TreeMap<>();;
  52 
  53     // Override:
  54     public String put(String key, String value) {
  55         String oldValue = theMap.put(key, value);
  56         return oldValue;
  57     }
  58 
  59     // All this other stuff is private to the current package.
  60     // Outide clients of Pack200 do not need to use it; they can
  61     // get by with generic SortedMap functionality.
  62     private static Map<String, String> defaultProps;
  63     static {
  64         Properties props = new Properties();
  65 
  66         // Allow implementation selected via -Dpack.disable.native=true
  67         String propValue = getPropertyValue(Utils.DEBUG_DISABLE_NATIVE, "false");
  68         props.put(Utils.DEBUG_DISABLE_NATIVE,
  69                   String.valueOf(Boolean.parseBoolean(propValue)));




  30 import java.io.PrintStream;
  31 import java.io.PrintWriter;
  32 import java.security.AccessController;
  33 import java.security.PrivilegedAction;
  34 import java.util.ArrayList;
  35 import java.util.Collection;
  36 import java.util.Comparator;
  37 import java.util.HashMap;
  38 import java.util.List;
  39 import java.util.Map;
  40 import java.util.Properties;
  41 import java.util.Set;
  42 import java.util.SortedMap;
  43 import java.util.TreeMap;
  44 import java.util.jar.Pack200;
  45 
  46 /**
  47  * Control block for publishing Pack200 options to the other classes.
  48  */
  49 
  50 @SuppressWarnings({"removal"})
  51 final class PropMap implements SortedMap<String, String>  {
  52     private final TreeMap<String, String> theMap = new TreeMap<>();;
  53 
  54     // Override:
  55     public String put(String key, String value) {
  56         String oldValue = theMap.put(key, value);
  57         return oldValue;
  58     }
  59 
  60     // All this other stuff is private to the current package.
  61     // Outide clients of Pack200 do not need to use it; they can
  62     // get by with generic SortedMap functionality.
  63     private static Map<String, String> defaultProps;
  64     static {
  65         Properties props = new Properties();
  66 
  67         // Allow implementation selected via -Dpack.disable.native=true
  68         String propValue = getPropertyValue(Utils.DEBUG_DISABLE_NATIVE, "false");
  69         props.put(Utils.DEBUG_DISABLE_NATIVE,
  70                   String.valueOf(Boolean.parseBoolean(propValue)));


< prev index next >