refs #7800
Change-Id: Ife7ed9a2c7ec556194987b34c3301e6ea8e0e7bc
public Variable getVariable(ReadGraph graph, Variable context, String name) throws DatabaseException {
Variable parent = context.getParent(graph);
Resource container = parent.getPossibleRepresents(graph);
public Variable getVariable(ReadGraph graph, Variable context, String name) throws DatabaseException {
Variable parent = context.getParent(graph);
Resource container = parent.getPossibleRepresents(graph);
+ if(container == null)
+ return null;
Map<String,Resource> methods = graph.syncRequest(new UnescapedMethodMapOfResource(container));
Resource predicate = methods.get(name);
if(predicate != null) {
Map<String,Resource> methods = graph.syncRequest(new UnescapedMethodMapOfResource(container));
Resource predicate = methods.get(name);
if(predicate != null) {
import org.simantics.db.Resource;
import org.simantics.db.WriteGraph;
import org.simantics.db.common.procedure.adapter.TransientCacheAsyncListener;
import org.simantics.db.Resource;
import org.simantics.db.WriteGraph;
import org.simantics.db.common.procedure.adapter.TransientCacheAsyncListener;
-import org.simantics.db.common.utils.Logger;
import org.simantics.db.common.validation.L0Validations;
import org.simantics.db.exception.DatabaseException;
import org.simantics.db.exception.ValidationException;
import org.simantics.db.common.validation.L0Validations;
import org.simantics.db.exception.DatabaseException;
import org.simantics.db.exception.ValidationException;
import org.simantics.layer0.Layer0;
import org.simantics.utils.Development;
import org.simantics.utils.datastructures.Pair;
import org.simantics.layer0.Layer0;
import org.simantics.utils.Development;
import org.simantics.utils.datastructures.Pair;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class StandardGraphPropertyVariable extends AbstractPropertyVariable {
public class StandardGraphPropertyVariable extends AbstractPropertyVariable {
+ private static final Logger LOGGER = LoggerFactory.getLogger(StandardGraphPropertyVariable.class);
+
protected static final PropertyInfo NO_PROPERTY = new PropertyInfo(null, null,
false, Collections.<String> emptySet(), null, null, null, null, null, null,
Collections.<String, Pair<Resource, ChildReference>> emptyMap(),
protected static final PropertyInfo NO_PROPERTY = new PropertyInfo(null, null,
false, Collections.<String> emptySet(), null, null, null, null, null, null,
Collections.<String, Pair<Resource, ChildReference>> emptyMap(),
if(Development.DEVELOPMENT) {
String error = L0Validations.checkValueType(graph, parentResource, property.predicate);
if(error != null) {
if(Development.DEVELOPMENT) {
String error = L0Validations.checkValueType(graph, parentResource, property.predicate);
if(error != null) {
- Logger.defaultLogError(new ValidationException(error));
//throw new ValidationException(error);
}
}
//throw new ValidationException(error);
}
}
if(Development.DEVELOPMENT) {
String error = L0Validations.checkValueType(graph, parentResource, property.predicate);
if(error != null) {
if(Development.DEVELOPMENT) {
String error = L0Validations.checkValueType(graph, parentResource, property.predicate);
if(error != null) {
- Logger.defaultLogError(new ValidationException(error));
throw new ValidationException(error);
}
}
throw new ValidationException(error);
}
}
if(Development.DEVELOPMENT) {
String error = L0Validations.checkValueType(graph, parentResource, property.predicate);
if(error != null) {
if(Development.DEVELOPMENT) {
String error = L0Validations.checkValueType(graph, parentResource, property.predicate);
if(error != null) {
- Logger.defaultLogError(new ValidationException(error));
//throw new ValidationException(error);
}
}
//throw new ValidationException(error);
}
}
if(Development.DEVELOPMENT) {
String error = L0Validations.checkValueType(graph, parentResource, property.predicate);
if(error != null) {
if(Development.DEVELOPMENT) {
String error = L0Validations.checkValueType(graph, parentResource, property.predicate);
if(error != null) {
- Logger.defaultLogError(new ValidationException(error));
throw new ValidationException(error);
}
}
throw new ValidationException(error);
}
}
return valueMap.getVariable(graph, this, name);
} catch (DatabaseException e) {
return null;
return valueMap.getVariable(graph, this, name);
} catch (DatabaseException e) {
return null;
- } catch (Throwable t) {
- System.err.println("err: " + getURI(graph) + " # " + name);
+ } catch (Exception t) {
+ LOGGER.error("getPossibleDomainProperty is implemented incorrectly, but returns null on Exception for backward compatibility. URI="+getURI(graph)+", name="+name+".", t);