GreenDelta / olca-app

Source code of openLCA
openlca.org
Mozilla Public License 2.0
194 stars 43 forks source link

Projects crash with older report formats #155

Closed msrocka closed 2 years ago

msrocka commented 2 years ago

When opening a project with a report file, the report file is deserialized in the following way:

report = new Gson().fromJson(buffer, Report.class);

This crashes with older reports as the report format has changed. An example where this happens is the bottles case study on openLCA Nexus.

To fix that it would be good to read reports in a backwards-compatible way based on the JSON elements of the report document, e.g. implementing a fromJson function for the report elements like here: https://github.com/GreenDelta/olca-app/blob/master/olca-app/src/org/openlca/app/tools/openepd/model/Ec3Epd.java#L37