summaryrefslogtreecommitdiff
path: root/src/main/java/com/amazon/carbonado/layout
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/amazon/carbonado/layout')
-rw-r--r--src/main/java/com/amazon/carbonado/layout/Layout.java2
-rw-r--r--src/main/java/com/amazon/carbonado/layout/LayoutProperty.java6
2 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/com/amazon/carbonado/layout/Layout.java b/src/main/java/com/amazon/carbonado/layout/Layout.java
index d127835..62e29f2 100644
--- a/src/main/java/com/amazon/carbonado/layout/Layout.java
+++ b/src/main/java/com/amazon/carbonado/layout/Layout.java
@@ -420,7 +420,7 @@ public class Layout {
mStoredLayout.update();
}
for (LayoutProperty property : mAllProperties) {
- property.insert();
+ property.store();
}
}
}
diff --git a/src/main/java/com/amazon/carbonado/layout/LayoutProperty.java b/src/main/java/com/amazon/carbonado/layout/LayoutProperty.java
index 4a7dea1..a0ce48f 100644
--- a/src/main/java/com/amazon/carbonado/layout/LayoutProperty.java
+++ b/src/main/java/com/amazon/carbonado/layout/LayoutProperty.java
@@ -185,7 +185,9 @@ public class LayoutProperty {
return mStoredLayoutProperty.toString();
}
- void insert() throws PersistException {
- mStoredLayoutProperty.insert();
+ void store() throws PersistException {
+ if (!mStoredLayoutProperty.tryInsert()) {
+ mStoredLayoutProperty.update();
+ }
}
}