import java.io.IOException;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Map;
import java.util.TreeMap;
import org.simantics.databoard.annotations.Union;
import org.simantics.databoard.binding.Binding;
import org.simantics.databoard.binding.error.BindingConstructionException;
-import org.simantics.databoard.serialization.SerializationException;
import org.simantics.databoard.serialization.Serializer;
import org.simantics.databoard.serialization.SerializerConstructionException;
import org.simantics.db.Metadata;
import org.simantics.db.common.utils.NameUtils;
import org.simantics.db.exception.DatabaseException;
import org.simantics.layer0.Layer0;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class DependencyChanges implements Metadata {
-
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(DependencyChanges.class);
+
public final @Arguments({Resource.class, Change[].class}) TreeMap<Resource, Change[]> modelChanges;
public final boolean hasUnresolved;
Binding binding = databoard.getBinding( DependencyChanges.class );
Serializer serializer = databoard.getSerializer( binding );
return serializer.serialize(this);
- } catch (SerializationException e) {
- e.printStackTrace();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (SerializerConstructionException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (BindingConstructionException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
+ } catch (IOException | SerializerConstructionException | BindingConstructionException e) {
+ LOGGER.error("Could not serialise {} {}", getClass().getSimpleName(), this, e);
+ }
return new byte[0];
}
Binding binding = databoard.getBinding( DependencyChanges.class );
Serializer serializer = databoard.getSerializer( binding );
return (DependencyChanges) serializer.deserialize(input);
- } catch (SerializationException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- } catch (SerializerConstructionException e) {
- e.printStackTrace();
- } catch (BindingConstructionException e) {
- e.printStackTrace();
- }
+ } catch (IOException | SerializerConstructionException | BindingConstructionException e) {
+ LOGGER.error("Could not deserialise {}", Arrays.toString(input), e);
+ }
return null;
}