Finished implementing and testing state change and bug fixes from

testing

Fixes #44
Fixes #60
Fixes #61
Fixes #63
Fixes #66
Fixes #69
This commit is contained in:
Admin
2016-03-21 16:37:13 -05:00
parent 926a7f50dc
commit 9c3d95f177
6 changed files with 99 additions and 10 deletions

View File

@@ -36,6 +36,7 @@ public class DeviceRepository extends BackupHandler {
super();
gson =
new GsonBuilder()
.excludeFieldsWithoutExposeAnnotation()
.create();
repositoryPath = null;
repositoryPath = Paths.get(deviceDb);
@@ -81,7 +82,7 @@ public class DeviceRepository extends BackupHandler {
public void save(DeviceDescriptor[] descriptors) {
String theNames = "";
for(int i = 0; i < descriptors.length; i++) {
if(descriptors[i].getId() != null)
if(descriptors[i].getId() != null && descriptors[i].getId().length() > 0)
devices.remove(descriptors[i].getId());
else
descriptors[i].setId(String.valueOf(random.nextInt(Integer.MAX_VALUE)));