Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CityDoctor
CityDoctor2
Commits
934b4f19
Commit
934b4f19
authored
Dec 01, 2020
by
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
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/check/Check.java
View file @
934b4f19
...
...
@@ -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
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/check/Checkable.java
View file @
934b4f19
...
...
@@ -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
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/GmlElement.java
View file @
934b4f19
...
...
@@ -73,4 +73,9 @@ public abstract class GmlElement extends Checkable {
}
return
gmlId
;
}
@Override
public
boolean
hasGmlId
()
{
return
gmlId
!=
null
;
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment