From: Marko Luukkainen Date: Mon, 25 Feb 2019 13:50:46 +0000 (+0000) Subject: Merge "Fixed Acorn MainProgram and GraphClientImpl2 to use Logger" into release/1... X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=commitdiff_plain;h=dee4cc98ae471422ccb8d782f6f1295c65d14343;hp=d373c8ad0c060ef5032f9bfee834d3a75c620968 Merge "Fixed Acorn MainProgram and GraphClientImpl2 to use Logger" into release/1.35.1 --- diff --git a/bundles/org.simantics.acorn/src/org/simantics/acorn/GraphClientImpl2.java b/bundles/org.simantics.acorn/src/org/simantics/acorn/GraphClientImpl2.java index 251a80314..172fdd103 100644 --- a/bundles/org.simantics.acorn/src/org/simantics/acorn/GraphClientImpl2.java +++ b/bundles/org.simantics.acorn/src/org/simantics/acorn/GraphClientImpl2.java @@ -49,7 +49,6 @@ import org.simantics.db.service.ClusterSetsSupport; import org.simantics.db.service.ClusterUID; import org.simantics.db.service.EventSupport; import org.simantics.db.service.LifecycleSupport; -import org.simantics.utils.DataContainer; import org.simantics.utils.datastructures.Pair; import org.simantics.utils.logging.TimeLogger; import org.slf4j.Logger; @@ -700,7 +699,7 @@ public class GraphClientImpl2 implements Database.Session { LOGGER.info("performUndo " + ccsid); performUndo(ccsid, clusterChanges, support); } catch (DatabaseException e) { - e.printStackTrace(); + LOGGER.error("failed to perform undo for cluster change set {}", ccsid, e); } } } diff --git a/bundles/org.simantics.acorn/src/org/simantics/acorn/MainProgram.java b/bundles/org.simantics.acorn/src/org/simantics/acorn/MainProgram.java index 8dea16d7f..ec4d56c21 100644 --- a/bundles/org.simantics.acorn/src/org/simantics/acorn/MainProgram.java +++ b/bundles/org.simantics.acorn/src/org/simantics/acorn/MainProgram.java @@ -61,6 +61,7 @@ public class MainProgram implements Runnable, Closeable { } } + @SuppressWarnings("unchecked") MainProgram(GraphClientImpl2 client, ClusterManager clusters) { this.client = client; @@ -128,7 +129,7 @@ public class MainProgram implements Runnable, Closeable { try { swapChunks(); } catch (AcornAccessVerificationException | IllegalAcornStateException e) { - e.printStackTrace(); + LOGGER.error("cluster chunk swapping failed", e); } finally { clusters.streamLRU.releaseMutex(); } @@ -146,7 +147,7 @@ public class MainProgram implements Runnable, Closeable { } } catch (Throwable t) { - t.printStackTrace(); + LOGGER.error("FATAL: MainProgram died unexpectedly", t); } finally { deathBarrier.release(); } @@ -356,7 +357,7 @@ public class MainProgram implements Runnable, Closeable { executor.awaitTermination(500, TimeUnit.MILLISECONDS); clusterUpdateThreads[i] = null; } catch (InterruptedException e) { - e.printStackTrace(); + LOGGER.error("clusterUpdateThread[{}] termination interrupted", i, e); } } }