Skip to content
Snippets Groups Projects
Commit e401fc38 authored by Florian Hölzl's avatar Florian Hölzl
Browse files

bugfix: constraint service interface was too specific, implementation produced NPE

parent abd250ec
No related branches found
No related tags found
No related merge requests found
......@@ -77,8 +77,12 @@ public class ConstraintService extends
*/
private void performConstraintCheck(EObject modelElement,
List<IConstraintViolation<EObject>> violationList) {
for (IConstraintChecker<EObject> checker : getRegisteredHandlers(modelElement
.getClass())) {
List<IConstraintChecker<EObject>> handlers = getRegisteredHandlers(modelElement
.getClass());
if (handlers == null) {
return;
}
for (IConstraintChecker<EObject> checker : handlers) {
if (checker.isApplicable(modelElement)) {
IConstraintViolation<EObject> violation = checker
.apply(modelElement);
......
......@@ -43,8 +43,8 @@ public interface IConstraintService {
* its content and returns the check results. Note, that this method can be
* time-consuming for large model element trees.
*/
<T extends EObject> List<IConstraintViolation<T>> performAllConstraintChecksRecursively(
T modelElement);
List<IConstraintViolation<EObject>> performAllConstraintChecksRecursively(
EObject modelElement);
/**
* Performs all constraint checks only on the given model element and
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment