+
+ /* Code to test state save/restore. Enable only for that purpose
+ */
+ if (false) {
+ AltosJson json = new AltosJson(this);
+ String onetrip = json.toPrettyString();
+ AltosJson back = AltosJson.fromString(onetrip);
+ AltosState tripstate = (AltosState) back.make(this.getClass());
+ AltosJson tripjson = new AltosJson(tripstate);
+ String twotrip = tripjson.toPrettyString();
+
+ if (!onetrip.equals(twotrip)) {
+ try {
+ FileWriter one_file = new FileWriter("one.json", true);
+ one_file.write(onetrip);
+ one_file.flush();
+ FileWriter two_file = new FileWriter("two.json", true);
+ two_file.write(twotrip);
+ two_file.flush();
+ } catch (Exception e) {
+ }
+ System.out.printf("json error\n");
+ System.exit(1);
+ }
+ }