Panagiotis Triantafyllou

revert session impl, crash fixes

...@@ -2,7 +2,7 @@ apply plugin: 'com.android.library' ...@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
2 2
3 ext { 3 ext {
4 PUBLISH_GROUP_ID = 'ly.warp' 4 PUBLISH_GROUP_ID = 'ly.warp'
5 - PUBLISH_VERSION = '4.5.4.6rc40' 5 + PUBLISH_VERSION = '4.5.4.6rc41'
6 PUBLISH_ARTIFACT_ID = 'warply-android-sdk' 6 PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
7 } 7 }
8 8
......
...@@ -119,7 +119,7 @@ public class DiskBasedCache implements Cache { ...@@ -119,7 +119,7 @@ public class DiskBasedCache implements Cache {
119 byte[] data = streamToBytes(cis, (int) Math.abs((int)(file.length() - cis.bytesRead))); 119 byte[] data = streamToBytes(cis, (int) Math.abs((int)(file.length() - cis.bytesRead)));
120 // byte[] data = readAllBytes(cis); 120 // byte[] data = readAllBytes(cis);
121 return entry.toCacheEntry(data); 121 return entry.toCacheEntry(data);
122 - } catch (IOException e) { 122 + } catch (IOException | NegativeArraySizeException e) {
123 VolleyLog.d("%s: %s", file.getAbsolutePath(), e.toString()); 123 VolleyLog.d("%s: %s", file.getAbsolutePath(), e.toString());
124 remove(key); 124 remove(key);
125 return null; 125 return null;
...@@ -315,11 +315,11 @@ public class DiskBasedCache implements Cache { ...@@ -315,11 +315,11 @@ public class DiskBasedCache implements Cache {
315 /** 315 /**
316 * Reads the contents of an InputStream into a byte[]. 316 * Reads the contents of an InputStream into a byte[].
317 * */ 317 * */
318 - private static byte[] streamToBytes(InputStream in, int length) throws IOException { 318 + private static byte[] streamToBytes(InputStream in, int length) throws IOException, NegativeArraySizeException {
319 byte[] bytes = new byte[1]; 319 byte[] bytes = new byte[1];
320 try { 320 try {
321 bytes = IOUtils.toByteArray(in); 321 bytes = IOUtils.toByteArray(in);
322 - } catch (OutOfMemoryError e) { 322 + } catch (OutOfMemoryError | NegativeArraySizeException e) {
323 e.printStackTrace(); 323 e.printStackTrace();
324 } 324 }
325 int count; 325 int count;
......
...@@ -63,7 +63,7 @@ public class WarplyProperty { ...@@ -63,7 +63,7 @@ public class WarplyProperty {
63 Properties properties = new Properties(); 63 Properties properties = new Properties();
64 properties.load(context.getResources().getAssets().open(PROPERTIES_FILE)); 64 properties.load(context.getResources().getAssets().open(PROPERTIES_FILE));
65 return properties.getProperty(propertyKey); 65 return properties.getProperty(propertyKey);
66 - } catch (IOException e) { 66 + } catch (IOException | NullPointerException e) {
67 WarpUtils.log(e.getMessage()); 67 WarpUtils.log(e.getMessage());
68 return ""; 68 return "";
69 } 69 }
......