solved bug on instantiation error for types that are not in the model

This commit is contained in:
lucio.lelii 2021-09-28 13:36:56 +02:00
parent 24576cd30f
commit 147e8a8961
1 changed files with 2 additions and 1 deletions

View File

@ -7,6 +7,7 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
import org.gcube.common.storagehub.model.annotations.RootNode; import org.gcube.common.storagehub.model.annotations.RootNode;
import org.gcube.common.storagehub.model.items.Item;
import org.gcube.common.storagehub.model.items.RootItem; import org.gcube.common.storagehub.model.items.RootItem;
import org.reflections.Reflections; import org.reflections.Reflections;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -51,7 +52,7 @@ public class ClassHandler {
public Class<? extends RootItem> get(String nodeType){ public Class<? extends RootItem> get(String nodeType){
if (classMap.containsKey(nodeType)) return classMap.get(nodeType); if (classMap.containsKey(nodeType)) return classMap.get(nodeType);
if (deprecatedNode.contains(nodeType)) return RootItem.class; if (deprecatedNode.contains(nodeType)) return Item.class;
return null; return null;
//throw new RuntimeException("mapping not found for nodetype "+ nodeType); //throw new RuntimeException("mapping not found for nodetype "+ nodeType);
} }