]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Adding Logger to DiagramContentRequest 10/1910/2
authorjsimomaa <jani.simomaa@gmail.com>
Wed, 11 Jul 2018 05:20:26 +0000 (08:20 +0300)
committerJani Simomaa <jani.simomaa@semantum.fi>
Wed, 11 Jul 2018 06:41:39 +0000 (06:41 +0000)
Change-Id: I904c7ed209198d897370003b0676df6831892927

bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/DiagramContentRequest.java

index 845adb4cc0d95664ec816f8986063604209734ef..36e4051571534a7d92094d47667470f91fffb188 100644 (file)
@@ -31,6 +31,8 @@ import org.simantics.diagram.content.RouteGraphConnectionPartRequest;
 import org.simantics.diagram.stubs.DiagramResource;
 import org.simantics.diagram.synchronization.ErrorHandler;
 import org.simantics.g2d.canvas.ICanvasContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import gnu.trove.list.array.TIntArrayList;
 import gnu.trove.map.hash.THashMap;
@@ -42,6 +44,8 @@ import gnu.trove.set.hash.THashSet;
  */
 public class DiagramContentRequest extends BaseRequest<Resource, DiagramContents> {
 
+    private static final Logger LOGGER = LoggerFactory.getLogger(DiagramContentRequest.class);
+
     int previousElementCount = 32;
     ErrorHandler errorHandler;
 
@@ -158,13 +162,13 @@ public class DiagramContentRequest extends BaseRequest<Resource, DiagramContents
              }         
                
         }
-        
+
         try {
-                       s.waitFor(components.size());
-               } catch (InterruptedException e) {
-                       e.printStackTrace();
-               }
-        
+            s.waitFor(components.size());
+        } catch (InterruptedException e) {
+            LOGGER.error("An error occured while waiting for diagram to load", e);
+        }
+
         // Remove elements that were not recognized in descending order.
         unrecognizedElementIndices.sort();
         unrecognizedElementIndices.forEachDescending(new TIntProcedure() {