Heartstopper Commit

Enabled every catch block in the project to log parsed exceptions.
This commit is contained in:
ronancpl
2017-04-02 21:38:07 -03:00
parent 3990a08202
commit 5f01d3b7fd
88 changed files with 13325 additions and 40964 deletions

View File

@@ -105,6 +105,7 @@ public class MapleDataTool {
try {
return Integer.parseInt(getString(d));
} catch (NumberFormatException nfe) {
nfe.printStackTrace();
return def;
}
} else {

View File

@@ -75,6 +75,7 @@ public class ListWZFile {
listwz = new ListWZFile(MapleDataProviderFactory.fileInWZPath("List.wz"));
modernImgs = new HashSet<String>(listwz.getEntries());
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
}

View File

@@ -142,6 +142,7 @@ public class WZFile implements MapleDataProvider {
MapleData ret = imgFile.getRoot();
return ret;
} catch (IOException e) {
e.printStackTrace();
}
return null;
}

View File

@@ -56,11 +56,14 @@ public class WZTool {
try {
cipher = Cipher.getInstance("AES");
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (NoSuchPaddingException e) {
e.printStackTrace();
}
try {
cipher.init(Cipher.ENCRYPT_MODE, skeySpec);
} catch (InvalidKeyException e) {
e.printStackTrace();
}
encKey = new byte[0xFFFF];
for (int i = 0; i < (0xFFFF / 16); i++) {

View File

@@ -28,6 +28,8 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.text.NumberFormat;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
@@ -42,6 +44,7 @@ import org.xml.sax.SAXException;
public class XMLDomMapleData implements MapleData {
private Node node;
private File imageDataDir;
private NumberFormat nf;
public XMLDomMapleData(FileInputStream fis, File imageDataDir) {
try {
@@ -57,10 +60,12 @@ public class XMLDomMapleData implements MapleData {
throw new RuntimeException(e);
}
this.imageDataDir = imageDataDir;
this.nf = NumberFormat.getInstance(Locale.FRANCE);
}
private XMLDomMapleData(Node node) {
this.node = node;
this.nf = NumberFormat.getInstance(Locale.FRANCE);
}
@Override
@@ -114,25 +119,35 @@ public class XMLDomMapleData implements MapleData {
case DOUBLE:
case FLOAT:
case INT:
case SHORT:
case SHORT: {
String value = attributes.getNamedItem("value").getNodeValue();
Number nval;
try {
nval = nf.parse(value);
}
catch(java.text.ParseException pe) {
pe.printStackTrace();
nval = 0.0f;
}
switch (type) {
case DOUBLE:
return nval.doubleValue();
case FLOAT:
return nval.floatValue();
case INT:
return nval.intValue();
case SHORT:
return nval.shortValue();
default:
return null;
}
}
case STRING:
case UOL: {
String value = attributes.getNamedItem("value").getNodeValue();
switch (type) {
case DOUBLE:
return Double.valueOf(Double.parseDouble(value));
case FLOAT:
return Float.valueOf(Float.parseFloat(value));
case INT:
return Integer.valueOf(Integer.parseInt(value));
case SHORT:
return Short.valueOf(Short.parseShort(value));
case STRING:
case UOL:
return value;
default:
break;
}
return value;
}
case VECTOR: {
String x = attributes.getNamedItem("x").getNodeValue();