< prev index next >

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

Print this page
rev 52881 : 8214971: Replace use of string.equals("") with isEmpty()
Reviewed-by: jlaskey, prappo, lancea, dfuchs, redestad


 220                 int modtime = props.getTime(Pack200.Packer.MODIFICATION_TIME);
 221                 if (modtime != Constants.NO_MODTIME) {
 222                     pkg.default_modtime = modtime;
 223                 }
 224             }
 225             if (!keepDeflateHint) {
 226                 boolean deflate_hint = props.getBoolean(Pack200.Packer.DEFLATE_HINT);
 227                 if (deflate_hint) {
 228                     pkg.default_options |= Constants.AO_DEFLATE_HINT;
 229                 }
 230             }
 231         }
 232 
 233         long totalOutputSize = 0;
 234         int  segmentCount = 0;
 235         long segmentTotalSize = 0;
 236         long segmentSize = 0;  // running counter
 237         final long segmentLimit;
 238         {
 239             long limit;
 240             if (props.getProperty(Pack200.Packer.SEGMENT_LIMIT, "").equals(""))
 241                 limit = -1;
 242             else
 243                 limit = props.getLong(Pack200.Packer.SEGMENT_LIMIT);
 244             limit = Math.min(Integer.MAX_VALUE, limit);
 245             limit = Math.max(-1, limit);
 246             if (limit == -1)
 247                 limit = Long.MAX_VALUE;
 248             segmentLimit = limit;
 249         }
 250 
 251         final List<String> passFiles;  // parsed pack.pass.file options
 252         {
 253             // Which class files will be passed through?
 254             passFiles = props.getProperties(Pack200.Packer.PASS_FILE_PFX);
 255             for (ListIterator<String> i = passFiles.listIterator(); i.hasNext(); ) {
 256                 String file = i.next();
 257                 if (file == null) { i.remove(); continue; }
 258                 file = Utils.getJarEntryName(file);  // normalize '\\' to '/'
 259                 if (file.endsWith("/"))
 260                     file = file.substring(0, file.length()-1);




 220                 int modtime = props.getTime(Pack200.Packer.MODIFICATION_TIME);
 221                 if (modtime != Constants.NO_MODTIME) {
 222                     pkg.default_modtime = modtime;
 223                 }
 224             }
 225             if (!keepDeflateHint) {
 226                 boolean deflate_hint = props.getBoolean(Pack200.Packer.DEFLATE_HINT);
 227                 if (deflate_hint) {
 228                     pkg.default_options |= Constants.AO_DEFLATE_HINT;
 229                 }
 230             }
 231         }
 232 
 233         long totalOutputSize = 0;
 234         int  segmentCount = 0;
 235         long segmentTotalSize = 0;
 236         long segmentSize = 0;  // running counter
 237         final long segmentLimit;
 238         {
 239             long limit;
 240             if (props.getProperty(Pack200.Packer.SEGMENT_LIMIT, "").isEmpty())
 241                 limit = -1;
 242             else
 243                 limit = props.getLong(Pack200.Packer.SEGMENT_LIMIT);
 244             limit = Math.min(Integer.MAX_VALUE, limit);
 245             limit = Math.max(-1, limit);
 246             if (limit == -1)
 247                 limit = Long.MAX_VALUE;
 248             segmentLimit = limit;
 249         }
 250 
 251         final List<String> passFiles;  // parsed pack.pass.file options
 252         {
 253             // Which class files will be passed through?
 254             passFiles = props.getProperties(Pack200.Packer.PASS_FILE_PFX);
 255             for (ListIterator<String> i = passFiles.listIterator(); i.hasNext(); ) {
 256                 String file = i.next();
 257                 if (file == null) { i.remove(); continue; }
 258                 file = Utils.getJarEntryName(file);  // normalize '\\' to '/'
 259                 if (file.endsWith("/"))
 260                     file = file.substring(0, file.length()-1);


< prev index next >