Commit 934b4f19 authored by Matthias Betz's avatar Matthias Betz
Browse files

fixed an issue with checks that apply to superclasses instead of actual instances

parent a0ff9ed7
Pipeline #1381 passed with stage
in 1 minute and 58 seconds
......@@ -126,7 +126,7 @@ public abstract class Check {
*/
public boolean canExecute(Checkable c) {
// ignore objects where this check doesn't apply to
if (!getApplicableToClasses().contains(c.getCheckClass())) {
if (!canBeApplied(c)) {
return false;
}
// check that object doesn't have errors for dependencies of this check
......@@ -145,6 +145,15 @@ public abstract class Check {
}
return true;
}
private boolean canBeApplied(Checkable c) {
for (Class<Checkable> checkableClass : getApplicableToClasses()) {
if (checkableClass.isAssignableFrom(c.getCheckClass())) {
return true;
}
}
return false;
}
/**
* check anything
......
......@@ -74,6 +74,11 @@ public abstract class Checkable implements Serializable {
* @return the GML-ID
*/
public abstract GmlId getGmlId();
public boolean hasGmlId() {
return false;
}
/**
* This should be called before executing a check if low memory consumption
......
......@@ -73,4 +73,9 @@ public abstract class GmlElement extends Checkable {
}
return gmlId;
}
@Override
public boolean hasGmlId() {
return gmlId != null;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment