--- a/jdk/src/share/classes/com/sun/java/util/jar/pack/PropMap.java Tue May 29 13:16:17 2012 -0700
+++ b/jdk/src/share/classes/com/sun/java/util/jar/pack/PropMap.java Tue May 29 14:56:48 2012 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -193,13 +193,18 @@
boolean setBoolean(String s, boolean val) {
return toBoolean(setProperty(s, String.valueOf(val)));
}
-
int toInteger(String val) {
- if (val == null) return 0;
+ return toInteger(val, 0);
+ }
+ int toInteger(String val, int def) {
+ if (val == null) return def;
if (Pack200.Packer.TRUE.equals(val)) return 1;
if (Pack200.Packer.FALSE.equals(val)) return 0;
return Integer.parseInt(val);
}
+ int getInteger(String s, int def) {
+ return toInteger(getProperty(s), def);
+ }
int getInteger(String s) {
return toInteger(getProperty(s));
}