summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian S. O'Neill <bronee@gmail.com>2009-06-25 01:17:04 +0000
committerBrian S. O'Neill <bronee@gmail.com>2009-06-25 01:17:04 +0000
commitbe265775e90f926715d7a9f74963fa517f83a8bc (patch)
treeab2a965028ec384bb60f84cce683db074de16b9e /src
parent2304be6285502e10fe9201409274541500c4a081 (diff)
Set storable with primary key when corruption is detected against current layout generation.
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/amazon/carbonado/raw/GenericStorableCodec.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/com/amazon/carbonado/raw/GenericStorableCodec.java b/src/main/java/com/amazon/carbonado/raw/GenericStorableCodec.java
index 4b9bd07..7bd9407 100644
--- a/src/main/java/com/amazon/carbonado/raw/GenericStorableCodec.java
+++ b/src/main/java/com/amazon/carbonado/raw/GenericStorableCodec.java
@@ -237,6 +237,8 @@ public class GenericStorableCodec<S extends Storable> implements StorableCodec<S
RawStorableGenerator.DECODE_DATA_METHOD_NAME,
null, byteArrayParam);
CodeBuilder b = new CodeBuilder(mi);
+ Label tryStartDecode = b.createLabel().setLocation();
+
Label altGenerationHandler = b.createLabel();
// assembler = b
@@ -262,16 +264,15 @@ public class GenericStorableCodec<S extends Storable> implements StorableCodec<S
b.loadField(StorableGenerator.SUPPORT_FIELD_NAME, triggerSupportType);
b.checkCast(rawSupportType);
- Label tryStartDecode = b.createLabel().setLocation();
b.loadThis();
b.loadLocal(actualGeneration);
b.loadLocal(b.getParameter(0));
b.invokeInterface(rawSupportType, "decode", null,
new TypeDesc[] {storableType, TypeDesc.INT, byteArrayType});
- Label tryEndDecode = b.createLabel().setLocation();
-
b.returnVoid();
+ Label tryEndDecode = b.createLabel().setLocation();
+
// If unable to decode, fill out exception.
b.exceptionHandler(tryStartDecode, tryEndDecode,
CorruptEncodingException.class.getName());