]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.reflection/src/org/simantics/scl/reflection/internal/typeRegistry/TypeRegistry.java
Getting rid of *Array and replace with Vector * (SCL)
[simantics/platform.git] / bundles / org.simantics.scl.reflection / src / org / simantics / scl / reflection / internal / typeRegistry / TypeRegistry.java
index e7eb1486c88d9ae4e908c9116cc6bf8f67606c23..f09877021806e4bfb6ab0a50f13aa72c1488cf61 100644 (file)
@@ -9,8 +9,13 @@ import org.simantics.scl.compiler.types.TCon;
 import org.simantics.scl.compiler.types.Types;
 import org.simantics.scl.reflection.TypeNotFoundException;
 import org.simantics.scl.reflection.internal.registry.BindingRegistry;
 import org.simantics.scl.compiler.types.Types;
 import org.simantics.scl.reflection.TypeNotFoundException;
 import org.simantics.scl.reflection.internal.registry.BindingRegistry;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class TypeRegistry {
 
 public class TypeRegistry {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(TypeRegistry.class);
+
     private static final ConcurrentHashMap<TCon, Class<?>> map = 
             new ConcurrentHashMap<TCon, Class<?>>();
     
     private static final ConcurrentHashMap<TCon, Class<?>> map = 
             new ConcurrentHashMap<TCon, Class<?>>();
     
@@ -26,7 +31,6 @@ public class TypeRegistry {
         map.put(Types.FLOAT, Float.class);
         map.put(Types.DOUBLE, Double.class);
         map.put(Types.STRING, String.class);
         map.put(Types.FLOAT, Float.class);
         map.put(Types.DOUBLE, Double.class);
         map.put(Types.STRING, String.class);
-        map.put(Types.BYTE_ARRAY, byte[].class);
         
         map.put(Types.LIST, List.class);
         for(int i=0;i<8;++i)
         
         map.put(Types.LIST, List.class);
         for(int i=0;i<8;++i)
@@ -35,7 +39,7 @@ public class TypeRegistry {
                     map.put(Types.tupleConstructor(i), 
                             Class.forName("org.simantics.scl.runtime.tuple.Tuple" + i));
                 } catch(ClassNotFoundException e) {
                     map.put(Types.tupleConstructor(i), 
                             Class.forName("org.simantics.scl.runtime.tuple.Tuple" + i));
                 } catch(ClassNotFoundException e) {
-                    e.printStackTrace();
+                    LOGGER.error("Could not find class for {}", i, e);
                 }
         
         for(TCon con : map.keySet())
                 }
         
         for(TCon con : map.keySet())
@@ -48,7 +52,7 @@ public class TypeRegistry {
             try {
                 clazz = BindingRegistry.getClass(type);
             } catch(TypeNotFoundException e) {
             try {
                 clazz = BindingRegistry.getClass(type);
             } catch(TypeNotFoundException e) {
-                e.printStackTrace();
+                LOGGER.error("Could not get class for type {}", type, e);
                 throw e;
             }
             map.put(type, clazz);
                 throw e;
             }
             map.put(type, clazz);