Clean up String.format

It works like printf, why not use it like printf?
This commit is contained in:
Matthew Smith 2015-08-31 22:14:03 +01:00
parent c75c2c204a
commit e632cf884b

View file

@ -68,10 +68,7 @@ public class JarUtils {
if(!entry.isDirectory()) if(!entry.isDirectory())
files.put(name, bytes); files.put(name, bytes);
} else { } else {
String cafebabe = String.format("%02X", bytes[0]) String cafebabe = String.format("%02X%02X%02X%02X", bytes[0], bytes[1], bytes[2], bytes[3]);
+ String.format("%02X", bytes[1])
+ String.format("%02X", bytes[2])
+ String.format("%02X", bytes[3]);
if(cafebabe.toLowerCase().equals("cafebabe")) { if(cafebabe.toLowerCase().equals("cafebabe")) {
try { try {
final ClassNode cn = getNode(bytes); final ClassNode cn = getNode(bytes);